Commit a7ca0110 by zhangxw

申请退款,区域运营退款审批

1 parent 59d1d0e9
Showing 47 changed files with 1649 additions and 35 deletions
...@@ -364,5 +364,21 @@ module.exports = { ...@@ -364,5 +364,21 @@ module.exports = {
// 作废开票二维码 // 作废开票二维码
cancelInvoiceQrcode(data) { cancelInvoiceQrcode(data) {
return api.post("dj.api.smartcarlife.vpt.invoiceIssueQrcode.cancelInvoiceQrcode", data); return api.post("dj.api.smartcarlife.vpt.invoiceIssueQrcode.cancelInvoiceQrcode", data);
},
// 获取退款申请待审批数目查询
getWaitAuditCountAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.waitForAudit.count', data)
},
// 查询订单可展示按钮类型
getMoreBtnAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.button.select', data)
},
// 退款申请时区域运营查询
areaSupervisionExistsAPI(data) {
return api.post('dj.api.smartcarlife.serviceMerchant.areaSupervision.exists', data)
},
// 退款详情列表查询
getRefundDetailListAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.singleOrder.list', data)
} }
} }
...@@ -116,7 +116,10 @@ ...@@ -116,7 +116,10 @@
"pages/mentorshipManage/mentorshipManage", "pages/mentorshipManage/mentorshipManage",
"pages/tabWorkOrderRelevance/index", "pages/tabWorkOrderRelevance/index",
"pages/invoiceCode/invoiceCode", "pages/invoiceCode/invoiceCode",
"pages/invoiceResult/invoiceResult" "pages/invoiceResult/invoiceResult",
"pages/refundOperationList/refundOperationList",
"pages/refundDetailList/refundDetailList",
"pages/refundApply/refundApply"
] ]
}, },
{ {
......
// components/areaOperationsModal/areaOperationsModal.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
Component({
/**
* 组件的属性列表
*/
properties: {
isShow: {
type: Boolean,
value: false
}
},
/**
* 组件的初始数据
*/
data: {
IMG_URL
},
/**
* 组件的方法列表
*/
methods: {
handleClose() {
this.triggerEvent('close')
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* components/areaOperationsModal/areaOperationsModal.wxss */
.icon {
width: 64px;
height: 64px;
}
.layout {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 1000;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.bg {
position: absolute;
width: 100%;
height: 100%;
z-index: -1;
background: rgba(0, 0, 0, .8);
}
.content {
position: relative;
text-align: center;
box-sizing: border-box;
padding: var(--fontSize48) var(--fontSize76);
width: var(--fontSize542);
height: var(--fontSize576);
background-image: linear-gradient(180deg, #F7F9FF 0%, #FFFFFF 54%);
border-radius: var(--fontSize24);
font-weight: 400;
font-size: var(--fontSize28);
color: #9B9B9E;
}
.title {
text-align: center;
font-weight: 500;
font-size: var(--fontSize48);
color: #292D33;
margin-top: var(--fontSize32);
}
.tipTxt {
font-size: 14px;
color: #9B9B9E;
margin-top: var(--fontSize8);
}
.btn {
position: absolute;
bottom: var(--fontSize80);
width: var(--fontSize392);
height: var(--fontSize96);
line-height: var(--fontSize96);
text-align: center;
background: #347BFF;
border-radius: var(--fontSize12);
font-weight: 600;
font-size: var(--fontSize36);
color: #FFFFFF;
margin-top: var(--fontSize48);
}
\ No newline at end of file \ No newline at end of file
<!--components/areaOperationsModal/areaOperationsModal.wxml-->
<view wx:if="{{isShow}}" class="layout">
<view class="bg" bindtap="handleShow" />
<view class="content">
<image class="icon" src="{{IMG_URL}}equity/reopen_error.png" show-menu-by-longpress="{{true}}"></image>
<view class="title">申请失败</view>
<view class="tipTxt">未配置区域运营,请联系总部处理</view>
<view class="btn" bindtap="handleClose">知道了</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -237,5 +237,9 @@ module.exports = { ...@@ -237,5 +237,9 @@ module.exports = {
// 根据商户号获取可选商品列表 // 根据商户号获取可选商品列表
getSelectOrderGoodsList(data){ getSelectOrderGoodsList(data){
return api.post('dj.api.smartcarlife.selectOrderGoods.list', data) return api.post('dj.api.smartcarlife.selectOrderGoods.list', data)
},
// 查询订单可展示按钮类型
getMoreBtnAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.button.select', data)
} }
} }
...@@ -9,13 +9,15 @@ import { ...@@ -9,13 +9,15 @@ import {
getQuotationInfoById, getQuotationInfoById,
updateCustomerInfo, updateCustomerInfo,
errorOrderById, errorOrderById,
updateZyInfo updateZyInfo,
getMoreBtnAPI
} from "../../../api"; } from "../../../api";
import { import {
checkDailyReport checkDailyReport
} from "~/store/ModalToQueueControl"; } from "~/store/ModalToQueueControl";
import data from "../constant/data"; import data from "../constant/data";
import constantData from "../constant/data"; import constantData from "../constant/data";
import api from "~/api/api"
import { import {
ImgUrl as IMG_URL ImgUrl as IMG_URL
} from "~/config"; } from "~/config";
...@@ -220,11 +222,10 @@ Component({ ...@@ -220,11 +222,10 @@ Component({
// 更多按钮 // 更多按钮
moreBtnVisible: false, moreBtnVisible: false,
btnOrderInfo: {}, btnOrderInfo: {},
btnsList: [{ btnsList: [],
name: '申请开票'
}],
// 选择发票 // 选择发票
invoiveVisible: false invoiveVisible: false,
areaOperationsFlag: false
}, },
observers: { observers: {
mode: function (value) { mode: function (value) {
...@@ -323,7 +324,7 @@ Component({ ...@@ -323,7 +324,7 @@ Component({
merchantBrand merchantBrand
} = this.data; } = this.data;
// wx.$router.go(mode ? 'createOrderCarQuotationSimple' : 'createOrderCarQuotation') // wx.$router.go(mode ? 'createOrderCarQuotationSimple' : 'createOrderCarQuotation')
if (merchantBrand.findIndex((i) => ["鸿蒙智行"].includes(i.name)) != -1) if (merchantBrand?.findIndex((i) => ["鸿蒙智行"].includes(i.name)) != -1)
wx.$router.go("beforeCreate", { wx.$router.go("beforeCreate", {
mode, mode,
}); });
...@@ -377,7 +378,7 @@ Component({ ...@@ -377,7 +378,7 @@ Component({
if (!arr) { if (!arr) {
return arr; return arr;
} }
var attrList = ["equityPrice", "quotedPrice", "quotedPriceUpdate"]; var attrList = ["equityPrice", "quotedPrice", "quotedPriceUpdate", "refundAmount"];
arr.forEach((item) => { arr.forEach((item) => {
attrList.forEach((k) => { attrList.forEach((k) => {
if (item[k]) { if (item[k]) {
...@@ -1264,16 +1265,39 @@ Component({ ...@@ -1264,16 +1265,39 @@ Component({
}, },
/** 更多按钮 */ /** 更多按钮 */
handleMoreBtn(e) { handleMoreBtn(e) {
let { const { target } = e.currentTarget.dataset
target let { isOrder } = this.data
} = e.currentTarget.dataset const btnArr = []
// 判断是否显示发票入口
if (target.showInvoiceEntrance) {
btnArr.push({
name: target.invoicing === 2 ? '查看发票' : '申请开票'
})
}
// 查询订单可展示按钮
getMoreBtnAPI({orderCode: target.payId}).then(res => {
let { code, message, data } = res
if (code == 0) {
if (data.refundApplyButton == 'Y' && target.zyPayStatus != 1 && isOrder) {
btnArr.push({ name: '申请退款' })
}
if (data.refundApplyDetailButton == 'Y' && target.zyPayStatus != 1 && isOrder) {
btnArr.push({ name: '退款详情' })
}
this.setData({ this.setData({
'btnsList[0].name': target.invoicing == 2 ? '查看发票' : '申请开票' btnsList: btnArr,
btnOrderInfo: { ...target, orderCode: target.payId }
}) })
target.orderCode = target.payId
this.handleBtnCancel() this.handleBtnCancel()
} else {
wx.$util.showToast(message)
}
})
},
// 关闭未配置区域运营弹窗提示
closeModal() {
this.setData({ this.setData({
btnOrderInfo: target || {} areaOperationsFlag: false
}) })
}, },
handleBtnCancel() { handleBtnCancel() {
...@@ -1285,7 +1309,53 @@ Component({ ...@@ -1285,7 +1309,53 @@ Component({
}) })
}, },
handleBtnClick(e) { handleBtnClick(e) {
const btnName = e.detail.name
let { btnOrderInfo } = this.data
switch (btnName) {
case '申请开票':
case '查看发票':
this.handleInvoiceDetail() this.handleInvoiceDetail()
break
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}`,
})
}
}
})
break
case '退款详情':
// 退款详情点击埋点
wx.$track.setTrackData(0, 'refund_detail_page', {}, '', 0)
// 点击退款详情,判断是否存在多条退款申请记录,存在跳转列表页,不存在直接跳转详情页
api.getRefundDetailListAPI({orderCode: btnOrderInfo.orderCode}).then(res => {
let { code, data } = res
if (code == 0) {
if (data?.length > 1) {
wx.navigateTo({
url: `/tabWorkOrder/pages/refundDetailList/refundDetailList?orderCode=${btnOrderInfo.orderCode}`,
})
} else if (data.length == 1) {
wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${data[0].applyCode}`,
})
}
}
})
break
}
this.handleBtnCancel() this.handleBtnCancel()
}, },
handleSelectInvoice() { handleSelectInvoice() {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
"order-screen": "../components/OrderScreen/OrderScreen", "order-screen": "../components/OrderScreen/OrderScreen",
"zy-pay-popup": "../components/zyPayPopup/zyPayPopup", "zy-pay-popup": "../components/zyPayPopup/zyPayPopup",
"more-btn": "/components/MoreBtn/MoreBtn", "more-btn": "/components/MoreBtn/MoreBtn",
"select-invoice-modal": "/components/SelectInvoiceModal/SelectInvoiceModal" "select-invoice-modal": "/components/SelectInvoiceModal/SelectInvoiceModal",
"area-operations-modal": "/components/areaOperationsModal/areaOperationsModal"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -121,6 +121,10 @@ ...@@ -121,6 +121,10 @@
<text class="unit">¥</text> <text class="unit">¥</text>
{{item.quotedPriceUpdate || ''}} {{item.quotedPriceUpdate || ''}}
</view> </view>
<view class="refund-box" wx:if="{{item.refundAmount}}">部分退款
<text class="unit">¥</text>
{{item.refundAmount}}
</view>
<!-- 已录单未签名 --> <!-- 已录单未签名 -->
<!-- <view wx:if="{{(item.orderStatus == '3' && item.equityOrderStatus == '0') || (item.orderStatus == '5' && item.equityOrderStatus == '0')}}" class="orange-txt"> <!-- <view wx:if="{{(item.orderStatus == '3' && item.equityOrderStatus == '0') || (item.orderStatus == '5' && item.equityOrderStatus == '0')}}" class="orange-txt">
<image class="icon-info" src="/packageEquity/images/icon-info.png"></image> <image class="icon-info" src="/packageEquity/images/icon-info.png"></image>
...@@ -169,7 +173,7 @@ ...@@ -169,7 +173,7 @@
</block> </block>
<block wx:else> <block wx:else>
<view wx:if="{{ item.orderStatus != '4' && item.orderStatus!=11&& item.orderStatus!=9 }}" class="btn_class"> <view wx:if="{{ item.orderStatus != '4' && item.orderStatus!=11&& item.orderStatus!=9 }}" class="btn_class">
<block wx:if="{{item.showInvoiceEntrance}}"> <block wx:if="{{item.showInvoiceEntrance || ((item.orderStatus == 3 || item.orderStatus == 5 || item.orderStatus == 6) && item.payType != 2 && isOrder)}}">
<view class="order-btn default-btn padding_20" bindtap="handleMoreBtn" data-target="{{ item }}">更多</view> <view class="order-btn default-btn padding_20" bindtap="handleMoreBtn" data-target="{{ item }}">更多</view>
</block> </block>
<block wx:if="{{ item.canUpdateZyPayUrl == 1 && item.zyPayStatus == 2 }}"> <block wx:if="{{ item.canUpdateZyPayUrl == 1 && item.zyPayStatus == 2 }}">
...@@ -196,14 +200,14 @@ ...@@ -196,14 +200,14 @@
</block> </block>
</view> </view>
<view wx:else class="btn_class"> <view wx:else class="btn_class">
<block wx:if="{{item.showInvoiceEntrance}}"> <block wx:if="{{item.showInvoiceEntrance || ((item.orderStatus == 3 || item.orderStatus == 5 || item.orderStatus == 6) && item.payType != 2 && isOrder)}}">
<view class="order-btn default-btn padding_20" bindtap="handleMoreBtn" data-target="{{ item }}">更多</view> <view class="order-btn default-btn padding_20" bindtap="handleMoreBtn" data-target="{{ item }}">更多</view>
</block> </block>
</view> </view>
</block> </block>
</block> </block>
<view wx:else class="btn_class"> <view wx:else class="btn_class">
<block wx:if="{{item.showInvoiceEntrance}}"> <block wx:if="{{item.showInvoiceEntrance || ((item.orderStatus == 3 || item.orderStatus == 5 || (item.orderStatus == 6 && item.refundAmount)) && item.payType != 2 && isOrder)}}">
<view class="order-btn default-btn padding_20" bindtap="handleMoreBtn" data-target="{{ item }}">更多</view> <view class="order-btn default-btn padding_20" bindtap="handleMoreBtn" data-target="{{ item }}">更多</view>
</block> </block>
</view> </view>
...@@ -306,3 +310,4 @@ ...@@ -306,3 +310,4 @@
<zy-pay-popup wx:if="{{showZyPayPopup}}" showZyTarget="{{showZyTarget}}" updateZyFlag="{{updateZyFlag}}" isListShow="{{true}}" show="{{showZyPayPopup}}" bindconfirm="zyPayConfirm"></zy-pay-popup> <zy-pay-popup wx:if="{{showZyPayPopup}}" showZyTarget="{{showZyTarget}}" updateZyFlag="{{updateZyFlag}}" isListShow="{{true}}" show="{{showZyPayPopup}}" bindconfirm="zyPayConfirm"></zy-pay-popup>
<more-btn wx:if="{{ moreBtnVisible }}" popupVisible="{{ moreBtnVisible }}" btnsList="{{btnsList}}" bindcancel="handleBtnCancel" bindbtnClick="handleBtnClick"></more-btn> <more-btn wx:if="{{ moreBtnVisible }}" popupVisible="{{ moreBtnVisible }}" btnsList="{{btnsList}}" bindcancel="handleBtnCancel" bindbtnClick="handleBtnClick"></more-btn>
<select-invoice-modal invoiveVisible="{{ invoiveVisible }}" orderInfo="{{btnOrderInfo}}"></select-invoice-modal> <select-invoice-modal invoiveVisible="{{ invoiveVisible }}" orderInfo="{{btnOrderInfo}}"></select-invoice-modal>
<area-operations-modal wx:if="{{areaOperationsFlag}}" isShow="{{areaOperationsFlag}}" bindclose="closeModal"></area-operations-modal>
\ No newline at end of file \ No newline at end of file
...@@ -503,6 +503,21 @@ ...@@ -503,6 +503,21 @@
color: #347BFF; color: #347BFF;
} }
.refund-box{
margin-left: var(--fontSize16);
background: #FFF2E0;
padding: var(--fontSize4) var(--fontSize8);
color: #F7A431;
font-size: var(--fontSize24);
font-weight: 500;
font-family: 'numberBold';
border-radius: var(--fontSize4);
}
.refund-box .unit {
font-size: var(--fontSize24);
}
.orange-txt { .orange-txt {
color: #EB9B2F; color: #EB9B2F;
} }
......
...@@ -10,6 +10,7 @@ import { ...@@ -10,6 +10,7 @@ import {
getRecordDetailList getRecordDetailList
} from "../../receptionRecordsApi" } from "../../receptionRecordsApi"
import aiApi from '../../aiApi' import aiApi from '../../aiApi'
import { getWaitAuditCountAPI } from '~/api/api'
let lastPath = null; // 用于存储上一次的路径 let lastPath = null; // 用于存储上一次的路径
function throttle(func, delay) { function throttle(func, delay) {
let timeoutId; let timeoutId;
...@@ -413,6 +414,10 @@ Component({ ...@@ -413,6 +414,10 @@ Component({
if (menuList.some((item) => item.menuText == "战败下单" && mode == 0)) { if (menuList.some((item) => item.menuText == "战败下单" && mode == 0)) {
menuList = menuList.filter((item) => item.menuText != "战败下单"); menuList = menuList.filter((item) => item.menuText != "战败下单");
} }
const auditIndex = menuList.findIndex(e => e.menuText == '待审批')
if (auditIndex > -1) {
this.getAwaitAuditCount(userInfo, auditIndex)
}
// console.log('menuList', mode, menuList,); // console.log('menuList', mode, menuList,);
// 将menuList排序 // 将menuList排序
menuList.sort((a, b) => a.sortVal - b.sortVal) menuList.sort((a, b) => a.sortVal - b.sortVal)
...@@ -602,6 +607,15 @@ Component({ ...@@ -602,6 +607,15 @@ Component({
icon: "mentorship-manage" icon: "mentorship-manage"
}); });
} }
// 区域运营角色退款审批入口
if (userInfo?.loginRole == 3 && menuList.every(item => item.menuText != '待审批')) {
menuList.push({
menuText: '待审批',
path: 'tabWorkOrder.refundOperationList',
icon: 'refund_review_icon',
tipsNum: 0
})
}
this.checkIsPadOrNot(); this.checkIsPadOrNot();
this.getData(); this.getData();
// 隐藏待办事项模块 // 隐藏待办事项模块
...@@ -617,6 +631,16 @@ Component({ ...@@ -617,6 +631,16 @@ Component({
// 非区域督导和超管角色 // 非区域督导和超管角色
if (!userInfo?.isSuper && userInfo?.loginRole != 3 && userInfo?.loginRole != 6) this.getMerchantCarBrandList(); if (!userInfo?.isSuper && userInfo?.loginRole != 3 && userInfo?.loginRole != 6) this.getMerchantCarBrandList();
}, },
getAwaitAuditCount(userInfo, index) {
getWaitAuditCountAPI({sceneType: userInfo?.sceneType}).then(res => {
let { code, data } = res
if (code == 0) {
this.setData({
[`menuList[${index}].tipsNum`]: data.waiteForAuditNum
})
}
})
},
getStoreList() { getStoreList() {
return new Promise(resolve => { return new Promise(resolve => {
// if (wx.$receptionLoaded) return // if (wx.$receptionLoaded) return
...@@ -1193,7 +1217,7 @@ Component({ ...@@ -1193,7 +1217,7 @@ Component({
/**禁止提单 */ /**禁止提单 */
if(item.beforeClick && await wx.$globalDataFunction[item.beforeClick]()) return if(item.beforeClick && await wx.$globalDataFunction[item.beforeClick]()) return
if ( if (
merchantBrand.findIndex((i) => ["鸿蒙智行"].includes(i.name)) != -1 merchantBrand?.findIndex((i) => ["鸿蒙智行"].includes(i.name)) != -1
) { ) {
wx.$router.go("beforeCreate", { wx.$router.go("beforeCreate", {
mode, mode,
......
...@@ -250,7 +250,8 @@ export const checkScene = options => { ...@@ -250,7 +250,8 @@ export const checkScene = options => {
'tabDateIndex': 'pages/tabDateIndex/pages/tabDateIndex', 'tabDateIndex': 'pages/tabDateIndex/pages/tabDateIndex',
'tabDateIndex': 'pages/tabDateIndex/pages/tabDateIndex', 'tabDateIndex': 'pages/tabDateIndex/pages/tabDateIndex',
'h5AuthPhone': 'pages/h5AuthPhone/h5AuthPhone', 'h5AuthPhone': 'pages/h5AuthPhone/h5AuthPhone',
'mentorShipManage': 'tabWorkOrder/pages/mentorshipManage/mentorshipManage' 'mentorShipManage': 'tabWorkOrder/pages/mentorshipManage/mentorshipManage',
'refundApply': 'tabWorkOrder/pages/refundApply/refundApply'
} }
options.path = pagePath[query.page] options.path = pagePath[query.page]
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import mixins from './index_mixins' import mixins from './index_mixins'
import api from '../../api.js' import api from '../../api.js'
import NP from 'number-precision' import NP from 'number-precision'
import { getWaitAuditCountAPI } from '~/api/api'
import { import {
getYQInfo, getYQInfo,
get4SStoreList, get4SStoreList,
...@@ -536,6 +537,10 @@ Page({ ...@@ -536,6 +537,10 @@ Page({
if (item.url == 'tabWorkOrder.supervisorDaily' && (userInfo?.loginRole == 6 || mentorFlag)) { if (item.url == 'tabWorkOrder.supervisorDaily' && (userInfo?.loginRole == 6 || mentorFlag)) {
wx.$track.setTrackData(0, 'supervisor_daily_page', {}, '', 1) wx.$track.setTrackData(0, 'supervisor_daily_page', {}, '', 1)
} }
// 区域运营点击退款审批
if (item.path == 'tabWorkOrder.refundOperationList') {
return wx.$router.go(item.path)
}
console.log(userInfo); console.log(userInfo);
// 判断是不是门店员工 // 判断是不是门店员工
if (userInfo?.merchantType && !userInfo.isSuper && type == 2) { if (userInfo?.merchantType && !userInfo.isSuper && type == 2) {
...@@ -1544,14 +1549,38 @@ Page({ ...@@ -1544,14 +1549,38 @@ Page({
}) })
} }
}) })
// 区域运营角色审批退款申请入口
if (userInfo?.loginRole == 3 && menu.every(item => item.name != '待审批')) {
menu.push({
name: '待审批',
icon: 'refund_review_icon',
path: 'tabWorkOrder.refundOperationList',
noCheckdailyReport: true
})
}
this.setData({ this.setData({
menu, menu,
isNoStaff, isNoStaff,
newMenu newMenu
}, () => {
let index = menu.findIndex(e => e.name == '待审批')
if (index > -1) {
// 获取待审批数量
this.getAwaitAuditCount(userInfo, index)
}
}) })
this.getIsBusinessSchoolEnableCurrentUser() this.getIsBusinessSchoolEnableCurrentUser()
}, },
getAwaitAuditCount(userInfo, index) {
getWaitAuditCountAPI({sceneType: userInfo?.sceneType}).then(res => {
let { code, data } = res
if (code == 0) {
this.setData({
[`menu[${index}].tipsNum`]: data.waiteForAuditNum
})
}
})
},
onRoute(options) { onRoute(options) {
options && this.checkShowOrderPop(options) options && this.checkShowOrderPop(options)
wx.__HAS_SHOW_MODAL = false wx.__HAS_SHOW_MODAL = false
......
...@@ -289,8 +289,12 @@ module.exports = { ...@@ -289,8 +289,12 @@ module.exports = {
return api.post("dj.api.businessSchool.miniProgram.teachTask.count", data, [], "/rop-dj-business-school-miniprogram/router") return api.post("dj.api.businessSchool.miniProgram.teachTask.count", data, [], "/rop-dj-business-school-miniprogram/router")
}, },
// 根据商户号获取可选商品列表 // 根据商户号获取可选商品列表
getSelectOrderGoodsList(data){ getSelectOrderGoodsList(data){
return api.post('dj.api.smartcarlife.selectOrderGoods.list', data) return api.post('dj.api.smartcarlife.selectOrderGoods.list', data)
},
// 退款审批列表查询
getRefundReviewListAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.waitForAudit.list', data)
} }
}; };
// tabWorkOrder/components/applyRefundBtn/applyRefundBtn.js
import api from "~/api/api"
Component({
/**
* 组件的属性列表
*/
properties: {
orderInfo: Object
},
/**
* 组件的初始数据
*/
data: {
moreSelectData: [],
showSelect: false,
moreSelectIndex: null,
areaOperationsFlag: false
},
/**
* 组件的方法列表
*/
methods: {
// 点击更多按钮
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,
})
}
})
},
filterMoreSelectData(refundApplyButton, refundApplyDetailButton) {
const allOptions = ['申请退款', '退款详情']
const conditions = {
'申请退款': refundApplyButton === 'Y',
'退款详情': refundApplyDetailButton === 'Y'
}
return allOptions.filter(option => conditions[option])
},
closeSelect() {
this.setData({
showSelect: false,
moreSelectIndex: null
})
},
optionTap(e) {
let { index, item } = e.currentTarget.dataset
let { orderInfo } = this.data
let userInfo = wx.$util.getUserInfo()
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
if (code == 0) {
if (!data) {
return this.setData({
areaOperationsFlag: true,
showSelect: !this.data.showSelect
})
} else {
wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?orderCode=${orderInfo.orderCode}&shopMerchantName=${orderInfo.merchantName}&shopMerchantId=${orderInfo.merchantId}`,
})
this.closeSelect()
}
} else {
return wx.$util.showToast(message)
}
})
} else {
// 退款详情点击埋点
wx.$track.setTrackData(0, 'refund_detail_page', {}, '', 1)
// 点击退款详情,判断是否存在多条退款申请记录,存在跳转列表页,不存在直接跳转详情页
api.getRefundDetailListAPI({orderCode: orderInfo.orderCode}).then(res => {
let { code, data } = res
if (code == 0) {
if (data?.length > 1) {
wx.navigateTo({
url: `/tabWorkOrder/pages/refundDetailList/refundDetailList?orderCode=${orderInfo.orderCode}`,
})
} else if (data.length == 1) {
wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${data[0].applyCode}`,
})
}
}
this.closeSelect()
})
}
this.setData({
moreSelectIndex: index,
// showSelect: !this.data.showSelect
})
},
closeModal() {
this.setData({
areaOperationsFlag: false
})
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {
"area-operations-modal": "/components/areaOperationsModal/areaOperationsModal"
}
}
\ No newline at end of file \ No newline at end of file
/* tabWorkOrder/components/applyRefundBtn/applyRefundBtn.wxss */
.select_box {
position: relative;
.more-btn {
position: relative;
font-size: var(--fontSize28);
color: #347BFF;
font-weight: 400;
}
.option_box{
position: absolute;
z-index: 1005;
top: var(--fontSize60);
right: calc(-1 * var(--fontSize24));
width: var(--fontSize194);
box-sizing: border-box;
background: #FFFFFF;
box-shadow: 0 var(--fontSize4) var(--fontSize12) #0000000d;
border-radius: var(--fontSize16);
overflow: hidden;
.option{
display: block;
height: var(--fontSize88);
line-height: var(--fontSize88);
text-align: center;
color: #181A1F;
overflow: hidden;
font-weight: 400;
font-size: var(--fontSize28);
}
.option:first-child{
border-radius: var(--fontSize16) var(--fontSize16) 0 0;
}
.option:last-child{
border-radius: 0 0 var(--fontSize16) var(--fontSize16);
}
.option.active{
background: #347bff1a;
color: #347BFF;
}
}
.option_box::after{
height: 0;
width: 0;
content: '';
position: absolute;
border: var(--fontSize14) solid transparent;
border-right: var(--fontSize14) solid #FFFFFF;
top: calc(-1 * var(--fontSize28));
left: var(--fontSize88);
z-index: 1;
transform: rotate(90deg);
filter: drop-shadow(0 var(--fontSize4) var(--fontSize8) #0000000d)
}
.option_box::before{
height: 0;
width: 0;
content: '';
position: absolute;
border: var(--fontSize14) solid transparent;
border-right: var(--fontSize14) solid #FFFFFF;
top: calc(-1 * var(--fontSize28));
left: var(--fontSize88);
z-index: 1;
transform: rotate(90deg);
filter: drop-shadow(0 var(--fontSize4) var(--fontSize8) #0000000d)
}
.mask_class{
width: 100vw;
height: 100vh;
background: transparent;
position: fixed;
top: 0;
left: 0;
z-index: 1000;
}
}
\ No newline at end of file \ No newline at end of file
<!--tabWorkOrder/components/applyRefundBtn/applyRefundBtn.wxml-->
<view class='select_box' >
<view class='select' catchtap='selectTap'>
<view class='more-btn'>更多</view>
</view>
<view class='option_box' wx:if="{{showSelect}}">
<view class='option {{moreSelectIndex == index ? "active" : ""}}' wx:for='{{moreSelectData}}' wx:key='this' data-index='{{index}}' data-item="{{item}}" catchtap='optionTap'>{{item}}</view>
</view>
<view class="mask_class" wx:if="{{showSelect}}" bindtap="closeSelect"></view>
</view>
<area-operations-modal wx:if="{{areaOperationsFlag}}" isShow="{{areaOperationsFlag}}" bindclose="closeModal"></area-operations-modal>
\ No newline at end of file \ No newline at end of file
...@@ -80,6 +80,46 @@ var filterDisabled = function (role, weeklyList, date, disabledStatus) { ...@@ -80,6 +80,46 @@ var filterDisabled = function (role, weeklyList, date, disabledStatus) {
} }
} }
var filterShowBtn = function (list) {
var arr = list.filter(function (val) {
return val.status == 2
})
return arr
}
// 判断子订单数据和退款申请已选子订单数据状态
var filterOrderStatus = function (infoData, userInfo) {
var flag = true
var afterStatus = infoData.afterStatus
var subOrderList = infoData.subOrderList
var refundApplyDetailList = infoData.refundApplyDetailList
var loginRole = userInfo.loginRole
subOrderList.forEach(function (val) {
refundApplyDetailList && refundApplyDetailList.forEach(function (v) {
if (val.subOrderCode == v.subOrderCode && val.status == 2) flag = false
})
})
return afterStatus === '' || (afterStatus == 5 && flag && loginRole != 3)
}
// 判断退款详情是否可操作
var filterRefundDisabled = function (infoData, userInfo,) {
var afterStatus = infoData.afterStatus
var subOrderList = infoData.subOrderList
var refundApplyDetailList = infoData.refundApplyDetailList
var loginRole = userInfo.loginRole
var flag = false
subOrderList.forEach(function (val) {
refundApplyDetailList && refundApplyDetailList.forEach(function (v) {
if (val.subOrderCode == v.subOrderCode && val.status == 2) flag = true
})
})
return afterStatus === 0
|| (afterStatus && afterStatus != 5)
|| loginRole == 3
|| (afterStatus == 5 && flag)
}
/* /*
* 导出 * 导出
*/ */
...@@ -89,5 +129,8 @@ module.exports = { ...@@ -89,5 +129,8 @@ module.exports = {
formatPosition: formatPosition, formatPosition: formatPosition,
filterIncludes: filterIncludes, filterIncludes: filterIncludes,
filterDisabled: filterDisabled, filterDisabled: filterDisabled,
filterTemplateList: filterTemplateList filterTemplateList: filterTemplateList,
filterShowBtn: filterShowBtn,
filterOrderStatus: filterOrderStatus,
filterRefundDisabled: filterRefundDisabled
} }
...@@ -34,6 +34,7 @@ Page({ ...@@ -34,6 +34,7 @@ Page({
// 发票按钮 // 发票按钮
invoiceName: '申请开票', invoiceName: '申请开票',
invoiveVisible: false, invoiveVisible: false,
showMoreBtn: false
}, },
RatingPopupSetting() { RatingPopupSetting() {
this.setData({ this.setData({
...@@ -404,6 +405,17 @@ Page({ ...@@ -404,6 +405,17 @@ Page({
let { code, message, data } = res; let { code, message, data } = res;
if (code == 0) { if (code == 0) {
wx.$util.hideLoading(); wx.$util.hideLoading();
if (data.selectPayType != 2 && (data.status == 4 || data.status == 6 || data.status == 12)) {
// 查询订单可展示按钮
commonApi.getMoreBtnAPI({orderCode: data.orderCode}).then(res => {
let { code, data } = res
if (code == 0) {
this.setData({
showMoreBtn: data.refundApplyButton == "Y" || data.refundApplyDetailButton == 'Y'
})
}
})
}
let couponName = data.customerCoupon let couponName = data.customerCoupon
? data.customerCoupon.couponName ? data.customerCoupon.couponName
: ""; : "";
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"usingComponents": { "usingComponents": {
"orderRatingPopup": "/tabWorkOrder/components/orderRatingPopup/orderRatingPopup", "orderRatingPopup": "/tabWorkOrder/components/orderRatingPopup/orderRatingPopup",
"select-invoice-modal": "/components/SelectInvoiceModal/SelectInvoiceModal" "select-invoice-modal": "/components/SelectInvoiceModal/SelectInvoiceModal",
"apply-refund-btn": "/tabWorkOrder/components/applyRefundBtn/applyRefundBtn"
} }
} }
...@@ -90,6 +90,7 @@ page { ...@@ -90,6 +90,7 @@ page {
position: relative; position: relative;
font-size: var(--fontSize28); font-size: var(--fontSize28);
color: #347BFF; color: #347BFF;
font-weight: normal;
} }
...@@ -156,7 +157,6 @@ page { ...@@ -156,7 +157,6 @@ page {
font-size: 28rpx; font-size: 28rpx;
font-weight: 400; font-weight: 400;
color: #347BFF; color: #347BFF;
margin-left: 20rpx;
} }
.invoice-btn .icon { .invoice-btn .icon {
......
...@@ -105,10 +105,15 @@ ...@@ -105,10 +105,15 @@
<view class="box"> <view class="box">
<view class="title infoTitle"> <view class="title infoTitle">
<view class="flex">工单信息 <view class="flex">工单信息
<view style="display: flex;gap: var(--fontSize32);margin-left: var(--fontSize32);">
<view wx:if="{{orderInfo.showInvoiceEntrance || orderInfo.invoiceStatus == 2}}" class="invoice-btn" bindtap="handleBtnInvoice"> <view wx:if="{{orderInfo.showInvoiceEntrance || orderInfo.invoiceStatus == 2}}" class="invoice-btn" bindtap="handleBtnInvoice">
<gl-image class="icon" src="/icon-invoice.png"></gl-image> <gl-image class="icon" src="/icon-invoice.png"></gl-image>
{{invoiceName}} {{invoiceName}}
</view> </view>
<view wx:if="{{isStaff && showMoreBtn}}">
<apply-refund-btn orderInfo="{{orderInfo}}"></apply-refund-btn>
</view>
</view>
</view> </view>
<view class="operate" wx:if="{{ orderInfo.canOperate&&(isYqdSuper||isStaff)&&isMake }}"> <view class="operate" wx:if="{{ orderInfo.canOperate&&(isYqdSuper||isStaff)&&isMake }}">
<text bindtap="targetOperate">操作</text> <text bindtap="targetOperate">操作</text>
......
...@@ -249,6 +249,17 @@ Page({ ...@@ -249,6 +249,17 @@ Page({
// 获取对应园区店配置 // 获取对应园区店配置
await this.getServiceBaseInfo(data.merchantId) await this.getServiceBaseInfo(data.merchantId)
await this.getSignatureSwitch(data.merchantId) await this.getSignatureSwitch(data.merchantId)
if (data.selectPayType != 2 && (data.status == 4 || data.status == 6 || data.status == 12)) {
// 查询订单可展示按钮
commonApi.getMoreBtnAPI({orderCode: data.orderCode}).then(res => {
let { code, data } = res
if (code == 0) {
this.setData({
showMoreBtn: data.refundApplyButton == "Y" || data.refundApplyDetailButton == 'Y'
})
}
})
}
// 服务商是否使用膜卷号配置 // 服务商是否使用膜卷号配置
if (!userInfo?.isSuper && userInfo.userType == 2 && data.status != 10 && data.status != 9) { if (!userInfo?.isSuper && userInfo.userType == 2 && data.status != 10 && data.status != 9) {
isUseFilmRoll = await getServiceFilmRollSetting(data?.sellerMerchantId) isUseFilmRoll = await getServiceFilmRollSetting(data?.sellerMerchantId)
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
"usingComponents": { "usingComponents": {
"artificer-select-popup" : "/components/ArtificerSelectPopup/artificerSelectPopup", "artificer-select-popup" : "/components/ArtificerSelectPopup/artificerSelectPopup",
"film-roll-no-popup": "/tabWorkOrder/components/FilmRollNoPopup/FilmRollNoPopup", "film-roll-no-popup": "/tabWorkOrder/components/FilmRollNoPopup/FilmRollNoPopup",
"select-invoice-modal": "/components/SelectInvoiceModal/SelectInvoiceModal" "select-invoice-modal": "/components/SelectInvoiceModal/SelectInvoiceModal",
"apply-refund-btn": "/tabWorkOrder/components/applyRefundBtn/applyRefundBtn"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -95,11 +95,17 @@ ...@@ -95,11 +95,17 @@
<view class="box"> <view class="box">
<view class="title invoice"> <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)}}">
<apply-refund-btn orderInfo="{{orderInfo}}"></apply-refund-btn>
</view>
<view wx:if="{{orderInfo.showInvoiceEntrance || orderInfo.invoiceStatus == 2}}" class="invoice-btn" bindtap="handleBtnInvoice"> <view wx:if="{{orderInfo.showInvoiceEntrance || orderInfo.invoiceStatus == 2}}" class="invoice-btn" bindtap="handleBtnInvoice">
<gl-image class="icon" src="/icon-invoice.png"></gl-image> <gl-image class="icon" src="/icon-invoice.png"></gl-image>
{{invoiceName}} {{invoiceName}}
</view> </view>
</view> </view>
</view>
<block wx:for="{{orderObj}}" wx:key="index"> <block wx:for="{{orderObj}}" wx:key="index">
<view class="cell"> <view class="cell">
<view class="label">{{item.label}}</view> <view class="label">{{item.label}}</view>
......
...@@ -207,6 +207,17 @@ Page({ ...@@ -207,6 +207,17 @@ Page({
} = res } = res
if (code == 0) { if (code == 0) {
wx.$util.hideLoading() wx.$util.hideLoading()
if (data.selectPayType != 2 && (data.status == 4 || data.status == 6 || data.status == 12)) {
// 查询订单可展示按钮
commonApi.getMoreBtnAPI({orderCode: data.orderCode}).then(res => {
let { code, data } = res
if (code == 0) {
this.setData({
showMoreBtn: data.refundApplyButton == "Y" || data.refundApplyDetailButton == 'Y'
})
}
})
}
let couponName = data.customerCoupon ? data.customerCoupon.couponName : '' let couponName = data.customerCoupon ? data.customerCoupon.couponName : ''
let total_price = 0 let total_price = 0
let warrantyCardList = [] let warrantyCardList = []
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
"usingComponents": { "usingComponents": {
"artificer-select-popup" : "/components/ArtificerSelectPopup/artificerSelectPopup", "artificer-select-popup" : "/components/ArtificerSelectPopup/artificerSelectPopup",
"film-roll-no-popup": "/tabWorkOrder/components/FilmRollNoPopup/FilmRollNoPopup", "film-roll-no-popup": "/tabWorkOrder/components/FilmRollNoPopup/FilmRollNoPopup",
"select-invoice-modal": "/components/SelectInvoiceModal/SelectInvoiceModal" "select-invoice-modal": "/components/SelectInvoiceModal/SelectInvoiceModal",
"apply-refund-btn": "/tabWorkOrder/components/applyRefundBtn/applyRefundBtn"
} }
} }
...@@ -6,17 +6,17 @@ ...@@ -6,17 +6,17 @@
<view class="tips">感谢您的配合,请在确认以下信息后,在下方的签字区内签字确认,谢谢!</view> <view class="tips">感谢您的配合,请在确认以下信息后,在下方的签字区内签字确认,谢谢!</view>
</view> </view>
<view class="box"> <view class="box">
<view class="title invoice"> <view class="title invoice">信息确认
信息确认 <view style="display: flex;gap: var(--fontSize32);">
<view <view wx:if="{{isStaff && orderInfo.selectPayType != 2 && showMoreBtn && (orderInfo.status == 4 || orderInfo.status == 6 || orderInfo.status == 12)}}">
wx:if="{{ orderInfo.showInvoiceEntrance || orderInfo.invoiceStatus == 2 }}" <apply-refund-btn orderInfo="{{orderInfo}}"></apply-refund-btn>
class="invoice-btn" </view>
bindtap="handleBtnInvoice" <view wx:if="{{orderInfo.showInvoiceEntrance || orderInfo.invoiceStatus == 2}}" class="invoice-btn" bindtap="handleBtnInvoice">
>
<gl-image class="icon" src="/icon-invoice.png"></gl-image> <gl-image class="icon" src="/icon-invoice.png"></gl-image>
{{invoiceName}} {{invoiceName}}
</view> </view>
</view> </view>
</view>
<view class="cell"> <view class="cell">
<view class="label">客户姓名:</view> <view class="label">客户姓名:</view>
<view class="value">{{orderInfo.customerName || ''}}</view> <view class="value">{{orderInfo.customerName || ''}}</view>
......
import api from "~/utils/request/request.js";
module.exports = {
// 退款申请流程状态栏
getRefundStatusAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.audit.select', data)
},
// 标记订单子订单详情查询
getSubOrderInfoAPI(data) {
return api.post('dj.api.smartcarlife.goodsOrder.goodsSubOrder.list', data)
},
// 退款详情明细查询
getRefundDetailInfoAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.detail.select', data)
},
// 发起退款申请
applyRefundAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.add', data)
},
// 退款审核
auditRefundAllpyAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.audit.update', data)
},
// 根据主订单号获取退款成功记录
getRefundLogByOrderCodeAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.refundedGoodsOrder.list', data)
}
}
\ No newline at end of file \ No newline at end of file
// tabWorkOrder/components/reviewStatus/reviewStatus.js
import api from '../../api'
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
},
{
nameObj: {
1: '总部审核',
2: '总部审核',
3: '总部审核'
},
type: 1,
active: false
},
{
nameObj: {
1: '待退款',
2: '已退款',
},
type: 1,
active: false
}
]
},
/**
* 组件的方法列表
*/
methods: {
setStatusInfo(beforeStatus, afterStatus, transferStatus) {
const STATUS = {
INITIATE: 0, // 发起申请
APPLIED: 1, // 已申请
REGION_REVIEW: 2, // 区域运营审核
REGION_PASS: 3, // 区域运营审核通过
REGION_REJECT: 4, // 区域运营审核不通过
HEAD_REVIEW: 5, // 总部审核
HEAD_PASS: 6, // 总部审核通过
HEAD_REJECT: 7, // 总部审核不通过
PENDING_REFUND: 8, // 待退款
REFUNDED: 9 // 已退款
}
// 定义状态类型
const STATUS_TYPE = {
CURRENT: 1, // 当前进行中
COMPLETED: 2, // 已完成
REJECTED: 3 // 已驳回
}
// 处理空值
const before = beforeStatus ?? ''
const after = afterStatus ?? ''
const transfer = transferStatus ?? ''
// 确定当前状态
let currentStatus
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 == 8) {
currentStatus = STATUS.HEAD_REVIEW
} else if (before == 7 && after == 5) {
currentStatus = STATUS.REGION_REJECT
} else if ([0, 1, 2, 8].includes(before) && [0, 1, 2, 3].includes(after)) {
currentStatus = STATUS.HEAD_REVIEW
} else if (before == 3 && after == 4) {
currentStatus = STATUS.HEAD_PASS
} else if ([0, 1, 2, 3].includes(before) && after == 5) {
currentStatus = STATUS.HEAD_REJECT
} else if (after == 4) {
currentStatus = STATUS.PENDING_REFUND
} else if (transfer == 3) {
currentStatus = STATUS.REFUNDED
}
// 更新状态列表
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
}
}
// 第三步状态(总部审核)
if (index === 2) {
if (currentStatus === STATUS.HEAD_REVIEW) {
item.type = STATUS_TYPE.CURRENT
item.active = true
} else if (currentStatus === STATUS.HEAD_REJECT) {
item.type = STATUS_TYPE.REJECTED
item.active = true
} else if (currentStatus > STATUS.HEAD_REVIEW) {
item.type = STATUS_TYPE.COMPLETED
item.active = false
}
}
// 第四步状态(退款)
if (index === 3) {
if (currentStatus == STATUS.PENDING_REFUND) {
item.type = STATUS_TYPE.CURRENT
item.active = true
} else if (currentStatus > STATUS.PENDING_REFUND) {
item.type = STATUS_TYPE.COMPLETED
item.active = false
}
}
})
this.setData({
statusList
})
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* tabWorkOrder/components/reviewStatus/reviewStatus.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(--fontSize100);
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 \ No newline at end of file
<!--tabWorkOrder/components/reviewStatus/reviewStatus.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 \ No newline at end of file
{
"navigationBarTitleText": "零售退款申请表",
"usingComponents": {
"review-status": "./components/reviewStatus/reviewStatus"
}
}
\ No newline at end of file \ No newline at end of file
// tabWorkOrder/pages/refundDetailList/refundDetailList.js
import api from "~/api/api"
Page({
/**
* 页面的初始数据
*/
data: {
orderObj: [{
label: '申请时间',
key: 'createdDate'
}, {
label: '订单支付总额',
key: 'refundableTotalPrice',
unit: true
}, {
label: '退款申请金额',
key: 'applyRefundAmount',
unit: true
}],
reviewObj: [{
label: '申请时间',
key: 'createdDate'
}, {
label: '退款时间',
key: 'refundTime'
}, {
label: '订单支付总额',
key: 'refundableTotalPrice',
unit: true
}, {
label: '退款申请金额',
key: 'applyRefundAmount',
unit: true
}],
list: [],
flag: true,
reviewStatusObj: {
0: {
text: '区域运营审核中',
background: '#FFF2E0',
color: '#F7A431'
},
1: {
text: '区域运营审核不通过',
background: '#FDECE9',
color: '#F24724'
},
2: {
text: '总部审核',
background: '#FFF2E0',
color: '#F7A431'
},
3: {
text: '总部审核不通过',
background: '#FDECE9',
color: '#F24724'
},
4: {
text: '待退款',
background: '#FFF2E0',
color: '#F7A431'
},
5: {
text: '已退款',
background: '#EAF1FF',
color: '#347BFF'
}
}
},
jump(e) {
let { item } = e.currentTarget.dataset
wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${item.applyCode}`
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// 获取退款详情列表
api.getRefundDetailListAPI({orderCode: options.orderCode}).then(res => {
let { code, data } = res
if (code == 0) {
// 处理审批状态
data.forEach(val => {
if (val.beforeStatus == 6 && val.afterStatus == 7) {
val.reviewStatus = 0 // 区域运营审批
}
if (val.beforeStatus == 7 && val.afterStatus == 5) {
val.reviewStatus = 1 // 区域审核不通过
}
if (([0, 1, 2, 8].includes(val.beforeStatus) && [0, 1, 2, 3].includes(val.afterStatus)) || (val.beforeStatus == 7 && val.afterStatus == 8)) {
val.reviewStatus = 2 // 总部审核
}
if ([0, 1, 2, 3].includes(val.beforeStatus) && val.afterStatus == 5) {
val.reviewStatus = 3 // 总部审核不通过
}
if (val.afterStatus == 4) {
val.reviewStatus = 4 // 待退款
}
if (val.transferStatus == 3) {
val.reviewStatus = 5 // 已退款
}
val.orderCode = options.orderCode
if (val.createdDate) val.createdDate = new Date(val.createdDate).format("yyyy-MM-dd hh:mm:ss")
if (val.refundTime) val.refundTime = new Date(val.refundTime).format("yyyy-MM-dd hh:mm:ss")
})
this.setData({
list: data || []
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "退款详情",
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* tabWorkOrder/pages/refundDetailList/refundDetailList.wxss */
page {
background-color: #F4F5F7;
}
.list-content {
padding-bottom: var(--fontSize30);
.item {
box-sizing: border-box;
background: #FFFFFF;
padding: var(--fontSize32);
position: relative;
margin: var(--fontSize20);
box-shadow: 0 var(--fontSize4) var(--fontSize20) 0 #0000001a;
border-radius: var(--fontSize16);
font-size: var(--fontSize24);
.item-top{
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: var(--fontSize28);
.code{
color: '#292D33';
font-size: var(--fontSize32);
font-weight: 500;
.code-text{
font-size: var(--fontSize24);
font-weight: 400;
margin-left: var(--fontSize12);
}
}
.status{
padding: var(--fontSize4) var(--fontSize8);
font-size: var(--fontSize24);
}
}
.order-list {
.order {
display: flex;
margin-bottom: var(--fontSize16);
.order-label {
width: var(--fontSize160);
color: #999EA8;
}
.order-value{
width: calc(100% - var(--fontSize160));
color: #292D33;
display: flex;
align-items: center;
.split {
margin: 0 var(--fontSize6);
}
}
.break-value{
word-break: break-all;
}
}
}
}
}
\ No newline at end of file \ No newline at end of file
<!--tabWorkOrder/pages/refundDetailList/refundDetailList.wxml-->
<view class="list-content">
<block wx:if="{{ flag }}">
<block wx:if="{{ list.length > 0 }}">
<block wx:for="{{ list }}" wx:for-item="li" wx:for-index="ind" wx:key="ind">
<view
class="item content"
catchtap="jump"
data-ind="{{ ind }}"
data-item="{{ li }}"
>
<view class="item-top">
<view class="code">
<text>退款编号</text>
<text class="code-text">{{li.applyCode}}</text>
</view>
<view class="status text-center" style="color:{{ reviewStatusObj[li.reviewStatus].color }};background-color:{{reviewStatusObj[li.reviewStatus].background }};">
{{reviewStatusObj[li.reviewStatus].text }}
</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">
<view class="order">
<view class="order-label">{{i.label}}</view>
<view class="order-value">
<block wx:if="{{ i.arr }}">
<block wx:if="{{ li[i.arr[1]] }}">
<block wx:for="{{ i.arr }}" wx:key="sindex" wx:for-index="arr_index" wx:for-item="k">
<view class="order-value-item text-hide">
<block wx:if="{{ arr_index == 1 }}">
<text class="split">|</text>
</block>
{{li[k]}}
</view>
</block>
</block>
</block>
<block wx:else><text wx:if="{{i.unit && li[i.key]}}" style="margin-right: var(--fontSize10);">¥</text>{{li[i.key] || ''}}</block>
</view>
</view>
</block>
<block wx:if="{{li.reviewStatus == 5}}">
<view class="order" >
<view class="order-label">实际退款金额</view>
<view class="order-value"><text style="margin-right: var(--fontSize10);">¥</text>{{li.payAmount}}</view>
</view>
</block>
<block wx:if="{{li.reviewStatus == 1 || li.reviewStatus == 3}}">
<view class="order">
<view class="order-label">不通过原因</view>
<view class="order-value break-value">{{li.remark}}</view>
</view>
</block>
</view>
</view>
</block>
</block>
</block>
</view>
\ No newline at end of file \ No newline at end of file
import api from "../../api"
import { getWaitAuditCountAPI } from '~/api/api'
// tabWorkOrder/pages/refundOperationList/refundOperationList.js
Page({
/**
* 页面的初始数据
*/
data: {
tabList: [{
text: '全部'
}, {
text: '待审批',
count: 0
}, {
text: '已审批'
}],
activeIndex: 0,
flag: false,
list: [],
pageNum: 1,
reviewStatusObj: {
0: {
text: '待审批',
background: '#FFF2E0',
color: '#F7A431'
},
1: {
text: '审批通过',
background: '#EAF9F1',
color: '#35C376'
},
2: {
text: '不通过',
background: '#FDECE9',
color: '#F24724'
}
},
reviewObj: [{
label: '申请人',
arr: ['applyStaffYqMerchantName', 'applyStaffName']
}, {
label: '申请时间',
key: 'createdDate'
}, {
label: '审批状态',
key: 'reviewText'
}, {
label: '退款状态',
key: 'refundText'
}, {
label: '订单支付总额',
key: 'refundableTotalPrice',
unit: true
}, {
label: '退款申请金额',
key: 'applyRefundAmount',
unit: true
}],
orderObj: [{
label: '申请人',
arr: ['applyStaffYqMerchantName', 'applyStaffName']
}, {
label: '申请时间',
key: 'createdDate'
}, {
label: '审批状态',
key: 'reviewText'
}, {
label: '审批人',
key: 'auditor'
}, {
label: '退款状态',
key: 'refundText'
}, {
label: '订单支付总额',
key: 'refundableTotalPrice',
unit: true
}, {
label: '退款申请金额',
key: 'applyRefundAmount',
unit: true
}],
nothing: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
scrollonReachBottom() {
this.getList()
this.getStatByStatus()
},
search() {
this.setData({
list: [],
pageNum: 1,
flag: false,
nothing: false,
})
this.getList()
this.getStatByStatus()
},
tabClick(e) {
this.setData({
tabIndex: e.detail
}, () => {
this.search()
})
},
// 获取待审批数目
getStatByStatus() {
let userInfo = wx.$util.getUserInfo()
let { activeIndex, nothing } = this.data
const status = activeIndex == 1 ? 0 : activeIndex == 2 ? 1 : ''
if (nothing) return
getWaitAuditCountAPI({sceneType: userInfo?.sceneType, status}).then(res => {
let { code, data } = res
if (code == 0) {
this.setData({
[`tabList[1].count`]: data.waiteForAuditNum || 0
})
}
})
},
// 获取列表数据
getList() {
let { pageNum, tabIndex, nothing, reviewStatusObj } = this.data
let userInfo = wx.$util.getUserInfo()
if (nothing) return
const auditStatus = tabIndex == 1 ? 0 : tabIndex == 2 ? 3 : ''
wx.$util.showLoading()
api.getRefundReviewListAPI({sceneType: userInfo.sceneType, auditStatus, pageNum, pageSize: 4}).then(res => {
wx.$util.hideLoading()
let total = 0
let list = []
let {
code,
data,
message
} = res
if (code == 0) {
data?.list?.forEach(val => {
val.reviewText = reviewStatusObj[val.auditStatus].text
if (val.beforeStatus == 6 && val.afterStatus == 7) {
val.refundText = '区域运营审核中' // 区域运营审批
val.refundStatus = 0
}
if (val.beforeStatus == 7 && val.afterStatus == 5) {
val.refundText = '区域运营审核不通过' // 区域审核不通过
val.refundStatus = 1
}
if (([0, 1, 2, 8].includes(val.beforeStatus) && [0, 1, 2, 3].includes(val.afterStatus)) || (val.beforeStatus == 7 && val.afterStatus == 8)) {
val.refundText = '总部审核' // 总部审核
val.refundStatus = 2
}
if ([0, 1, 2, 3].includes(val.beforeStatus) && val.afterStatus == 5) {
val.refundText = '总部审核不通过' // 总部审核不通过
val.refundStatus = 3
}
if (val.afterStatus == 4) {
val.refundText = '待退款'
val.refundStatus = 4
}
if (val.transferStatus == 3) {
val.refundText = '已退款' // 已退款
val.refundStatus = 5
}
if (val.createdDate) val.createdDate = new Date(val.createdDate).format("yyyy-MM-dd hh:mm:ss")
if (val.refundTime) val.refundTime = new Date(val.refundTime).format("yyyy-MM-dd hh:mm:ss")
})
list = data.list
total = data.total
} else {
wx.$util.showToast(message)
}
if (total != 0) {
this.setData({
[`list[${pageNum - 1}]`]: list
})
}
this.setData({
total,
flag: true,
triggered: false,
pageNum: pageNum + 1,
nothing: pageNum == data.pages
})
})
},
jump(e) {
let { item } = e.currentTarget.dataset
wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${item.applyCode}`
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.search()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "审批详情",
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* tabWorkOrder/pages/refundOperationList/refundOperationList.wxss */
page {
background-color: #F4F5F7;
}
.list-content {
.to-box {
position: sticky;
left: 0;
z-index: 2;
background: #FFFFFF;
}
.list {
box-sizing: border-box;
width: 100%;
.item {
box-sizing: border-box;
background: #FFFFFF;
padding: var(--fontSize32);
position: relative;
margin: 0 var(--fontSize20) var(--fontSize20);
box-shadow: 0 var(--fontSize4) var(--fontSize20) 0 #0000001a;
border-radius: var(--fontSize16);
font-size: var(--fontSize24);
.item-top{
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: var(--fontSize28);
.code{
color: '#292D33';
font-size: var(--fontSize32);
font-weight: 500;
.code-text{
font-size: var(--fontSize24);
font-weight: 400;
margin-left: var(--fontSize12);
}
}
.status{
padding: var(--fontSize4) var(--fontSize8);
font-size: var(--fontSize24);
}
}
.order-list {
.order {
display: flex;
margin-bottom: var(--fontSize16);
.order-label {
width: var(--fontSize160);
color: #999EA8;
}
.order-value{
width: calc(100% - var(--fontSize160));
color: #292D33;
display: flex;
align-items: center;
.split {
margin: 0 var(--fontSize6);
}
}
.break-value{
word-break: break-all;
}
}
}
}
}
}
\ No newline at end of file \ No newline at end of file
<!--tabWorkOrder/pages/refundOperationList/refundOperationList.wxml-->
<view class="list-content">
<view class="to-box">
<tab-bar tabList="{{ tabList }}" bindclick="tabClick" activeIndex="{{ activeIndex }}" />
</view>
<block wx:if="{{ flag }}">
<scroll-view
scroll-y
enable-back-to-top
refresher-enabled="{{ true }}"
bindrefresherrefresh="search"
bindscrolltolower="scrollonReachBottom"
class="list"
style="height:calc(100vh - var(--fontSize92));"
refresher-threshold="104"
refresher-triggered="{{ triggered }}"
>
<view style="width: 100%;height: var(--fontSize20);"></view>
<block wx:if="{{ list.length > 0 }}">
<block wx:for="{{ list }}" wx:key="index">
<block wx:for="{{ item }}" wx:for-item="li" wx:for-index="ind" wx:key="ind">
<view
data-ind="{{ ind }}"
data-index="{{ index }}"
>
<view
class="item content"
catchtap="jump"
data-ind="{{ ind }}"
data-index="{{ index }}"
data-item="{{ li }}"
>
<view class="item-top">
<view class="code">
<text>退款编号</text>
<text class="code-text">{{li.applyCode}}</text>
</view>
<view class="status text-center" style="color:{{ reviewStatusObj[li.auditStatus].color }};background-color:{{reviewStatusObj[li.auditStatus].background }};">
{{reviewStatusObj[li.auditStatus].text }}
</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">
<view class="order">
<view class="order-label">{{i.label}}</view>
<view class="order-value">
<block wx:if="{{ i.arr }}">
<block wx:if="{{ li[i.arr[1]] }}">
<block wx:for="{{ i.arr }}" wx:key="sindex" wx:for-index="arr_index" wx:for-item="k">
<view class="order-value-item text-hide">
<block wx:if="{{ arr_index == 1 }}">
<text class="split">|</text>
</block>
{{li[k]}}
</view>
</block>
</block>
</block>
<block wx:else><text wx:if="{{i.unit && li[i.key]}}" style="margin-right: var(--fontSize10);">¥</text>{{li[i.key] || ''}}</block>
</view>
</view>
</block>
<block wx:if="{{li.refundStatus == 5}}">
<view class="order" >
<view class="order-label">实际退款金额</view>
<view class="order-value"><text style="margin-right: var(--fontSize10);">¥</text>{{li.payAmount}}</view>
</view>
<view class="order" >
<view class="order-label">退款时间</view>
<view class="order-value">{{li.refundTime}}</view>
</view>
</block>
<block wx:if="{{li.refundStatus == 1 || li.refundStatus == 3}}">
<view class="order">
<view class="order-label">不通过原因</view>
<view class="order-value break-value">{{li.remark}}</view>
</view>
</block>
</view>
</view>
</view>
</block>
</block>
<block wx:if="{{ nothing }}">
<view class="list-nothing">到底了~</view>
</block>
</block>
<block wx:else>
<empty-data />
</block>
</scroll-view>
</block>
</view>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!