From d3655cd746ec5f8a4d19dad90555e9508505254a Mon Sep 17 00:00:00 2001
From: aihe <961836564@qq.com>
Date: Sun, 30 Jun 2024 01:19:08 +0800
Subject: [PATCH] uu
---
common/api/order.js | 10 +++++
common/api/url.js | 4 +-
components/tpx-com-dialog/tpx-com-dialog.vue | 14 ++++++-
pages/login/login.vue | 5 ++-
pages/tabBar/order/order.vue | 42 ++++++++++++++++----
5 files changed, 63 insertions(+), 12 deletions(-)
diff --git a/common/api/order.js b/common/api/order.js
index ecabea7..334b858 100644
--- a/common/api/order.js
+++ b/common/api/order.js
@@ -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, {})
+}
diff --git a/common/api/url.js b/common/api/url.js
index 3ca90f0..1136227 100644
--- a/common/api/url.js
+++ b/common/api/url.js
@@ -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`, // 取消订单
}
diff --git a/components/tpx-com-dialog/tpx-com-dialog.vue b/components/tpx-com-dialog/tpx-com-dialog.vue
index ffae9b6..10f1354 100644
--- a/components/tpx-com-dialog/tpx-com-dialog.vue
+++ b/components/tpx-com-dialog/tpx-com-dialog.vue
@@ -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
+ }
+ })
}
}
}
diff --git a/pages/login/login.vue b/pages/login/login.vue
index d177032..15f319b 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -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: []
},
}
diff --git a/pages/tabBar/order/order.vue b/pages/tabBar/order/order.vue
index 102c962..d774dcf 100644
--- a/pages/tabBar/order/order.vue
+++ b/pages/tabBar/order/order.vue
@@ -50,7 +50,7 @@
@@ -88,6 +88,14 @@
+
+
+
+
+
+
+
@@ -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}`)