From 8dc907e992bb0f0c9ce4903dea33b84daefa9418 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Sat, 16 Nov 2024 12:56:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A1=A5=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/base/carmain/CarMainForm.vue | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/views/base/carmain/CarMainForm.vue b/src/views/base/carmain/CarMainForm.vue index fd64ad0..d257646 100644 --- a/src/views/base/carmain/CarMainForm.vue +++ b/src/views/base/carmain/CarMainForm.vue @@ -33,7 +33,7 @@ - + @@ -113,7 +113,9 @@ - 计算 + + 计算 + @@ -205,7 +207,7 @@ export default { nextMaintenanceMileage: undefined, carModel: undefined }, - buttonLoading:false, + buttonLoading: false, // 表单校验 formRules: { engineNumber: [{required: true, message: '发动机号码不能为空', trigger: 'blur'}], @@ -221,9 +223,13 @@ export default { }, methods: { /**计算车辆信息*/ - async compute(){ + async compute() { this.buttonLoading = true - try{ + try { + const brand = this.formData.brandAndModel + if (typeof brand === 'string'){ + this.formData.brandAndModel = [brand, this.formData?.carModel] + } const data = this.formData; debugger const res = await CarMainApi.compute(data); @@ -259,7 +265,10 @@ export default { async submitForm() { // 校验主表 // await this.$refs["formRef"].validate(); - this.formData.brandAndModel = [this.formData?.brandAndModel, this.formData?.carModel] + const brand = this.formData.brandAndModel + if (typeof brand === 'string'){ + this.formData.brandAndModel = [brand, this.formData?.carModel] + } this.formLoading = true; try { const data = this.formData;