【类 型】:refactor
【主 题】:任务提交前 检查 【描 述】: [原因]:排除意外情况 [过程]: [影响]: 【结 束】 # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
479103333e
commit
3d47d2c32e
@ -406,6 +406,19 @@ export default {
|
||||
* @description: 执行任务前 先检测订单是否 合法 例如:订单重量会不会超出飞机载重上限
|
||||
*/
|
||||
checkQuest () {
|
||||
console.log(this.questForm.id)
|
||||
if (this.questForm.id === '') {
|
||||
this.$message.error('未选择订单任务!')
|
||||
return
|
||||
}
|
||||
if (!this.currentOrder) {
|
||||
this.$message.error('此订单已被申请退款或者订单已经被取消!')
|
||||
return
|
||||
}
|
||||
if (this.currentOrder.bind_route === null) { // 判断站点是否已经绑定站点 未绑定 中断操作
|
||||
this.$message.error('此站点,未绑定任务航点')
|
||||
return
|
||||
}
|
||||
if (Number(this.currentOrder.total_weight) >= Number(this.plane.weight_max)) { // 检查重量
|
||||
this.$confirm('此订单总重超出本飞机的载重上限', '检测订单', {
|
||||
confirmButtonText: '仍然提交',
|
||||
@ -449,19 +462,10 @@ export default {
|
||||
* @description: 执行订单任务
|
||||
*/
|
||||
runQuest () {
|
||||
if (this.questForm.id === '') {
|
||||
this.$message.error('未选择订单任务!')
|
||||
return
|
||||
}
|
||||
if (this.currentOrder) {
|
||||
/* 插入日志 */
|
||||
this.$store.dispatch('fetchLog', { content: `${this.plane.name} 开始执行 订单ID:${this.currentOrder.id}、叫餐号:${this.currentOrder.food_sn}号。` })
|
||||
/* 执行写在这里 */
|
||||
if (this.currentOrder.bind_route === null) { // 判断站点是否已经绑定站点 未绑定 中断操作
|
||||
this.$message.error('此站点,未绑定任务航点')
|
||||
return
|
||||
}
|
||||
let routeData
|
||||
let routeData // 航线数据内容
|
||||
let newRuning // 执行飞机注册后的 running字段信息
|
||||
try {
|
||||
/* 站点正在执行任务runing 注册 */
|
||||
@ -480,7 +484,7 @@ export default {
|
||||
if (!foundEmpty) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '此站点执行飞机已达上线,如果想执行请为该站点绑定更多航线'
|
||||
message: '站点所有航线都已被占用!'
|
||||
})
|
||||
return // 退出外层函数
|
||||
}
|
||||
@ -504,9 +508,6 @@ export default {
|
||||
this.questAss(this.currentOrder.id, 'shipment_status', '已发货')// 订单改为发货状态 并更新订单列表
|
||||
this.$store.dispatch('fetchLockSite', { id: this.currentOrder.receive_site_id, runing: newRuning })// 航线注册飞机 锁定送餐点
|
||||
this.speakText('提交任务,锁定航线。')
|
||||
} else {
|
||||
this.$message.error('此订单已被申请退款或者订单已经被取消!')
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @description: 匹配声音航点字符串 比如$food_sn$ food_sn匹配成 送餐订单里面的对应字段
|
||||
@ -666,6 +667,13 @@ export default {
|
||||
}
|
||||
return false
|
||||
})
|
||||
},
|
||||
questList (val) {
|
||||
/* 任务列表更新时 判断还有没有当前选择的id 没有就清空 */
|
||||
const found = val.some(item => item.id === this.questForm.id)
|
||||
if (!found) {
|
||||
this.questForm.id = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user