From 4e6ad64f34cc2065e4a0cfbd6bd33537ca4becd4 Mon Sep 17 00:00:00 2001 From: sjz-mxj <1375998991@qq.com> Date: Tue, 25 Apr 2023 18:44:36 +0800 Subject: [PATCH] =?UTF-8?q?type:refactor=20commit:=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/massif/info.vue | 18 +++++++++--------- pages/massif/plant_plan.vue | 6 +++--- pages/warehouse/info.vue | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pages/massif/info.vue b/pages/massif/info.vue index 065014d..3a64fad 100644 --- a/pages/massif/info.vue +++ b/pages/massif/info.vue @@ -32,9 +32,9 @@ import request from '@/common/request' return{ fields:{ plantBaseInfoId:{label:"基地名称",type:"select",columns:[[]],value:[],disabled:this.$store.getters['userInfo'].roleCode=="base_admin"}, - plotNumber:{label:"地块编号"}, plotName:{label:"地块名称"}, - drawArea:{label:"地块面积(亩)",type:'digit'}, + plotNumber:{label:"地块编号"}, + drawArea:{label:"勾画面积(亩)",disabled:true,type:'digit'}, realityArea:{label:"实际面积",type:'digit'}, image:{label:"地块图片",type:"upImg",num:3,value:''}, date:{label:"使用日期",type:"dateRange",value:[]}, @@ -57,19 +57,19 @@ import request from '@/common/request' }, rules:{ plantBaseInfoId:{required:true, message:"基地名称必填!", trigger:"change"}, - plotNumber:{required:true, message:"地块编号必填!", trigger:"blur"}, + // plotNumber:{required:false, message:"地块编号必填!", trigger:"blur"}, plotName:{required:true, message:"地块名称必填!", trigger:"blur"}, - drawArea:{required:true, type:'number', message:"地块面积必填!", trigger:"blur"}, + // drawArea:{required:true, type:'number', message:"!", trigger:"blur"}, realityArea:{required:true, type:'number', message:"实际面积必填!", trigger:"blur"}, image:{required:true, type:"array", min:1, validator:(rule,val,call)=>{ if(this.fields.image.value.length<=0)call(new Error('地块图片必选!')); else call() }, trigger:"change"}, - date:{required:true,validator:(rule,val,call)=>{ - if(!this.fields.date.value[0])call(new Error('请选择开始时间!')); - else if(!this.fields.date.value[1])call(new Error('请选择结束时间!')); - else call() - }, trigger:"change"} + // date:{required:true,validator:(rule,val,call)=>{ + // if(!this.fields.date.value[0])call(new Error('请选择开始时间!')); + // else if(!this.fields.date.value[1])call(new Error('请选择结束时间!')); + // else call() + // }, trigger:"change"} }, eventChannel:null, } diff --git a/pages/massif/plant_plan.vue b/pages/massif/plant_plan.vue index 135767c..da3d9f2 100644 --- a/pages/massif/plant_plan.vue +++ b/pages/massif/plant_plan.vue @@ -18,7 +18,7 @@ :key="k" v-bind="v" :field="k" - :required="!!rules[k]" + :required="!!rules[k]&&rules[k].required" :value="/^select$/.test(v.type)?fields[k].value:formData[k]" @select="fields[k].value=$event.map(v=>v.value);formData[k]=fields[k].value.at(-1)" @input="formData[k]=$event" @@ -76,8 +76,8 @@ export default { plantStandard: {required:true, message:"种植标准必填!", trigger:"blur"}, plantBatch: {required:true, message:"种植批次号必填!", trigger:"blur"}, principal: {required:true, message:"负责人必填!", trigger:"blur"}, - principalId: {required:true, validator(rule,val,call){ - if(!val)call(new Error("负责人身份证必填!")); + principalId: {required:false, validator(rule,val,call){ + if(!val)call(); else if(!/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(val))call(new Error("请输入正确身份证格式!")); else call(); }, trigger:"blur"}, diff --git a/pages/warehouse/info.vue b/pages/warehouse/info.vue index 79adf7b..40c4428 100644 --- a/pages/warehouse/info.vue +++ b/pages/warehouse/info.vue @@ -51,7 +51,7 @@ import request from '@/common/request.js' }, rules:{ warehouseName:{required:true, message:"仓库名称必填!", trigger:["blur","change"]}, - warehouseNo: {required:true, message:"种植编号必填!", trigger:"blur"}, + // warehouseNo: {required:true, message:"仓库编号必填!", trigger:"blur"}, warehouseAddress:{required:true, message:"仓库位置必填!", trigger:["blur","change"]}, warehouseVolume:{required:true, message:"仓库容量必填!", type:"number", trigger:["blur","change"]}, goodsType:{required:true, message:"存储物品类型必填!", trigger:["blur","change"]},