|
|
|
@ -49,27 +49,60 @@
|
|
|
|
|
<a-row type="flex" :gutter="16">
|
|
|
|
|
<a-col>
|
|
|
|
|
<div class="nav-box">
|
|
|
|
|
<div v-if="type == 'Edit'" class="nav" @click="FnPrint"><i class="iconfont icon-printing"></i>打印</div>
|
|
|
|
|
<div v-if="type == 'Add' || 'Edit'" class="nav" @click="handleSubmit">
|
|
|
|
|
<i class="iconfont icon-icon_baocun"></i>保存
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="type == 'Edit'" class="nav" @click="FnPrint"><i class="iconfont icon-printing"></i>预览</div>
|
|
|
|
|
<!-- <div v-if="type == 'Add' || 'Edit'" class="nav" @click="handleSubmit">
|
|
|
|
|
<i class="iconfont icon-icon_baocun"></i>
|
|
|
|
|
</div> -->
|
|
|
|
|
<!-- <div v-if="taskPKId" class="nav" @click="handleSubmit">
|
|
|
|
|
<i class="iconfont icon-icon_baocun"></i>分拆派车
|
|
|
|
|
</div> -->
|
|
|
|
|
<div v-if="type == 'Edit' && !taskPKId" class="nav" @click="FnSubmit">
|
|
|
|
|
<i class="iconfont icon-yunshu1"></i>提交派车
|
|
|
|
|
<div style="display: inline-block;margin-right: 10px;" v-if="type == 'Add' || 'Edit' && !taskPKId">
|
|
|
|
|
<div style="padding: 0px;margin-right: 0px;" class="nav" @click="FnSubmit">
|
|
|
|
|
<i class="iconfont icon-yunshu1"></i>保存并提交
|
|
|
|
|
</div>
|
|
|
|
|
<a-dropdown>
|
|
|
|
|
<a-icon style="margin-left: 5px;font-size: 12px;" type="down" />
|
|
|
|
|
<a-menu slot="overlay">
|
|
|
|
|
<a-menu-item>
|
|
|
|
|
<div @click="handleSubmit">保存</div>
|
|
|
|
|
</a-menu-item>
|
|
|
|
|
</a-menu>
|
|
|
|
|
</a-dropdown>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="taskPKId" class="nav" @click="FnSendCar"><i class="iconfont icon-icon_baocun"></i>派车</div>
|
|
|
|
|
<div style="display: inline-block;" v-if="taskPKId">
|
|
|
|
|
<div style="padding: 0px;margin-right: 0px;" class="nav" @click="FnSendCar">
|
|
|
|
|
<i class="iconfont icon-icon_baocun"></i>保存并派车
|
|
|
|
|
</div>
|
|
|
|
|
<a-dropdown>
|
|
|
|
|
<a-icon style="margin-left: 5px;font-size: 12px;" type="down" />
|
|
|
|
|
<a-menu slot="overlay">
|
|
|
|
|
<a-menu-item>
|
|
|
|
|
<div @click="handleSubmit">保存</div>
|
|
|
|
|
</a-menu-item>
|
|
|
|
|
</a-menu>
|
|
|
|
|
</a-dropdown>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div v-if="taskPKId" class="nav" @click="FnSendCar"><i class="iconfont icon-icon_baocun"></i>保存并派车</div> -->
|
|
|
|
|
<!-- <div v-if="taskPKId" class="nav" @click="handleSubmit"><i class="iconfont icon-icon_baocun"></i>发单</div> -->
|
|
|
|
|
<div v-if="taskPKId" class="nav" @click="CancelSendCar">
|
|
|
|
|
<i class="iconfont icon-icon_baocun"></i>取消派车
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="type == 'Edit' && !taskPKId" class="nav" @click="FnCancel">
|
|
|
|
|
<i class="iconfont icon-shanchu1"></i>撤销派车
|
|
|
|
|
<div style="display: inline-block;" v-if="type == 'Edit' && !taskPKId">
|
|
|
|
|
<div style="padding: 0px;margin-right: 0px;" class="nav" @click="FnCancel">
|
|
|
|
|
<i class="iconfont icon-yunshu1"></i>撤销并删除
|
|
|
|
|
</div>
|
|
|
|
|
<a-dropdown>
|
|
|
|
|
<a-icon style="margin-left: 5px;font-size: 12px;" type="down" />
|
|
|
|
|
<a-menu slot="overlay">
|
|
|
|
|
<a-menu-item>
|
|
|
|
|
<div @click="FnDelete">删除</div>
|
|
|
|
|
</a-menu-item>
|
|
|
|
|
</a-menu>
|
|
|
|
|
</a-dropdown>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="type == 'Edit' && BookingId" class="nav" @click="FnDelete">
|
|
|
|
|
<!-- <div v-if="type == 'Edit' && BookingId" class="nav" @click="FnDelete">
|
|
|
|
|
<i class="iconfont icon-shanchu1"></i>删除
|
|
|
|
|
</div>
|
|
|
|
|
</div> -->
|
|
|
|
|
</div>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
@ -322,7 +355,7 @@
|
|
|
|
|
{{ item.shortName }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
<a v-if="addrList.length>0" @click="addrsFlag=true">地址</a>
|
|
|
|
|
<a v-if="addrList.length > 0" @click="addrsFlag = true">地址</a>
|
|
|
|
|
</div>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
@ -340,7 +373,10 @@
|
|
|
|
|
sm: { span: 17 }
|
|
|
|
|
}"
|
|
|
|
|
has-feedback>
|
|
|
|
|
<a-textarea style="line-height: 22px;height: 150px;" :auto-size="{ minRows: 3, maxRows: 5 }" v-decorator="['factoryAddr']" />
|
|
|
|
|
<a-textarea
|
|
|
|
|
style="line-height: 22px;height: 150px;"
|
|
|
|
|
:auto-size="{ minRows: 3, maxRows: 5 }"
|
|
|
|
|
v-decorator="['factoryAddr']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="11">
|
|
|
|
@ -355,7 +391,10 @@
|
|
|
|
|
sm: { span: 19 }
|
|
|
|
|
}"
|
|
|
|
|
has-feedback>
|
|
|
|
|
<a-textarea style="line-height: 22px;height: 150px;" :auto-size="{ minRows: 3, maxRows: 5 }" v-decorator="['remark']" />
|
|
|
|
|
<a-textarea
|
|
|
|
|
style="line-height: 22px;height: 150px;"
|
|
|
|
|
:auto-size="{ minRows: 3, maxRows: 5 }"
|
|
|
|
|
v-decorator="['remark']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
@ -606,7 +645,11 @@
|
|
|
|
|
</a-modal>
|
|
|
|
|
<a-modal :footer="null" width="1000px" :maskClosable="false" v-model="addrsFlag" title="选择地址">
|
|
|
|
|
<a-button @click="addSelectAddress" style="color: white;" type="primary">添加勾选地址</a-button>
|
|
|
|
|
<a-table :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :pagination="false" :columns="columns" :data-source="addrList">
|
|
|
|
|
<a-table
|
|
|
|
|
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
|
|
|
:pagination="false"
|
|
|
|
|
:columns="columns"
|
|
|
|
|
:data-source="addrList">
|
|
|
|
|
<template slot="action" slot-scope="text,record">
|
|
|
|
|
<span>
|
|
|
|
|
<a @click="handleSelect(record)">选择</a>
|
|
|
|
@ -850,21 +893,21 @@ export default {
|
|
|
|
|
ChangeFactory(e, option) {
|
|
|
|
|
if (e !== undefined) {
|
|
|
|
|
this.inFactory.forEach(item => {
|
|
|
|
|
if (item.id == option.key) {
|
|
|
|
|
if (item.addrs && item.addrs.length > 0) {
|
|
|
|
|
this.addrsFlag = true
|
|
|
|
|
this.addrList = item.addrs
|
|
|
|
|
} else {
|
|
|
|
|
const chief = item.chief ? item.chief : ''
|
|
|
|
|
const fullNameEN = item.fullNameEN ? item.fullNameEN : ''
|
|
|
|
|
const addr = item.addr ? item.addr : ''
|
|
|
|
|
const tel = item.tel ? item.tel : ''
|
|
|
|
|
this.addrList = []
|
|
|
|
|
this.form.setFieldsValue({ factoryAddr: fullNameEN + addr })
|
|
|
|
|
this.form.setFieldsValue({ factoryContact: chief + tel })
|
|
|
|
|
if (item.id == option.key) {
|
|
|
|
|
if (item.addrs && item.addrs.length > 0) {
|
|
|
|
|
this.addrsFlag = true
|
|
|
|
|
this.addrList = item.addrs
|
|
|
|
|
} else {
|
|
|
|
|
const chief = item.chief ? item.chief : ''
|
|
|
|
|
const fullNameEN = item.fullNameEN ? item.fullNameEN : ''
|
|
|
|
|
const addr = item.addr ? item.addr : ''
|
|
|
|
|
const tel = item.tel ? item.tel : ''
|
|
|
|
|
this.addrList = []
|
|
|
|
|
this.form.setFieldsValue({ factoryAddr: fullNameEN + addr })
|
|
|
|
|
this.form.setFieldsValue({ factoryContact: chief + tel })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleSelect(row) {
|
|
|
|
@ -883,13 +926,23 @@ export default {
|
|
|
|
|
TaskManageTruckPrintTemplateWithHistoryList(Data).then((res) => {
|
|
|
|
|
this.templateType = res.data
|
|
|
|
|
this.spinning = false
|
|
|
|
|
this.PrintModalVisible = true
|
|
|
|
|
if (this.templateType.length > 1) {
|
|
|
|
|
this.PrintModalVisible = true
|
|
|
|
|
}
|
|
|
|
|
if (this.templateType.length == 1) {
|
|
|
|
|
this.FnCilckTemplateType(this.templateType[0].id)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
BookingTruckPrintTemplateWithHistoryList(Data).then((res) => {
|
|
|
|
|
this.templateType = res.data
|
|
|
|
|
this.spinning = false
|
|
|
|
|
this.PrintModalVisible = true
|
|
|
|
|
if (this.templateType.length > 1) {
|
|
|
|
|
this.PrintModalVisible = true
|
|
|
|
|
}
|
|
|
|
|
if (this.templateType.length == 1) {
|
|
|
|
|
this.FnCilckTemplateType(this.templateType[0].id)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@ -946,31 +999,47 @@ export default {
|
|
|
|
|
// 调度派车
|
|
|
|
|
FnSendCar() {
|
|
|
|
|
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}`)
|
|
|
|
|
const {
|
|
|
|
|
form: { validateFields }
|
|
|
|
|
} = this
|
|
|
|
|
validateFields((errors, values) => {
|
|
|
|
|
if (!errors) {
|
|
|
|
|
values.contaList = this.ContactsData
|
|
|
|
|
values = this.FnCompleteName(values)
|
|
|
|
|
values.pK_ID = this.WebData.pK_ID
|
|
|
|
|
this.confirmLoading = true
|
|
|
|
|
TaskManageTruckSendDispatch({ ...values }).then((res) => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('派车成功')
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`派车失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.confirmLoading = true
|
|
|
|
|
TaskManageTruckSendDispatchBatch([this.WebData.pK_ID]).then((res) => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('派车成功')
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`派车失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 调度取消派车
|
|
|
|
|
CancelSendCar() {
|
|
|
|
|
this.confirmLoading = true
|
|
|
|
|
TaskManageTruckCancelDispatch({ pkId: this.WebData.pK_ID }).then((res) => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('取消成功')
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`取消失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
FnDelete() {
|
|
|
|
@ -1055,12 +1124,15 @@ export default {
|
|
|
|
|
this.GetPrintData('truckBill', printType)
|
|
|
|
|
},
|
|
|
|
|
FnCancel() {
|
|
|
|
|
BookingTruckCancel({ id: this.WebData.id }).then((res) => {
|
|
|
|
|
this.confirmLoading = true
|
|
|
|
|
BookingTruckCancel({ id: this.WebData.id, isAfterDelete: true }).then((res) => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('撤销成功')
|
|
|
|
|
this.$message.success('操作成功')
|
|
|
|
|
this.init()
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`撤销失败,${res.data.msg}`)
|
|
|
|
|
this.$message.error(`操作失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
addSelectAddress() {
|
|
|
|
@ -1097,11 +1169,21 @@ export default {
|
|
|
|
|
if (this.type == 'Edit') {
|
|
|
|
|
values.id = this.WebData.id
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
values.bookingId = this.BookingId
|
|
|
|
|
BookingTruckSubmit({ ...values })
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('提交成功')
|
|
|
|
|
const type = this.type
|
|
|
|
|
if (this.type == 'Add' && !this.BookingId) {
|
|
|
|
|
this.type = 'Edit'
|
|
|
|
|
this.id = res.data.ext
|
|
|
|
|
} else if (this.type == 'Add' && this.BookingId) {
|
|
|
|
|
this.type = 'Edit'
|
|
|
|
|
}
|
|
|
|
|
if (type == 'Add') {
|
|
|
|
|
this.init()
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`提交失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|