【类 型】:factor
【主 题】:飞机订单操作 【描 述】: [原因]:防止不能进入 飞机航线注册状态 [过程]:先注册 注销航线 确认返回 再改订单状态 [影响]: 【结 束】 # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
ebc8880d26
commit
34180d722b
@ -465,7 +465,8 @@ export default {
|
|||||||
/* 站点正在执行任务runing 注册 */
|
/* 站点正在执行任务runing 注册 */
|
||||||
const runing = (this.currentOrder.runing ?? '').split(',')
|
const runing = (this.currentOrder.runing ?? '').split(',')
|
||||||
let foundEmpty = false
|
let foundEmpty = false
|
||||||
let selIndex // 记录执行飞机注册的索引 此索引对应 要使用的航线的索引
|
let selIndex // 记录执行飞机注册的索引 此索引对应要使用的航线的索引
|
||||||
|
|
||||||
runing.some((item, index, arr) => {
|
runing.some((item, index, arr) => {
|
||||||
if (item === '') {
|
if (item === '') {
|
||||||
arr[index] = this.plane.id
|
arr[index] = this.plane.id
|
||||||
@ -474,6 +475,7 @@ export default {
|
|||||||
return true // 找到空位后退出循环
|
return true // 找到空位后退出循环
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
newRuning = runing.join(',')
|
newRuning = runing.join(',')
|
||||||
if (!foundEmpty) {
|
if (!foundEmpty) {
|
||||||
this.$message({
|
this.$message({
|
||||||
@ -499,9 +501,9 @@ export default {
|
|||||||
this.$message.error('操作失败,航线异常')
|
this.$message.error('操作失败,航线异常')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let res = await this.questAss(this.currentOrder.id, 'shipment_status', '已发货')// 订单改为发货状态 并更新订单列表
|
let res = await this.$store.dispatch('fetchLockSite', { id: this.currentOrder.receive_site_id, shop_id: this.plane.shop_id, runing: newRuning })// 航线注册飞机 锁定送餐点
|
||||||
if (res.data.status === 1) {
|
if (res.data.status === 1) {
|
||||||
res = await this.$store.dispatch('fetchLockSite', { id: this.currentOrder.receive_site_id, shop_id: this.plane.shop_id, runing: newRuning })// 航线注册飞机 锁定送餐点
|
res = await this.questAss(this.currentOrder.id, 'shipment_status', '已发货')// 订单改为发货状态 并更新订单列表
|
||||||
if (res.data.status === 1) {
|
if (res.data.status === 1) {
|
||||||
this.publishFun(`{"questAss":${routeData}}`)// 发送航点信息主题
|
this.publishFun(`{"questAss":${routeData}}`)// 发送航点信息主题
|
||||||
this.speakText('提交任务,注册航线。')
|
this.speakText('提交任务,注册航线。')
|
||||||
@ -574,9 +576,9 @@ export default {
|
|||||||
})
|
})
|
||||||
/* 确认 把订单从发货退回到已接单 站点runing字段飞机航线注销 重置飞机状态 */
|
/* 确认 把订单从发货退回到已接单 站点runing字段飞机航线注销 重置飞机状态 */
|
||||||
if (found) {
|
if (found) {
|
||||||
this.questAss(orderId, 'shipment_status', '已接单').then(res => { // 退回到已接单 并更新订单列表
|
this.$store.dispatch('fetchLockSite', { id: receiveSiteId, shop_id: this.plane.shop_id, runing: newRuning }).then(res => { // 退回到已接单 并更新订单列表
|
||||||
if (res.data.status === 1) {
|
if (res.data.status === 1) {
|
||||||
this.$store.dispatch('fetchLockSite', { id: receiveSiteId, shop_id: this.plane.shop_id, runing: newRuning }).then(res => { // 注销航线
|
this.questAss(orderId, 'shipment_status', '已接单').then(res => { // 注销航线
|
||||||
if (res.data.status === 1) {
|
if (res.data.status === 1) {
|
||||||
this.publishFun('{"resetState":1}')// 发送设置飞机状态主题 状态设为闲置
|
this.publishFun('{"resetState":1}')// 发送设置飞机状态主题 状态设为闲置
|
||||||
}
|
}
|
||||||
@ -619,9 +621,9 @@ export default {
|
|||||||
})
|
})
|
||||||
/* 确认 把订单从发货退回到已接单 站点runing字段飞机航线注销 重置飞机状态 */
|
/* 确认 把订单从发货退回到已接单 站点runing字段飞机航线注销 重置飞机状态 */
|
||||||
if (found) {
|
if (found) {
|
||||||
this.questAss(orderId, 'shipment_status', '已送达').then(res => { // 订单改为已完成状态
|
this.$store.dispatch('fetchLockSite', { id: receiveSiteId, shop_id: this.plane.shop_id, runing: newRuning }).then(res => { // 订单改为已完成状态
|
||||||
if (res.data.status === 1) {
|
if (res.data.status === 1) {
|
||||||
this.$store.dispatch('fetchLockSite', { id: receiveSiteId, shop_id: this.plane.shop_id, runing: newRuning }).then(res => { // 注销航线
|
this.questAss(orderId, 'shipment_status', '已送达').then(res => { // 注销航线
|
||||||
if (res.data.status === 1) {
|
if (res.data.status === 1) {
|
||||||
this.publishFun('{"resetState":1}')// 发送设置飞机状态主题 状态设为闲置
|
this.publishFun('{"resetState":1}')// 发送设置飞机状态主题 状态设为闲置
|
||||||
}
|
}
|
||||||
@ -722,7 +724,7 @@ export default {
|
|||||||
this.publishFun('{getPlaneState:1}')
|
this.publishFun('{getPlaneState:1}')
|
||||||
},
|
},
|
||||||
ShippedList (val) {
|
ShippedList (val) {
|
||||||
console.log(val)
|
// console.log(val)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user