szh_zidingyibiaoti
lilu 2 years ago
commit 4956ed5e9a

@ -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
})
}
/**
* 订舱生成派车初始信息
*/

@ -91,7 +91,7 @@
<a-select
:showSearch="true"
:filterOption="filterOption"
v-decorator="['truckId', { rules: [{ required: true, message: '请选择客户属性!' }] }]"
v-decorator="['truckId']"
@focus="gettruckIdData"
@change="ChangetruckId"
allowClear
@ -131,6 +131,7 @@
<a-input v-decorator="['attnFax']" allowClear :disabled="taskPKId ? false : true" />
</a-form-item>
</a-col>
<!-- , { rules: [{ required: true, message: '请选择调度!' }] } -->
<a-col :span="6">
<a-form-item label="调度:" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select v-decorator="['dispatcherId']" allowClear>
@ -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() {

@ -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}`)
}

Loading…
Cancel
Save