|
@ -17,7 +17,7 @@ |
|
|
:value="/^checkBox$/.test(v.type)?fields[k].value:formData[k]" |
|
|
:value="/^checkBox$/.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" |
|
|
@select="formData[k]=$event[0].value;fields[k].value=$event[0].label" |
|
|
@imgs="fields[k].value=$event"/> |
|
|
@imgs="fields[k].value=$event"/> |
|
|
</u-form> |
|
|
</u-form> |
|
|
<button class="cu-btn round bg-green shadow submit" @click="sumbit">保存</button> |
|
|
<button class="cu-btn round bg-green shadow submit" @click="sumbit">保存</button> |
|
@ -29,8 +29,8 @@ export default { |
|
|
data(){ |
|
|
data(){ |
|
|
return{ |
|
|
return{ |
|
|
fields:{ |
|
|
fields:{ |
|
|
growthProcess:{label:"作物生长过程",type:"select-tab",dictCode:"growth_process"}, |
|
|
|
|
|
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"}, |
|
|
symptom:{label:"显著症状",type:"select-tab",dictCode:"symptom"}, |
|
|
symptom:{label:"显著症状",type:"select-tab",dictCode:"symptom"}, |
|
|
medicationArea:{label:"农资作用面积",type:"digit",suffix:"亩"}, |
|
|
medicationArea:{label:"农资作用面积",type:"digit",suffix:"亩"}, |
|
|
pic:{label:"凭证",type:"upImg",value:""}, |
|
|
pic:{label:"凭证",type:"upImg",value:""}, |
|
@ -38,7 +38,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
formData:{ |
|
|
formData:{ |
|
|
growthProcess:'', |
|
|
growthProcess:'', |
|
|
pestSite:[], |
|
|
pestSite:'', |
|
|
symptom:"", |
|
|
symptom:"", |
|
|
medicationArea:"", |
|
|
medicationArea:"", |
|
|
pic:[], |
|
|
pic:[], |
|
@ -59,6 +59,16 @@ export default { |
|
|
}, |
|
|
}, |
|
|
onLoad(){ |
|
|
onLoad(){ |
|
|
this.eventChannel=this.getOpenerEventChannel() |
|
|
this.eventChannel=this.getOpenerEventChannel() |
|
|
|
|
|
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.formData=Object.assign(this.formData,{ |
|
|
|
|
|
...e, |
|
|
|
|
|
pic:e?.pic?.split?.(",")?.filter?.(v=>v)||[] |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
methods:{ |
|
|
methods:{ |
|
|
sumbit(){ |
|
|
sumbit(){ |
|
@ -66,7 +76,9 @@ export default { |
|
|
if(valid){ |
|
|
if(valid){ |
|
|
this.eventChannel.emit("addPest",{ |
|
|
this.eventChannel.emit("addPest",{ |
|
|
...this.formData, |
|
|
...this.formData, |
|
|
pic:this.fields.pic.value |
|
|
pic:this.fields.pic.value, |
|
|
|
|
|
growthProcessLabel:this.fields.growthProcess.value, |
|
|
|
|
|
symptomLabel:this.fields.symptom.value, |
|
|
}) |
|
|
}) |
|
|
uni.navigateBack() |
|
|
uni.navigateBack() |
|
|
} |
|
|
} |
|
|