|
|
@@ -89,8 +89,8 @@
|
|
|
<!-- 待审核尚未落定 sameDay,不展示;通过后再展示冲减/不冲减口径 -->
|
|
|
<template v-if="Number(info.status) !== 0">
|
|
|
<view class="refund-row">
|
|
|
- <view class="refund-label">订单时间</view>
|
|
|
- <view class="refund-value">{{ info.sameDay === 0 ? '过去订单' : '当天订单' }}</view>
|
|
|
+ <view class="refund-label">退款类型</view>
|
|
|
+ <view class="refund-value">{{ info.sameDay === 0 ? '封账后退款' : '当天退款' }}</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -209,15 +209,15 @@ export default {
|
|
|
}
|
|
|
return classMap[this.info.status] || 'refund-status'
|
|
|
},
|
|
|
- /** 已通过且待资金落地 */
|
|
|
+ /** 已通过且待资金落地(字段缺省按 0,避免 undefined 导致不跳转) */
|
|
|
canFundAction() {
|
|
|
return Number(this.info.status) === 1
|
|
|
- && Number(this.info.hasReturn) === 0
|
|
|
- && Number(this.info.returnBalance) === 0
|
|
|
+ && Number(this.info.hasReturn || 0) === 0
|
|
|
+ && Number(this.info.returnBalance || 0) === 0
|
|
|
},
|
|
|
/** 已通过且返充余额时可查看凭证 */
|
|
|
canShowPoster() {
|
|
|
- return Number(this.info.status) === 1 && Number(this.info.returnBalance) === 1
|
|
|
+ return Number(this.info.status) === 1 && Number(this.info.returnBalance || 0) === 1
|
|
|
},
|
|
|
/** 待审核:商城顾客申请,超管可在本页通过/驳回 */
|
|
|
canAudit() {
|
|
|
@@ -279,8 +279,8 @@ export default {
|
|
|
)
|
|
|
},
|
|
|
/**
|
|
|
- * 审核通过:对齐商家即时售后
|
|
|
- * - 待选手选落地(线下微信/支付宝/现金/银行卡等)→ forwardResult
|
|
|
+ * 审核通过:线下等待落地单直接进退还方式选择页(等同点「退还方式」),无需再点一次
|
|
|
+ * - 待选手选落地 → forwardResult
|
|
|
* - 已返充余额 → 凭证页
|
|
|
* - 已原路(线上/余额/挂账)→ 留在详情刷新
|
|
|
*/
|
|
|
@@ -295,55 +295,57 @@ export default {
|
|
|
}
|
|
|
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)
|
|
|
+ // 先把接口资金字段合并进 info,便于立刻判断
|
|
|
+ if (data && typeof data === 'object') {
|
|
|
+ this.info = Object.assign({}, this.info, {
|
|
|
+ status: 1,
|
|
|
+ hasReturn: data.hasReturn != null ? data.hasReturn : this.info.hasReturn,
|
|
|
+ returnBalance: data.returnBalance != null ? data.returnBalance : this.info.returnBalance,
|
|
|
+ couldReturn: data.couldReturn != null ? data.couldReturn : this.info.couldReturn,
|
|
|
+ payWay: data.payWay != null ? data.payWay : this.info.payWay,
|
|
|
+ onlinePay: data.onlinePay != null ? data.onlinePay : this.info.onlinePay,
|
|
|
+ refundSn: data.refundSn || data.orderSn || this.info.refundSn,
|
|
|
+ customBalance: data.customBalance != null ? data.customBalance : this.info.customBalance
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 接口明确待落地 / 已返充:立即跳(与手动点按钮同一页)
|
|
|
+ if (this.shouldGoFundAfterPass(data) || this.canFundAction) {
|
|
|
+ this.goFundAction()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (Number(data.returnBalance) === 1 || this.canShowPoster) {
|
|
|
+ this.goPoster()
|
|
|
return
|
|
|
}
|
|
|
- this.init()
|
|
|
+ // 接口未带齐字段时刷新详情再判一次,避免只留「退还方式」按钮
|
|
|
+ this.init().then(() => {
|
|
|
+ if (this.canFundAction) {
|
|
|
+ this.goFundAction()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.canShowPoster) {
|
|
|
+ this.goPoster()
|
|
|
+ }
|
|
|
+ })
|
|
|
}).catch(() => {
|
|
|
uni.hideLoading()
|
|
|
this.busy = false
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
- * 通过后进资金结果页:选手选「已线下转账 / 返充余额」或查看凭证
|
|
|
- * @param {Object} data pass 接口返回的资金字段
|
|
|
- * @param {boolean} needFund 是否待选手选
|
|
|
- * @param {boolean} showPoster 是否已返充需看凭证
|
|
|
+ * 通过接口返回判断是否要进退还方式选择页
|
|
|
+ * needFundAction=1,或 hasReturn/returnBalance 未落且 couldReturn=1(线下等)
|
|
|
*/
|
|
|
- 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' : ''
|
|
|
+ shouldGoFundAfterPass(data) {
|
|
|
+ if (!data || typeof data !== 'object') {
|
|
|
+ return false
|
|
|
}
|
|
|
- uni.setStorageSync('forwardResultPayload', payload)
|
|
|
- this.$util.pageTo({
|
|
|
- url: '/admin/billing/forwardResult',
|
|
|
- type: 2,
|
|
|
- query: Object.assign({}, payload, {
|
|
|
- customName: encodeURIComponent(payload.customName || ''),
|
|
|
- mode: payload.mode || ''
|
|
|
- })
|
|
|
- })
|
|
|
+ if (Number(data.needFundAction) === 1) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return Number(data.hasReturn) === 0
|
|
|
+ && Number(data.returnBalance) === 0
|
|
|
+ && Number(data.couldReturn) === 1
|
|
|
},
|
|
|
confirmReject() {
|
|
|
const reason = (this.rejectReason || '').trim()
|
|
|
@@ -391,9 +393,14 @@ export default {
|
|
|
},
|
|
|
goFundAction() {
|
|
|
const payload = this.buildForwardPayload('')
|
|
|
+ // 强制标记待选手选,避免 needFundAction 因字段缺省为 0 导致结果页不展示选项
|
|
|
+ if (Number(payload.hasReturn || 0) === 0 && Number(payload.returnBalance || 0) === 0) {
|
|
|
+ payload.needFundAction = 1
|
|
|
+ }
|
|
|
uni.setStorageSync('forwardResultPayload', payload)
|
|
|
this.$util.pageTo({
|
|
|
url: '/admin/billing/forwardResult',
|
|
|
+ type: 2,
|
|
|
query: Object.assign({}, payload, {
|
|
|
customName: encodeURIComponent(payload.customName || '')
|
|
|
})
|