diff --git a/pages/massif/add_farming.vue b/pages/massif/add_farming.vue index 8b65d07..a553901 100644 --- a/pages/massif/add_farming.vue +++ b/pages/massif/add_farming.vue @@ -38,15 +38,24 @@ .card{ margin-top:0; &>.item{ - display:flex; - align-items:center; border-bottom:2rpx solid rgba(216, 216, 216, 0.4); - height:70rpx; - .title{ - margin-right:auto; + padding-bottom:10rpx; + .tabulation{ + display:flex; + align-items:center; + height:70rpx; + .title{ + margin-right:auto; + } + .record{ + color:#FBA83C; + } } - .record{ - color:#FBA83C; + .value{ + background:#F7F7F7; + border-radius: 24rpx; + color:#333; + padding:20rpx 30rpx; } } .plant-dikuaimianji{ @@ -190,7 +199,12 @@ - 操作 病虫害记录 + + 操作 病虫害记录 + + + 过程:{{formData.farmPests.growthProcessLabel}},病虫害部位:{{formData.farmPests.pestSite}},症状:{{formData.farmPests.symptomLabel}} + this.formData.farmPests=e} + events:{addPest: e=>this.formData.farmPests=e}, + success:(res)=>{ + res.eventChannel.emit("detail",{...(this.formData.farmPests||{})}) + } }) }, }, diff --git a/pages/massif/pestRecord.vue b/pages/massif/pestRecord.vue index b470754..bbba991 100644 --- a/pages/massif/pestRecord.vue +++ b/pages/massif/pestRecord.vue @@ -17,7 +17,7 @@ :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" + @select="formData[k]=$event[0].value;fields[k].value=$event[0].label" @imgs="fields[k].value=$event"/> @@ -29,8 +29,8 @@ export default { data(){ return{ fields:{ - growthProcess:{label:"作物生长过程",type:"select-tab",dictCode:"growth_process"}, 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"}, medicationArea:{label:"农资作用面积",type:"digit",suffix:"亩"}, pic:{label:"凭证",type:"upImg",value:""}, @@ -38,7 +38,7 @@ export default { }, formData:{ growthProcess:'', - pestSite:[], + pestSite:'', symptom:"", medicationArea:"", pic:[], @@ -59,6 +59,16 @@ export default { }, onLoad(){ 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:{ sumbit(){ @@ -66,7 +76,9 @@ export default { if(valid){ this.eventChannel.emit("addPest",{ ...this.formData, - pic:this.fields.pic.value + pic:this.fields.pic.value, + growthProcessLabel:this.fields.growthProcess.value, + symptomLabel:this.fields.symptom.value, }) uni.navigateBack() } diff --git a/uni_modules/d-form/components/d-form/d-form.vue b/uni_modules/d-form/components/d-form/d-form.vue index 21056bb..ba7594f 100644 --- a/uni_modules/d-form/components/d-form/d-form.vue +++ b/uni_modules/d-form/components/d-form/d-form.vue @@ -1,5 +1,6 @@