【类 型】:feat
【主 题】:1.提交任务前检查 2.修改已经订单下拉框 超重的 已经有飞机在执行任务的 显示成红色 【描 述】: [原因]:提交任务前检查 当前站点任务 是否正在有飞机正在执行 给出提示 ;样式重点提醒 [过程]: [影响]: 【结 束】 # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
a36944460e
commit
f8efe12fe0
@ -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
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user