【类 型】:fix
【主 题】:飞机操作模块 完成任务函数 【描 述】: [原因]:request函数 去掉订单的 逻辑bug(分割之后取下标订单id 少+1) [过程]:从executeOrder计算属性里面直接 拿订单信息 [影响]: 【结 束】 # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
3cd0beaed2
commit
e7a8ebb499
@ -678,33 +678,26 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
/* 关联当前订单的站点 搜寻注册的飞机 并预设newRuning 用于注销runing字段航线 */
|
/* 关联当前订单的站点 搜寻注册的飞机 并预设newRuning 用于注销runing字段航线 */
|
||||||
let newRuning // 确保newRuning在函数块外定义
|
// 分割字符串成数组
|
||||||
let receiveSiteId
|
const runingArray = this.executeOrder.runing.split(',')
|
||||||
let orderId
|
// 遍历数组并替换相等的值
|
||||||
const found = this.ShippedList.some((element) => {
|
for (let i = 0; i < runingArray.length; i++) {
|
||||||
const runing = (element.runing ?? '').split(',')
|
if (runingArray[i] === this.executeOrder.by_plane_id) {
|
||||||
return runing.some((item, index, arr) => {
|
runingArray[i] = ''
|
||||||
if (item === this.plane.id.toString()) {
|
|
||||||
arr[index] = '' // 将匹配的id替换为空字符串
|
|
||||||
newRuning = runing.join(',')
|
|
||||||
orderId = element.id
|
|
||||||
receiveSiteId = element.receive_site_id
|
|
||||||
return true // 找到id后退出内层循环
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
})
|
// 将数组重新组合成字符串
|
||||||
|
const newRuning = runingArray.join(',')
|
||||||
/* 确认 把订单从发货退回到已接单 站点runing字段飞机航线注销 重置飞机状态 */
|
/* 确认 把订单从发货退回到已接单 站点runing字段飞机航线注销 重置飞机状态 */
|
||||||
if (found) {
|
this.$store.dispatch('fetchLockSite', { id: this.executeOrder.receive_site_id, shop_id: this.plane.shop_id, runing: newRuning }).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.questAss(orderId, 'shipment_status', '已送达').then(res => { // 注销航线
|
this.questAss(this.executeOrder.id, 'shipment_status', '已送达').then(res => { // 注销航线
|
||||||
if (res.data.status === 1) {
|
if (res.data.status === 1) {
|
||||||
this.publishFun('{"resetState":1}')// 发送设置飞机状态主题 状态设为闲置
|
this.publishFun('{"resetState":1}')// 发送设置飞机状态主题 状态设为闲置
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$message.info('取消操作!')
|
this.$message.info('取消操作!')
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user