|
|
@ -203,15 +203,19 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="card"> |
|
|
|
<view v-if="/^用药$|^施肥$/.test(formData.farmingType)" class="item" @click="toPestRecord"> |
|
|
|
<!-- <view v-if="/^用药$|^施肥$/.test(formData.farmingType)" class="item" @click="toPestRecord"> |
|
|
|
<view class="tabulation" :class="{mast:/^用药$/.test(formData.farmingType)}"> |
|
|
|
<text class="title">操作</text> <text class="record">病虫害记录</text><text class="plant-youbian"/> |
|
|
|
</view> |
|
|
|
<view class="value" v-if="formData.farmPests"> |
|
|
|
过程:{{formData.farmPests.growthProcess}},病虫害部位:{{formData.farmPests.pestSite}},症状:{{formData.farmPests.symptom}}({{formData.farmPests.pestName.map(v=>v.name).join(',')}}) |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
<u-form class="inline" errorType="toast" :model="formData" :rules="rules" ref="form" labelWidth="auto"> |
|
|
|
<template v-if="/^用药$|^施肥$/.test(formData.farmingType)"> |
|
|
|
<d-form label="防治对象" type="select" :value="[formData.pestsType]" @select="formData.pestsType=$event.slice(-1)[0].value" :columns="[[{label:'病害',value:'病害'},{label:'虫害',value:'虫害'}]]"/> |
|
|
|
<d-form :label="()=>`${formData.pestsType||'病虫害'}名称`" type="navigate" :value="formData.pests" :btnFun="pestsFun"/> |
|
|
|
</template> |
|
|
|
<d-form |
|
|
|
v-for="(v,k) in fields" |
|
|
|
:key="k" |
|
|
@ -256,6 +260,8 @@ export default { |
|
|
|
workTime:0, |
|
|
|
inputList:[], |
|
|
|
farmPests:null,//病虫害 |
|
|
|
pestsType:"", |
|
|
|
pests:"", |
|
|
|
plotId:"", |
|
|
|
plantBaseInfoId: this.$store.state.baseInfo.id, |
|
|
|
}, |
|
|
@ -271,6 +277,13 @@ export default { |
|
|
|
eventChannel:null, |
|
|
|
} |
|
|
|
}, |
|
|
|
watch:{ |
|
|
|
'formData.pestsType'(n,o){ |
|
|
|
if(n){ |
|
|
|
this.formData.pests='' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options){ |
|
|
|
this.eventChannel=this.getOpenerEventChannel() |
|
|
|
this.formData.plotId=options.plotId |
|
|
@ -404,6 +417,18 @@ export default { |
|
|
|
uni.showToast({title:"请输入内容!",icon:"none"}) |
|
|
|
} |
|
|
|
}, |
|
|
|
//选择病虫害名称 |
|
|
|
pestsFun(){ |
|
|
|
uni.navigateTo({ |
|
|
|
url:`/pages/massif/pestType?type=${({"病害":"disease","虫害":"pestis"})[this.formData.pestsType]}`, |
|
|
|
events:{type:e=>{ |
|
|
|
this.formData.pests=e.map(v=>v).join(',') |
|
|
|
}}, |
|
|
|
success:res=>{ |
|
|
|
res.eventChannel.emit('ids',this.formData?.pests?.split?.(',')?.filter(v=>v)||[]) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
//添加病虫害记录 |
|
|
|
toPestRecord(){ |
|
|
|
uni.navigateTo({ |
|
|
|