diff --git a/src/api/modular/main/SendCar.js b/src/api/modular/main/SendCar.js
index e104838..3acd314 100644
--- a/src/api/modular/main/SendCar.js
+++ b/src/api/modular/main/SendCar.js
@@ -202,6 +202,16 @@ export function TaskManageTruckCancelDispatch(parameter) {
params: parameter
})
}
+/**
+ * 批量取消派车
+ */
+export function TaskManageTruckCancelDispatchBatch(parameter) {
+ return axios({
+ url: '/TaskManageTruck/CancelDispatchBatch',
+ method: 'post',
+ data: parameter
+ })
+}
/**
* 批量派车
*/
@@ -212,6 +222,16 @@ export function TaskManageTruckSendDispatchBatch(parameter) {
data: parameter
})
}
+/**
+ * 派车
+ */
+export function TaskManageTruckSendDispatch(parameter) {
+ return axios({
+ url: '/TaskManageTruck/SendDispatch',
+ method: 'post',
+ data: parameter
+ })
+}
/**
* 订舱生成派车初始信息
*/
diff --git a/src/views/main/SendCar/addForm.vue b/src/views/main/SendCar/addForm.vue
index d41161e..b958b6a 100644
--- a/src/views/main/SendCar/addForm.vue
+++ b/src/views/main/SendCar/addForm.vue
@@ -91,7 +91,7 @@
+
@@ -560,7 +561,8 @@ import {
TaskManageTruckSendDispatchBatch,
BookingTruckPrintTemplateWithHistoryList,
TaskManageTruckPrintTemplateWithHistoryList,
- BookingTruckInitFromBookingOrder
+ BookingTruckInitFromBookingOrder,
+ TaskManageTruckSendDispatch
} from '@/api/modular/main/SendCar'
import { GetCtn } from '@/api/modular/main/BookingLedger'
import { GetSysUserPage } from '@/api/modular/main/BookingLedger'
@@ -795,13 +797,23 @@ export default {
},
// 调度派车
FnSendCar() {
- TaskManageTruckSendDispatchBatch([this.WebData.pK_ID]).then(res => {
- if (res.data.succ) {
- this.$message.success('派车成功')
- } else {
- this.$message.error(`派车失败,${res.data.msg}`)
- }
- })
+ if (this.taskPKId) {
+ TaskManageTruckSendDispatch({ pkId: this.WebData.pK_ID }).then(res => {
+ if (res.data.succ) {
+ this.$message.success('派车成功')
+ } else {
+ this.$message.error(`派车失败,${res.data.msg}`)
+ }
+ })
+ } else {
+ TaskManageTruckSendDispatchBatch([this.WebData.pK_ID]).then(res => {
+ if (res.data.succ) {
+ this.$message.success('派车成功')
+ } else {
+ this.$message.error(`派车失败,${res.data.msg}`)
+ }
+ })
+ }
},
// 调度取消派车
CancelSendCar() {
diff --git a/src/views/main/Taskmanage/TaskmanageList/index.vue b/src/views/main/Taskmanage/TaskmanageList/index.vue
index 6952c00..ac703c9 100644
--- a/src/views/main/Taskmanage/TaskmanageList/index.vue
+++ b/src/views/main/Taskmanage/TaskmanageList/index.vue
@@ -185,7 +185,7 @@
打印
派车
- 取消派车
+ 取消派车
{
- 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}`)
}