|
@ -14,7 +14,7 @@ |
|
|
:field="k" |
|
|
:field="k" |
|
|
v-bind="v" |
|
|
v-bind="v" |
|
|
:required="!!rules[k]" |
|
|
:required="!!rules[k]" |
|
|
:value="/^checkBox$/.test(v.type)?fields[k].value:formData[k]" |
|
|
:value="/^checkBox$|^navigate$/.test(v.type)?fields[k].value:formData[k]" |
|
|
@input="formData[k]=$event" |
|
|
@input="formData[k]=$event" |
|
|
@checkBox="fields[k].value=$event;formData[k]=$event.join(',')" |
|
|
@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=$event[0].label" |
|
@ -32,7 +32,16 @@ export default { |
|
|
pestSite:{label:"病虫害部位",type:"checkBox",value:[],columns:[{label:"根",value:"根"},{label:"茎",value:"茎"},{label:"叶",value:"叶"}]}, |
|
|
pestSite:{label:"病虫害部位",type:"checkBox",value:[],columns:[{label:"根",value:"根"},{label:"茎",value:"茎"},{label:"叶",value:"叶"}]}, |
|
|
growthProcess:{label:"作物生长过程",type:"select-tab",dictCode:"growth_process"}, |
|
|
growthProcess:{label:"作物生长过程",type:"select-tab",dictCode:"growth_process"}, |
|
|
symptom:{label:"显著症状",type:"select-tab",dictCode:"symptom"}, |
|
|
symptom:{label:"显著症状",type:"select-tab",dictCode:"symptom"}, |
|
|
pestName:{label:"害虫名称",type:"navigate",btnFun:()=>uni.navigateTo({url:"/pages/massif/pestType",events:{type:e=>this.formData.pestName=e}})}, |
|
|
pestName:{label:"害虫名称",type:"navigate",value:"",btnFun:()=>uni.navigateTo({ |
|
|
|
|
|
url:"/pages/massif/pestType", |
|
|
|
|
|
events:{type:e=>{ |
|
|
|
|
|
this.formData.pestName=e |
|
|
|
|
|
this.fields.pestName.value=e.map(v=>v.name).join(",") |
|
|
|
|
|
}}, |
|
|
|
|
|
success:res=>{ |
|
|
|
|
|
res.eventChannel.emit("ids",this.formData.pestName) |
|
|
|
|
|
} |
|
|
|
|
|
})}, |
|
|
medicationArea:{label:"农资作用面积",type:"digit",suffix:"亩"}, |
|
|
medicationArea:{label:"农资作用面积",type:"digit",suffix:"亩"}, |
|
|
pic:{label:"凭证",type:"upImg",value:""}, |
|
|
pic:{label:"凭证",type:"upImg",value:""}, |
|
|
description:{label:"病虫害描述",type:"textarea"}, |
|
|
description:{label:"病虫害描述",type:"textarea"}, |
|
@ -41,7 +50,7 @@ export default { |
|
|
growthProcess:'', |
|
|
growthProcess:'', |
|
|
pestSite:'', |
|
|
pestSite:'', |
|
|
symptom:"", |
|
|
symptom:"", |
|
|
pestName:"", |
|
|
pestName:[], |
|
|
medicationArea:"", |
|
|
medicationArea:"", |
|
|
pic:[], |
|
|
pic:[], |
|
|
description:"", |
|
|
description:"", |
|
@ -50,7 +59,7 @@ export default { |
|
|
growthProcess:{required:true,message:"请选择作物生长过程!",trigger:['blur','change']}, |
|
|
growthProcess:{required:true,message:"请选择作物生长过程!",trigger:['blur','change']}, |
|
|
pestSite:{required:true,message:"请选择病虫害部位!",trigger:['blur','change']}, |
|
|
pestSite:{required:true,message:"请选择病虫害部位!",trigger:['blur','change']}, |
|
|
symptom:{required:true,message:"请选择显著症状!",trigger:['blur','change']}, |
|
|
symptom:{required:true,message:"请选择显著症状!",trigger:['blur','change']}, |
|
|
pestName:{required:true,message:"请选择害虫!",trigger:['blur','change']}, |
|
|
pestName:{required:true,message:"请选择害虫!",type:"array",trigger:['blur','change']}, |
|
|
medicationArea:{required:true,message:"请输入农资作用面积!",type:"number",trigger:['blur','change']}, |
|
|
medicationArea:{required:true,message:"请输入农资作用面积!",type:"number",trigger:['blur','change']}, |
|
|
pic:{required:true,validator:(rule,val,call)=>{ |
|
|
pic:{required:true,validator:(rule,val,call)=>{ |
|
|
if(!this.fields.pic.value)call(new Error("请选择凭证!")); |
|
|
if(!this.fields.pic.value)call(new Error("请选择凭证!")); |
|
@ -67,6 +76,7 @@ export default { |
|
|
this.fields.pestSite.value=e?.pestSite?.split?.(",")?.filter?.(v=>v)||[] |
|
|
this.fields.pestSite.value=e?.pestSite?.split?.(",")?.filter?.(v=>v)||[] |
|
|
this.fields.growthProcess.value=e?.growthProcessLabel||"" |
|
|
this.fields.growthProcess.value=e?.growthProcessLabel||"" |
|
|
this.fields.symptom.value=e?.symptomLabel||"" |
|
|
this.fields.symptom.value=e?.symptomLabel||"" |
|
|
|
|
|
this.fields.pestName.value=e?.pestName?.map(v=>v.name).join(',') |
|
|
this.formData=Object.assign(this.formData,{ |
|
|
this.formData=Object.assign(this.formData,{ |
|
|
...e, |
|
|
...e, |
|
|
pic:e?.pic?.split?.(",")?.filter?.(v=>v)||[] |
|
|
pic:e?.pic?.split?.(",")?.filter?.(v=>v)||[] |
|
|