Commit 07e819c0 by Jaxon

Merge branch 'feature/optimize-refund-flow-' into 'SAAS+V5.7.9'

Feature/optimize refund flow

See merge request !522
2 parents b9c2229a 68e245c1
// tabWorkOrder/components/applyRefundBtn/applyRefundBtn.js // tabWorkOrder/components/applyRefundBtn/applyRefundBtn.js
import api from '~/api/api' import api from "~/api/api";
import qs from "~/utils/lib/qs";
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -7,7 +8,7 @@ Component({ ...@@ -7,7 +8,7 @@ Component({
properties: { properties: {
orderInfo: Object, orderInfo: Object,
showRefundBtn: Boolean, showRefundBtn: Boolean,
updateFlag: Boolean updateFlag: Boolean,
}, },
/** /**
...@@ -17,7 +18,7 @@ Component({ ...@@ -17,7 +18,7 @@ Component({
moreSelectData: [], moreSelectData: [],
showSelect: false, showSelect: false,
moreSelectIndex: null, moreSelectIndex: null,
areaOperationsFlag: false areaOperationsFlag: false,
}, },
/** /**
...@@ -26,144 +27,125 @@ Component({ ...@@ -26,144 +27,125 @@ Component({
methods: { methods: {
// 点击更多按钮 // 点击更多按钮
selectTap() { selectTap() {
let { orderInfo } = this.data let { orderInfo } = this.data;
let allOptions = [] let allOptions = [];
if (orderInfo.selectPayType == 2) { if (orderInfo.selectPayType == 2) {
// 门店收款订单查询退款可展示按钮 // 门店收款订单查询退款可展示按钮
allOptions = ['标记退款', '退款详情'] allOptions = ["标记退款", "退款详情"];
// 查询订单可展示按钮 // 查询订单可展示按钮
api.getMoreBtnAPI({ orderCode: orderInfo.orderCode }).then(res => { api.getMoreBtnAPI({ orderCode: orderInfo.orderCode }).then((res) => {
let { code, data } = res let { code, data } = res;
if (code == 0) { if (code == 0) {
this.setData({ this.setData({
moreSelectData: this.filterMoreSelectData( moreSelectData: this.filterMoreSelectData(data.refundApplyButton, data.refundApplyDetailButton, allOptions, 1),
data.refundApplyButton, showSelect: !this.data.showSelect,
data.refundApplyDetailButton, });
allOptions,
1
),
showSelect: !this.data.showSelect
})
} }
}) });
} else { } else {
allOptions = ['申请退款', '退款详情'] allOptions = ["申请退款", "退款详情"];
// 查询订单可展示按钮 // 查询订单可展示按钮
api.getMoreBtnAPI({ orderCode: orderInfo.orderCode }).then(res => { api.getMoreBtnAPI({ orderCode: orderInfo.orderCode }).then((res) => {
let { code, data } = res let { code, data } = res;
if (code == 0) { if (code == 0) {
this.setData({ this.setData({
moreSelectData: this.filterMoreSelectData( moreSelectData: this.filterMoreSelectData(data.refundApplyButton, data.refundApplyDetailButton, allOptions, 2),
data.refundApplyButton, showSelect: !this.data.showSelect,
data.refundApplyDetailButton, });
allOptions,
2
),
showSelect: !this.data.showSelect
})
} }
}) });
} }
}, },
filterMoreSelectData( filterMoreSelectData(refundApplyButton, refundApplyDetailButton, allOptions, num) {
refundApplyButton, const buttonType = num === 2 ? "申请退款" : "标记退款";
refundApplyDetailButton,
allOptions,
num
) {
const buttonType = num === 2 ? '申请退款' : '标记退款'
const conditions = { const conditions = {
[buttonType]: refundApplyButton === 'Y', [buttonType]: refundApplyButton === "Y",
退款详情: refundApplyDetailButton === 'Y' 退款详情: refundApplyDetailButton === "Y",
} };
return allOptions.filter(option => conditions[option]) return allOptions.filter((option) => conditions[option]);
}, },
closeSelect() { closeSelect() {
this.setData({ this.setData({
showSelect: false, showSelect: false,
moreSelectIndex: null moreSelectIndex: null,
}) });
}, },
tapConstruction() { tapConstruction() {
this.closeSelect() this.closeSelect();
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance();
thisPage.setData({ thisPage.setData({
sublistVisible: true sublistVisible: true,
}) });
}, },
optionTap(e) { optionTap(e) {
let { index, item } = e.currentTarget.dataset let { index, item } = e.currentTarget.dataset;
let { orderInfo } = this.data let { orderInfo } = this.data;
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo();
if (item == '申请退款' || item == '标记退款') { if (item == "申请退款" || item == "标记退款") {
// 申请退款点击埋点 // 申请退款点击埋点
if (item == '申请退款') if (item == "申请退款") wx.$track.setTrackData(0, "apply_refund_page", {}, "", 1);
wx.$track.setTrackData(0, 'apply_refund_page', {}, '', 1)
// 退款申请时区域运营查询 // 退款申请时区域运营查询
api api.areaSupervisionExistsAPI({
.areaSupervisionExistsAPI({
merchantId: userInfo.shopMerchantId, merchantId: userInfo.shopMerchantId,
sceneType: userInfo.sceneType sceneType: userInfo.sceneType,
}) }).then((res) => {
.then(res => { let { code, data, message } = res;
let { code, data, message } = res
if (code == 0) { if (code == 0) {
if (!data) { if (!data) {
return this.setData({ return this.setData({
areaOperationsFlag: true, areaOperationsFlag: true,
showSelect: !this.data.showSelect showSelect: !this.data.showSelect,
}) });
} else { } else {
wx.navigateTo({ wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?orderCode=${ url:
orderInfo.orderCode "/tabWorkOrder/pages/refundApply/refundApply?" +
}&shopMerchantName=${orderInfo.merchantName}&shopMerchantId=${ qs.stringify({
orderInfo.merchantId orderCode: orderInfo.orderCode,
}&refundPayType=${orderInfo.selectPayType == 2 ? 2 : 1}` shopMerchantName: orderInfo.merchantName,
}) shopMerchantId: orderInfo.merchantId,
this.closeSelect() refundPayType: orderInfo.selectPayType == 2 ? 2 : 1,
refundName: orderInfo.customerName,
}),
});
this.closeSelect();
} }
} else { } else {
return wx.$util.showToast(message) return wx.$util.showToast(message);
} }
}) });
} else { } else {
// 退款详情点击埋点 // 退款详情点击埋点
if (orderInfo?.selectPayType != 2) if (orderInfo?.selectPayType != 2) wx.$track.setTrackData(0, "refund_detail_page", {}, "", 1);
wx.$track.setTrackData(0, 'refund_detail_page', {}, '', 1)
// 点击退款详情,判断是否存在多条退款申请记录,存在跳转列表页,不存在直接跳转详情页 // 点击退款详情,判断是否存在多条退款申请记录,存在跳转列表页,不存在直接跳转详情页
api api.getRefundDetailListAPI({ orderCode: orderInfo.orderCode }).then((res) => {
.getRefundDetailListAPI({ orderCode: orderInfo.orderCode }) let { code, data } = res;
.then(res => {
let { code, data } = res
if (code == 0) { if (code == 0) {
if (data?.length > 1) { if (data?.length > 1) {
wx.navigateTo({ wx.navigateTo({
url: `/tabWorkOrder/pages/refundDetailList/refundDetailList?orderCode=${orderInfo.orderCode}` url: `/tabWorkOrder/pages/refundDetailList/refundDetailList?orderCode=${orderInfo.orderCode}`,
}) });
} else if (data.length == 1) { } else if (data.length == 1) {
wx.navigateTo({ wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${ url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${data[0].applyCode}&refundPayType=${orderInfo.selectPayType == 2 ? 2 : 1}`,
data[0].applyCode });
}&refundPayType=${orderInfo.selectPayType == 2 ? 2 : 1}`
})
} }
this.closeSelect() this.closeSelect();
} }
}) });
} }
this.setData({ this.setData({
moreSelectIndex: index moreSelectIndex: index,
// showSelect: !this.data.showSelect // showSelect: !this.data.showSelect
}) });
}, },
closeModal() { closeModal() {
this.setData({ this.setData({
areaOperationsFlag: false areaOperationsFlag: false,
}) });
} },
} },
}) });
...@@ -1349,7 +1349,7 @@ Page({ ...@@ -1349,7 +1349,7 @@ Page({
if (orderObj.orderType !== undefined && orderObj.orderType !== null) { if (orderObj.orderType !== undefined && orderObj.orderType !== null) {
orderObj.djOrderType = orderObj.orderType orderObj.djOrderType = orderObj.orderType
} else { } else {
orderObj.djOrderType = 0 orderObj.djOrderType = 1
} }
} }
......
...@@ -89,7 +89,7 @@ Page({ ...@@ -89,7 +89,7 @@ Page({
refundRule: { refundRule: {
data: "", data: "",
show: false, show: false,
title: "展开", title: "查看",
}, },
}, },
}, },
...@@ -139,7 +139,7 @@ Page({ ...@@ -139,7 +139,7 @@ Page({
}, 500); }, 500);
}, },
onCollapseChange(e) { onCollapseChange(e) {
const value = e.detail ? "收起" : "展开"; const value = e.detail ? "收起" : "查看";
this.setData({ this.setData({
"collapse.refundRule.show": e.detail, "collapse.refundRule.show": e.detail,
"collapse.refundRule.title": value, "collapse.refundRule.title": value,
...@@ -635,6 +635,7 @@ Page({ ...@@ -635,6 +635,7 @@ Page({
let { submitStatus, infoData, userInfo, refundPayType } = this.data; let { submitStatus, infoData, userInfo, refundPayType } = this.data;
// 校验是否选择退款方式 // 校验是否选择退款方式
if (!infoData.refundType) return wx.$util.showToast("请选择退款方式"); if (!infoData.refundType) return wx.$util.showToast("请选择退款方式");
if (infoData.payee === "" || infoData.payee == null || infoData.payee == undefined) return wx.$util.showToast("请输入收款人姓名");
// 部分退款校验子订单 // 部分退款校验子订单
let checkKey = this.checkSubOrderValid(infoData.subOrderList); let checkKey = this.checkSubOrderValid(infoData.subOrderList);
if (checkKey) return wx.$util.showToast(checkKey); if (checkKey) return wx.$util.showToast(checkKey);
......
...@@ -331,6 +331,14 @@ page { ...@@ -331,6 +331,14 @@ page {
} }
} }
} }
.modify-name-wrapper {
border-top: var(--fontSize2) solid #eff0f2;
padding: var(--fontSize40);
color: #5a5e66;
font-size: var(--fontSize24);
line-height: var(--fontSize36);
}
} }
.review_box { .review_box {
display: flex; display: flex;
......
...@@ -329,6 +329,10 @@ ...@@ -329,6 +329,10 @@
</view> </view>
</view> </view>
</view> </view>
<view wx:if="{{ !filter.filterRefundDisabled(infoData, userInfo) }}"
class="modify-name-wrapper">
说明:收款人姓名将自动带入工单完整姓名,如需修改请确保提供实际收款人付款凭证,避免影响审核进度。
</view>
</block> </block>
<block wx:else> <block wx:else>
<view class="upload_box"> <view class="upload_box">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!