|
@@ -1,7 +1,7 @@
|
|
|
<!--
|
|
<!--
|
|
|
无原单退款确认页
|
|
无原单退款确认页
|
|
|
- 用途:工作台「退款」选客户、选花材后,确认金额/资金方式并提交;生成无关联销售单的售后单(sameDay=0)。
|
|
|
|
|
- 谁用:admin/billing/freeRefund → 本页 → forwardResult 或成功提示。
|
|
|
|
|
|
|
+ 用途:选花材后确认金额,并选择退款方式 / 退货方式 / 是否返充余额,提交生成无关联销售单的售后单。
|
|
|
|
|
+ 谁用:admin/billing/freeRefund → 本页 → forwardResult。
|
|
|
-->
|
|
-->
|
|
|
<template>
|
|
<template>
|
|
|
<view class="app-content">
|
|
<view class="app-content">
|
|
@@ -56,8 +56,50 @@
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
+ <!-- 退款方式 / 退货方式 / 返充到余额(对齐业务确认图) -->
|
|
|
|
|
+ <view class="module-com option-module">
|
|
|
|
|
+ <view class="option-block">
|
|
|
|
|
+ <view class="option-title">退款方式</view>
|
|
|
|
|
+ <view class="option-row">
|
|
|
|
|
+ <view
|
|
|
|
|
+ v-for="item in payWayList"
|
|
|
|
|
+ :key="'pay-' + item.id"
|
|
|
|
|
+ class="option-btn"
|
|
|
|
|
+ :class="{ active: form.payWay === item.id }"
|
|
|
|
|
+ @click="form.payWay = item.id"
|
|
|
|
|
+ >{{ item.name }}</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="option-block">
|
|
|
|
|
+ <view class="option-title">退货方式</view>
|
|
|
|
|
+ <view class="option-row">
|
|
|
|
|
+ <view
|
|
|
|
|
+ v-for="item in returnWayList"
|
|
|
|
|
+ :key="'ret-' + item.id"
|
|
|
|
|
+ class="option-btn"
|
|
|
|
|
+ :class="{ active: form.returnWay === item.id }"
|
|
|
|
|
+ @click="form.returnWay = item.id"
|
|
|
|
|
+ >{{ item.name }}</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="option-block">
|
|
|
|
|
+ <view class="option-title">返充到余额</view>
|
|
|
|
|
+ <view class="option-row">
|
|
|
|
|
+ <view
|
|
|
|
|
+ v-for="item in toBalanceList"
|
|
|
|
|
+ :key="'bal-' + item.id"
|
|
|
|
|
+ class="option-btn"
|
|
|
|
|
+ :class="{ active: form.toBalance === item.id }"
|
|
|
|
|
+ @click="form.toBalance = item.id"
|
|
|
|
|
+ >{{ item.name }}</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
<view class="tip-box">
|
|
<view class="tip-box">
|
|
|
- 此退款不关联销售单:退货将回库;资金可选返充客户余额或仅记账。
|
|
|
|
|
|
|
+ 无关联销售单。「库存退回」会加库存;「返充到余额」会增加客户余额,选「否」则仅记账。
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -66,40 +108,47 @@
|
|
|
<button class="admin-button-com blue big" style="width:220upx;" @click="onSubmitTap">确认退款</button>
|
|
<button class="admin-button-com blue big" style="width:220upx;" @click="onSubmitTap">确认退款</button>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
- <!-- 无原单:不可原路退,只选返余额/仅记账 -->
|
|
|
|
|
- <forward-options-popup
|
|
|
|
|
- :show="showFundPop"
|
|
|
|
|
- :allow-original="false"
|
|
|
|
|
- :force-balance="false"
|
|
|
|
|
- mode="free"
|
|
|
|
|
- @cancel="showFundPop = false"
|
|
|
|
|
- @confirm="onFundConfirm"
|
|
|
|
|
- />
|
|
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import TuiListCell from '@/components/plugin/list-cell'
|
|
import TuiListCell from '@/components/plugin/list-cell'
|
|
|
import productMins from '@/mixins/product2'
|
|
import productMins from '@/mixins/product2'
|
|
|
-import ForwardOptionsPopup from '@/components/forward-options-popup'
|
|
|
|
|
import { createFreeRefund } from '@/api/refund'
|
|
import { createFreeRefund } from '@/api/refund'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'freeRefundConfirm',
|
|
name: 'freeRefundConfirm',
|
|
|
- components: { TuiListCell, ForwardOptionsPopup },
|
|
|
|
|
|
|
+ components: { TuiListCell },
|
|
|
mixins: [productMins],
|
|
mixins: [productMins],
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
autoLoad: false,
|
|
autoLoad: false,
|
|
|
selectJobType: 'freeRefund',
|
|
selectJobType: 'freeRefund',
|
|
|
- showFundPop: false,
|
|
|
|
|
|
|
+ // 与开单/支出一致:0微信 1支付宝 4现金 5银行卡
|
|
|
|
|
+ payWayList: [
|
|
|
|
|
+ { name: '线下微信', id: 0 },
|
|
|
|
|
+ { name: '线下支付宝', id: 1 },
|
|
|
|
|
+ { name: '现金', id: 4 },
|
|
|
|
|
+ { name: '银行卡', id: 5 }
|
|
|
|
|
+ ],
|
|
|
|
|
+ // 0库存不退(默认) 1库存退回
|
|
|
|
|
+ returnWayList: [
|
|
|
|
|
+ { name: '库存不退', id: 0 },
|
|
|
|
|
+ { name: '库存退回', id: 1 }
|
|
|
|
|
+ ],
|
|
|
|
|
+ // 无默认,须选手选
|
|
|
|
|
+ toBalanceList: [
|
|
|
|
|
+ { name: '是', id: 1 },
|
|
|
|
|
+ { name: '否', id: 0 }
|
|
|
|
|
+ ],
|
|
|
form: {
|
|
form: {
|
|
|
customId: '',
|
|
customId: '',
|
|
|
customName: '',
|
|
customName: '',
|
|
|
price: '',
|
|
price: '',
|
|
|
remark: '',
|
|
remark: '',
|
|
|
- fundType: 2
|
|
|
|
|
|
|
+ payWay: -1,
|
|
|
|
|
+ returnWay: 0,
|
|
|
|
|
+ toBalance: -1
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -115,18 +164,15 @@ export default {
|
|
|
} else {
|
|
} else {
|
|
|
uni.setNavigationBarTitle({ title: '退款确认' })
|
|
uni.setNavigationBarTitle({ title: '退款确认' })
|
|
|
}
|
|
}
|
|
|
- // 默认退款金额=已选花材合计
|
|
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
this.form.price = this.allPrice > 0 ? String(this.allPrice) : ''
|
|
this.form.price = this.allPrice > 0 ? String(this.allPrice) : ''
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- /** 行单价展示 */
|
|
|
|
|
getUnitPrice(item) {
|
|
getUnitPrice(item) {
|
|
|
if (item.userPrice > 0) return parseFloat(item.userPrice).toFixed(2)
|
|
if (item.userPrice > 0) return parseFloat(item.userPrice).toFixed(2)
|
|
|
return parseFloat(item.bigPrice || item.price || 0).toFixed(2)
|
|
return parseFloat(item.bigPrice || item.price || 0).toFixed(2)
|
|
|
},
|
|
},
|
|
|
- /** 行小计 */
|
|
|
|
|
getLineAmount(item) {
|
|
getLineAmount(item) {
|
|
|
const unit = Number(this.getUnitPrice(item))
|
|
const unit = Number(this.getUnitPrice(item))
|
|
|
const big = Number(item.bigCount) || 0
|
|
const big = Number(item.bigCount) || 0
|
|
@@ -136,7 +182,10 @@ export default {
|
|
|
gobackEvent() {
|
|
gobackEvent() {
|
|
|
uni.navigateBack({})
|
|
uni.navigateBack({})
|
|
|
},
|
|
},
|
|
|
- /** 先弹资金选项再提交 */
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 校验三组选项后提交
|
|
|
|
|
+ * returnWay→refundType;toBalance→fundType;payWay原样上报
|
|
|
|
|
+ */
|
|
|
onSubmitTap() {
|
|
onSubmitTap() {
|
|
|
if (this.$util.isEmpty(this.selectList)) {
|
|
if (this.$util.isEmpty(this.selectList)) {
|
|
|
this.$msg('请选择花材')
|
|
this.$msg('请选择花材')
|
|
@@ -151,18 +200,17 @@ export default {
|
|
|
this.$msg('请填写退款金额')
|
|
this.$msg('请填写退款金额')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- this.showFundPop = true
|
|
|
|
|
- },
|
|
|
|
|
- /**
|
|
|
|
|
- * 资金确认后提交无原单退款
|
|
|
|
|
- * @param {{fundType:number}} opt
|
|
|
|
|
- */
|
|
|
|
|
- onFundConfirm(opt) {
|
|
|
|
|
- this.showFundPop = false
|
|
|
|
|
- this.form.fundType = opt.fundType
|
|
|
|
|
|
|
+ if (this.form.payWay === -1 || this.form.payWay === '' || this.form.payWay === null) {
|
|
|
|
|
+ this.$msg('请选择退款方式')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.form.toBalance === -1 || this.form.toBalance === '' || this.form.toBalance === null) {
|
|
|
|
|
+ this.$msg('请选择是否返充到余额')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
this.submitFreeRefund()
|
|
this.submitFreeRefund()
|
|
|
},
|
|
},
|
|
|
- /** 组装花材明细并调 create-free-refund */
|
|
|
|
|
|
|
+ /** 组装明细并调用 create-free-refund */
|
|
|
submitFreeRefund() {
|
|
submitFreeRefund() {
|
|
|
const that = this
|
|
const that = this
|
|
|
const product = []
|
|
const product = []
|
|
@@ -191,59 +239,52 @@ export default {
|
|
|
this.$msg('请选择花材数量')
|
|
this.$msg('请选择花材数量')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
+ // 库存退回=退货退款(1);库存不退=仅退款(2)
|
|
|
|
|
+ const refundType = Number(this.form.returnWay) === 1 ? 1 : 2
|
|
|
|
|
+ // 返充是=fundType2;否=仅记账3
|
|
|
|
|
+ const fundType = Number(this.form.toBalance) === 1 ? 2 : 3
|
|
|
|
|
+
|
|
|
uni.showLoading({ title: '提交中', mask: true })
|
|
uni.showLoading({ title: '提交中', mask: true })
|
|
|
createFreeRefund({
|
|
createFreeRefund({
|
|
|
customId: this.form.customId,
|
|
customId: this.form.customId,
|
|
|
price: this.form.price,
|
|
price: this.form.price,
|
|
|
remark: this.form.remark,
|
|
remark: this.form.remark,
|
|
|
- refundType: 1,
|
|
|
|
|
- fundType: this.form.fundType,
|
|
|
|
|
|
|
+ payWay: this.form.payWay,
|
|
|
|
|
+ returnWay: this.form.returnWay,
|
|
|
|
|
+ toBalance: this.form.toBalance,
|
|
|
|
|
+ refundType: refundType,
|
|
|
|
|
+ fundType: fundType,
|
|
|
product: JSON.stringify(product)
|
|
product: JSON.stringify(product)
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
|
if (res.code != 1) {
|
|
if (res.code != 1) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- // 清空购物车记忆,避免下次误带
|
|
|
|
|
that.removeFromSaveDirect && that.removeFromSaveDirect()
|
|
that.removeFromSaveDirect && that.removeFromSaveDirect()
|
|
|
const data = res.data || {}
|
|
const data = res.data || {}
|
|
|
- if (Number(data.fundType) === 2) {
|
|
|
|
|
- uni.setStorageSync('forwardResultPayload', {
|
|
|
|
|
- fundType: data.fundType,
|
|
|
|
|
- amount: data.refundPrice || that.form.price,
|
|
|
|
|
- customId: data.customId || that.form.customId,
|
|
|
|
|
- customBalance: data.customBalance != null ? data.customBalance : '',
|
|
|
|
|
- customName: data.customName || that.form.customName || '',
|
|
|
|
|
- forwardSn: data.orderSn || '',
|
|
|
|
|
- forwardId: data.id || 0,
|
|
|
|
|
- orderId: 0
|
|
|
|
|
- })
|
|
|
|
|
- that.$util.pageTo({
|
|
|
|
|
- url: '/admin/billing/forwardResult',
|
|
|
|
|
- type: 2,
|
|
|
|
|
- query: {
|
|
|
|
|
- fundType: data.fundType,
|
|
|
|
|
- amount: data.refundPrice || that.form.price,
|
|
|
|
|
- customId: data.customId || that.form.customId,
|
|
|
|
|
- customBalance: data.customBalance != null ? data.customBalance : '',
|
|
|
|
|
- customName: encodeURIComponent(data.customName || that.form.customName || ''),
|
|
|
|
|
- forwardSn: data.orderSn || '',
|
|
|
|
|
- forwardId: data.id || 0,
|
|
|
|
|
- orderId: 0
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const goFundType = data.fundType != null ? data.fundType : fundType
|
|
|
|
|
+ uni.setStorageSync('forwardResultPayload', {
|
|
|
|
|
+ fundType: goFundType,
|
|
|
|
|
+ amount: data.refundPrice || that.form.price,
|
|
|
|
|
+ customId: data.customId || that.form.customId,
|
|
|
|
|
+ customBalance: data.customBalance != null ? data.customBalance : '',
|
|
|
|
|
+ customName: data.customName || that.form.customName || '',
|
|
|
|
|
+ forwardSn: data.orderSn || '',
|
|
|
|
|
+ forwardId: data.id || 0,
|
|
|
|
|
+ orderId: 0
|
|
|
|
|
+ })
|
|
|
that.$util.pageTo({
|
|
that.$util.pageTo({
|
|
|
url: '/admin/billing/forwardResult',
|
|
url: '/admin/billing/forwardResult',
|
|
|
type: 2,
|
|
type: 2,
|
|
|
query: {
|
|
query: {
|
|
|
- fundType: data.fundType || that.form.fundType,
|
|
|
|
|
|
|
+ fundType: goFundType,
|
|
|
amount: data.refundPrice || that.form.price,
|
|
amount: data.refundPrice || that.form.price,
|
|
|
customId: data.customId || that.form.customId,
|
|
customId: data.customId || that.form.customId,
|
|
|
|
|
+ customBalance: data.customBalance != null ? data.customBalance : '',
|
|
|
customName: encodeURIComponent(data.customName || that.form.customName || ''),
|
|
customName: encodeURIComponent(data.customName || that.form.customName || ''),
|
|
|
forwardSn: data.orderSn || '',
|
|
forwardSn: data.orderSn || '',
|
|
|
- forwardId: data.id || 0
|
|
|
|
|
|
|
+ forwardId: data.id || 0,
|
|
|
|
|
+ orderId: 0
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
@@ -332,8 +373,44 @@ export default {
|
|
|
font-size: 28upx;
|
|
font-size: 28upx;
|
|
|
color: #333;
|
|
color: #333;
|
|
|
}
|
|
}
|
|
|
|
|
+.option-module {
|
|
|
|
|
+ padding: 24upx 30upx 10upx;
|
|
|
|
|
+}
|
|
|
|
|
+.option-block {
|
|
|
|
|
+ margin-bottom: 28upx;
|
|
|
|
|
+}
|
|
|
|
|
+.option-title {
|
|
|
|
|
+ font-size: 30upx;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ margin-bottom: 16upx;
|
|
|
|
|
+}
|
|
|
|
|
+.option-row {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+}
|
|
|
|
|
+.option-btn {
|
|
|
|
|
+ min-width: 140upx;
|
|
|
|
|
+ height: 64upx;
|
|
|
|
|
+ line-height: 64upx;
|
|
|
|
|
+ padding: 0 24upx;
|
|
|
|
|
+ margin-right: 16upx;
|
|
|
|
|
+ margin-bottom: 16upx;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ font-size: 26upx;
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ border: 1upx solid #cccccc;
|
|
|
|
|
+ border-radius: 8upx;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+}
|
|
|
|
|
+.option-btn.active {
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ background: #3385ff;
|
|
|
|
|
+ border-color: #3385ff;
|
|
|
|
|
+}
|
|
|
.tip-box {
|
|
.tip-box {
|
|
|
- margin: 20upx 30upx;
|
|
|
|
|
|
|
+ margin: 10upx 30upx 20upx;
|
|
|
font-size: 24upx;
|
|
font-size: 24upx;
|
|
|
color: #999;
|
|
color: #999;
|
|
|
line-height: 1.5;
|
|
line-height: 1.5;
|