|
|
|
@ -483,8 +483,8 @@ import {
|
|
|
|
|
TaskManageTruckGetInfoByTaskId,
|
|
|
|
|
TaskManageTruckPrintTemplateWithHistoryList,
|
|
|
|
|
TaskManageTruckPrint,
|
|
|
|
|
TaskManageTruckSendDispatchBatch,
|
|
|
|
|
TaskManageTruckCancelDispatchBatch
|
|
|
|
|
TaskManageTruckSendDispatchBatchByTask,
|
|
|
|
|
TaskManageTruckCancelDispatchBatchByTask
|
|
|
|
|
} from '@/api/modular/main/SendCar'
|
|
|
|
|
export default {
|
|
|
|
|
name: 'TaskmanageList',
|
|
|
|
@ -687,30 +687,37 @@ export default {
|
|
|
|
|
this.$message.error('请选择数据')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
let ApiArr = []
|
|
|
|
|
pkIdArr.forEach((item, index) => {
|
|
|
|
|
TaskManageTruckGetInfoByTaskId({ taskPkId: item })
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
ApiArr.push(res.data.ext.pK_ID)
|
|
|
|
|
if (index + 1 == pkIdArr.length) {
|
|
|
|
|
TaskManageTruckSendDispatchBatch(ApiArr).then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('派车成功')
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`派车失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
TaskManageTruckSendDispatchBatchByTask(pkIdArr).then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('派车成功')
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`派车失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
// let ApiArr = []
|
|
|
|
|
// pkIdArr.forEach((item, index) => {
|
|
|
|
|
// TaskManageTruckGetInfoByTaskId({ taskPkId: item })
|
|
|
|
|
// .then(res => {
|
|
|
|
|
// if (res.data.succ) {
|
|
|
|
|
// ApiArr.push(res.data.ext.pK_ID)
|
|
|
|
|
// if (index + 1 == pkIdArr.length) {
|
|
|
|
|
// TaskManageTruckSendDispatchBatch(ApiArr).then(res => {
|
|
|
|
|
// if (res.data.succ) {
|
|
|
|
|
// this.$message.success('派车成功')
|
|
|
|
|
// } else {
|
|
|
|
|
// this.$message.error(`派车失败,${res.data.msg}`)
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// this.$message.error(`${res.data.msg}`)
|
|
|
|
|
// }
|
|
|
|
|
// this.confirmLoading = false
|
|
|
|
|
// })
|
|
|
|
|
// .catch(() => {
|
|
|
|
|
// this.confirmLoading = false
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
},
|
|
|
|
|
CancelSendCar() {
|
|
|
|
|
const select = this.$refs.xGrid.getCheckboxRecords()
|
|
|
|
@ -721,30 +728,36 @@ export default {
|
|
|
|
|
this.$message.error('请选择数据')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
let ApiArr = []
|
|
|
|
|
pkIdArr.forEach((item, index) => {
|
|
|
|
|
TaskManageTruckGetInfoByTaskId({ taskPkId: item })
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
ApiArr.push(res.data.ext.pK_ID)
|
|
|
|
|
if (index + 1 == pkIdArr.length) {
|
|
|
|
|
TaskManageTruckCancelDispatchBatch(ApiArr).then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('派车成功')
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`派车失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
TaskManageTruckCancelDispatchBatchByTask(pkIdArr).then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('取消派车成功')
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`取消派车失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
// pkIdArr.forEach((item, index) => {
|
|
|
|
|
// TaskManageTruckGetInfoByTaskId({ taskPkId: item })
|
|
|
|
|
// .then(res => {
|
|
|
|
|
// if (res.data.succ) {
|
|
|
|
|
// ApiArr.push(res.data.ext.pK_ID)
|
|
|
|
|
// if (index + 1 == pkIdArr.length) {
|
|
|
|
|
// TaskManageTruckCancelDispatchBatch(ApiArr).then(res => {
|
|
|
|
|
// if (res.data.succ) {
|
|
|
|
|
// this.$message.success('派车成功')
|
|
|
|
|
// } else {
|
|
|
|
|
// this.$message.error(`派车失败,${res.data.msg}`)
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// this.$message.error(`${res.data.msg}`)
|
|
|
|
|
// }
|
|
|
|
|
// this.confirmLoading = false
|
|
|
|
|
// })
|
|
|
|
|
// .catch(() => {
|
|
|
|
|
// this.confirmLoading = false
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
},
|
|
|
|
|
onSelect(selectedKeys, info) {
|
|
|
|
|
console.log('selected', selectedKeys, info)
|
|
|
|
|