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 = {})=> {
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`, // 运单附件上传
getPackNo: `/emis/common/getPackNo`, // 生成合包号
getCarNoList: `/emis/emisTmsCar/listSimple`, // 获取车牌号列表
confirmOrder: `/emis/emisWaybill/confirmOrder`, // 确认接单
cancelOrder: `/emis/emisWaybill/cancelOrder`, // 取消订单
}

View File

@ -55,7 +55,7 @@
},
data() {
return {
curDealPromise: {}
}
},
created() {
@ -74,11 +74,23 @@
handleBtnCheck(type) {
if(type == 'yes') {
this.$emit('onSure')
this.curDealPromise?.resolve?.(true)
} else {
this.handleCloseModal()
this.curDealPromise?.resolve?.(false)
this.$emit('onClose')
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 { getSessionLoginInfo, setSessionLoginInfo, setSessionXToken } from "@/session"
import { encrypt } from "@/common/libs/jsencrypt_utils"
import { getSystemInfo } from "@/common/appUpdate"
export default {
props: {
},
data() {
let curDeviceId = getSystemInfo()?.deviceId
return {
submitParams: {
isEncrypt: true,
username: '',
password: '',
// macCode: '', // 设备唯一ID TODO
// macCode: curDeviceId, // 设备唯一ID TODO
remberPassport: []
},
}

View File

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