|
|
|
@ -185,7 +185,7 @@
|
|
|
|
|
</a-popconfirm>
|
|
|
|
|
<a-button class="list-btn" type="primary" icon="check" @click="FnPrint">打印</a-button>
|
|
|
|
|
<a-button class="list-btn" type="primary" icon="check" @click="FnSendCar">派车</a-button>
|
|
|
|
|
<a-button class="list-btn" type="primary" icon="check">取消派车</a-button>
|
|
|
|
|
<a-button class="list-btn" type="primary" icon="check" @click="CancelSendCar">取消派车</a-button>
|
|
|
|
|
<template v-if="taskType === 'BC'">
|
|
|
|
|
<a-popconfirm
|
|
|
|
|
title="确定批量下载当前选择项?"
|
|
|
|
@ -482,7 +482,9 @@ import {
|
|
|
|
|
import {
|
|
|
|
|
TaskManageTruckGetInfoByTaskId,
|
|
|
|
|
TaskManageTruckPrintTemplateWithHistoryList,
|
|
|
|
|
TaskManageTruckPrint
|
|
|
|
|
TaskManageTruckPrint,
|
|
|
|
|
TaskManageTruckSendDispatchBatch,
|
|
|
|
|
TaskManageTruckCancelDispatchBatch
|
|
|
|
|
} from '@/api/modular/main/SendCar'
|
|
|
|
|
export default {
|
|
|
|
|
name: 'TaskmanageList',
|
|
|
|
@ -685,31 +687,55 @@ export default {
|
|
|
|
|
this.$message.error('请选择数据')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
pkIdArr.forEach(item => {
|
|
|
|
|
TaskManageTruckGetInfoByTaskId({ taskPkId: this.pkIdArr[0] })
|
|
|
|
|
let ApiArr = []
|
|
|
|
|
pkIdArr.forEach((item, index) => {
|
|
|
|
|
TaskManageTruckGetInfoByTaskId({ taskPkId: item })
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
// TaskManageTruckPrint({
|
|
|
|
|
// taskPKId: res.data.ext.pK_ID,
|
|
|
|
|
// templateId,
|
|
|
|
|
// cateCode: 'truckBill',
|
|
|
|
|
// type: this.PrintType,
|
|
|
|
|
// printType
|
|
|
|
|
// }).then(res => {
|
|
|
|
|
// if (!res.success) {
|
|
|
|
|
// this.$message.error(res.message)
|
|
|
|
|
// } else {
|
|
|
|
|
// // this.$message.success(res.data)
|
|
|
|
|
// if (this.PrintType == 1) {
|
|
|
|
|
// window.open(` ${process.env.VUE_APP_API_BASE_URL}/BookingOrder/ViewPrintPdf/${res.data}`, '_blank')
|
|
|
|
|
// } else {
|
|
|
|
|
// window.open(
|
|
|
|
|
// ` ${process.env.VUE_APP_API_BASE_URL}/BookingOrder/downloadPrint?filename=${res.data}`,
|
|
|
|
|
// '_blank'
|
|
|
|
|
// )
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
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()
|
|
|
|
|
const pkIdArr = select.map((item, index) => {
|
|
|
|
|
return item.pkId
|
|
|
|
|
})
|
|
|
|
|
if (pkIdArr.length === 0) {
|
|
|
|
|
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}`)
|
|
|
|
|
}
|
|
|
|
|