|
|
@ -14,8 +14,9 @@ |
|
|
|
:field="k" |
|
|
|
v-bind="v" |
|
|
|
:required="!!rules[k]" |
|
|
|
:value="/^$/.test(v.type)?fields[k].value:formData[k]" |
|
|
|
:value="/^checkBox$/.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" |
|
|
|
@imgs="fields[k].value=$event"/> |
|
|
|
</u-form> |
|
|
@ -29,7 +30,7 @@ export default { |
|
|
|
return{ |
|
|
|
fields:{ |
|
|
|
growthProcess:{label:"作物生长过程",type:"select-tab",dictCode:"growth_process"}, |
|
|
|
pestSite:{label:"病虫害部位",type:"checkBox",columns:[{label:"根",value:"根"},{label:"茎",value:"茎"},{label:"叶",value:"叶"}]}, |
|
|
|
pestSite:{label:"病虫害部位",type:"checkBox",value:[],columns:[{label:"根",value:"根"},{label:"茎",value:"茎"},{label:"叶",value:"叶"}]}, |
|
|
|
symptom:{label:"显著症状",type:"select-tab",dictCode:"symptom"}, |
|
|
|
medicationArea:{label:"农资作用面积",type:"digit",suffix:"亩"}, |
|
|
|
pic:{label:"凭证",type:"upImg",value:""}, |
|
|
@ -45,7 +46,7 @@ export default { |
|
|
|
}, |
|
|
|
rules:{ |
|
|
|
growthProcess:{required:true,message:"请选择作物生长过程!",trigger:['blur','change']}, |
|
|
|
pestSite:{required:true,message:"请选择病虫害部位!",type:"array",trigger:['blur','change']}, |
|
|
|
pestSite:{required:true,message:"请选择病虫害部位!",trigger:['blur','change']}, |
|
|
|
symptom:{required:true,message:"请选择显著症状!",trigger:['blur','change']}, |
|
|
|
medicationArea:{required:true,message:"请输入农资作用面积!",type:"number",trigger:['blur','change']}, |
|
|
|
pic:{required:true,validator:(rule,val,call)=>{ |
|
|
|