【类 型】:feat

【主	题】:1.提交任务前检查 2.修改已经订单下拉框 超重的 已经有飞机在执行任务的 显示成红色
【描	述】:
	[原因]:提交任务前检查 当前站点任务 是否正在有飞机正在执行  给出提示 ;样式重点提醒
	[过程]:
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
This commit is contained in:
tk 2024-07-08 19:42:48 +08:00
parent a36944460e
commit f8efe12fe0

View File

@ -59,7 +59,7 @@
<el-form-item label="已接订单">
<el-select v-model="questForm.id" :filterable="isMobile" placeholder="请选择,也可输入搜索" :disabled="airLock">
<el-option v-for="item in questList" :key="item.id" :label="item.id" :value="item.id"
:class="Number(item.total_weight) >= Number(plane.weight_max) ? 'danger-color' : ''">
:class="isWaring(item) ? 'danger-color' : ''">
<span class="l">{{ item.id }}</span>
<span class="l m-l-5">{{ item.receiver }}</span>
<span class="l m-l-5">{{ item.receive_site_name }}</span>
@ -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
})
}
}