|
|
|
@ -55,10 +55,18 @@
|
|
|
|
|
<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="FnSubmit">
|
|
|
|
|
<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>
|
|
|
|
|
<div v-if="type == 'Edit'" class="nav" @click="FnCancel">
|
|
|
|
|
<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>
|
|
|
|
|
<div v-if="type == 'Edit' && BookingId" class="nav" @click="FnDelete">
|
|
|
|
@ -159,7 +167,7 @@
|
|
|
|
|
<p class="CsFormTitle">
|
|
|
|
|
<span><i class="iconfont icon-shiyongwendang"></i>派车通知详细信息</span>
|
|
|
|
|
</p>
|
|
|
|
|
<a-row v-if="type == 'Edit'">
|
|
|
|
|
<a-row v-if="taskPKId">
|
|
|
|
|
<a-col :span="5">
|
|
|
|
|
<a-form-item label="船名:" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input v-decorator="['vessel']" disabled />
|
|
|
|
@ -485,7 +493,12 @@ import {
|
|
|
|
|
BookingTruckCancel,
|
|
|
|
|
BookingTruckGetTruckListByBooking,
|
|
|
|
|
apibookingtruck,
|
|
|
|
|
BookingTruckPullInBookingOrderConta
|
|
|
|
|
BookingTruckPullInBookingOrderConta,
|
|
|
|
|
TaskManageTruckGetInfoByTaskId,
|
|
|
|
|
TaskManageTruckSave,
|
|
|
|
|
TaskManageTruckPrint,
|
|
|
|
|
TaskManageTruckCancelDispatch,
|
|
|
|
|
TaskManageTruckSendDispatchBatch
|
|
|
|
|
} from '@/api/modular/main/SendCar'
|
|
|
|
|
import { GetCtn } from '@/api/modular/main/BookingLedger'
|
|
|
|
|
import { GetSysUserPage } from '@/api/modular/main/BookingLedger'
|
|
|
|
@ -606,7 +619,8 @@ export default {
|
|
|
|
|
if (
|
|
|
|
|
this.id == this.$route.query.id &&
|
|
|
|
|
this.type == this.$route.query.type &&
|
|
|
|
|
this.BookingId == this.$route.query.BookingId
|
|
|
|
|
this.BookingId == this.$route.query.BookingId &&
|
|
|
|
|
this.taskPKId == this.$route.query.taskPKId
|
|
|
|
|
) {
|
|
|
|
|
console.log(
|
|
|
|
|
this.id,
|
|
|
|
@ -617,6 +631,7 @@ export default {
|
|
|
|
|
this.$route.query.BookingId
|
|
|
|
|
)
|
|
|
|
|
} else {
|
|
|
|
|
this.taskPKId = this.$route.query.taskPKId
|
|
|
|
|
this.id = this.$route.query.id
|
|
|
|
|
this.type = this.$route.query.type
|
|
|
|
|
this.BookingId = this.$route.query.BookingId
|
|
|
|
@ -628,6 +643,26 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
mounted() {},
|
|
|
|
|
methods: {
|
|
|
|
|
// 调度派车
|
|
|
|
|
FnSendCar() {
|
|
|
|
|
TaskManageTruckSendDispatchBatch([this.WebData.pK_ID]).then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('派车成功')
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`派车失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 调度取消派车
|
|
|
|
|
CancelSendCar() {
|
|
|
|
|
TaskManageTruckCancelDispatch({ pkId: this.WebData.pK_ID }).then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('取消成功')
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`取消失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
FnDelete() {
|
|
|
|
|
apibookingtruck(this.WebData.id).then(res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
@ -694,6 +729,15 @@ export default {
|
|
|
|
|
return Rdata
|
|
|
|
|
},
|
|
|
|
|
FnPrint() {
|
|
|
|
|
if (this.taskPKId) {
|
|
|
|
|
TaskManageTruckPrint({ pkId: this.WebData.pK_ID }).then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('打印成功')
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`打印失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
BookingTruckPrint({ id: this.WebData.id }).then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('打印成功')
|
|
|
|
@ -701,6 +745,7 @@ export default {
|
|
|
|
|
this.$message.error(`打印失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
FnCancel() {
|
|
|
|
|
BookingTruckCancel({ id: this.WebData.id }).then(res => {
|
|
|
|
@ -747,8 +792,46 @@ export default {
|
|
|
|
|
if (this.BookingId && this.type == 'Edit') {
|
|
|
|
|
BookingTruckGetTruckListByBooking({ bookingId: this.BookingId }).then(res => {
|
|
|
|
|
this.Bookingdata = res.data
|
|
|
|
|
if (res.data.length) {
|
|
|
|
|
this.$refs.xTable1.setRadioRow(res.data[0])
|
|
|
|
|
this.SData(res.data[0].id)
|
|
|
|
|
} else {
|
|
|
|
|
this.type = 'Add'
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else if (this.taskPKId) {
|
|
|
|
|
TaskManageTruckGetInfoByTaskId({ taskPkId: this.taskPKId })
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
if (res.data.ext.contaList) {
|
|
|
|
|
res.data.ext.contaList.forEach((item, index) => {
|
|
|
|
|
item.WebKey = index + 1
|
|
|
|
|
})
|
|
|
|
|
this.ContactsData = res.data.ext.contaList
|
|
|
|
|
}
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.form.setFieldsValue({ ...res.data.ext })
|
|
|
|
|
this.WebData = res.data.ext
|
|
|
|
|
this.ChangetruckId(res.data.ext.truckId)
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.Changeattn(res.data.ext.attn)
|
|
|
|
|
}, 110)
|
|
|
|
|
this.Changeyardid(res.data.ext.yardid)
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.Changeyardcontract(res.data.ext.yardcontract)
|
|
|
|
|
}, 110)
|
|
|
|
|
this.ChangeinYardID(res.data.ext.inYardID)
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.ChangeinYardContact(res.data.ext.inYardContact)
|
|
|
|
|
}, 110)
|
|
|
|
|
}, 100)
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -770,27 +853,6 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
if (this.type == 'Edit' && this.id) {
|
|
|
|
|
this.SData(this.id)
|
|
|
|
|
// BookingTruckGetInfo({ id: this.id }).then(res => {
|
|
|
|
|
// if (res.data.ext.contaList) {
|
|
|
|
|
// this.ContactsData = res.data.ext.contaList
|
|
|
|
|
// }
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// this.form.setFieldsValue({ ...res.data.ext })
|
|
|
|
|
// this.WebData = res.data.ext
|
|
|
|
|
// this.ChangetruckId(res.data.ext.truckId)
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// this.Changeattn(res.data.ext.attn)
|
|
|
|
|
// }, 110)
|
|
|
|
|
// this.Changeyardid(res.data.ext.yardid)
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// this.Changeyardcontract(res.data.ext.yardcontract)
|
|
|
|
|
// }, 110)
|
|
|
|
|
// this.ChangeinYardID(res.data.ext.inYardID)
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// this.ChangeinYardContact(res.data.ext.inYardContact)
|
|
|
|
|
// }, 110)
|
|
|
|
|
// }, 100)
|
|
|
|
|
// })
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
FnRctncode(value) {
|
|
|
|
@ -952,7 +1014,7 @@ export default {
|
|
|
|
|
/**
|
|
|
|
|
* 提交表单
|
|
|
|
|
*/
|
|
|
|
|
handleSubmit(WebType) {
|
|
|
|
|
handleSubmit() {
|
|
|
|
|
const {
|
|
|
|
|
form: { validateFields }
|
|
|
|
|
} = this
|
|
|
|
@ -961,6 +1023,31 @@ export default {
|
|
|
|
|
validateFields((errors, values) => {
|
|
|
|
|
if (!errors) {
|
|
|
|
|
values.contaList = this.ContactsData
|
|
|
|
|
if (this.taskPKId) {
|
|
|
|
|
values.pK_ID = this.WebData.pK_ID
|
|
|
|
|
TaskManageTruckSave({ ...values })
|
|
|
|
|
.then(res => {
|
|
|
|
|
console.log(res.data)
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('保存成功')
|
|
|
|
|
// if (this.type == 'Add' && !this.BookingId) {
|
|
|
|
|
// this.type = 'Edit'
|
|
|
|
|
// this.id = res.data.ext
|
|
|
|
|
// } else if (this.type == 'Add' && this.BookingId) {
|
|
|
|
|
// this.type = 'Edit'
|
|
|
|
|
// }
|
|
|
|
|
this.init()
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`保存失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.init()
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
if (this.type == 'Edit') {
|
|
|
|
|
values.id = this.WebData.id
|
|
|
|
|
}
|
|
|
|
@ -988,6 +1075,7 @@ export default {
|
|
|
|
|
this.init()
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
}
|
|
|
|
|