Commit 1a116a8b by 张立顺

feat 错误订单功能开发

1 parent 7698b746
...@@ -18,7 +18,7 @@ export const appId = 'wx570d9331f9ace0bd' ...@@ -18,7 +18,7 @@ export const appId = 'wx570d9331f9ace0bd'
* 4预发布 * 4预发布
* 5cdptest * 5cdptest
*/ */
let index = 4 let index = 0
const accountInfo = wx.getAccountInfoSync() const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync() const systemInfo = wx.getSystemInfoSync()
const envName = accountInfo.miniProgram.envVersion const envName = accountInfo.miniProgram.envVersion
......
...@@ -365,5 +365,12 @@ module.exports = { ...@@ -365,5 +365,12 @@ module.exports = {
// 获取园区店下角色名包含技师员工有效列表 // 获取园区店下角色名包含技师员工有效列表
getQYTechnicianList(data) { getQYTechnicianList(data) {
return api.post('dj.api.smartcarlife.roleTechnician.list.effective', data) return api.post('dj.api.smartcarlife.roleTechnician.list.effective', data)
},
/**施工单状态统计 */
statByStatus(data) {
let params = data || {}
return api.post('dj.api.smartcarlife.construction.summary.status', {
...params
})
} }
} }
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
{{invoiceName}} {{invoiceName}}
</view> </view>
<view> <view>
<apply-refund-btn updateFlag="{{ updateFlag&&filter.btnPermissions(userPermissions, 'CHUANGJIANSHIGONGDAN') }}" orderInfo="{{ orderInfo }}" showRefundBtn="{{ isStaff && showMoreBtn }}"></apply-refund-btn> <apply-refund-btn updateFlag="{{ updateFlag&&filter.btnPermissions(userPermissions, 'CHUANGJIANSHIGONGDAN')&&(orderInfo.status == 4 || orderInfo.status == 6) }}" orderInfo="{{ orderInfo }}" showRefundBtn="{{ isStaff && showMoreBtn }}"></apply-refund-btn>
</view> </view>
</view> </view>
</view> </view>
...@@ -302,8 +302,8 @@ ...@@ -302,8 +302,8 @@
</view> </view>
</block> </block>
<!-- <view class="btn text-center" data-btnName="{{ confirmFlagObj.btnName }}" bindtap="showModal">{{confirmFlagObj.showBtn}}</view> --> <!-- <view class="btn text-center" data-btnName="{{ confirmFlagObj.btnName }}" bindtap="showModal">{{confirmFlagObj.showBtn}}</view> -->
<view wx:if="{{ confirmFlagObj.btnName == 'constructionVisible' }}" class="btn text-center" data-btnName="{{ confirmFlagObj.btnName }}" bindtap="showModal">{{confirmFlagObj.showBtn}}</view> <view wx:if="{{ confirmFlagObj.btnName == 'constructionVisible'&&(orderInfo.status == 4 || orderInfo.status == 6) }}" class="btn text-center" data-btnName="{{ confirmFlagObj.btnName }}" bindtap="showModal">{{confirmFlagObj.showBtn}}</view>
<view wx:if="{{ confirmFlagObj.btnName == 'sublistVisible' &&filter.btnPermissions(userPermissions, 'CHUANGJIANSHIGONGDAN') }}" class="btn text-center" data-btnName="{{ confirmFlagObj.btnName }}" bindtap="showModal">{{confirmFlagObj.showBtn}}</view> <view wx:if="{{ confirmFlagObj.btnName == 'sublistVisible' &&filter.btnPermissions(userPermissions, 'CHUANGJIANSHIGONGDAN') &&(orderInfo.status == 4 || orderInfo.status == 6)}}" class="btn text-center" data-btnName="{{ confirmFlagObj.btnName }}" bindtap="showModal">{{confirmFlagObj.showBtn}}</view>
</view> </view>
</block> </block>
<modal id="modal3" class="modal" custom="true" btns="{{ ['取消','确定'] }}"> <modal id="modal3" class="modal" custom="true" btns="{{ ['取消','确定'] }}">
......
...@@ -6,6 +6,7 @@ import { ...@@ -6,6 +6,7 @@ import {
getServiceFilmRollSetting, getServiceFilmRollSetting,
setConfigInfo setConfigInfo
} from '~/store/index' } from '~/store/index'
import { checkDailyReport } from '~/store/ModalToQueueControl'
import commonApi from '~/api/api' import commonApi from '~/api/api'
const IMG_URL = const IMG_URL =
'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/' 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
...@@ -17,6 +18,8 @@ Page({ ...@@ -17,6 +18,8 @@ Page({
data: { data: {
IMG_URL, IMG_URL,
...order_mixins.data, ...order_mixins.data,
selectType: 1,
selectTypeOrder: 1,
allNoConstruction: true, allNoConstruction: true,
userPermissions: [], // 权限数组 userPermissions: [], // 权限数组
showTips: true, showTips: true,
...@@ -63,6 +66,22 @@ Page({ ...@@ -63,6 +66,22 @@ Page({
} }
) )
}, },
selectType(e) {
let { type } = e.currentTarget.dataset
console.log(e, e.currentTarget.dataset, type)
this.setData({
selectType: type
})
},
showRefundAlert() {
wx.showModal({
title: '提示',
content:
'订单已发起退款,禁止标记为错误工单!如需标记错误请联系总部运营。',
showCancel: false,
confirmText: '好的'
})
},
constructionCancel() { constructionCancel() {
this.setData( this.setData(
{ {
...@@ -80,6 +99,115 @@ Page({ ...@@ -80,6 +99,115 @@ Page({
// constructionVisible: false // constructionVisible: false
// }) // })
}, },
// 确定是否要显示
showErrorType() {
console.log('showErrorType')
wx.$modal(
this,
{
show: true,
title: '请选择录单入口',
tabTitleShow: false,
success: async res => {
// 再次校验 防止二次确认弹窗弹起后长时间未操作,导致订单状态变更异常
let { orderInfo, selectType } = this.data
let canRefundStep = await commonApi.getOrderRefundStep({
orderCode: orderInfo.orderCode
})
if (canRefundStep?.data == 'Y') return this.showRefundAlert()
// 跳转新增订单页面 并带特定参数
console.log(orderInfo)
if (selectType == 1) {
orderInfo.associateOrderCode = orderInfo.orderCode
delete orderInfo.orderCode
if (orderInfo.technicianList) {
delete orderInfo.technicianList
}
orderInfo.selectPayType = 2
let urlName = 'createOrder'
wx.$router.redirectTo(urlName, orderInfo)
} else {
// 无需补录
api
.noNeedSupplementOrder({ oldOrderCode: orderInfo.orderCode })
.then(res => {
console.log(res)
if (res.code == 0) {
wx.$util.refreshPageData()
wx.$router.go('pages.index')
this.setData({
modalShow: false
})
wx.$modal(this, { show: false }, '#modal2')
} else {
wx.$util.showToast(res.message)
}
})
.catch(err => {
console.log(err)
})
}
},
error: () => { }
},
'#modal2'
)
},
// 确定是否要显示
async targetError() {
// 校验是否填写昨日日报
let staffCheck = await checkDailyReport()
if (staffCheck) return false
// 校验订单是否可标记错误工单(退款流程中订单状态无法变更)
let { orderInfo } = this.data
let refundStep = await commonApi.getOrderRefundStep({
orderCode: orderInfo.orderCode
})
// console.log(refundStep, 'refundStep')
if (refundStep?.data == 'Y') return this.showRefundAlert()
// 有进行的施工单做提示
let res = await api.statByStatus({ merchantId: orderInfo.merchantId, orderCode: orderInfo.orderCode })
console.log(res, 'status');
let { data } = res
if (data?.incompleteTotal > 0) {
wx.$modal(
this,
{
show: true,
title: '提醒',
tabTitleShow: false,
success: res => {
console.log(res, 'res')
this.showTarget()
},
error: () => { }
},
'#modal5'
)
} else {
this.showTarget()
}
},
showTarget() {
wx.$modal(this, {
show: true,
title: '工单标记',
tabTitleShow: false,
success: res => {
console.log(res, 'res')
this.showErrorType()
},
error: () => { }
})
},
targetOperate() {
let { showTip } = this.data
this.setData({
showTip: !showTip
})
},
jumpUserPortrait() { jumpUserPortrait() {
wx.$router.go('tabDate.userPortrait', this.data.orderInfo) wx.$router.go('tabDate.userPortrait', this.data.orderInfo)
}, },
...@@ -467,7 +595,11 @@ Page({ ...@@ -467,7 +595,11 @@ Page({
data.carType = `${data.customer.carBrand || ''}-${data.customer.carChildsBrandName || '' data.carType = `${data.customer.carBrand || ''}-${data.customer.carChildsBrandName || ''
}-${data.customer.carSeriesName || ''}` }-${data.customer.carSeriesName || ''}`
} }
// 处理订单是否显示 操作按钮 支付方式为pos和微信 并且订单状态是 4和6
// data.failureFlag != 'Y'
data.canOperate =
[1, 3, 4].includes(data.selectPayType) &&
[4, 6].includes(data.status)
this.setData({ this.setData({
allNoConstruction, allNoConstruction,
orderInfo: data, orderInfo: data,
......
...@@ -765,4 +765,173 @@ page { ...@@ -765,4 +765,173 @@ page {
.warrantyCardList { .warrantyCardList {
margin-bottom: 120rpx; margin-bottom: 120rpx;
}
.operate {
position: relative;
font-size: var(--fontSize28);
color: #347BFF;
font-weight: normal;
}
.flex {
display: flex;
}
.operate .tip.none {
display: none;
}
/*提示框容器*/
.tip {
display: none;
box-sizing: border-box;
/* position: relative; */
position: absolute;
/* margin-left: 20px;
margin-top: 20px; */
left: calc(-1 * var(--fontSize100));
top: var(--fontSize50);
display: flex;
align-items: center;
width: var(--fontSize196);
font-size: var(--fontSize28);
/* background: #fff; */
background: rgba(0, 0, 0, 0.8000);
color: #fff;
padding: var(--fontSize20) var(--fontSize15);
/* padding-right: var(--fontSize10); */
/*设置圆角*/
-webkit-border-radius: var(--fontSize10);
-moz-border-radius: var(--fontSize10);
border-radius: var(--fontSize10);
}
.drawIcon {
width: var(--fontSize32);
height: var(--fontSize32);
/* margin-right: var(--fontSize5); */
}
/*提示框-上三角*/
.tip-trangle-top {
position: absolute;
top: calc(-1 * var(--fontSize20));
left: var(--fontSize110);
width: 0;
height: 0;
border-left: var(--fontSize20) solid transparent;
border-right: var(--fontSize20) solid transparent;
border-bottom: var(--fontSize20) solid rgba(0, 0, 0, 0.8000);
}
.modatcontentOrder {
padding: 30rpx 50rpx;
}
.modal text,
.modal {
font-size: var(--fontSize28);
color: #333333;
}
.modal .orderCode {
margin-bottom: var(--fontSize20);
}
.modal .code {
color: #888888;
}
.modal .color {
color: #F24724;
}
.modal {
.icon {
width: 96rpx;
height: 96rpx;
margin-right: 30rpx;
}
.modalbox {
display: flex;
align-items: center;
box-sizing: border-box;
width: 522rpx;
height: 136rpx;
background: #F7F8FA;
border-radius: 8rpx;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 28rpx;
color: #292D33;
padding-left: 24rpx;
margin: 0 auto;
&+.modalbox {
margin-top: 16rpx;
}
}
.act {
background: #347bff1a;
border: 2rpx solid #347BFF;
color: #3582EE;
}
.modatcontent {
padding: 50rpx var(--fontSize48) 32rpx;
}
.textarea {
background: #F7F7F7;
border: var(--fontSize1) solid #C3C3C3;
border-radius: var(--fontSize12);
// width: calc(100% - var(--fontSize80));
width: 100%;
height: var(--fontSize240);
box-sizing: border-box;
margin: 0 auto var(--fontSize12);
padding: var(--fontSize25) 0;
font-size: var(--fontSize28);
color: #333333;
}
.title {
font-weight: 500;
font-size: 32rpx;
color: #292D33;
text-align: center;
margin-bottom: 32rpx
}
.productName {
font-weight: 400;
font-size: 30rpx;
color: #5A5E66;
text-align: center;
margin-bottom: 32rpx
}
.label {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 30rpx;
color: #5A5E66;
margin-bottom: 16rpx
}
.tips {
font-weight: 400;
font-size: 24rpx;
color: #999EA8;
}
}
.meal-box {
background: #F7F8FA;
border: var(--fontSize1) solid #EFF0F2;
border-radius: var(--fontSize12);
margin: 0 calc(-1 * var(--fontSize20)) var(--fontSize16);
} }
\ 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!