shish hace 8 horas
padre
commit
3e0435c560
Se han modificado 2 ficheros con 96 adiciones y 22 borrados
  1. 54 9
      hdApp/src/admin/order/refundDetail.vue
  2. 42 13
      mallApp/src/pages/order/refund.vue

+ 54 - 9
hdApp/src/admin/order/refundDetail.vue

@@ -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) {

+ 42 - 13
mallApp/src/pages/order/refund.vue

@@ -2,6 +2,7 @@
   商城订单申请售后页
   供订单详情「申请售后」进入;顾客勾选商品/金额后提交待审核申请,商家在 hdApp 审核
   仅当存在待审核申请时锁进度页不可再提交;无待审核则直接进表单(含已取消/通过/驳回后再申)
+  申请页按原单支付方式提示退款去向:线上原路 / 余额 / 挂账冲减 / 线下由商家转账或返充
   退货并退款金额:普通商品按勾选原价分摊会员折/满减;秒杀、团购按活动单价退,不再叠整单优惠
   红包全额抵扣导致实付为 0 时仍可申请:提交 0 元,审核通过后退回红包
 -->
@@ -56,6 +57,11 @@
 				<text>{{ refundDeadlineTip }}</text>
 			</view>
 
+			<!-- 原单支付去向提示:与商家审核落地规则一致,避免顾客误以为一律原路微信退回 -->
+			<view class="tip-section" v-if="payRefundTip.text">
+				<text class="tip-text" :class="payRefundTip.tone + '-tip'">{{ payRefundTip.text }}</text>
+			</view>
+
 			<!-- 退款方式 -->
 			<view class="card-section">
 				<view class="section-title">
@@ -284,6 +290,37 @@ export default {
 				this.orderInfo.mainPay != null ? this.orderInfo.mainPay : this.orderInfo.orderPrice
 			) || 0
 			return Number(this.orderInfo.hbAmount || 0) > payAmount
+		},
+		/**
+		 * 申请页支付去向提示(与 hd 审核落地一致)
+		 * 线上微信/支付宝→原路;余额→退余额;挂账→冲欠款;线下→商家选手选转账或返充
+		 */
+		payRefundTip() {
+			const payWay = Number(this.orderInfo.payWay)
+			const online = Number(this.orderInfo.onlinePay)
+			if (online === 2 && (payWay === 0 || payWay === 1)) {
+				return {
+					tone: 'online',
+					text: '原单线上支付:商家审核通过后将原路退回'
+				}
+			}
+			if (payWay === 2) {
+				return {
+					tone: 'online',
+					text: '原单余额支付:商家审核通过后退回账户余额'
+				}
+			}
+			if (payWay === 3) {
+				return {
+					tone: 'debt',
+					text: '原单挂账:商家审核通过后冲减欠款'
+				}
+			}
+			// 线下微信/支付宝/现金/银行卡等:审核通过后由商家确认线下转或返充
+			return {
+				tone: 'offline',
+				text: '原单线下支付:商家审核通过后线下退款或返充余额,请与商家确认到账方式'
+			}
 		}
 	},
 	methods: {
@@ -545,20 +582,12 @@ export default {
 			const money = Number(this.refundMoney) || 0
 			let title = '确认提交'
 			let content = money > 0
-				? '确认申请退款 ¥' + this.refundMoney
+				? '确认申请退款 ¥' + this.refundMoney + '?'
 				: '订单实付为0,提交后将申请退回红包'
-			// 按支付方式补充去向说明(对齐采购售后确认弹窗)
-			if (money > 0) {
-				if (Number(this.orderInfo.onlinePay) == 2) {
-					content = '确认申请退款 ¥' + this.refundMoney + '?'
-				} else if (Number(this.orderInfo.payWay) == 2) {
-					content = '确认申请退款 ¥' + this.refundMoney + '?'
-				} else if (Number(this.orderInfo.payWay) == 3 || Number(this.orderInfo.debt) == 1) {
-					content = '确认申请退款 ¥' + this.refundMoney + '?'
-				} else {
-					title = '特别注意'
-					content = '确认申请退款 ¥' + this.refundMoney + '?'
-				}
+			// 有金额时附带去向说明,与上方 tip、商家审核落地一致
+			if (money > 0 && this.payRefundTip && this.payRefundTip.text) {
+				title = '确认提交'
+				content = '确认申请退款 ¥' + this.refundMoney + '?\n' + this.payRefundTip.text
 			}
 			uni.showModal({
 				title: title,