From f8efe12fe01625e3c83ad6e6278d82243c1b9bee Mon Sep 17 00:00:00 2001 From: tk Date: Mon, 8 Jul 2024 19:42:48 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=09=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afeat=20=E3=80=90=E4=B8=BB=09=E9=A2=98=E3=80=91?= =?UTF-8?q?=EF=BC=9A1.=E6=8F=90=E4=BA=A4=E4=BB=BB=E5=8A=A1=E5=89=8D?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=202.=E4=BF=AE=E6=94=B9=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E4=B8=8B=E6=8B=89=E6=A1=86=20=E8=B6=85?= =?UTF-8?q?=E9=87=8D=E7=9A=84=20=E5=B7=B2=E7=BB=8F=E6=9C=89=E9=A3=9E?= =?UTF-8?q?=E6=9C=BA=E5=9C=A8=E6=89=A7=E8=A1=8C=E4=BB=BB=E5=8A=A1=E7=9A=84?= =?UTF-8?q?=20=E6=98=BE=E7=A4=BA=E6=88=90=E7=BA=A2=E8=89=B2=20=E3=80=90?= =?UTF-8?q?=E6=8F=8F=09=E8=BF=B0=E3=80=91=EF=BC=9A=20=09[=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0]=EF=BC=9A=E6=8F=90=E4=BA=A4=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=89=8D=E6=A3=80=E6=9F=A5=20=E5=BD=93=E5=89=8D=E7=AB=99?= =?UTF-8?q?=E7=82=B9=E4=BB=BB=E5=8A=A1=20=E6=98=AF=E5=90=A6=E6=AD=A3?= =?UTF-8?q?=E5=9C=A8=E6=9C=89=E9=A3=9E=E6=9C=BA=E6=AD=A3=E5=9C=A8=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=20=20=E7=BB=99=E5=87=BA=E6=8F=90=E7=A4=BA=20=EF=BC=9B?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E9=87=8D=E7=82=B9=E6=8F=90=E9=86=92=20=09[?= =?UTF-8?q?=E8=BF=87=E7=A8=8B]=EF=BC=9A=20=09[=E5=BD=B1=E5=93=8D]=EF=BC=9A?= =?UTF-8?q?=20=E3=80=90=E7=BB=93=09=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 | 55 ++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/src/components/ControllerTabs.vue b/src/components/ControllerTabs.vue index 226f663..3f7d218 100644 --- a/src/components/ControllerTabs.vue +++ b/src/components/ControllerTabs.vue @@ -59,7 +59,7 @@ + :class="isWaring(item) ? 'danger-color' : ''"> {{ item.id }} {{ item.receiver }} {{ item.receive_site_name }} @@ -298,11 +298,11 @@ export default { return plane ? plane.planeState.state : null }, /** - * @description: 已付款 未送达 未发起退款 订单列表 + * @description: 已付款 已接单 未发起退款 订单列表 */ questList () { const plane = this.plane - return plane ? this.$store.state.paidOrderList.filter((item) => item.shop_id === plane.shop_id && item.refund_status !== '申请中') : [] + return plane ? this.$store.state.paidOrderList.filter((item) => item.shop_id === plane.shop_id && item.shipment_status === '已接单' && item.refund_status !== '申请中') : [] }, /** * @description: 已发货 订单列表 @@ -406,8 +406,7 @@ export default { * @description: 执行任务前 先检测订单是否 合法 例如:订单重量会不会超出飞机载重上限 */ checkQuest () { - // 检查重量 - if (Number(this.currentOrder.total_weight) >= Number(this.plane.weight_max)) { + if (Number(this.currentOrder.total_weight) >= Number(this.plane.weight_max)) { // 检查重量 this.$confirm('此订单总重超出本飞机的载重上限', '检测订单', { confirmButtonText: '仍然提交', cancelButtonText: '放弃提交', @@ -426,6 +425,25 @@ export default { message: '取消提交订单' }) }) + } else if (this.currentOrder.runing.split(',').some(item => item !== '')) { // 检查 此站点上有否有飞机正在执行任务 + this.$confirm('此订单的目标站点,已经有飞机正在执行任务。请注意安全!', '检测订单', { + confirmButtonText: '仍然提交', + cancelButtonText: '放弃提交', + type: 'warning' + }) + .then(() => { + this.$message({ + type: 'warning', + message: '存在风险,仍然提交订单' + }) + this.runQuest()// 提交订单 + }) + .catch(action => { + this.$message({ + type: 'info', + message: '取消提交订单' + }) + }) } else { // 合法 直接提交订单 this.runQuest() @@ -616,11 +634,26 @@ export default { } } }) + }, + /** + * @description: 判断 已接订单下拉框 的任务 有疑问的 坐标集 class样式显示成红色 + * @param {*} item 对应下拉框的任务 + */ + isWaring (item) { + const isOverWaight = Number(item.total_weight) >= Number(this.plane.weight_max)// 是否超重 + const isQuestIng = item.runing.split(',').some(i => i !== '')// 是否有飞机正在执行 + return isOverWaight || isQuestIng } }, created () { if (this.siteList && this.routeList) { - this.airLock = this.siteList.some(item => item.runing === this.planesId) + this.airLock = this.siteList.some(item => { + if (item.runing) { + const runingArray = item.runing.split(',').map(str => str.trim()) // 将 item.runing 分割成数组并去除空格 + return runingArray.includes(this.planesId.toString()) // 比较数组中的元素和 this.planesId + } + return false + }) } }, watch: { @@ -630,11 +663,17 @@ export default { } else { // 如果没有执行任务 把地图上航线清除 this.$emit('clearRoute') } - this.$store.dispatch('fetchPaiOrderList')// 刷新订单列表 + this.$store.dispatch('fetchPaidOrderList')// 刷新订单列表 this.$store.dispatch('fetchSiteList')// 刷新站点列表 }, siteList (val) { - this.airLock = val.some(item => item.runing === this.planesId) + this.airLock = this.siteList.some(item => { + if (item.runing) { + const runingArray = item.runing.split(',').map(str => str.trim()) // 将 item.runing 分割成数组并去除空格 + return runingArray.includes(this.planesId.toString()) // 比较数组中的元素和 this.planesId + } + return false + }) } }