From affe57159d10db5c1321202bdeb3ff8cab982727 Mon Sep 17 00:00:00 2001 From: zhouxueli <2841188632@qq.com> Date: Mon, 17 Mar 2025 16:53:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E6=89=8B=E8=BD=A6=E4=BA=A4=E6=98=93?= =?UTF-8?q?=EF=BC=8C=E5=BF=85=E5=A1=AB=E9=A1=B9=E5=9B=9E=E5=88=B0=E5=8E=9F?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/secondHandCar/carSource.vue | 58 ++++++++++++++++++--------- src/views/secondHandCar/wantBuy.vue | 32 ++++++++++----- 2 files changed, 61 insertions(+), 29 deletions(-) diff --git a/src/views/secondHandCar/carSource.vue b/src/views/secondHandCar/carSource.vue index 3a0f0611..18660cca 100644 --- a/src/views/secondHandCar/carSource.vue +++ b/src/views/secondHandCar/carSource.vue @@ -312,24 +312,6 @@ export default { this.$toast('请填写不通过原因') return } - await this.commonMethods(); - try { - await auditCarInfo({ - id: this.id, - auditResult: type ? 1 : 0 , - auditReason: this.auditReason, - ...this.form, - otherPhoto:this.otherImgSrc?.join(',') - }) - this.clearStorageFormInfo() - setTimeout(()=>{ - this.closeParentDialog() - },1000) - } finally { - console.log(type) - } - }, - commonMethods(){ if (!this.form.vehicleLicensePhoto) { this.$toast('行驶证不能为空') return @@ -354,6 +336,21 @@ export default { this.$toast(rule.name) return } + try { + await auditCarInfo({ + id: this.id, + auditResult: type ? 1 : 0 , + auditReason: this.auditReason, + ...this.form, + otherPhoto:this.otherImgSrc?.join(',') + }) + this.clearStorageFormInfo() + setTimeout(()=>{ + this.closeParentDialog() + },1000) + } finally { + console.log(type) + } }, // 发布车源 async submitHandle(){ @@ -361,7 +358,30 @@ export default { this.$toast('请勾选我已阅读并同意') return } - await this.commonMethods(); + if (!this.form.vehicleLicensePhoto) { + this.$toast('行驶证不能为空') + return + } + if (!this.form.vehicleAnglePhoto) { + this.$toast('车辆45度不能为空') + return + } + let flag=this.validateHandle() + if(flag){ + this.$toast(flag) + return + } + if (this.form.vehicleType=='拖车' && !this.form.boardType) { + this.$toast('落板方式不能为空') + return + }else if(this.form.vehicleType !=='拖车'){ + this.form.boardType='' + } + let rule=this.validationRules.find(item=>!item.value) + if(rule){ + this.$toast(rule.name) + return + } try { let res = await publishCarInfo({ ...this.form, diff --git a/src/views/secondHandCar/wantBuy.vue b/src/views/secondHandCar/wantBuy.vue index 4b0b0a4b..37328c45 100644 --- a/src/views/secondHandCar/wantBuy.vue +++ b/src/views/secondHandCar/wantBuy.vue @@ -194,7 +194,22 @@ export default { this.$toast('请填写不通过原因') return } - await this.commonMethods() + let flag=this.validateHandle() + if(flag){ + this.$toast(flag) + return + } + if (this.form.vehicleType=='拖车' && !this.form.boardType) { + this.$toast('落板方式不能为空') + return + }else if(this.form.vehicleType !=='拖车'){ + this.form.boardType='' + } + let rule=this.validationRules.find(item=>!item.value) + if(rule){ + this.$toast(rule.name) + return + } try { await auditCarInfo({ id: this.id, @@ -215,7 +230,12 @@ export default { } }, - commonMethods() { + // 发布求购 + async submitHandle(){ + if (!this.radio) { + this.$toast('请勾选我已阅读并同意') + return + } let flag=this.validateHandle() if(flag){ this.$toast(flag) @@ -232,14 +252,6 @@ export default { this.$toast(rule.name) return } - }, - // 发布求购 - async submitHandle(){ - if (!this.radio) { - this.$toast('请勾选我已阅读并同意') - return - } - await this.commonMethods() try { let res = await publishCarInfo({ ...this.form,