szh_zidingyibiaoti
张同海 2 years ago
parent 0a103c18e4
commit ad54c86462

@ -129,6 +129,56 @@ export function BookingTruckPullInBookingOrderConta(parameter) {
params: parameter
})
}
/**
* 通过任务主键获取派车详情
*/
export function TaskManageTruckGetInfoByTaskId(parameter) {
return axios({
url: '/TaskManageTruck/GetInfoByTaskId',
method: 'get',
params: parameter
})
}
/**
* 保存派车
*/
export function TaskManageTruckSave(parameter) {
return axios({
url: '/TaskManageTruck/Save',
method: 'post',
data: parameter
})
}
/**
* 打印派车
*/
export function TaskManageTruckPrint(parameter) {
return axios({
url: '/TaskManageTruck/Print',
method: 'get',
params: parameter
})
}
/**
* 取消派车
*/
export function TaskManageTruckCancelDispatch(parameter) {
return axios({
url: '/TaskManageTruck/CancelDispatch',
method: 'get',
params: parameter
})
}
/**
* 批量派车
*/
export function TaskManageTruckSendDispatchBatch(parameter) {
return axios({
url: '/TaskManageTruck/SendDispatchBatch',
method: 'post',
data: parameter
})
}
/**
* 添加订舱模板
*

@ -873,17 +873,13 @@ export default {
FnGoSendCar() {
BookingTruckGetTruckListByBooking({ bookingId: this.id }).then(res => {
console.log(res)
if (res.data.length) {
this.$router.push({
name: 'SendCarAdd',
query: {
type: 'Edit',
BookingId: this.id
}
})
} else {
this.$message.error('暂无派车数据')
}
this.$router.push({
name: 'SendCarAdd',
query: {
type: 'Edit',
BookingId: this.id
}
})
})
},
// ========== OCR ==========

@ -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,13 +729,23 @@ export default {
return Rdata
},
FnPrint() {
BookingTruckPrint({ id: this.WebData.id }).then(res => {
if (res.data.succ) {
this.$message.success('打印成功')
} else {
this.$message.error(`打印失败,${res.data.msg}`)
}
})
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('打印成功')
} else {
this.$message.error(`打印失败,${res.data.msg}`)
}
})
}
},
FnCancel() {
BookingTruckCancel({ id: this.WebData.id }).then(res => {
@ -747,9 +792,47 @@ export default {
if (this.BookingId && this.type == 'Edit') {
BookingTruckGetTruckListByBooking({ bookingId: this.BookingId }).then(res => {
this.Bookingdata = res.data
this.$refs.xTable1.setRadioRow(res.data[0])
this.SData(res.data[0].id)
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
})
}
// this.$data = this.$options.data()
@ -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,33 +1023,59 @@ export default {
validateFields((errors, values) => {
if (!errors) {
values.contaList = this.ContactsData
if (this.type == 'Edit') {
values.id = this.WebData.id
}
if (this.type == 'Add' && this.BookingId) {
values.bookingId = this.BookingId
}
BookingTruckSave({ ...values })
.then(res => {
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'
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()
} else {
this.$message.error(`保存失败,${res.data.msg}`)
}
this.confirmLoading = false
})
} else {
if (this.type == 'Edit') {
values.id = this.WebData.id
}
if (this.type == 'Add' && this.BookingId) {
values.bookingId = this.BookingId
}
BookingTruckSave({ ...values })
.then(res => {
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
})
this.confirmLoading = false
})
.catch(() => {
this.init()
this.confirmLoading = false
})
}
} else {
this.confirmLoading = false
}

@ -913,7 +913,8 @@ export default {
this.$router.push({
name: 'SendCarAdd',
query: {
type: 'Edit'
type: 'Edit',
taskPKId: data.pkId
}
})
} else {

Loading…
Cancel
Save