From 13868cd60798bd61b42612f22e7954bf100c7ac9 Mon Sep 17 00:00:00 2001 From: tk Date: Fri, 12 Jul 2024 19:58:51 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=09=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9A=20=E3=80=90=E4=B8=BB=09=E9=A2=98=E3=80=91=EF=BC=9A=20?= =?UTF-8?q?=E3=80=90=E6=8F=8F=09=E8=BF=B0=E3=80=91=EF=BC=9A=20=09[?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0]=EF=BC=9A=20=09[=E8=BF=87=E7=A8=8B]=EF=BC=9A?= =?UTF-8?q?=20=09[=E5=BD=B1=E5=93=8D]=EF=BC=9A=20=E3=80=90=E7=BB=93=09?= =?UTF-8?q?=E6=9D=9F=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动 --- src/components/ControllerTabs.vue | 18 +++++++++++------- src/store/index.js | 2 +- src/utils/api/table.js | 6 +++--- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/components/ControllerTabs.vue b/src/components/ControllerTabs.vue index 0fc79c9..e6f171b 100644 --- a/src/components/ControllerTabs.vue +++ b/src/components/ControllerTabs.vue @@ -83,18 +83,18 @@ icon="f-s-14 iconfont icon-chakanzhihangrizhi" @click="checkQuest"> 上传航点 - 航点写入中··· 解锁飞机 执行任务 @@ -326,7 +326,7 @@ export default { */ executeOrder () { const plane = this.plane - return plane ? this.ShippedList.find((item) => item.by_plane_id === plane.id) : null + return plane ? this.ShippedList.find((item) => item.by_plane_id === plane.id) : {} }, /** * @description: 航线列表 @@ -415,7 +415,11 @@ export default { * @description: 执行任务前 先检测订单是否 合法 例如:订单重量会不会超出飞机载重上限 */ checkQuest () { - if (!this.currentOrder && !this.executeOrder) { + if (this.questForm.id === '') { + this.$message.error('未选择订单任务!') + return + } + if (!this.currentOrder) { this.$message.error('此订单已被申请退款或者订单已经被取消!') return } @@ -687,7 +691,7 @@ export default { }, created () { // 判断当前飞机有没有挂载的任务 判断是否是锁定状态 - if (this.executeOrder === null) { + if (Object.keys(this.executeOrder).length === 0) { this.airLock = false } else { this.airLock = true @@ -714,7 +718,7 @@ export default { }, executeOrder (val) { // 判断当前飞机有没有挂载的任务 判断是否是锁定状态 - if (val === null) { + if (Object.keys(val).length === 0) { this.airLock = false } else { this.airLock = true diff --git a/src/store/index.js b/src/store/index.js index bd63fe2..8f3615b 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -941,7 +941,7 @@ const store = new Vuex.Store({ } }, /** - * @description: 获取订单列表 + * @description: 获取已付款 订单列表 * @return {*} 列表 */ async fetchPaidOrderList ({ commit }) { diff --git a/src/utils/api/table.js b/src/utils/api/table.js index fa8eb47..eaf8705 100644 --- a/src/utils/api/table.js +++ b/src/utils/api/table.js @@ -23,7 +23,7 @@ export async function apiCrosFrequency (params) { * @description: 向改变订单承接任务api 提交数据,参数可以是数组 提交多个字段和字段内容 () ,并更新订单列表 * @param {*} id 订单id * @param {array string} type 主状态"main_status" 货物状态"shipment_status" 退款状态"refund_status" 执行飞机"by_plane_id" - * @param {array string} val 修改字段的值 ps:by_plane_id值给'null' 字符串或者留空 数据库改为null + * @param {array string} val 修改字段的值 ps:by_plane_id值给'' 数据库改为null */ export async function questAss (id, type, val) { const params = new URLSearchParams()// post对象参数 转成 字符串连接 @@ -34,10 +34,10 @@ export async function questAss (id, type, val) { return } for (let i = 0; i < type.length; i++) { - params.append(type[i], val[i] === '' ? 'null' : val[i]) + params.append(type[i], val[i]) } } else if (typeof type === 'string' && typeof val === 'string') { - params.append(type, val === '' ? 'null' : val) + params.append(type, val) } else { return }