Commit 6be2e8e0 by zhangxw

门店标记退款开发联调

1 parent f5e03ea6
......@@ -380,5 +380,9 @@ module.exports = {
// 退款详情列表查询
getRefundDetailListAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.singleOrder.list', data)
},
// 查询订单是否支持状态变更
getOrderRefundStep(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.isExist', data)
}
}
......@@ -18,7 +18,7 @@ export const appId = 'wx570d9331f9ace0bd'
* 4预发布
* 5cdptest
*/
let index = 2;
let index = 1;
const accountInfo = wx.getAccountInfoSync();
const systemInfo = wx.getSystemInfoSync();
const envName = accountInfo.miniProgram.envVersion;
......
......@@ -1085,7 +1085,8 @@ Component({
const {
id,
repeal,
status
status,
payid
} = e.currentTarget.dataset;
let _this = this;
if (repeal && status == -1) {
......@@ -1094,21 +1095,36 @@ Component({
repealId: id
})
} else {
// 校验订单是否可撤销(在退款流程中无法撤销)
let refundStep = await commonApi.getOrderRefundStep({orderCode: payid})
if (refundStep?.data == 'Y') return _this.showRefundAlert()
wx.showModal({
title: "",
content: "是否取撤销该工单?",
confirmText: "是",
confirmColor: "#347BFF",
cancelText: "否",
success(res) {
if (res.confirm) {
async success(r) {
if (r.confirm) {
// _this.showLoading('取消中...')
// 再次校验订单是否可撤销(退款流程中无法撤销)防止弹出二次确认时长时间未操作,未拦截导致订单状态变更了
let canRefundStep = await commonApi.getOrderRefundStep({orderCode: payid})
if (canRefundStep?.data == 'Y') return _this.showRefundAlert()
_this.repeal(id);
}
},
});
}
},
showRefundAlert(type) {
const text = type == 'error' ? '订单已发起退款,禁止标记为错误工单!如需标记错误请联系总部运营。' : '订单已发起退款,禁止撤销!如需撤销请联系总部运营。'
wx.showModal({
title: '提示',
content: text,
showCancel: false,
confirmText: "好的"
})
},
toCopyNumber(e) {
let {
ordernum
......@@ -1163,14 +1179,18 @@ Component({
async toshowErrorOrder(e) {
// 校验是否填写昨日日报
let staffCheck = await checkDailyReport(true);
if (staffCheck) return false;;
if (staffCheck) return false;
let _this = this
const {
item
} = e.currentTarget.dataset;
this.setData({
_this.setData({
showErrorId: item.payId,
},
() => {
async () => {
// 校验订单是否可标记为错误订单(在退款流程中无法流转)
let refundStep = await commonApi.getOrderRefundStep({orderCode: item.payId})
if (refundStep?.data == 'Y') return _this.showRefundAlert('error')
wx.$modal(this, {
show: true,
title: "工单标记",
......@@ -1198,7 +1218,10 @@ Component({
show: true,
title: "请选择录单入口",
tabTitleShow: false,
success: (res) => {
success: async (res) => {
// 再次校验 防止二次确认弹窗弹起后长时间未操作,导致订单状态变更异常
let canRefundStep = await commonApi.getOrderRefundStep({orderCode: item.payId})
if (canRefundStep?.data == 'Y') return this.showRefundAlert()
// 跳转新增订单页面 并带特定参数
let {
selectType
......@@ -1304,7 +1327,7 @@ Component({
let { code, message, data } = res
if (code == 0) {
if (data.refundApplyButton == 'Y' && target.zyPayStatus != 1 && isOrder) {
btnArr.push({ name: '申请退款' })
btnArr.push({ name: target.payType == 2 ? '标记退款' : '申请退款' })
}
if (data.refundApplyDetailButton == 'Y' && target.zyPayStatus != 1 && isOrder) {
btnArr.push({ name: '退款详情' })
......@@ -1344,26 +1367,14 @@ Component({
case '申请退款':
// 申请退款点击埋点
wx.$track.setTrackData(0, 'apply_refund_page', {}, '', 0)
let userInfo = wx.$util.getUserInfo()
// 退款申请时区域运营查询
api.areaSupervisionExistsAPI({merchantId: userInfo.shopMerchantId, sceneType: userInfo.sceneType}).then(res => {
let {code, data} = res
if (code == 0) {
if (!data) {
this.setData({ areaOperationsFlag: true })
this.handleBtnCancel()
return
} else {
wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?orderCode=${btnOrderInfo.orderCode}&shopMerchantName=${btnOrderInfo.merchantName}&shopMerchantId=${btnOrderInfo.merchantId}`,
})
}
}
})
this.toRefund()
break
case '标记退款':
this.toRefund(true)
break
case '退款详情':
// 退款详情点击埋点
wx.$track.setTrackData(0, 'refund_detail_page', {}, '', 0)
if (btnOrderInfo.payType != 2) wx.$track.setTrackData(0, 'refund_detail_page', {}, '', 0)
// 点击退款详情,判断是否存在多条退款申请记录,存在跳转列表页,不存在直接跳转详情页
api.getRefundDetailListAPI({orderCode: btnOrderInfo.orderCode}).then(res => {
let { code, data } = res
......@@ -1374,7 +1385,7 @@ Component({
})
} else if (data.length == 1) {
wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${data[0].applyCode}`,
url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${data[0].applyCode}&refundPayType=${btnOrderInfo.payType == 2 ? 2 : 1}`,
})
}
}
......@@ -1383,6 +1394,25 @@ Component({
}
this.handleBtnCancel()
},
toRefund(flag) {
let userInfo = wx.$util.getUserInfo()
let { btnOrderInfo } = this.data
// 退款申请时区域运营查询
api.areaSupervisionExistsAPI({merchantId: userInfo.shopMerchantId, sceneType: userInfo.sceneType}).then(res => {
let {code, data} = res
if (code == 0) {
if (!data) {
this.setData({ areaOperationsFlag: true })
this.handleBtnCancel()
return
} else {
wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?orderCode=${btnOrderInfo.orderCode}&shopMerchantName=${btnOrderInfo.merchantName}&shopMerchantId=${btnOrderInfo.merchantId}&refundPayType=${flag ? 2 : 1}`,
})
}
}
})
},
handleSelectInvoice() {
let {
invoiveVisible
......
......@@ -173,7 +173,7 @@
</block>
<block wx:else>
<view wx:if="{{ item.orderStatus != '4' && item.orderStatus!=11&& item.orderStatus!=9 }}" class="btn_class">
<block wx:if="{{item.showInvoiceEntrance || ((item.orderStatus == 3 || item.orderStatus == 5 || item.orderStatus == 6) && item.payType != 2 && isOrder)}}">
<block wx:if="{{item.showInvoiceEntrance || ((item.orderStatus == 3 || item.orderStatus == 5 || item.orderStatus == 6) && isOrder)}}">
<view class="order-btn default-btn padding_20" bindtap="handleMoreBtn" data-target="{{ item }}">更多</view>
</block>
<block wx:if="{{ item.canUpdateZyPayUrl == 1 && item.zyPayStatus == 2 }}">
......@@ -200,14 +200,14 @@
</block>
</view>
<view wx:else class="btn_class">
<block wx:if="{{item.showInvoiceEntrance || ((item.orderStatus == 3 || item.orderStatus == 5 || item.orderStatus == 6) && item.payType != 2 && isOrder)}}">
<block wx:if="{{item.showInvoiceEntrance || ((item.orderStatus == 3 || item.orderStatus == 5 || item.orderStatus == 6) && isOrder)}}">
<view class="order-btn default-btn padding_20" bindtap="handleMoreBtn" data-target="{{ item }}">更多</view>
</block>
</view>
</block>
</block>
<view wx:else class="btn_class">
<block wx:if="{{item.showInvoiceEntrance || ((item.orderStatus == 3 || item.orderStatus == 5 || (item.orderStatus == 6 && item.refundAmount)) && item.payType != 2 && isOrder)}}">
<block wx:if="{{item.showInvoiceEntrance || ((item.orderStatus == 3 || item.orderStatus == 5 || (item.orderStatus == 6 && item.refundAmount)) && isOrder)}}">
<view class="order-btn default-btn padding_20" bindtap="handleMoreBtn" data-target="{{ item }}">更多</view>
</block>
</view>
......@@ -225,11 +225,11 @@
</view>
</block>
</view>
<view wx:if="{{ (item.payType==2 ||item.payType==5 || item.payType == 6 || item.payType == 7)|| item.onlyRepeal }}" data-id="{{ item.id }}" data-repeal="{{ item.onlyRepeal }}" data-status="{{ item.orderStatus }}" bind:tap="toConfirmReturanOrder" class="del">
<view wx:if="{{ (item.payType==2 ||item.payType==5 || item.payType == 6 || item.payType == 7)|| item.onlyRepeal }}" data-id="{{ item.id }}" data-repeal="{{ item.onlyRepeal }}" data-status="{{ item.orderStatus }}" data-payid="{{ item.payId }}" bind:tap="toConfirmReturanOrder" class="del">
<view>撤销</view>
<view>工单</view>
</view>
<view wx:if="{{ item.payType==1 && !item.onlyRepeal }}" data-item="{{ item }}" bind:tap="toshowErrorOrder" class="del">
<view wx:if="{{ item.payType==1 && !item.onlyRepeal }}" data-item="{{ item }}" data-payid="{{ item.payId }}" bind:tap="toshowErrorOrder" class="del">
<view>错误</view>
<view>工单</view>
</view>
......
......@@ -642,8 +642,8 @@ Component({
[`menuList[${index}].tipsNum`]: data.waiteForAuditNum
})
}
resolve()
})
resolve()
})
},
getStoreList() {
......
......@@ -386,16 +386,21 @@ Page({
orderCode
},
} = e.currentTarget.dataset;
// 校验订单是否可撤销(退款流程中无法撤销)
let refundStep = await commonApi.getOrderRefundStep({orderCode})
if (refundStep?.data == 'Y') return _this.showRefundAlert()
wx.showModal({
title: "",
content: "是否取撤销该工单?",
content: "是否确认撤销该工单?",
confirmText: "是",
confirmColor: "#347BFF",
cancelText: "否",
success(res) {
async success(res) {
if (res.confirm) {
_this.showLoading("取消中...");
// 校验订单是否可撤销(退款流程中无法撤销)防止弹出二次确认时长时间未操作,未拦截导致订单状态变更了
let canRefundStep = await commonApi.getOrderRefundStep({orderCode})
if (canRefundStep?.data == 'Y') return _this.showRefundAlert()
_this.repeal(orderCode);
}
},
......@@ -405,6 +410,15 @@ Page({
// list
// })
},
// 拦截订单状态变更弹窗
showRefundAlert() {
wx.showModal({
title: '提示',
content: '订单已发起退款,禁止撤销!如需撤销请联系总部运营。',
showCancel: false,
confirmText: "好的"
})
},
// 撤销该工单
async repeal(orderCode) {
// 校验是否填写昨日日报
......
......@@ -26,22 +26,39 @@ Component({
// 点击更多按钮
selectTap() {
let { orderInfo } = this.data
// 查询订单可展示按钮
api.getMoreBtnAPI({orderCode: orderInfo.orderCode}).then(res => {
let { code, data } = res
if (code == 0) {
this.setData({
moreSelectData: this.filterMoreSelectData(data.refundApplyButton, data.refundApplyDetailButton),
showSelect: !this.data.showSelect,
})
}
})
let allOptions = []
if (orderInfo.selectPayType == 2) { // 门店收款订单查询退款可展示按钮
allOptions = ['标记退款', '退款详情']
// 查询订单可展示按钮
api.getMoreBtnAPI({orderCode: orderInfo.orderCode}).then(res => {
let { code, data } = res
if (code == 0) {
this.setData({
moreSelectData: this.filterMoreSelectData(data.refundApplyButton, data.refundApplyDetailButton, allOptions, 1),
showSelect: !this.data.showSelect,
})
}
})
} else {
allOptions = ['申请退款', '退款详情']
// 查询订单可展示按钮
api.getMoreBtnAPI({orderCode: orderInfo.orderCode}).then(res => {
let { code, data } = res
if (code == 0) {
this.setData({
moreSelectData: this.filterMoreSelectData(data.refundApplyButton, data.refundApplyDetailButton, allOptions, 2),
showSelect: !this.data.showSelect,
})
}
})
}
},
filterMoreSelectData(refundApplyButton, refundApplyDetailButton) {
const allOptions = ['申请退款', '退款详情']
filterMoreSelectData(refundApplyButton, refundApplyDetailButton, allOptions, num) {
const buttonType = num === 2 ? '申请退款' : '标记退款'
const conditions = {
'申请退款': refundApplyButton === 'Y',
[buttonType]: refundApplyButton === 'Y',
'退款详情': refundApplyDetailButton === 'Y'
}
return allOptions.filter(option => conditions[option])
......@@ -58,9 +75,9 @@ Component({
let { index, item } = e.currentTarget.dataset
let { orderInfo } = this.data
let userInfo = wx.$util.getUserInfo()
if (item == '申请退款') {
if (item == '申请退款' || item == '标记退款') {
// 申请退款点击埋点
wx.$track.setTrackData(0, 'apply_refund_page', {}, '', 1)
if (item == '申请退款') wx.$track.setTrackData(0, 'apply_refund_page', {}, '', 1)
// 退款申请时区域运营查询
api.areaSupervisionExistsAPI({merchantId: userInfo.shopMerchantId, sceneType: userInfo.sceneType}).then(res => {
let { code, data, message} = res
......@@ -72,7 +89,7 @@ Component({
})
} else {
wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?orderCode=${orderInfo.orderCode}&shopMerchantName=${orderInfo.merchantName}&shopMerchantId=${orderInfo.merchantId}`,
url: `/tabWorkOrder/pages/refundApply/refundApply?orderCode=${orderInfo.orderCode}&shopMerchantName=${orderInfo.merchantName}&shopMerchantId=${orderInfo.merchantId}&refundPayType=${orderInfo.selectPayType == 2 ? 2 : 1}`,
})
this.closeSelect()
}
......@@ -82,7 +99,7 @@ Component({
})
} else {
// 退款详情点击埋点
wx.$track.setTrackData(0, 'refund_detail_page', {}, '', 1)
if (orderInfo?.selectPayType != 2) wx.$track.setTrackData(0, 'refund_detail_page', {}, '', 1)
// 点击退款详情,判断是否存在多条退款申请记录,存在跳转列表页,不存在直接跳转详情页
api.getRefundDetailListAPI({orderCode: orderInfo.orderCode}).then(res => {
let { code, data } = res
......@@ -93,7 +110,7 @@ Component({
})
} else if (data.length == 1) {
wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${data[0].applyCode}`,
url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${data[0].applyCode}&refundPayType=${orderInfo.selectPayType == 2 ? 2 : 1}`,
})
}
}
......
......@@ -237,6 +237,10 @@ Page({
// 校验是否填写昨日日报
let staffCheck = await checkDailyReport();
if (staffCheck) return false;
// 校验订单是否可标记错误工单(退款流程中订单状态无法变更)
let { orderInfo } = this.data
let refundStep = await commonApi.getOrderRefundStep({orderCode: orderInfo.orderCode})
if (refundStep?.data == 'Y') return this.showRefundAlert()
wx.$modal(this, {
show: true,
title: "工单标记",
......@@ -247,6 +251,14 @@ Page({
error: () => { },
});
},
showRefundAlert() {
wx.showModal({
title: '提示',
content: '订单已发起退款,禁止标记为错误工单!如需标记错误请联系总部运营。',
showCancel: false,
confirmText: "好的"
})
},
// 确定是否要显示
showErrorType() {
wx.$modal(
......@@ -255,9 +267,12 @@ Page({
show: true,
title: "请选择录单入口",
tabTitleShow: false,
success: (res) => {
success: async (res) => {
// 再次校验 防止二次确认弹窗弹起后长时间未操作,导致订单状态变更异常
let { orderInfo, selectType } = this.data
let canRefundStep = await commonApi.getOrderRefundStep({orderCode: orderInfo.orderCode})
if (canRefundStep?.data == 'Y') return this.showRefundAlert()
// 跳转新增订单页面 并带特定参数
let { orderInfo, selectType } = this.data;
console.log(orderInfo)
if (selectType == 1) {
orderInfo.associateOrderCode = orderInfo.orderCode;
......@@ -425,7 +440,7 @@ Page({
let { code, message, data } = res;
if (code == 0) {
wx.$util.hideLoading();
if (data.selectPayType != 2 && (data.status == 4 || data.status == 6 || data.status == 12)) {
if ((data.status == 4 || data.status == 6 || data.status == 12)) {
// 查询订单可展示按钮
commonApi.getMoreBtnAPI({ orderCode: data.orderCode }).then(res => {
let { code, data } = res
......
......@@ -249,7 +249,7 @@ Page({
// 获取对应园区店配置
await this.getServiceBaseInfo(data.merchantId)
await this.getSignatureSwitch(data.merchantId)
if (data.selectPayType != 2 && (data.status == 4 || data.status == 6 || data.status == 12)) {
if (data.status == 4 || data.status == 6 || data.status == 12) {
// 查询订单可展示按钮
commonApi.getMoreBtnAPI({ orderCode: data.orderCode }).then(res => {
let { code, data } = res
......
......@@ -102,7 +102,7 @@
工单信息
<view style="display: flex;gap: var(--fontSize32);">
<!-- 非门店收款 已支付/已退款展示 -->
<view wx:if="{{isStaff && orderInfo.selectPayType != 2 && showMoreBtn && (orderInfo.status == 4 || orderInfo.status == 6 || orderInfo.status == 12)}}">
<view wx:if="{{isStaff && showMoreBtn && (orderInfo.status == 4 || orderInfo.status == 6 || orderInfo.status == 12)}}">
<apply-refund-btn orderInfo="{{orderInfo}}"></apply-refund-btn>
</view>
<view wx:if="{{orderInfo.showInvoiceEntrance || orderInfo.invoiceStatus == 2}}" class="invoice-btn" bindtap="handleBtnInvoice">
......
......@@ -207,7 +207,7 @@ Page({
} = res
if (code == 0) {
wx.$util.hideLoading()
if (data.selectPayType != 2 && (data.status == 4 || data.status == 6 || data.status == 12)) {
if (data.status == 4 || data.status == 6 || data.status == 12) {
// 查询订单可展示按钮
commonApi.getMoreBtnAPI({ orderCode: data.orderCode }).then(res => {
let { code, data } = res
......
......@@ -8,7 +8,7 @@
<view class="box">
<view class="title invoice">信息确认
<view style="display: flex;gap: var(--fontSize32);">
<view wx:if="{{isStaff && orderInfo.selectPayType != 2 && showMoreBtn && (orderInfo.status == 4 || orderInfo.status == 6 || orderInfo.status == 12)}}">
<view wx:if="{{isStaff && showMoreBtn && (orderInfo.status == 4 || orderInfo.status == 6 || orderInfo.status == 12)}}">
<apply-refund-btn orderInfo="{{orderInfo}}"></apply-refund-btn>
</view>
<view wx:if="{{orderInfo.showInvoiceEntrance || orderInfo.invoiceStatus == 2}}" class="invoice-btn" bindtap="handleBtnInvoice">
......
......@@ -23,5 +23,9 @@ module.exports = {
// 根据主订单号获取退款成功记录
getRefundLogByOrderCodeAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.refundedGoodsOrder.list', data)
},
// 门店收款订单标记退款
markAsRefundedAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.offlinePay.add', data)
}
}
\ No newline at end of file
// tabWorkOrder/pages/refundApply/components/labelRefundStatus/labelRefundStatus.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
Component({
/**
* 组件的属性列表
*/
properties: {
infoData: {
type: Object,
observer: function(n) {
this.setStatusInfo(n.beforeStatus, n.afterStatus, n.transferStatus)
}
}
},
/**
* 组件的初始数据
*/
data: {
IMG_URL,
statusList: [ //进度条
{
nameObj: {
1: '申请标记退款',
2: '已申请'
},
type: 1,
active: true
},
{
nameObj: {
1: '区域运营审核',
2: '区域运营审核',
3: '区域运营审核'
},
type: 1,
active: false
}
]
},
/**
* 组件的方法列表
*/
methods: {
setStatusInfo(beforeStatus, afterStatus, transferStatus) {
const STATUS = {
INITIATE: 0, // 发起申请
APPLIED: 1, // 已申请
REGION_REVIEW: 2, // 区域运营审核
REGION_PASS: 3, // 区域运营审核通过
REGION_REJECT: 4, // 区域运营审核不通过
}
// 定义状态类型
const STATUS_TYPE = {
CURRENT: 1, // 当前进行中
COMPLETED: 2, // 已完成
REJECTED: 3 // 已驳回
}
// 处理空值
const before = beforeStatus ?? ''
const after = afterStatus ?? ''
const transfer = transferStatus ?? ''
// 确定当前状态
let currentStatus
if (transfer == 3) {
currentStatus = STATUS.REGION_PASS
}
if (before === '' && after === '') {
currentStatus = STATUS.INITIATE
} else if (before === '' && after == 6) {
currentStatus = STATUS.APPLIED
} else if (before == 6 && after == 7) {
currentStatus = STATUS.REGION_REVIEW
} else if (before == 7 && after == 5) {
currentStatus = STATUS.REGION_REJECT
}
// 更新状态列表
const { statusList } = this.data
statusList.forEach((item, index) => {
// 第一步状态
if (index === 0) {
item.type = currentStatus === STATUS.INITIATE ? STATUS_TYPE.CURRENT : STATUS_TYPE.COMPLETED
item.active = currentStatus === STATUS.INITIATE
}
// 第二步状态(区域审核)
if (index === 1) {
if (currentStatus === STATUS.REGION_REVIEW) {
item.type = STATUS_TYPE.CURRENT
item.active = true
} else if (currentStatus === STATUS.REGION_REJECT) {
item.type = STATUS_TYPE.REJECTED
item.active = true
} else if (currentStatus > STATUS.REGION_REVIEW) {
item.type = STATUS_TYPE.COMPLETED
item.active = false
}
}
})
this.setData({
statusList
})
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* tabWorkOrder/pages/refundApply/components/labelRefundStatus/labelRefundStatus.wxss */
.status-wrap{
display: flex;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
margin: var(--fontSize32) 0;
.status-item{
display: flex;
flex-wrap: nowrap;
font-size: var(--fontSize24);
font-weight: 500;
color: #999EA8;
.info{
display: flex;
flex-direction: column;
align-items: center;
width: 80rpx;
.circle-box{
width: var(--fontSize56);
height: var(--fontSize56);
display: flex;
align-items: center;
justify-content: center;
position: relative;
.circle{
width: var(--fontSize40);
height: var(--fontSize40);
display: flex;
align-items: center;
justify-content: center;
color: #FFFFFF;
font-size: var(--fontSize24);
font-weight: 500;
.circle_text{
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
border-radius: 50%;
background: #DEE0E3;
}
}
.status-img{
position: absolute;
top: 0;
left: 0;
z-index: 1;
width: var(--fontSize56);
height: var(--fontSize56);
}
}
.name{
margin-top: var(--fontSize20);
font-weight: 500;
white-space: nowrap;
color: #7A8299;
margin-bottom: var(--fontSize4);
}
}
.line{
margin: 24rpx 8rpx 0;
width: var(--fontSize270);
height: var(--fontSize8);
background: #DEE0E3;
border-radius: var(--fontSize4);
}
.line_color{
background: #347bff1a;
}
}
}
.no_pass_box{
box-sizing: border-box;
width: 100%;
background: #FDECE9;
font-size: var(--fontSize24);
color: #F24724;
padding: var(--fontSize10) var(--fontSize24);
word-break: break-all;
}
.pass_box{
box-sizing: border-box;
width: 100%;
background: #EFF5FE;
font-size: var(--fontSize24);
padding: var(--fontSize10) var(--fontSize24);
color: #666666;
.time{
color: #347BFF;
margin-bottom: var(--fontSize8);
}
}
\ No newline at end of file
<!--tabWorkOrder/pages/refundApply/components/labelRefundStatus/labelRefundStatus.wxml-->
<view class="status-wrap">
<view class="status-item" wx:for="{{statusList}}" wx:key="index">
<view class="info {{ item.active && item.type==1 ? 'active' : '' }}">
<view class="circle-box">
<view class="circle">
<image wx:if="{{item.active}}" class="status-img" webp src="{{IMG_URL}}equity/review_icon.png"></image>
<image wx:if="{{item.type==2}}" class="status-img" webp src="{{IMG_URL}}equity/review_success_icon.png"></image>
<image wx:if="{{item.active && item.type==3}}" class="status-img" webp src="{{IMG_URL}}equity/review_error_icon.png"></image>
<view wx:if="{{!item.active && item.type < 2}}" class="circle_text">{{index + 1}}</view>
</view>
</view>
<view class="name" style="color: {{item.active || item.type > 1 ? '#292D33' : '#999EA8'}}">{{item.nameObj[item.type]}}</view>
<block>
<view wx:if="{{(index == 1 || index == 2) && item.type > 1}}" class="status-text" style="color: {{item.type == 2 ? '#292D33' : '#E75E58'}}">{{item.type == 2 ? '通过' : '不通过'}}</view>
<view style="height: var(--fontSize32);" wx:else>{{' '}}</view>
</block>
</view>
<view class="line {{item.type == 2 ? 'line_color' : ''}}" wx:if="{{index!=statusList.length-1}}"></view>
</view>
</view>
<view class="no_pass_box" wx:if="{{infoData.afterStatus == 5}}">
<text>退款申请失败:</text><text>{{infoData.reviewRemark}}</text>
</view>
<view class="pass_box" wx:if="{{infoData.transferStatus == 3}}">
<view class="time">退款成功:{{infoData.refundTime}},实际退款 ¥{{infoData.payAmount}}。</view>
</view>
\ No newline at end of file
// tabWorkOrder/pages/refundApply/refundApply.js
import { getSubOrderInfoAPI, applyRefundAPI, auditRefundAllpyAPI, getRefundDetailInfoAPI, getRefundStatusAPI, getRefundLogByOrderCodeAPI } from './api'
import { getSubOrderInfoAPI, auditRefundAllpyAPI, getRefundDetailInfoAPI, getRefundStatusAPI, getRefundLogByOrderCodeAPI} from './api'
import refundAPI from './api'
import NP from 'number-precision'
import api from '~/api/api.js'
import reportPageTrackMixin from '~/mixins/reportPageTrackMixin'
......@@ -69,7 +70,8 @@ Page({
scene: null, // 埋点业务类型
repealVisible: false,
repealStatus: false,
userInfo: {}
userInfo: {},
refundPayType: ''
},
/**
......@@ -79,9 +81,15 @@ Page({
// 跳转进入页面 清空防止选择账号后再次进入页面
wx.$SCENE = null
let userInfo = wx.$util.getUserInfo()
if (options.refundPayType == 2) {
wx.setNavigationBarTitle({title: '退款标记申请'})
} else {
wx.setNavigationBarTitle({title: '零售退款申请表'})
}
this.setData({
scene: userInfo?.sceneType, // 埋点业务场景
userInfo
userInfo,
refundPayType: options.refundPayType
})
// 申请退款
if (!options.applyCode) {
......@@ -249,8 +257,8 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
// 埋点
this.onPageShow()
// 埋点 只统计非门店收款订单的申请退款
if (this.data.refundPayType != 2) this.onPageShow()
},
// 计算订单总支付金额
......@@ -555,7 +563,7 @@ Page({
// 提交申请
submit() {
let {submitStatus, infoData, userInfo} = this.data
let {submitStatus, infoData, userInfo, refundPayType} = this.data
// 校验是否选择退款方式
if (!infoData.refundType) return wx.$util.showToast('请选择退款方式')
// 部分退款校验子订单
......@@ -564,7 +572,7 @@ Page({
if (infoData.refundType == 2 && !infoData.subOrderList?.filter(v => v.checked)?.length) return wx.$util.showToast('')
let key = this.checkRequired(infoData)
if (key) {
if (key && refundPayType != 2) {
toastList[key] && wx.$util.showToast(toastList[key]);
toastList[key] &&
wx.pageScrollTo({
......@@ -572,6 +580,8 @@ Page({
});
return;
}
// 门店收款标记退款,客户退款回单必传
if (refundPayType == 2 && !infoData.attachmentList?.length) return wx.$util.showToast('客户退款回单不能为空')
if (submitStatus) return
this.setData({
submitStatus: true,
......@@ -601,7 +611,8 @@ Page({
attachmentList: infoData.attachmentList?.map(val => { return { fileUrl: val.fileUrl, fileName: val.fileName } }),
refundApplyDetailList
}
applyRefundAPI(params).then(res => {
const eventObj = refundPayType == 2 ? 'markAsRefundedAPI' : 'applyRefundAPI'
refundAPI[eventObj](params).then(res => {
let {code, message} = res
if (code == 0) {
wx.showToast({
......@@ -629,16 +640,16 @@ Page({
* 生命周期函数--监听页面隐藏
*/
onHide() {
// 埋点
this.onPageHide()
// 埋点 只统计非门店收款订单的申请退款
if (this.data.refundPayType != 2) this.onPageHide()
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
// 埋点
this.onPageHide()
// 埋点 只统计非门店收款订单的申请退款
if (this.data.refundPayType != 2) this.onPageHide()
},
/**
......
{
"navigationBarTitleText": "零售退款申请表",
"navigationBarTitleText": "",
"usingComponents": {
"review-status": "./components/reviewStatus/reviewStatus",
"van-loading": "@vant/weapp/loading/index"
"van-loading": "@vant/weapp/loading/index",
"label-refund-status": "./components/labelRefundStatus/labelRefundStatus"
}
}
\ No newline at end of file
......@@ -241,6 +241,10 @@ page{
}
.upload_box{
padding: var(--fontSize40);
.required {
color: #f00;
margin-left: var(--fontSize8);
}
.label{
font-size: var(--fontSize28);
color: #292D33;
......
......@@ -2,7 +2,12 @@
<wxs src="../../index.wxs" module="filter" />
<view class="apply-content">
<view class="status-box">
<review-status infoData="{{infoData}}"></review-status>
<block wx:if="{{refundPayType != 2}}">
<review-status infoData="{{infoData}}"></review-status>
</block>
<block wx:else>
<label-refund-status infoData="{{infoData}}"></label-refund-status>
</block>
</view>
<view class="form-item">
<view wx:for="{{userInfo.loginRole == 3 ? roleMessageObj : messageObj}}" wx:key="index">
......@@ -106,39 +111,53 @@
</view>
</block>
</view>
<gl-cell border valueAlign="right" label="收款人姓名" requiredAfter labelWidth="var(--fontSize280)" required>
<input placeholder="点击输入" class="input" maxlength="20" placeholder-class="placeholder-class" value="{{ infoData.payee }}" bindinput="input" data-name="payee" disabled="{{ filter.filterRefundDisabled(infoData, userInfo) }}" always-embed></input>
</gl-cell>
<gl-cell border valueAlign="right" label="开户行名称" requiredAfter labelWidth="var(--fontSize280)" required>
<input placeholder="点击输入" class="input" maxlength="50" placeholder-class="placeholder-class" value="{{ infoData.openAccBankName }}" bindinput="input" data-name="openAccBankName" disabled="{{ filter.filterRefundDisabled(infoData, userInfo) }}" always-embed></input>
</gl-cell>
<gl-cell border valueAlign="right" label="开户支行名称" requiredAfter labelWidth="var(--fontSize280)" required>
<input placeholder="点击输入" class="input" maxlength="50" placeholder-class="placeholder-class" value="{{ infoData.openAccBranchBankName }}" bindinput="input" data-name="openAccBranchBankName" disabled="{{ filter.filterRefundDisabled(infoData, userInfo) }}" always-embed></input>
</gl-cell>
<gl-cell border valueAlign="right" label="银行卡号" requiredAfter labelWidth="var(--fontSize280)" required>
<input placeholder="点击输入" class="input" type="number" maxlength="30" placeholder-class="placeholder-class" value="{{ infoData.bankAccountNo }}" bindinput="input" data-name="bankAccountNo" disabled="{{ filter.filterRefundDisabled(infoData, userInfo) }}" always-embed></input>
</gl-cell>
<view class="reason_box">
<view class="label">退款原因说明</view>
<view class="textarea_box">
<textarea value="{{ infoData.remark }}" disabled="{{filter.filterRefundDisabled(infoData, userInfo)}}" placeholder="请输入 (500字以内)" placeholder-class="placeholder-class" class="textarea" maxlength="500" bindinput="input" data-name="remark" />
<block wx:if="{{refundPayType != 2}}">
<gl-cell border valueAlign="right" label="收款人姓名" requiredAfter labelWidth="var(--fontSize280)" required>
<input placeholder="点击输入" class="input" maxlength="20" placeholder-class="placeholder-class" value="{{ infoData.payee }}" bindinput="input" data-name="payee" disabled="{{ filter.filterRefundDisabled(infoData, userInfo) }}" always-embed></input>
</gl-cell>
<gl-cell border valueAlign="right" label="开户行名称" requiredAfter labelWidth="var(--fontSize280)" required>
<input placeholder="点击输入" class="input" maxlength="50" placeholder-class="placeholder-class" value="{{ infoData.openAccBankName }}" bindinput="input" data-name="openAccBankName" disabled="{{ filter.filterRefundDisabled(infoData, userInfo) }}" always-embed></input>
</gl-cell>
<gl-cell border valueAlign="right" label="开户支行名称" requiredAfter labelWidth="var(--fontSize280)" required>
<input placeholder="点击输入" class="input" maxlength="50" placeholder-class="placeholder-class" value="{{ infoData.openAccBranchBankName }}" bindinput="input" data-name="openAccBranchBankName" disabled="{{ filter.filterRefundDisabled(infoData, userInfo) }}" always-embed></input>
</gl-cell>
<gl-cell border valueAlign="right" label="银行卡号" requiredAfter labelWidth="var(--fontSize280)" required>
<input placeholder="点击输入" class="input" type="number" maxlength="30" placeholder-class="placeholder-class" value="{{ infoData.bankAccountNo }}" bindinput="input" data-name="bankAccountNo" disabled="{{ filter.filterRefundDisabled(infoData, userInfo) }}" always-embed></input>
</gl-cell>
<view class="reason_box">
<view class="label">退款原因说明</view>
<view class="textarea_box">
<textarea value="{{ infoData.remark }}" disabled="{{filter.filterRefundDisabled(infoData, userInfo)}}" placeholder="请输入 (500字以内)" placeholder-class="placeholder-class" class="textarea" maxlength="500" bindinput="input" data-name="remark" />
</view>
</view>
</view>
<view class="upload_box" wx:if="{{infoData.afterStatus === '' || (infoData.afterStatus == 5 && !filter.filterRefundDisabled(infoData, userInfo)) || infoData.attachmentList.length}}">
<view class="label">上传图片</view>
<view class="label-tips first">原厂延保退款:退款须告知门店,请上传沟通确认凭证截图</view>
<view class="label-tips">嘀加权益退款:退款需上传自愿退款协议及告知客户退款后服务作废凭证截图</view>
<view class="content_box">
<view class="image_content" wx:for="{{infoData.attachmentList}}" wx:key="index">
<image bindtap="previewImage" class="image_box" data-url="{{infoData.attachmentList}}" data-index="{{index}}" src="{{item.fileUrl}}"/>
<image class="del_icon" wx:if="{{!filter.filterRefundDisabled(infoData, userInfo)}}" src="{{IMG_URL}}zy_paf_del_icon.png" mode="" bindtap="deleteFile" data-index="{{index}}" />
<view class="upload_box" wx:if="{{infoData.afterStatus === '' || (infoData.afterStatus == 5 && !filter.filterRefundDisabled(infoData, userInfo)) || infoData.attachmentList.length}}">
<view class="label">上传图片</view>
<view class="label-tips first">原厂延保退款:退款须告知门店,请上传沟通确认凭证截图</view>
<view class="label-tips">嘀加权益退款:退款需上传自愿退款协议及告知客户退款后服务作废凭证截图</view>
<view class="content_box">
<view class="image_content" wx:for="{{infoData.attachmentList}}" wx:key="index">
<image bindtap="previewImage" class="image_box" data-url="{{infoData.attachmentList}}" data-index="{{index}}" src="{{item.fileUrl}}"/>
<image class="del_icon" wx:if="{{!filter.filterRefundDisabled(infoData, userInfo)}}" src="{{IMG_URL}}zy_paf_del_icon.png" mode="" bindtap="deleteFile" data-index="{{index}}" />
</view>
</view>
<view class="upload_content" bindtap="uploadImages" wx:if="{{!filter.filterRefundDisabled(infoData, userInfo) && infoData.attachmentList.length < 5}}">
<image src="{{IMG_URL}}zy-upload_icon.png"></image>
<text class="text">最多5张</text>
</view>
</block>
<block wx:else>
<view class="upload_box">
<view class="label">客户退款回单<text class='required'>*</text></view>
<view class="label-tips"></view>
<view class="content_box">
<view class="image_content" wx:for="{{infoData.attachmentList}}" wx:key="index">
<image bindtap="previewImage" class="image_box" data-url="{{infoData.attachmentList}}" data-index="{{index}}" src="{{item.fileUrl}}"/>
<image class="del_icon" wx:if="{{!filter.filterRefundDisabled(infoData, userInfo)}}" src="{{IMG_URL}}zy_paf_del_icon.png" mode="" bindtap="deleteFile" data-index="{{index}}" />
</view>
<view class="upload_content" bindtap="uploadImages" wx:if="{{!filter.filterRefundDisabled(infoData, userInfo) && infoData.attachmentList.length < 5}}">
<image src="{{IMG_URL}}zy-upload_icon.png"></image>
<text class="text">最多5张</text>
</view>
</view>
</view>
</view>
</block>
</view>
<!-- 区域运营审核 -->
<view class="review_box" wx:if="{{infoData.beforeStatus == 6 && infoData.afterStatus == 7 && userInfo.loginRole == 3 && infoData.auditableFlag == 'Y'}}">
......
// tabWorkOrder/pages/refundDetailList/refundDetailList.js
import api from "~/api/api"
import dayjs from 'dayjs'
const obj = [{
label: '退款类型',
key: 'refundPayTypeText'
}, {
label: '订单编号',
key: 'orderCode'
}, {
label: '申请时间',
key: 'createdDate'
}]
Page({
/**
* 页面的初始数据
*/
data: {
orderObj: [{
label: '申请时间',
key: 'createdDate'
}, {
orderObj: [ // 申请退款未成功退款
...obj,
{
label: '订单支付总额',
key: 'orderTotalPrice',
unit: true
......@@ -19,10 +28,9 @@ Page({
key: 'applyRefundAmount',
unit: true
}],
reviewObj: [{
label: '申请时间',
key: 'createdDate'
}, {
reviewObj: [ // 申请退款成功退款
...obj,
{
label: '退款时间',
key: 'refundTime'
}, {
......@@ -34,6 +42,17 @@ Page({
key: 'applyRefundAmount',
unit: true
}],
labelObj: [ // 标记退款
...obj,
{
label: '订单支付总额',
key: 'orderTotalPrice',
unit: true
}, {
label: '实际退款总额',
key: 'applyRefundAmount',
unit: true
}],
list: [],
flag: true,
reviewStatusObj: {
......@@ -67,13 +86,17 @@ Page({
background: '#EAF1FF',
color: '#347BFF'
}
},
refundPayTypeObj: {
1: '已录订单退款',
2: '门店退款标记'
}
},
jump(e) {
let { item } = e.currentTarget.dataset
wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${item.applyCode}`
url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${item.applyCode}&refundPayType=${item.refundPayType}`
})
},
......@@ -81,6 +104,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let { refundPayTypeObj } = this.data
// 获取退款详情列表
api.getRefundDetailListAPI({orderCode: options.orderCode}).then(res => {
let { code, data } = res
......@@ -109,6 +133,7 @@ Page({
if (val.createdDate) val.createdDate = dayjs(val.createdDate).format("YYYY-MM-DD HH:mm:ss")
if (val.refundTime) val.refundTime = dayjs(val.refundTime).format("YYYY-MM-DD HH:mm:ss")
val.remark = val.remark || `你的申请被【${val.oaSpFailAuditorName || '总部'}】驳回,请联系驳回人员!`
val.refundPayTypeText = refundPayTypeObj[val.refundPayType] || ''
})
this.setData({
list: data || []
......
......@@ -19,7 +19,7 @@
</view>
</view>
<view class="order-list">
<block wx:for="{{li.reviewStatus != 5 ? orderObj : reviewObj }}" wx:key="sindex" wx:for-index="sindex" wx:for-item="i">
<block wx:for="{{li.refundPayType == 2 ? labelObj : li.reviewStatus != 5 ? orderObj : reviewObj }}" wx:key="sindex" wx:for-index="sindex" wx:for-item="i">
<view class="order">
<view class="order-label">{{i.label}}</view>
<view class="order-value">
......@@ -39,7 +39,7 @@
</view>
</view>
</block>
<block wx:if="{{li.reviewStatus == 5}}">
<block wx:if="{{li.reviewStatus == 5 && li.refundPayType != 2}}">
<view class="order" >
<view class="order-label">实际退款金额</view>
<view class="order-value"><text style="margin-right: var(--fontSize10);">¥</text>{{li.payAmount}}</view>
......
......@@ -2,6 +2,22 @@ import api from "../../api"
import { getWaitAuditCountAPI } from '~/api/api'
import dayjs from 'dayjs'
// tabWorkOrder/pages/refundOperationList/refundOperationList.js
const obj = [{
label: '退款类型',
key: 'refundPayTypeText'
}, {
label: '订单编号',
key: 'orderCode'
}, {
label: '申请人',
arr: ['applyStaffYqMerchantName', 'applyStaffName']
}, {
label: '申请时间',
key: 'createdDate'
}, {
label: '审批状态',
key: 'reviewText'
},]
Page({
/**
......@@ -37,16 +53,9 @@ Page({
color: '#F24724'
}
},
reviewObj: [{
label: '申请人',
arr: ['applyStaffYqMerchantName', 'applyStaffName']
}, {
label: '申请时间',
key: 'createdDate'
}, {
label: '审批状态',
key: 'reviewText'
}, {
reviewObj: [ // 非门店收款申请退款 未审批
...obj,
{
label: '退款状态',
key: 'refundText'
}, {
......@@ -58,16 +67,9 @@ Page({
key: 'applyRefundAmount',
unit: true
}],
orderObj: [{
label: '申请人',
arr: ['applyStaffYqMerchantName', 'applyStaffName']
}, {
label: '申请时间',
key: 'createdDate'
}, {
label: '审批状态',
key: 'reviewText'
}, {
orderObj: [ // 非门店收款申请退款 已审批(通过/不通过)
...obj,
{
label: '审批人',
key: 'auditor'
}, {
......@@ -82,7 +84,41 @@ Page({
key: 'applyRefundAmount',
unit: true
}],
nothing: false
labelObj: [ // 门店收款标记退款待审批
...obj,
{
label: '订单支付总额',
key: 'orderTotalPrice',
unit: true
},
{
label: '实际退款金额',
key: 'payAmount',
unit: true
}
],
reviewLabelObj: [ // 门店收款标记退款已审批(通过/不通过)
...obj,
{
label: '审批人',
key: 'auditor'
},
{
label: '订单支付总额',
key: 'orderTotalPrice',
unit: true
},
{
label: '实际退款金额',
key: 'payAmount',
unit: true
}
],
nothing: false,
refundPayTypeObj: {
1: '已录订单退款',
2: '门店退款标记'
}
},
/**
......@@ -131,7 +167,7 @@ Page({
},
// 获取列表数据
getList() {
let { pageNum, tabIndex, nothing, reviewStatusObj } = this.data
let { pageNum, tabIndex, nothing, reviewStatusObj, refundPayTypeObj } = this.data
let userInfo = wx.$util.getUserInfo()
if (nothing) return
const auditStatus = tabIndex == 1 ? 0 : tabIndex == 2 ? 3 : ''
......@@ -147,7 +183,7 @@ Page({
} = res
if (code == 0) {
data?.list?.forEach(val => {
val.reviewText = reviewStatusObj[val.auditStatus].text
val.reviewText = reviewStatusObj[val.auditStatus]?.text
if (val.beforeStatus == 6 && val.afterStatus == 7) {
val.refundText = '区域运营审核中' // 区域运营审批
val.refundStatus = 0
......@@ -175,6 +211,7 @@ Page({
if (val.createdDate) val.createdDate = dayjs(val.createdDate).format("YYYY-MM-DD HH:mm:ss")
if (val.refundTime) val.refundTime = dayjs(val.refundTime).format("YYYY-MM-DD HH:mm:ss")
val.remark = val.remark || `你的申请被【${val.oaSpFailAuditorName || '总部'}】驳回,请联系驳回人员!`
val.refundPayTypeText = refundPayTypeObj[val.refundPayType] || ''
})
list = data.list
total = data.total
......@@ -199,7 +236,7 @@ Page({
jump(e) {
let { item } = e.currentTarget.dataset
wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${item.applyCode}`
url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${item.applyCode}&refundPayType=${item.refundPayType}`
})
},
......
......@@ -40,7 +40,7 @@
</view>
</view>
<view class="order-list">
<block wx:for="{{li.auditStatus != 0 ? orderObj : reviewObj }}" wx:key="sindex" wx:for-index="sindex" wx:for-item="i">
<block wx:for="{{li.refundPayType == 2 ? (li.auditStatus != 0 ? reviewLabelObj : labelObj) : (li.auditStatus != 0 ? orderObj : reviewObj) }}" wx:key="sindex" wx:for-index="sindex" wx:for-item="i">
<view class="order">
<view class="order-label">{{i.label}}</view>
<view class="order-value">
......@@ -60,7 +60,7 @@
</view>
</view>
</block>
<block wx:if="{{li.refundStatus == 5}}">
<block wx:if="{{li.refundStatus == 5 && li.refundPayType != 2}}">
<view class="order" >
<view class="order-label">实际退款金额</view>
<view class="order-value"><text style="margin-right: var(--fontSize10);">¥</text>{{li.payAmount}}</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!