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,