szh_zidingyibiaoti
lilu 2 years ago
commit 4956ed5e9a

@ -202,6 +202,16 @@ export function TaskManageTruckCancelDispatch(parameter) {
params: 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 data: parameter
}) })
} }
/**
* 派车
*/
export function TaskManageTruckSendDispatch(parameter) {
return axios({
url: '/TaskManageTruck/SendDispatch',
method: 'post',
data: parameter
})
}
/** /**
* 订舱生成派车初始信息 * 订舱生成派车初始信息
*/ */

@ -91,7 +91,7 @@
<a-select <a-select
:showSearch="true" :showSearch="true"
:filterOption="filterOption" :filterOption="filterOption"
v-decorator="['truckId', { rules: [{ required: true, message: '请选择客户属性!' }] }]" v-decorator="['truckId']"
@focus="gettruckIdData" @focus="gettruckIdData"
@change="ChangetruckId" @change="ChangetruckId"
allowClear allowClear
@ -131,6 +131,7 @@
<a-input v-decorator="['attnFax']" allowClear :disabled="taskPKId ? false : true" /> <a-input v-decorator="['attnFax']" allowClear :disabled="taskPKId ? false : true" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<!-- , { rules: [{ required: true, message: '请选择调度!' }] } -->
<a-col :span="6"> <a-col :span="6">
<a-form-item label="调度:" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item label="调度:" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select v-decorator="['dispatcherId']" allowClear> <a-select v-decorator="['dispatcherId']" allowClear>
@ -560,7 +561,8 @@ import {
TaskManageTruckSendDispatchBatch, TaskManageTruckSendDispatchBatch,
BookingTruckPrintTemplateWithHistoryList, BookingTruckPrintTemplateWithHistoryList,
TaskManageTruckPrintTemplateWithHistoryList, TaskManageTruckPrintTemplateWithHistoryList,
BookingTruckInitFromBookingOrder BookingTruckInitFromBookingOrder,
TaskManageTruckSendDispatch
} from '@/api/modular/main/SendCar' } from '@/api/modular/main/SendCar'
import { GetCtn } from '@/api/modular/main/BookingLedger' import { GetCtn } from '@/api/modular/main/BookingLedger'
import { GetSysUserPage } from '@/api/modular/main/BookingLedger' import { GetSysUserPage } from '@/api/modular/main/BookingLedger'
@ -795,13 +797,23 @@ export default {
}, },
// //
FnSendCar() { FnSendCar() {
TaskManageTruckSendDispatchBatch([this.WebData.pK_ID]).then(res => { if (this.taskPKId) {
if (res.data.succ) { TaskManageTruckSendDispatch({ pkId: this.WebData.pK_ID }).then(res => {
this.$message.success('派车成功') if (res.data.succ) {
} else { this.$message.success('派车成功')
this.$message.error(`派车失败,${res.data.msg}`) } 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() { CancelSendCar() {

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

Loading…
Cancel
Save