|
|
@@ -1,6 +1,7 @@
|
|
|
<!--
|
|
|
销售单售后详情
|
|
|
用途:refundList / freeRefundList 点进查看;待审核的商城顾客申请可在本页通过/驳回。
|
|
|
+ 审核通过后:线下等待落地进 forwardResult 选手选;已返充进凭证;线上/余额/挂账原路则刷新详情。
|
|
|
-->
|
|
|
<template>
|
|
|
<view class="refund-page">
|
|
|
@@ -278,7 +279,10 @@ export default {
|
|
|
)
|
|
|
},
|
|
|
/**
|
|
|
- * 审核通过:成功后若已返充余额则进凭证页(对齐 ghs)
|
|
|
+ * 审核通过:对齐商家即时售后
|
|
|
+ * - 待选手选落地(线下微信/支付宝/现金/银行卡等)→ forwardResult
|
|
|
+ * - 已返充余额 → 凭证页
|
|
|
+ * - 已原路(线上/余额/挂账)→ 留在详情刷新
|
|
|
*/
|
|
|
doPass() {
|
|
|
this.busy = true
|
|
|
@@ -286,20 +290,61 @@ export default {
|
|
|
passRefund({ id: this.info.id }).then(res => {
|
|
|
uni.hideLoading()
|
|
|
this.busy = false
|
|
|
- if (res.code == 1) {
|
|
|
- this.$msg(res.msg || '已通过')
|
|
|
- // 通过后若已返充余额,直接进凭证页(对齐 ghs)
|
|
|
- this.init().then(() => {
|
|
|
- if (this.canShowPoster) {
|
|
|
- this.goPoster()
|
|
|
- }
|
|
|
- })
|
|
|
+ if (res.code != 1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$msg(res.msg || '已通过')
|
|
|
+ const data = res.data || {}
|
|
|
+ // 与 admin/order/refund.vue 成功跳转条件一致
|
|
|
+ const needFund = Number(data.needFundAction) === 1
|
|
|
+ || (Number(data.hasReturn) === 0
|
|
|
+ && Number(data.returnBalance) === 0
|
|
|
+ && Number(data.couldReturn) === 1)
|
|
|
+ const showPoster = Number(data.returnBalance) === 1
|
|
|
+ if (needFund || showPoster) {
|
|
|
+ this.goAfterPassResult(data, needFund, showPoster)
|
|
|
+ return
|
|
|
}
|
|
|
+ this.init()
|
|
|
}).catch(() => {
|
|
|
uni.hideLoading()
|
|
|
this.busy = false
|
|
|
})
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 通过后进资金结果页:选手选「已线下转账 / 返充余额」或查看凭证
|
|
|
+ * @param {Object} data pass 接口返回的资金字段
|
|
|
+ * @param {boolean} needFund 是否待选手选
|
|
|
+ * @param {boolean} showPoster 是否已返充需看凭证
|
|
|
+ */
|
|
|
+ goAfterPassResult(data, needFund, showPoster) {
|
|
|
+ const info = this.info || {}
|
|
|
+ const payload = {
|
|
|
+ amount: data.refundPrice != null ? data.refundPrice : info.refundPrice,
|
|
|
+ customId: data.customId != null ? data.customId : info.customId,
|
|
|
+ customBalance: data.customBalance != null ? data.customBalance : '',
|
|
|
+ customName: data.customName || info.customName || '',
|
|
|
+ forwardSn: data.refundSn || data.orderSn || info.refundSn || info.orderSn || '',
|
|
|
+ forwardId: data.id || info.id || 0,
|
|
|
+ orderId: data.orderId != null ? data.orderId : (info.orderId || 0),
|
|
|
+ payWay: data.payWay != null ? data.payWay : info.payWay,
|
|
|
+ onlinePay: data.onlinePay != null ? data.onlinePay : (info.onlinePay != null ? info.onlinePay : 1),
|
|
|
+ hasReturn: data.hasReturn != null ? data.hasReturn : 0,
|
|
|
+ couldReturn: data.couldReturn != null ? data.couldReturn : 1,
|
|
|
+ returnBalance: data.returnBalance != null ? data.returnBalance : 0,
|
|
|
+ needFundAction: needFund ? 1 : 0,
|
|
|
+ mode: showPoster && !needFund ? 'repost' : ''
|
|
|
+ }
|
|
|
+ uni.setStorageSync('forwardResultPayload', payload)
|
|
|
+ this.$util.pageTo({
|
|
|
+ url: '/admin/billing/forwardResult',
|
|
|
+ type: 2,
|
|
|
+ query: Object.assign({}, payload, {
|
|
|
+ customName: encodeURIComponent(payload.customName || ''),
|
|
|
+ mode: payload.mode || ''
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
confirmReject() {
|
|
|
const reason = (this.rejectReason || '').trim()
|
|
|
if (!reason) {
|