This commit is contained in:
aihe 2024-06-30 01:19:08 +08:00
parent 250773872a
commit d3655cd746
5 changed files with 63 additions and 12 deletions

View File

@ -177,3 +177,13 @@ export const getPackNo = (data = {})=> {
export const getCarNoList = (data = {})=> { export const getCarNoList = (data = {})=> {
return coreRequest(url.getCarNoList, data, {}, "GET") return coreRequest(url.getCarNoList, data, {}, "GET")
} }
// 确认接单
export const confirmOrder = (data = {})=> {
return coreRequest(url.confirmOrder, data, {})
}
// 取消订单
export const cancelOrder = (data = {})=> {
return coreRequest(url.cancelOrder, data, {})
}

View File

@ -56,6 +56,8 @@ export default {
uploadWaybillAttach: `/emis/emisWaybillAttachment/uploadWaybillAttach`, // 运单附件上传 uploadWaybillAttach: `/emis/emisWaybillAttachment/uploadWaybillAttach`, // 运单附件上传
getPackNo: `/emis/common/getPackNo`, // 生成合包号 getPackNo: `/emis/common/getPackNo`, // 生成合包号
getCarNoList: `/emis/emisTmsCar/listSimple`, // 获取车牌号列表 getCarNoList: `/emis/emisTmsCar/listSimple`, // 获取车牌号列表
confirmOrder: `/emis/emisWaybill/confirmOrder`, // 确认接单
cancelOrder: `/emis/emisWaybill/cancelOrder`, // 取消订单
} }

View File

@ -55,7 +55,7 @@
}, },
data() { data() {
return { return {
curDealPromise: {}
} }
}, },
created() { created() {
@ -74,11 +74,23 @@
handleBtnCheck(type) { handleBtnCheck(type) {
if(type == 'yes') { if(type == 'yes') {
this.$emit('onSure') this.$emit('onSure')
this.curDealPromise?.resolve?.(true)
} else { } else {
this.handleCloseModal() this.handleCloseModal()
this.curDealPromise?.resolve?.(false)
this.$emit('onClose') this.$emit('onClose')
this.$emit('onCancel') this.$emit('onCancel')
} }
this.curDealPromise = {}
},
getConfirmResult(){
// 显示弹框,并返回promise
this.$emit('update:show', true)
return new Promise((resolve, reject)=> {
this.curDealPromise = {
resolve
}
})
} }
} }
} }

View File

@ -48,18 +48,19 @@
import { USERKEY } from "@/store/actionKey" import { USERKEY } from "@/store/actionKey"
import { getSessionLoginInfo, setSessionLoginInfo, setSessionXToken } from "@/session" import { getSessionLoginInfo, setSessionLoginInfo, setSessionXToken } from "@/session"
import { encrypt } from "@/common/libs/jsencrypt_utils" import { encrypt } from "@/common/libs/jsencrypt_utils"
import { getSystemInfo } from "@/common/appUpdate"
export default { export default {
props: { props: {
}, },
data() { data() {
let curDeviceId = getSystemInfo()?.deviceId
return { return {
submitParams: { submitParams: {
isEncrypt: true, isEncrypt: true,
username: '', username: '',
password: '', password: '',
// macCode: '', // 设备唯一ID TODO // macCode: curDeviceId, // 设备唯一ID TODO
remberPassport: [] remberPassport: []
}, },
} }

View File

@ -50,7 +50,7 @@
<template v-slot:body> <template v-slot:body>
<view class="pos-abt-all"> <view class="pos-abt-all">
<tpx-scroll-view v-model:resObject="resData" :searchParam="searchParam" :getListFun="getListFun" <tpx-scroll-view v-model:resObject="resData" :searchParam="searchParam" :getListFun="getListFun"
ref="listRef" @onListReload="handleListReload" ref="listRef" @onListReload="listenListReload"
> >
<view class="pgb-cont"> <view class="pgb-cont">
<!-- 列表数据 --> <!-- 列表数据 -->
@ -88,6 +88,14 @@
</view> </view>
</template> </template>
</tpx-layout> </tpx-layout>
<tpx-com-dialog v-model:show="cancelModal.show" ref="cancelRef" title="确认取消">
<template v-slot:body>
<u-textarea v-model="cancelModal.data.orderRemark" border="surround" height="120" placeholder="请输入"
maxlength="50" count></u-textarea>
</template>
</tpx-com-dialog>
</tpx-page> </tpx-page>
</template> </template>
@ -136,6 +144,12 @@
}, },
resData: { resData: {
list: [] list: []
},
cancelModal: {
show: false,
data: {
orderRemark: ''
}
} }
} }
}, },
@ -146,12 +160,11 @@
} }
}, },
onShow(){ onShow(){
this?.$refs?.listRef?.getDataList?.(true) // 重置到第一页数据 this.triggerListReload()
this.initData() this.initData()
}, },
onLoad(option) { onLoad(option) {
this.queryOption = option this.queryOption = option
this.initData();
}, },
onUnload() { onUnload() {
}, },
@ -168,8 +181,9 @@
return res return res
}, },
initData(){ initData(){
}, },
handleListReload(params){ listenListReload(params){
// list重置到第一页,需重新查询统计数据 // list重置到第一页,需重新查询统计数据
this.getStaticData(params) this.getStaticData(params)
}, },
@ -184,19 +198,31 @@
}) })
this.staticInfo.orderStat = orderStat this.staticInfo.orderStat = orderStat
}, },
triggerListReload(){
this?.$refs?.listRef?.getDataList?.(true) // 重置到第一页数据
},
async handleDealItem(item, deal = { type: '1' }) { async handleDealItem(item, deal = { type: '1' }) {
let itemQuery = `?billCode=${item.billCode || ''}&orderSn=${item.orderSn || ''}` let itemQuery = `?billCode=${item.billCode || ''}&orderSn=${item.orderSn || ''}`
switch (deal.type){ switch (deal.type){
case 1: // 接单 case 1: // 接单
// TODO let conBl = await this.confirmModal('确认要接单吗?')
await this.confirmModal('确认要接单吗?') if(conBl) {
await apiService.confirmOrder({ orderSn: item.orderSn })
this.showToast('操作成功')
this.triggerListReload()
}
break; break;
case 2: // 立即开单 case 2: // 立即开单
this.goto(`post/openorder${itemQuery}`) this.goto(`post/openorder${itemQuery}`)
break; break;
case 3: // 取消 case 3: // 取消
// TODO let canBl = await this.$refs.cancelRef.getConfirmResult()
await this.confirmModal('确认要取消吗?') if(canBl) {
await apiService.cancelOrder({ orderSn: item.orderSn, ...this.cancelModal.data })
this.triggerListReload()
}
this.cancelModal.data = { }
this.cancelModal.show = false
break; break;
case 4: // 揽收 case 4: // 揽收
this.goto(`deliveryDeal/pickUp${itemQuery}`) this.goto(`deliveryDeal/pickUp${itemQuery}`)