From 99edd5d43130b6c3757f7c9ac2e60ea7f40561b1 Mon Sep 17 00:00:00 2001 From: zhoulinf <2507241354@qq.com> Date: Fri, 11 Apr 2025 11:01:47 +0800 Subject: [PATCH] =?UTF-8?q?story#5314=20=E4=BA=8C=E6=89=8B=E8=BD=A6?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E4=BC=98=E5=8C=96=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/secondHandCar/carSource.vue | 36 +++++++++++++++++++-------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/src/views/secondHandCar/carSource.vue b/src/views/secondHandCar/carSource.vue index 40b2a8d9..2b0c2dc8 100644 --- a/src/views/secondHandCar/carSource.vue +++ b/src/views/secondHandCar/carSource.vue @@ -401,17 +401,21 @@ export default { }else if(this.form.vehicleType !=='平板拖车'){ this.form.boardType='' } - let _validationRules; - if( type === 0 ) { - _validationRules = this.validationRules.filter(item => item.name != '底盘品牌不能为空') - } else { - _validationRules = this.validationRules - } - let rule = _validationRules.find(item => - item.value === null || - item.value === undefined || - item.value === '' - ) + let rule + if( type == 1 ) { + rule = this.validationRules.find(item => + item.value === null || + item.value === undefined || + item.value === '' + ) + } else { + rule = this.validationRulesSimple.find(item => + item.value === null || + item.value === undefined || + item.value === '' + ) + } + if(rule){ this.$toast(rule.name) return @@ -526,6 +530,16 @@ export default { { value: this.form.underpanBrand, name: '底盘品牌不能为空' }, ]; }, + validationRulesSimple() { + return [ + { value: this.form.vehicleType, name: '车辆类型不能为空' }, + { value: this.form.emissionStandard, name: '排放标准不能为空' }, + { value: this.form.areaCode, name: '所在城市不能为空' }, + { value: this.form.mileage, name: '行驶里程不能为空' }, + { value: this.form.contactNumber, name: '联系方式不能为空' }, + { value: this.form.minPrice, name: '售价不能为空' }, + ]; + }, }, }