From bee8c6d4f4337a92e2c1012f67ef158dc46e14f6 Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Fri, 3 Mar 2023 18:11:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E8=B0=83=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=99=AB=E5=AE=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/massif/add_farming.vue | 2 +- pages/massif/pestRecord.vue | 19 ++-- pages/massif/pestType.vue | 107 ++++++++++++------ .../d-form/components/d-form/d-form.vue | 21 ++-- 4 files changed, 98 insertions(+), 51 deletions(-) diff --git a/pages/massif/add_farming.vue b/pages/massif/add_farming.vue index 3943dd2..539a4ae 100644 --- a/pages/massif/add_farming.vue +++ b/pages/massif/add_farming.vue @@ -208,7 +208,7 @@ 操作 病虫害记录 - 过程:{{formData.farmPests.growthProcessLabel}},病虫害部位:{{formData.farmPests.pestSite}},症状:{{formData.farmPests.symptomLabel}}({{formData.farmPests.pestName.map(v=>v.name).join(',')}}) + 过程:{{formData.farmPests.growthProcess}},病虫害部位:{{formData.farmPests.pestSite}},症状:{{formData.farmPests.symptom}}({{formData.farmPests.pestName.map(v=>v.name).join(',')}}) diff --git a/pages/massif/pestRecord.vue b/pages/massif/pestRecord.vue index b9fc1ae..224755d 100644 --- a/pages/massif/pestRecord.vue +++ b/pages/massif/pestRecord.vue @@ -14,10 +14,10 @@ :field="k" v-bind="v" :required="!!rules[k]" - :value="/^checkBox$|^navigate$/.test(v.type)?fields[k].value:formData[k]" + :value="/^select$|^checkBox$|^navigate$/.test(v.type)?fields[k].value:formData[k]" @input="formData[k]=$event" @checkBox="fields[k].value=$event;formData[k]=$event.join(',')" - @select="formData[k]=$event[0].value;fields[k].value=$event[0].label" + @select="formData[k]=$event[0].value;fields[k].value=[formData[k]]" @imgs="fields[k].value=$event"/> @@ -32,8 +32,9 @@ export default { pestSite:{label:"病虫害部位",type:"checkBox",value:[],columns:[{label:"根",value:"根"},{label:"茎",value:"茎"},{label:"叶",value:"叶"}]}, growthProcess:{label:"作物生长过程",type:"select-tab",dictCode:"growth_process"}, symptom:{label:"显著症状",type:"select-tab",dictCode:"symptom"}, - pestName:{label:"害虫名称",type:"navigate",value:"",btnFun:()=>uni.navigateTo({ - url:"/pages/massif/pestType", + pestType:{label:"病虫害类型",type:"select",columns:[[{label:"病害",value:"病害"},{label:"虫害",value:"虫害"}]],value:['虫害']}, + pestName:{label:()=>`${this.formData.pestType}名称`,type:"navigate",value:"",btnFun:()=>uni.navigateTo({ + url:`/pages/massif/pestType?type=${({"病害":"disease","虫害":"pestis"})[this.formData.pestType]}`, events:{type:e=>{ this.formData.pestName=e this.fields.pestName.value=e.map(v=>v.name).join(",") @@ -50,6 +51,7 @@ export default { growthProcess:'', pestSite:'', symptom:"", + pestType:"虫害", pestName:[], medicationArea:"", pic:[], @@ -59,6 +61,7 @@ export default { growthProcess:{required:true,message:"请选择作物生长过程!",trigger:['blur','change']}, pestSite:{required:true,message:"请选择病虫害部位!",trigger:['blur','change']}, symptom:{required:true,message:"请选择显著症状!",trigger:['blur','change']}, + pestType:{required:true,message:"请选择病虫害类型!",trigger:['blur','change']}, pestName:{required:true,message:"请选择害虫!",type:"array",trigger:['blur','change']}, medicationArea:{required:true,message:"请输入农资作用面积!",type:"number",trigger:['blur','change']}, pic:{required:true,validator:(rule,val,call)=>{ @@ -74,8 +77,8 @@ export default { this.eventChannel.on("detail",e=>{ this.fields.pic.value=e.pic||'' this.fields.pestSite.value=e?.pestSite?.split?.(",")?.filter?.(v=>v)||[] - this.fields.growthProcess.value=e?.growthProcessLabel||"" - this.fields.symptom.value=e?.symptomLabel||"" + // this.fields.growthProcess.value=e?.growthProcessLabel||"" + // this.fields.symptom.value=e?.symptomLabel||"" this.fields.pestName.value=e?.pestName?.map(v=>v.name).join(',') this.formData=Object.assign(this.formData,{ ...e, @@ -90,8 +93,8 @@ export default { this.eventChannel.emit("addPest",{ ...this.formData, pic:this.fields.pic.value, - growthProcessLabel:this.fields.growthProcess.value, - symptomLabel:this.fields.symptom.value, + // growthProcessLabel:this.fields.growthProcess.value, + // symptomLabel:this.fields.symptom.value, }) uni.navigateBack() } diff --git a/pages/massif/pestType.vue b/pages/massif/pestType.vue index 1a049ad..905aac1 100644 --- a/pages/massif/pestType.vue +++ b/pages/massif/pestType.vue @@ -91,25 +91,27 @@