|
@@ -212,6 +212,7 @@
|
|
|
/**
|
|
/**
|
|
|
* 花店订单售后页:选择退货商品、填写退款金额并提交。
|
|
* 花店订单售后页:选择退货商品、填写退款金额并提交。
|
|
|
* 退货单价直接取订单原单价,只需填数量。
|
|
* 退货单价直接取订单原单价,只需填数量。
|
|
|
|
|
+ * 提交成功后统一跳转 admin/billing/forwardResult(资金落地 / 海报 / 原路成功)。
|
|
|
*/
|
|
*/
|
|
|
import { getDetail,refund } from "@/api/order/index";
|
|
import { getDetail,refund } from "@/api/order/index";
|
|
|
import ModalModule from "@/components/plugin/modal";
|
|
import ModalModule from "@/components/plugin/modal";
|
|
@@ -409,59 +410,46 @@ export default {
|
|
|
let refundParams = {product:JSON.stringify(selectProduct),id: this.option.id,price:this.refundMoney,remark:this.remark,refundType:this.refundType,refundHb:this.refundHb,getOriginalItem:1,version:2}
|
|
let refundParams = {product:JSON.stringify(selectProduct),id: this.option.id,price:this.refundMoney,remark:this.remark,refundType:this.refundType,refundHb:this.refundHb,getOriginalItem:1,version:2}
|
|
|
this.doRefund(refundParams)
|
|
this.doRefund(refundParams)
|
|
|
},
|
|
},
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 提交售后退款;成功后统一进 forwardResult(对齐 ghs 端)
|
|
|
|
|
+ * - 待选手选落地 / 已返充海报 / 已原路成功:均由 forwardResult 展示
|
|
|
|
|
+ * - 不再按 payWay 跳转 onlineResult / balanceCp / offlineRemind / debtResult
|
|
|
|
|
+ * - hd 无 ghs 的 refundSuccess(报损减库),原路终态也走 forwardResult 简版成功态
|
|
|
|
|
+ */
|
|
|
doRefund(refundParams){
|
|
doRefund(refundParams){
|
|
|
uni.showLoading({mask:true})
|
|
uni.showLoading({mask:true})
|
|
|
refund(refundParams).then(res => {
|
|
refund(refundParams).then(res => {
|
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
const data = res.data || {}
|
|
const data = res.data || {}
|
|
|
- // 需选手选资金落地:跳转 forwardResult(已线下转账 / 返充余额)
|
|
|
|
|
- if (Number(data.needFundAction) === 1) {
|
|
|
|
|
- const payload = {
|
|
|
|
|
- amount: data.refundPrice || this.refundMoney,
|
|
|
|
|
- customId: data.customId || this.orderInfo.customId,
|
|
|
|
|
- customBalance: data.customBalance != null ? data.customBalance : '',
|
|
|
|
|
- customName: data.customName || this.orderInfo.customName || '',
|
|
|
|
|
- forwardSn: data.refundSn || data.orderSn || '',
|
|
|
|
|
- forwardId: data.id || 0,
|
|
|
|
|
- orderId: data.orderId || this.orderInfo.id || 0,
|
|
|
|
|
- payWay: data.payWay != null ? data.payWay : this.orderInfo.payWay,
|
|
|
|
|
- onlinePay: data.onlinePay != null ? data.onlinePay : this.orderInfo.onlinePay,
|
|
|
|
|
- hasReturn: data.hasReturn != null ? data.hasReturn : 0,
|
|
|
|
|
- couldReturn: data.couldReturn != null ? data.couldReturn : 1,
|
|
|
|
|
- returnBalance: data.returnBalance != null ? data.returnBalance : 0,
|
|
|
|
|
- needFundAction: 1
|
|
|
|
|
- }
|
|
|
|
|
- uni.setStorageSync('forwardResultPayload', payload)
|
|
|
|
|
- this.$util.pageTo({
|
|
|
|
|
- url: '/admin/billing/forwardResult',
|
|
|
|
|
- type: 2,
|
|
|
|
|
- query: {
|
|
|
|
|
- amount: payload.amount,
|
|
|
|
|
- customId: payload.customId,
|
|
|
|
|
- customBalance: payload.customBalance,
|
|
|
|
|
- forwardId: payload.forwardId,
|
|
|
|
|
- needFundAction: 1
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- return
|
|
|
|
|
|
|
+ // 待确认退回方式:当天/隔天线下等 hasReturn=0 且 couldReturn=1
|
|
|
|
|
+ const needFund = Number(data.needFundAction) === 1
|
|
|
|
|
+ || (Number(data.hasReturn) === 0
|
|
|
|
|
+ && Number(data.returnBalance) === 0
|
|
|
|
|
+ && Number(data.couldReturn) === 1)
|
|
|
|
|
+ const payload = {
|
|
|
|
|
+ amount: data.refundPrice || this.refundMoney,
|
|
|
|
|
+ customId: data.customId || this.orderInfo.customId,
|
|
|
|
|
+ customBalance: data.customBalance != null ? data.customBalance : '',
|
|
|
|
|
+ customName: data.customName || this.orderInfo.customName || '',
|
|
|
|
|
+ forwardSn: data.refundSn || data.orderSn || '',
|
|
|
|
|
+ forwardId: data.id || 0,
|
|
|
|
|
+ orderId: data.orderId || this.orderInfo.id || 0,
|
|
|
|
|
+ payWay: data.payWay != null ? data.payWay : this.orderInfo.payWay,
|
|
|
|
|
+ onlinePay: data.onlinePay != null ? data.onlinePay : this.orderInfo.onlinePay,
|
|
|
|
|
+ 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
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- if(this.orderInfo.onlinePay == 2){
|
|
|
|
|
- this.$util.pageTo({url:'/admin/refund/onlineResult',type:2})
|
|
|
|
|
- }else{
|
|
|
|
|
- if(this.orderInfo.payWay == 2){
|
|
|
|
|
- //余额支付
|
|
|
|
|
- this.$util.pageTo({url:'/admin/refund/balanceCp?orderId='+this.orderInfo.id+'&amount='+this.refundMoney,type:2})
|
|
|
|
|
- }else if(this.orderInfo.payWay == 0 || this.orderInfo.payWay == 1 || this.orderInfo.payWay == 4 || this.orderInfo.payWay == 5){
|
|
|
|
|
- //线下微信、支付宝、现金和银行卡付款
|
|
|
|
|
- this.$util.pageTo({url:'/admin/refund/offlineRemind?orderId='+this.orderInfo.id+'&amount='+this.refundMoney+'&payWay='+this.orderInfo.payWay,type:2})
|
|
|
|
|
- }else{
|
|
|
|
|
- //挂账的
|
|
|
|
|
- this.$util.pageTo({url:'/admin/refund/debtResult?orderId='+this.orderInfo.id+'&amount='+this.refundMoney,type:2})
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ uni.setStorageSync('forwardResultPayload', payload)
|
|
|
|
|
+ this.$util.pageTo({
|
|
|
|
|
+ url: '/admin/billing/forwardResult',
|
|
|
|
|
+ type: 2,
|
|
|
|
|
+ query: Object.assign({}, payload, {
|
|
|
|
|
+ customName: encodeURIComponent(payload.customName || '')
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|