|
|
|
@ -951,6 +951,7 @@ export default {
|
|
|
|
|
this.form = this.$form.createForm(this)
|
|
|
|
|
if (this.BookingId) {
|
|
|
|
|
BookingTruckInitFromBookingOrder({ bookingId: this.BookingId }).then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
console.log(res, 'BookingTruckInitFromBookingOrder')
|
|
|
|
|
this.form.setFieldsValue({ ...res.data.ext })
|
|
|
|
|
if (res.data.ext.contaList) {
|
|
|
|
@ -959,6 +960,9 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
this.ContactsData = res.data.ext.contaList
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1273,23 +1277,20 @@ export default {
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
handleSubmit() {
|
|
|
|
|
console.log(1)
|
|
|
|
|
const {
|
|
|
|
|
form: { validateFields }
|
|
|
|
|
} = this
|
|
|
|
|
this.confirmLoading = true
|
|
|
|
|
console.log(2)
|
|
|
|
|
|
|
|
|
|
validateFields((errors, values) => {
|
|
|
|
|
if (!errors) {
|
|
|
|
|
console.log(3)
|
|
|
|
|
values.contaList = this.ContactsData
|
|
|
|
|
values = this.FnCompleteName(values)
|
|
|
|
|
console.log(this.taskPKId)
|
|
|
|
|
|
|
|
|
|
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) {
|
|
|
|
@ -1298,7 +1299,9 @@ export default {
|
|
|
|
|
// } else if (this.type == 'Add' && this.BookingId) {
|
|
|
|
|
// this.type = 'Edit'
|
|
|
|
|
// }
|
|
|
|
|
if (this.type == 'Add') {
|
|
|
|
|
this.init()
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`保存失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
@ -1319,6 +1322,8 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
BookingTruckSave({ ...values })
|
|
|
|
|
.then(res => {
|
|
|
|
|
let type = this.type
|
|
|
|
|
console.log(type)
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('保存成功')
|
|
|
|
|
if (this.type == 'Add' && !this.BookingId) {
|
|
|
|
@ -1327,7 +1332,10 @@ export default {
|
|
|
|
|
} else if (this.type == 'Add' && this.BookingId) {
|
|
|
|
|
this.type = 'Edit'
|
|
|
|
|
}
|
|
|
|
|
console.log(type)
|
|
|
|
|
if (type == 'Add') {
|
|
|
|
|
this.init()
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`保存失败,${res.data.msg}`)
|
|
|
|
|
}
|
|
|
|
|