Commit d5ed9368 by 前端

Merge branch 'SAAS+V5.0.0-1014' into 'develop'

上线合并

See merge request !421
2 parents f6667f59 37d4fc02
...@@ -380,5 +380,9 @@ module.exports = { ...@@ -380,5 +380,9 @@ module.exports = {
// 退款详情列表查询 // 退款详情列表查询
getRefundDetailListAPI(data) { getRefundDetailListAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.singleOrder.list', data) return api.post('dj.api.smartcarlife.refundApplyRecord.singleOrder.list', data)
},
// 查询订单是否支持状态变更
getOrderRefundStep(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.isExist', data)
} }
} }
...@@ -1085,7 +1085,8 @@ Component({ ...@@ -1085,7 +1085,8 @@ Component({
const { const {
id, id,
repeal, repeal,
status status,
payid
} = e.currentTarget.dataset; } = e.currentTarget.dataset;
let _this = this; let _this = this;
if (repeal && status == -1) { if (repeal && status == -1) {
...@@ -1094,21 +1095,36 @@ Component({ ...@@ -1094,21 +1095,36 @@ Component({
repealId: id repealId: id
}) })
} else { } else {
// 校验订单是否可撤销(在退款流程中无法撤销)
let refundStep = await commonApi.getOrderRefundStep({orderCode: payid})
if (refundStep?.data == 'Y') return _this.showRefundAlert()
wx.showModal({ wx.showModal({
title: "", title: "",
content: "是否取撤销该工单?", content: "是否取撤销该工单?",
confirmText: "是", confirmText: "是",
confirmColor: "#347BFF", confirmColor: "#347BFF",
cancelText: "否", cancelText: "否",
success(res) { async success(r) {
if (res.confirm) { if (r.confirm) {
// _this.showLoading('取消中...') // _this.showLoading('取消中...')
// 再次校验订单是否可撤销(退款流程中无法撤销)防止弹出二次确认时长时间未操作,未拦截导致订单状态变更了
let canRefundStep = await commonApi.getOrderRefundStep({orderCode: payid})
if (canRefundStep?.data == 'Y') return _this.showRefundAlert()
_this.repeal(id); _this.repeal(id);
} }
}, },
}); });
} }
}, },
showRefundAlert(type) {
const text = type == 'error' ? '订单已发起退款,禁止标记为错误工单!如需标记错误请联系总部运营。' : '订单已发起退款,禁止撤销!如需撤销请联系总部运营。'
wx.showModal({
title: '提示',
content: text,
showCancel: false,
confirmText: "好的"
})
},
toCopyNumber(e) { toCopyNumber(e) {
let { let {
ordernum ordernum
...@@ -1163,14 +1179,18 @@ Component({ ...@@ -1163,14 +1179,18 @@ Component({
async toshowErrorOrder(e) { async toshowErrorOrder(e) {
// 校验是否填写昨日日报 // 校验是否填写昨日日报
let staffCheck = await checkDailyReport(true); let staffCheck = await checkDailyReport(true);
if (staffCheck) return false;; if (staffCheck) return false;
let _this = this
const { const {
item item
} = e.currentTarget.dataset; } = e.currentTarget.dataset;
this.setData({ _this.setData({
showErrorId: item.payId, showErrorId: item.payId,
}, },
() => { async () => {
// 校验订单是否可标记为错误订单(在退款流程中无法流转)
let refundStep = await commonApi.getOrderRefundStep({orderCode: item.payId})
if (refundStep?.data == 'Y') return _this.showRefundAlert('error')
wx.$modal(this, { wx.$modal(this, {
show: true, show: true,
title: "工单标记", title: "工单标记",
...@@ -1198,7 +1218,10 @@ Component({ ...@@ -1198,7 +1218,10 @@ Component({
show: true, show: true,
title: "请选择录单入口", title: "请选择录单入口",
tabTitleShow: false, tabTitleShow: false,
success: (res) => { success: async (res) => {
// 再次校验 防止二次确认弹窗弹起后长时间未操作,导致订单状态变更异常
let canRefundStep = await commonApi.getOrderRefundStep({orderCode: item.payId})
if (canRefundStep?.data == 'Y') return this.showRefundAlert()
// 跳转新增订单页面 并带特定参数 // 跳转新增订单页面 并带特定参数
let { let {
selectType selectType
...@@ -1304,7 +1327,7 @@ Component({ ...@@ -1304,7 +1327,7 @@ Component({
let { code, message, data } = res let { code, message, data } = res
if (code == 0) { if (code == 0) {
if (data.refundApplyButton == 'Y' && target.zyPayStatus != 1 && isOrder) { 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) { if (data.refundApplyDetailButton == 'Y' && target.zyPayStatus != 1 && isOrder) {
btnArr.push({ name: '退款详情' }) btnArr.push({ name: '退款详情' })
...@@ -1344,26 +1367,14 @@ Component({ ...@@ -1344,26 +1367,14 @@ Component({
case '申请退款': case '申请退款':
// 申请退款点击埋点 // 申请退款点击埋点
wx.$track.setTrackData(0, 'apply_refund_page', {}, '', 0) wx.$track.setTrackData(0, 'apply_refund_page', {}, '', 0)
let userInfo = wx.$util.getUserInfo() this.toRefund()
// 退款申请时区域运营查询 break
api.areaSupervisionExistsAPI({merchantId: userInfo.shopMerchantId, sceneType: userInfo.sceneType}).then(res => { case '标记退款':
let {code, data} = res this.toRefund(true)
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 break
case '退款详情': 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 => { api.getRefundDetailListAPI({orderCode: btnOrderInfo.orderCode}).then(res => {
let { code, data } = res let { code, data } = res
...@@ -1374,7 +1385,7 @@ Component({ ...@@ -1374,7 +1385,7 @@ Component({
}) })
} else if (data.length == 1) { } else if (data.length == 1) {
wx.navigateTo({ 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({ ...@@ -1383,6 +1394,25 @@ Component({
} }
this.handleBtnCancel() 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() { handleSelectInvoice() {
let { let {
invoiveVisible invoiveVisible
......
...@@ -173,7 +173,7 @@ ...@@ -173,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 || ((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> <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 }}">
...@@ -200,14 +200,14 @@ ...@@ -200,14 +200,14 @@
</block> </block>
</view> </view>
<view wx:else class="btn_class"> <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> <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 || ((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> <view class="order-btn default-btn padding_20" bindtap="handleMoreBtn" data-target="{{ item }}">更多</view>
</block> </block>
</view> </view>
...@@ -225,11 +225,11 @@ ...@@ -225,11 +225,11 @@
</view> </view>
</block> </block>
</view> </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> <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>工单</view> <view>工单</view>
</view> </view>
......
...@@ -642,8 +642,8 @@ Component({ ...@@ -642,8 +642,8 @@ Component({
[`menuList[${index}].tipsNum`]: data.waiteForAuditNum [`menuList[${index}].tipsNum`]: data.waiteForAuditNum
}) })
} }
resolve()
}) })
resolve()
}) })
}, },
getStoreList() { getStoreList() {
......
...@@ -44,8 +44,8 @@ Page({ ...@@ -44,8 +44,8 @@ Page({
// 未选择4s店 非超管 // 未选择4s店 非超管
if ((userInfo?.shopMerchantId ?? '') === '' && !userInfo?.isSuper && userInfo?.loginRole != 3 && userInfo?.loginRole != 6) return wx.$router.reLaunch('pages.accountItems') if ((userInfo?.shopMerchantId ?? '') === '' && !userInfo?.isSuper && userInfo?.loginRole != 3 && userInfo?.loginRole != 6) return wx.$router.reLaunch('pages.accountItems')
// 未选择场景 // 未选择场景 或者二手场景
if ((userInfo?.sceneType ?? '') === '') return wx.$router.reLaunch('pages.sceneIndex') if ((userInfo?.sceneType ?? '') === '' || (userInfo?.sceneType == 7)) return wx.$router.reLaunch('pages.sceneIndex')
userInfo?.sceneType == 0 && wx.$track.setTrackData(0, 'user_login', { userInfo?.sceneType == 0 && wx.$track.setTrackData(0, 'user_login', {
merchantId: userInfo?.shopMerchantId, merchantId: userInfo?.shopMerchantId,
merchantName: userInfo?.shopMerchantName, merchantName: userInfo?.shopMerchantName,
...@@ -63,7 +63,7 @@ Page({ ...@@ -63,7 +63,7 @@ Page({
}, 'loading') }, 'loading')
if (navigateParams && navigateParams.url) { if (navigateParams && navigateParams.url) {
if (navigateParams.sceneType != null && navigateParams.shopMerchantId && (navigateParams.sceneType != userInfo.sceneType || navigateParams.shopMerchantId != userInfo.shopMerchantId)) { if (navigateParams.sceneType != null && navigateParams.shopMerchantId && (navigateParams.sceneType != userInfo.sceneType || navigateParams.shopMerchantId != userInfo.shopMerchantId)) {
return app.login(false, '请重新登录') return app.login(false, '请重新登录')
} }
wx.$router._to(navigateParams.url, navigateParams, 'reLaunch') wx.$router._to(navigateParams.url, navigateParams, 'reLaunch')
return return
......
...@@ -386,16 +386,21 @@ Page({ ...@@ -386,16 +386,21 @@ Page({
orderCode orderCode
}, },
} = e.currentTarget.dataset; } = e.currentTarget.dataset;
// 校验订单是否可撤销(退款流程中无法撤销)
let refundStep = await commonApi.getOrderRefundStep({orderCode})
if (refundStep?.data == 'Y') return _this.showRefundAlert()
wx.showModal({ wx.showModal({
title: "", title: "",
content: "是否取撤销该工单?", content: "是否确认撤销该工单?",
confirmText: "是", confirmText: "是",
confirmColor: "#347BFF", confirmColor: "#347BFF",
cancelText: "否", cancelText: "否",
success(res) { async success(res) {
if (res.confirm) { if (res.confirm) {
_this.showLoading("取消中..."); _this.showLoading("取消中...");
// 校验订单是否可撤销(退款流程中无法撤销)防止弹出二次确认时长时间未操作,未拦截导致订单状态变更了
let canRefundStep = await commonApi.getOrderRefundStep({orderCode})
if (canRefundStep?.data == 'Y') return _this.showRefundAlert()
_this.repeal(orderCode); _this.repeal(orderCode);
} }
}, },
...@@ -405,6 +410,15 @@ Page({ ...@@ -405,6 +410,15 @@ Page({
// list // list
// }) // })
}, },
// 拦截订单状态变更弹窗
showRefundAlert() {
wx.showModal({
title: '提示',
content: '订单已发起退款,禁止撤销!如需撤销请联系总部运营。',
showCancel: false,
confirmText: "好的"
})
},
// 撤销该工单 // 撤销该工单
async repeal(orderCode) { async repeal(orderCode) {
// 校验是否填写昨日日报 // 校验是否填写昨日日报
......
...@@ -327,5 +327,9 @@ module.exports = { ...@@ -327,5 +327,9 @@ module.exports = {
// 退款审批列表查询 // 退款审批列表查询
getRefundReviewListAPI(data) { getRefundReviewListAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.waitForAudit.list', data) return api.post('dj.api.smartcarlife.refundApplyRecord.waitForAudit.list', data)
},
// 日报填报前参数校验
dailyReportCheck(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.data.check', data)
} }
} }
...@@ -26,22 +26,39 @@ Component({ ...@@ -26,22 +26,39 @@ Component({
// 点击更多按钮 // 点击更多按钮
selectTap() { selectTap() {
let { orderInfo } = this.data let { orderInfo } = this.data
// 查询订单可展示按钮 let allOptions = []
api.getMoreBtnAPI({orderCode: orderInfo.orderCode}).then(res => { if (orderInfo.selectPayType == 2) { // 门店收款订单查询退款可展示按钮
let { code, data } = res allOptions = ['标记退款', '退款详情']
if (code == 0) { // 查询订单可展示按钮
this.setData({ api.getMoreBtnAPI({orderCode: orderInfo.orderCode}).then(res => {
moreSelectData: this.filterMoreSelectData(data.refundApplyButton, data.refundApplyDetailButton), let { code, data } = res
showSelect: !this.data.showSelect, 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) { filterMoreSelectData(refundApplyButton, refundApplyDetailButton, allOptions, num) {
const allOptions = ['申请退款', '退款详情'] const buttonType = num === 2 ? '申请退款' : '标记退款'
const conditions = { const conditions = {
'申请退款': refundApplyButton === 'Y', [buttonType]: refundApplyButton === 'Y',
'退款详情': refundApplyDetailButton === 'Y' '退款详情': refundApplyDetailButton === 'Y'
} }
return allOptions.filter(option => conditions[option]) return allOptions.filter(option => conditions[option])
...@@ -58,9 +75,9 @@ Component({ ...@@ -58,9 +75,9 @@ Component({
let { index, item } = e.currentTarget.dataset let { index, item } = e.currentTarget.dataset
let { orderInfo } = this.data let { orderInfo } = this.data
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
if (item == '申请退款') { 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 => { api.areaSupervisionExistsAPI({merchantId: userInfo.shopMerchantId, sceneType: userInfo.sceneType}).then(res => {
let { code, data, message} = res let { code, data, message} = res
...@@ -72,7 +89,7 @@ Component({ ...@@ -72,7 +89,7 @@ Component({
}) })
} else { } else {
wx.navigateTo({ 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() this.closeSelect()
} }
...@@ -82,7 +99,7 @@ Component({ ...@@ -82,7 +99,7 @@ Component({
}) })
} else { } 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 => { api.getRefundDetailListAPI({orderCode: orderInfo.orderCode}).then(res => {
let { code, data } = res let { code, data } = res
...@@ -93,7 +110,7 @@ Component({ ...@@ -93,7 +110,7 @@ Component({
}) })
} else if (data.length == 1) { } else if (data.length == 1) {
wx.navigateTo({ 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({ ...@@ -237,6 +237,10 @@ Page({
// 校验是否填写昨日日报 // 校验是否填写昨日日报
let staffCheck = await checkDailyReport(); let staffCheck = await checkDailyReport();
if (staffCheck) return false; 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, { wx.$modal(this, {
show: true, show: true,
title: "工单标记", title: "工单标记",
...@@ -247,6 +251,14 @@ Page({ ...@@ -247,6 +251,14 @@ Page({
error: () => { }, error: () => { },
}); });
}, },
showRefundAlert() {
wx.showModal({
title: '提示',
content: '订单已发起退款,禁止标记为错误工单!如需标记错误请联系总部运营。',
showCancel: false,
confirmText: "好的"
})
},
// 确定是否要显示 // 确定是否要显示
showErrorType() { showErrorType() {
wx.$modal( wx.$modal(
...@@ -255,9 +267,12 @@ Page({ ...@@ -255,9 +267,12 @@ Page({
show: true, show: true,
title: "请选择录单入口", title: "请选择录单入口",
tabTitleShow: false, 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) console.log(orderInfo)
if (selectType == 1) { if (selectType == 1) {
orderInfo.associateOrderCode = orderInfo.orderCode; orderInfo.associateOrderCode = orderInfo.orderCode;
...@@ -425,7 +440,7 @@ Page({ ...@@ -425,7 +440,7 @@ 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)) { if ((data.status == 4 || data.status == 6 || data.status == 12)) {
// 查询订单可展示按钮 // 查询订单可展示按钮
commonApi.getMoreBtnAPI({ orderCode: data.orderCode }).then(res => { commonApi.getMoreBtnAPI({ orderCode: data.orderCode }).then(res => {
let { code, data } = res let { code, data } = res
......
...@@ -249,7 +249,7 @@ Page({ ...@@ -249,7 +249,7 @@ 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)) { if (data.status == 4 || data.status == 6 || data.status == 12) {
// 查询订单可展示按钮 // 查询订单可展示按钮
commonApi.getMoreBtnAPI({ orderCode: data.orderCode }).then(res => { commonApi.getMoreBtnAPI({ orderCode: data.orderCode }).then(res => {
let { code, data } = res let { code, data } = res
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
工单信息 工单信息
<view style="display: flex;gap: var(--fontSize32);"> <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> <apply-refund-btn orderInfo="{{orderInfo}}"></apply-refund-btn>
</view> </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">
......
...@@ -207,7 +207,7 @@ Page({ ...@@ -207,7 +207,7 @@ 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)) { if (data.status == 4 || data.status == 6 || data.status == 12) {
// 查询订单可展示按钮 // 查询订单可展示按钮
commonApi.getMoreBtnAPI({ orderCode: data.orderCode }).then(res => { commonApi.getMoreBtnAPI({ orderCode: data.orderCode }).then(res => {
let { code, data } = res let { code, data } = res
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<view class="box"> <view class="box">
<view class="title invoice">信息确认 <view class="title invoice">信息确认
<view style="display: flex;gap: var(--fontSize32);"> <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> <apply-refund-btn orderInfo="{{orderInfo}}"></apply-refund-btn>
</view> </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">
......
...@@ -23,5 +23,9 @@ module.exports = { ...@@ -23,5 +23,9 @@ module.exports = {
// 根据主订单号获取退款成功记录 // 根据主订单号获取退款成功记录
getRefundLogByOrderCodeAPI(data) { getRefundLogByOrderCodeAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.refundedGoodsOrder.list', 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 \ 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 \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ 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 \ 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 \ No newline at end of file
// tabWorkOrder/pages/refundApply/refundApply.js // 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 NP from 'number-precision'
import api from '~/api/api.js' import api from '~/api/api.js'
import reportPageTrackMixin from '~/mixins/reportPageTrackMixin' import reportPageTrackMixin from '~/mixins/reportPageTrackMixin'
...@@ -69,7 +70,8 @@ Page({ ...@@ -69,7 +70,8 @@ Page({
scene: null, // 埋点业务类型 scene: null, // 埋点业务类型
repealVisible: false, repealVisible: false,
repealStatus: false, repealStatus: false,
userInfo: {} userInfo: {},
refundPayType: ''
}, },
/** /**
...@@ -79,9 +81,15 @@ Page({ ...@@ -79,9 +81,15 @@ Page({
// 跳转进入页面 清空防止选择账号后再次进入页面 // 跳转进入页面 清空防止选择账号后再次进入页面
wx.$SCENE = null wx.$SCENE = null
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
if (options.refundPayType == 2) {
wx.setNavigationBarTitle({title: '退款标记申请'})
} else {
wx.setNavigationBarTitle({title: '零售退款申请表'})
}
this.setData({ this.setData({
scene: userInfo?.sceneType, // 埋点业务场景 scene: userInfo?.sceneType, // 埋点业务场景
userInfo userInfo,
refundPayType: options.refundPayType
}) })
// 申请退款 // 申请退款
if (!options.applyCode) { if (!options.applyCode) {
...@@ -249,8 +257,8 @@ Page({ ...@@ -249,8 +257,8 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
// 埋点 // 埋点 只统计非门店收款订单的申请退款
this.onPageShow() if (this.data.refundPayType != 2) this.onPageShow()
}, },
// 计算订单总支付金额 // 计算订单总支付金额
...@@ -555,7 +563,7 @@ Page({ ...@@ -555,7 +563,7 @@ Page({
// 提交申请 // 提交申请
submit() { submit() {
let {submitStatus, infoData, userInfo} = this.data let {submitStatus, infoData, userInfo, refundPayType} = this.data
// 校验是否选择退款方式 // 校验是否选择退款方式
if (!infoData.refundType) return wx.$util.showToast('请选择退款方式') if (!infoData.refundType) return wx.$util.showToast('请选择退款方式')
// 部分退款校验子订单 // 部分退款校验子订单
...@@ -564,7 +572,7 @@ Page({ ...@@ -564,7 +572,7 @@ Page({
if (infoData.refundType == 2 && !infoData.subOrderList?.filter(v => v.checked)?.length) return wx.$util.showToast('') if (infoData.refundType == 2 && !infoData.subOrderList?.filter(v => v.checked)?.length) return wx.$util.showToast('')
let key = this.checkRequired(infoData) let key = this.checkRequired(infoData)
if (key) { if (key && refundPayType != 2) {
toastList[key] && wx.$util.showToast(toastList[key]); toastList[key] && wx.$util.showToast(toastList[key]);
toastList[key] && toastList[key] &&
wx.pageScrollTo({ wx.pageScrollTo({
...@@ -572,6 +580,8 @@ Page({ ...@@ -572,6 +580,8 @@ Page({
}); });
return; return;
} }
// 门店收款标记退款,客户退款回单必传
if (refundPayType == 2 && !infoData.attachmentList?.length) return wx.$util.showToast('客户退款回单不能为空')
if (submitStatus) return if (submitStatus) return
this.setData({ this.setData({
submitStatus: true, submitStatus: true,
...@@ -601,7 +611,8 @@ Page({ ...@@ -601,7 +611,8 @@ Page({
attachmentList: infoData.attachmentList?.map(val => { return { fileUrl: val.fileUrl, fileName: val.fileName } }), attachmentList: infoData.attachmentList?.map(val => { return { fileUrl: val.fileUrl, fileName: val.fileName } }),
refundApplyDetailList refundApplyDetailList
} }
applyRefundAPI(params).then(res => { const eventObj = refundPayType == 2 ? 'markAsRefundedAPI' : 'applyRefundAPI'
refundAPI[eventObj](params).then(res => {
let {code, message} = res let {code, message} = res
if (code == 0) { if (code == 0) {
wx.showToast({ wx.showToast({
...@@ -629,16 +640,16 @@ Page({ ...@@ -629,16 +640,16 @@ Page({
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { onHide() {
// 埋点 // 埋点 只统计非门店收款订单的申请退款
this.onPageHide() if (this.data.refundPayType != 2) this.onPageHide()
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {
// 埋点 // 埋点 只统计非门店收款订单的申请退款
this.onPageHide() if (this.data.refundPayType != 2) this.onPageHide()
}, },
/** /**
......
{ {
"navigationBarTitleText": "零售退款申请表", "navigationBarTitleText": "",
"usingComponents": { "usingComponents": {
"review-status": "./components/reviewStatus/reviewStatus", "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 \ No newline at end of file
...@@ -241,6 +241,10 @@ page{ ...@@ -241,6 +241,10 @@ page{
} }
.upload_box{ .upload_box{
padding: var(--fontSize40); padding: var(--fontSize40);
.required {
color: #f00;
margin-left: var(--fontSize8);
}
.label{ .label{
font-size: var(--fontSize28); font-size: var(--fontSize28);
color: #292D33; color: #292D33;
......
...@@ -2,7 +2,12 @@ ...@@ -2,7 +2,12 @@
<wxs src="../../index.wxs" module="filter" /> <wxs src="../../index.wxs" module="filter" />
<view class="apply-content"> <view class="apply-content">
<view class="status-box"> <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>
<view class="form-item"> <view class="form-item">
<view wx:for="{{userInfo.loginRole == 3 ? roleMessageObj : messageObj}}" wx:key="index"> <view wx:for="{{userInfo.loginRole == 3 ? roleMessageObj : messageObj}}" wx:key="index">
...@@ -106,39 +111,53 @@ ...@@ -106,39 +111,53 @@
</view> </view>
</block> </block>
</view> </view>
<gl-cell border valueAlign="right" label="收款人姓名" requiredAfter labelWidth="var(--fontSize280)" required> <block wx:if="{{refundPayType != 2}}">
<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 border valueAlign="right" label="收款人姓名" requiredAfter labelWidth="var(--fontSize280)" required>
</gl-cell> <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 border valueAlign="right" label="开户行名称" requiredAfter labelWidth="var(--fontSize280)" required> </gl-cell>
<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 border valueAlign="right" label="开户行名称" requiredAfter labelWidth="var(--fontSize280)" required>
</gl-cell> <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 border valueAlign="right" label="开户支行名称" requiredAfter labelWidth="var(--fontSize280)" required> </gl-cell>
<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 border valueAlign="right" label="开户支行名称" requiredAfter labelWidth="var(--fontSize280)" required>
</gl-cell> <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 border valueAlign="right" label="银行卡号" requiredAfter labelWidth="var(--fontSize280)" required> </gl-cell>
<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 border valueAlign="right" label="银行卡号" requiredAfter labelWidth="var(--fontSize280)" required>
</gl-cell> <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>
<view class="reason_box"> </gl-cell>
<view class="label">退款原因说明</view> <view class="reason_box">
<view class="textarea_box"> <view class="label">退款原因说明</view>
<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 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> <view class="upload_box" wx:if="{{infoData.afterStatus === '' || (infoData.afterStatus == 5 && !filter.filterRefundDisabled(infoData, userInfo)) || infoData.attachmentList.length}}">
<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">上传图片</view> <view class="label-tips first">原厂延保退款:退款须告知门店,请上传沟通确认凭证截图</view>
<view class="label-tips first">原厂延保退款:退款须告知门店,请上传沟通确认凭证截图</view> <view class="label-tips">嘀加权益退款:退款需上传自愿退款协议及告知客户退款后服务作废凭证截图</view>
<view class="label-tips">嘀加权益退款:退款需上传自愿退款协议及告知客户退款后服务作废凭证截图</view> <view class="content_box">
<view class="content_box"> <view class="image_content" wx:for="{{infoData.attachmentList}}" wx:key="index">
<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 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}}" />
<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>
<view class="upload_content" bindtap="uploadImages" wx:if="{{!filter.filterRefundDisabled(infoData, userInfo) && infoData.attachmentList.length < 5}}"> </view>
<image src="{{IMG_URL}}zy-upload_icon.png"></image> </block>
<text class="text">最多5张</text> <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> </view>
</view> </block>
</view> </view>
<!-- 区域运营审核 --> <!-- 区域运营审核 -->
<view class="review_box" wx:if="{{infoData.beforeStatus == 6 && infoData.afterStatus == 7 && userInfo.loginRole == 3 && infoData.auditableFlag == 'Y'}}"> <view class="review_box" wx:if="{{infoData.beforeStatus == 6 && infoData.afterStatus == 7 && userInfo.loginRole == 3 && infoData.auditableFlag == 'Y'}}">
......
// tabWorkOrder/pages/refundDetailList/refundDetailList.js // tabWorkOrder/pages/refundDetailList/refundDetailList.js
import api from "~/api/api" import api from "~/api/api"
import dayjs from 'dayjs' import dayjs from 'dayjs'
const obj = [{
label: '退款类型',
key: 'refundPayTypeText'
}, {
label: '订单编号',
key: 'orderCode'
}, {
label: '申请时间',
key: 'createdDate'
}]
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
orderObj: [{ orderObj: [ // 申请退款未成功退款
label: '申请时间', ...obj,
key: 'createdDate' {
}, {
label: '订单支付总额', label: '订单支付总额',
key: 'orderTotalPrice', key: 'orderTotalPrice',
unit: true unit: true
...@@ -19,10 +28,9 @@ Page({ ...@@ -19,10 +28,9 @@ Page({
key: 'applyRefundAmount', key: 'applyRefundAmount',
unit: true unit: true
}], }],
reviewObj: [{ reviewObj: [ // 申请退款成功退款
label: '申请时间', ...obj,
key: 'createdDate' {
}, {
label: '退款时间', label: '退款时间',
key: 'refundTime' key: 'refundTime'
}, { }, {
...@@ -34,6 +42,17 @@ Page({ ...@@ -34,6 +42,17 @@ Page({
key: 'applyRefundAmount', key: 'applyRefundAmount',
unit: true unit: true
}], }],
labelObj: [ // 标记退款
...obj,
{
label: '订单支付总额',
key: 'orderTotalPrice',
unit: true
}, {
label: '实际退款总额',
key: 'applyRefundAmount',
unit: true
}],
list: [], list: [],
flag: true, flag: true,
reviewStatusObj: { reviewStatusObj: {
...@@ -67,13 +86,17 @@ Page({ ...@@ -67,13 +86,17 @@ Page({
background: '#EAF1FF', background: '#EAF1FF',
color: '#347BFF' color: '#347BFF'
} }
},
refundPayTypeObj: {
1: '已录订单退款',
2: '门店退款标记'
} }
}, },
jump(e) { jump(e) {
let { item } = e.currentTarget.dataset let { item } = e.currentTarget.dataset
wx.navigateTo({ wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${item.applyCode}` url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${item.applyCode}&refundPayType=${item.refundPayType}`
}) })
}, },
...@@ -81,8 +104,17 @@ Page({ ...@@ -81,8 +104,17 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.setData({
pageOptions: options
}, () => {
this.getDetailList()
})
},
getDetailList() {
let { refundPayTypeObj, pageOptions } = this.data
// 获取退款详情列表 // 获取退款详情列表
api.getRefundDetailListAPI({orderCode: options.orderCode}).then(res => { api.getRefundDetailListAPI({orderCode: pageOptions.orderCode}).then(res => {
let { code, data } = res let { code, data } = res
if (code == 0) { if (code == 0) {
// 处理审批状态 // 处理审批状态
...@@ -105,10 +137,11 @@ Page({ ...@@ -105,10 +137,11 @@ Page({
if (val.transferStatus == 3) { if (val.transferStatus == 3) {
val.reviewStatus = 5 // 已退款 val.reviewStatus = 5 // 已退款
} }
val.orderCode = options.orderCode val.orderCode = pageOptions.orderCode
if (val.createdDate) val.createdDate = dayjs(val.createdDate).format("YYYY-MM-DD HH:mm:ss") 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") if (val.refundTime) val.refundTime = dayjs(val.refundTime).format("YYYY-MM-DD HH:mm:ss")
val.remark = val.remark || `你的申请被【${val.oaSpFailAuditorName || '总部'}】驳回,请联系驳回人员!` val.remark = val.remark || `你的申请被【${val.oaSpFailAuditorName || '总部'}】驳回,请联系驳回人员!`
val.refundPayTypeText = refundPayTypeObj[val.refundPayType] || ''
}) })
this.setData({ this.setData({
list: data || [] list: data || []
...@@ -128,7 +161,7 @@ Page({ ...@@ -128,7 +161,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
this.getDetailList()
}, },
/** /**
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</view> </view>
</view> </view>
<view class="order-list"> <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">
<view class="order-label">{{i.label}}</view> <view class="order-label">{{i.label}}</view>
<view class="order-value"> <view class="order-value">
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</view> </view>
</view> </view>
</block> </block>
<block wx:if="{{li.reviewStatus == 5}}"> <block wx:if="{{li.reviewStatus == 5 && li.refundPayType != 2}}">
<view class="order" > <view class="order" >
<view class="order-label">实际退款金额</view> <view class="order-label">实际退款金额</view>
<view class="order-value"><text style="margin-right: var(--fontSize10);">¥</text>{{li.payAmount}}</view> <view class="order-value"><text style="margin-right: var(--fontSize10);">¥</text>{{li.payAmount}}</view>
......
...@@ -2,6 +2,22 @@ import api from "../../api" ...@@ -2,6 +2,22 @@ import api from "../../api"
import { getWaitAuditCountAPI } from '~/api/api' import { getWaitAuditCountAPI } from '~/api/api'
import dayjs from 'dayjs' import dayjs from 'dayjs'
// tabWorkOrder/pages/refundOperationList/refundOperationList.js // tabWorkOrder/pages/refundOperationList/refundOperationList.js
const obj = [{
label: '退款类型',
key: 'refundPayTypeText'
}, {
label: '订单编号',
key: 'orderCode'
}, {
label: '申请人',
arr: ['applyStaffYqMerchantName', 'applyStaffName']
}, {
label: '申请时间',
key: 'createdDate'
}, {
label: '审批状态',
key: 'reviewText'
},]
Page({ Page({
/** /**
...@@ -37,16 +53,9 @@ Page({ ...@@ -37,16 +53,9 @@ Page({
color: '#F24724' color: '#F24724'
} }
}, },
reviewObj: [{ reviewObj: [ // 非门店收款申请退款 未审批
label: '申请人', ...obj,
arr: ['applyStaffYqMerchantName', 'applyStaffName'] {
}, {
label: '申请时间',
key: 'createdDate'
}, {
label: '审批状态',
key: 'reviewText'
}, {
label: '退款状态', label: '退款状态',
key: 'refundText' key: 'refundText'
}, { }, {
...@@ -58,16 +67,9 @@ Page({ ...@@ -58,16 +67,9 @@ Page({
key: 'applyRefundAmount', key: 'applyRefundAmount',
unit: true unit: true
}], }],
orderObj: [{ orderObj: [ // 非门店收款申请退款 已审批(通过/不通过)
label: '申请人', ...obj,
arr: ['applyStaffYqMerchantName', 'applyStaffName'] {
}, {
label: '申请时间',
key: 'createdDate'
}, {
label: '审批状态',
key: 'reviewText'
}, {
label: '审批人', label: '审批人',
key: 'auditor' key: 'auditor'
}, { }, {
...@@ -82,7 +84,41 @@ Page({ ...@@ -82,7 +84,41 @@ Page({
key: 'applyRefundAmount', key: 'applyRefundAmount',
unit: true 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({ ...@@ -131,7 +167,7 @@ Page({
}, },
// 获取列表数据 // 获取列表数据
getList() { getList() {
let { pageNum, tabIndex, nothing, reviewStatusObj } = this.data let { pageNum, tabIndex, nothing, reviewStatusObj, refundPayTypeObj } = this.data
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
if (nothing) return if (nothing) return
const auditStatus = tabIndex == 1 ? 0 : tabIndex == 2 ? 3 : '' const auditStatus = tabIndex == 1 ? 0 : tabIndex == 2 ? 3 : ''
...@@ -147,7 +183,7 @@ Page({ ...@@ -147,7 +183,7 @@ Page({
} = res } = res
if (code == 0) { if (code == 0) {
data?.list?.forEach(val => { data?.list?.forEach(val => {
val.reviewText = reviewStatusObj[val.auditStatus].text val.reviewText = reviewStatusObj[val.auditStatus]?.text
if (val.beforeStatus == 6 && val.afterStatus == 7) { if (val.beforeStatus == 6 && val.afterStatus == 7) {
val.refundText = '区域运营审核中' // 区域运营审批 val.refundText = '区域运营审核中' // 区域运营审批
val.refundStatus = 0 val.refundStatus = 0
...@@ -175,6 +211,7 @@ Page({ ...@@ -175,6 +211,7 @@ Page({
if (val.createdDate) val.createdDate = dayjs(val.createdDate).format("YYYY-MM-DD HH:mm:ss") 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") if (val.refundTime) val.refundTime = dayjs(val.refundTime).format("YYYY-MM-DD HH:mm:ss")
val.remark = val.remark || `你的申请被【${val.oaSpFailAuditorName || '总部'}】驳回,请联系驳回人员!` val.remark = val.remark || `你的申请被【${val.oaSpFailAuditorName || '总部'}】驳回,请联系驳回人员!`
val.refundPayTypeText = refundPayTypeObj[val.refundPayType] || ''
}) })
list = data.list list = data.list
total = data.total total = data.total
...@@ -199,7 +236,7 @@ Page({ ...@@ -199,7 +236,7 @@ Page({
jump(e) { jump(e) {
let { item } = e.currentTarget.dataset let { item } = e.currentTarget.dataset
wx.navigateTo({ 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 @@ ...@@ -40,7 +40,7 @@
</view> </view>
</view> </view>
<view class="order-list"> <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">
<view class="order-label">{{i.label}}</view> <view class="order-label">{{i.label}}</view>
<view class="order-value"> <view class="order-value">
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
</view> </view>
</view> </view>
</block> </block>
<block wx:if="{{li.refundStatus == 5}}"> <block wx:if="{{li.refundStatus == 5 && li.refundPayType != 2}}">
<view class="order" > <view class="order" >
<view class="order-label">实际退款金额</view> <view class="order-label">实际退款金额</view>
<view class="order-value"><text style="margin-right: var(--fontSize10);">¥</text>{{li.payAmount}}</view> <view class="order-value"><text style="margin-right: var(--fontSize10);">¥</text>{{li.payAmount}}</view>
......
...@@ -378,7 +378,6 @@ Page({ ...@@ -378,7 +378,6 @@ Page({
handleTemplagePickerChange(e) { handleTemplagePickerChange(e) {
const { value } = e.detail const { value } = e.detail
let { hwObjArray, otherObjArray, hwOhterObjArray } = this.data let { hwObjArray, otherObjArray, hwOhterObjArray } = this.data
console.log(value, e, 'checkFlag') console.log(value, e, 'checkFlag')
hwObjArray.forEach(item => (item.error = false)) hwObjArray.forEach(item => (item.error = false))
otherObjArray.forEach(item => (item.error = false)) otherObjArray.forEach(item => (item.error = false))
...@@ -574,10 +573,8 @@ Page({ ...@@ -574,10 +573,8 @@ Page({
(role != 'super' || !orderObj.isDateWithin60Days) (role != 'super' || !orderObj.isDateWithin60Days)
) )
return wx.$util.showToast('已超过提交时效') return wx.$util.showToast('已超过提交时效')
// for (let index = 0; index < carBandList.length; index++) { // for (let index = 0; index < carBandList.length; index++) {
// if (true) { // if (true) {
// } // }
// if (['', null].includes(carBandList[index].deliveryCount)) { // if (['', null].includes(carBandList[index].deliveryCount)) {
// return this.showToast(`请输入${carBandList[index].brandName}新车交付数`) // return this.showToast(`请输入${carBandList[index].brandName}新车交付数`)
...@@ -626,7 +623,6 @@ Page({ ...@@ -626,7 +623,6 @@ Page({
['orderObj.staffCountEmptyError']: true ['orderObj.staffCountEmptyError']: true
}) })
} }
console.log(checkFlag, 'checkFlag') console.log(checkFlag, 'checkFlag')
if (checkFlag) { if (checkFlag) {
this.setData({ this.setData({
...@@ -713,7 +709,6 @@ Page({ ...@@ -713,7 +709,6 @@ Page({
if (selectWeek != 0) { if (selectWeek != 0) {
timeBean.selectDay = 0 timeBean.selectDay = 0
} }
this.setData({ this.setData({
timeBean, timeBean,
selectWeek selectWeek
...@@ -801,7 +796,6 @@ Page({ ...@@ -801,7 +796,6 @@ Page({
} }
} }
}, },
inputCount(e) { inputCount(e) {
let { value } = e.detail let { value } = e.detail
console.log(e) console.log(e)
...@@ -811,7 +805,6 @@ Page({ ...@@ -811,7 +805,6 @@ Page({
const min = 0 // 默认最小值 0 const min = 0 // 默认最小值 0
const max = name == 'cancelOrderMoney' ? 9999999 : 100 // 默认最大值 const max = name == 'cancelOrderMoney' ? 9999999 : 100 // 默认最大值
// console.log(currentConfig, 'currentConfig') // console.log(currentConfig, 'currentConfig')
this.setData({ this.setData({
[`orderObj.${name}Error`]: false [`orderObj.${name}Error`]: false
}) })
...@@ -892,7 +885,6 @@ Page({ ...@@ -892,7 +885,6 @@ Page({
return return
} }
} }
// return; // return;
// 清洗输入值 // 清洗输入值
// let cleanedValue = value.replace(/\D/g, ''); // 移除非数字字符 // let cleanedValue = value.replace(/\D/g, ''); // 移除非数字字符
...@@ -944,7 +936,6 @@ Page({ ...@@ -944,7 +936,6 @@ Page({
if (selectWeek != 0) { if (selectWeek != 0) {
timeBean.selectDay = 0 timeBean.selectDay = 0
} }
this.setData({ this.setData({
timeBean, timeBean,
selectWeek selectWeek
...@@ -953,7 +944,6 @@ Page({ ...@@ -953,7 +944,6 @@ Page({
this.getStaffReport() this.getStaffReport()
this.getStaffDailyReportDetailWeeklyList() this.getStaffDailyReportDetailWeeklyList()
}, },
/** /**
* 选中了某一日,改变selectDay为选中日 * 选中了某一日,改变selectDay为选中日
*/ */
...@@ -1190,7 +1180,6 @@ Page({ ...@@ -1190,7 +1180,6 @@ Page({
} }
}) })
}, },
editReport() { editReport() {
this.setData({ this.setData({
isEditReport: true isEditReport: true
...@@ -1201,7 +1190,6 @@ Page({ ...@@ -1201,7 +1190,6 @@ Page({
isEditReport: false isEditReport: false
}) })
}, },
closeSlectItemPopup() { closeSlectItemPopup() {
let { formData } = this.data let { formData } = this.data
formData?.forEach(val => { formData?.forEach(val => {
...@@ -1247,7 +1235,6 @@ Page({ ...@@ -1247,7 +1235,6 @@ Page({
noStoreData: false noStoreData: false
}) })
} }
this.setData({ this.setData({
['orderObj.yqMerchantId']: data.yqMerchant.merchantId, ['orderObj.yqMerchantId']: data.yqMerchant.merchantId,
['orderObj.yqMerchantName']: data.yqMerchant.merchantName ['orderObj.yqMerchantName']: data.yqMerchant.merchantName
...@@ -1337,7 +1324,6 @@ Page({ ...@@ -1337,7 +1324,6 @@ Page({
: data.list[subIndex].merchantName : data.list[subIndex].merchantName
}) })
} }
if (pickerType == 'merchant') { if (pickerType == 'merchant') {
this.setData({ this.setData({
merchantRangeList: data.list merchantRangeList: data.list
...@@ -1394,7 +1380,6 @@ Page({ ...@@ -1394,7 +1380,6 @@ Page({
timeBean: util.getWeekDayList(this.data.selectWeek) timeBean: util.getWeekDayList(this.data.selectWeek)
}) })
} }
this.setReportDate() this.setReportDate()
setTimeout(() => { setTimeout(() => {
console.log(this.data.role, 'roleOther') console.log(this.data.role, 'roleOther')
...@@ -1403,7 +1388,6 @@ Page({ ...@@ -1403,7 +1388,6 @@ Page({
return return
} }
}) })
if (isStaff && approvedSource != '3') { if (isStaff && approvedSource != '3') {
// console.log(userInfo, 'userInfo'); // console.log(userInfo, 'userInfo');
const { const {
...@@ -1522,7 +1506,6 @@ Page({ ...@@ -1522,7 +1506,6 @@ Page({
options[key] = decodeURIComponent(options[key]) options[key] = decodeURIComponent(options[key])
} }
} }
// 初始化日期 // 初始化日期
if (options.hasOwnProperty('reportDate')) { if (options.hasOwnProperty('reportDate')) {
this.setData({ this.setData({
...@@ -1530,12 +1513,10 @@ Page({ ...@@ -1530,12 +1513,10 @@ Page({
}) })
this.initData(wx.$util.getUserInfo()) this.initData(wx.$util.getUserInfo())
} }
console.log(options, 'options,onLoad') console.log(options, 'options,onLoad')
this.setData({ this.setData({
flag: true flag: true
}) })
let { orderObj } = this.data let { orderObj } = this.data
// console.log(options.hasOwnProperty('approvedSource'), options, 'approvedSource'); // console.log(options.hasOwnProperty('approvedSource'), options, 'approvedSource');
if (options.hasOwnProperty('approvedSource')) { if (options.hasOwnProperty('approvedSource')) {
...@@ -1545,7 +1526,6 @@ Page({ ...@@ -1545,7 +1526,6 @@ Page({
} else { } else {
role = 'other' role = 'other'
} }
this.setData( this.setData(
{ {
role, role,
...@@ -1577,7 +1557,6 @@ Page({ ...@@ -1577,7 +1557,6 @@ Page({
// let { orderObj } = this.data // let { orderObj } = this.data
// console.log(options, 'onRouteoptions'); // console.log(options, 'onRouteoptions');
let { orderObj } = this.data let { orderObj } = this.data
// console.log(this.data, 'onRouteoptions'); // console.log(this.data, 'onRouteoptions');
// console.log(userInfo, 'userInfo') // console.log(userInfo, 'userInfo')
// 初始化日期 // 初始化日期
...@@ -1590,13 +1569,11 @@ Page({ ...@@ -1590,13 +1569,11 @@ Page({
flag: true flag: true
}) })
this.initData(wx.$util.getUserInfo()) this.initData(wx.$util.getUserInfo())
if (options.hasOwnProperty('scene')) { if (options.hasOwnProperty('scene')) {
this.setData({ this.setData({
scene: options.scene scene: options.scene
}) })
} }
if (options.hasOwnProperty('approvedSource')) { if (options.hasOwnProperty('approvedSource')) {
let role = '' let role = ''
if (options.approvedSource == '3') { if (options.approvedSource == '3') {
...@@ -1604,7 +1581,6 @@ Page({ ...@@ -1604,7 +1581,6 @@ Page({
} else { } else {
role = 'other' role = 'other'
} }
this.setData( this.setData(
{ {
role, role,
...@@ -1625,9 +1601,8 @@ Page({ ...@@ -1625,9 +1601,8 @@ Page({
) )
} }
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { } onReady: function () { }
}) })
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!