From e4cbe0c286bdc60601238fbcac2391a8b2fcd8c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <963808678@qq.com> Date: Mon, 24 Apr 2023 17:52:50 +0800 Subject: [PATCH] 4/24 --- src/views/main/SendCar/addForm.vue | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/views/main/SendCar/addForm.vue b/src/views/main/SendCar/addForm.vue index 9ed7b6b..9cfd402 100644 --- a/src/views/main/SendCar/addForm.vue +++ b/src/views/main/SendCar/addForm.vue @@ -1273,23 +1273,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 +1295,9 @@ export default { // } else if (this.type == 'Add' && this.BookingId) { // this.type = 'Edit' // } - this.init() + if (this.type == 'Add') { + this.init() + } } else { this.$message.error(`保存失败,${res.data.msg}`) } @@ -1319,6 +1318,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 +1328,10 @@ export default { } else if (this.type == 'Add' && this.BookingId) { this.type = 'Edit' } - this.init() + console.log(type) + if (type == 'Add') { + this.init() + } } else { this.$message.error(`保存失败,${res.data.msg}`) }