Browse Source

巡园记录 修改地块表单位置

master
邓宏 2 months ago
parent
commit
4a02ac5e3e
  1. 18
      pages/patrolGarden/abnoReport.vue
  2. 18
      pages/patrolGarden/info.vue

18
pages/patrolGarden/abnoReport.vue

@ -10,6 +10,7 @@
<u-form class="card inline" errorType="toast" :model="formData" ref="form" :rules="rules" labelWidth="auto">
<d-form label="当前位置" type="map" @position="formData.lat=$event.latitude;formData.lng=$event.longitude"/>
<d-form label="位置详情" required field="position" v-model="formData.position"/>
<d-form label="地块" type="navigate" required field="plotId" :value="formData.plotName" :btnFun="selectPlot"/>
<d-form label="凭证" required field="pic" :num="3" :value="imgs" type="upImg" @imgs="formData.pic=$event"/>
<d-form label="描述" type="textarea" v-model="formData.remark"/>
<d-form label="是否处理" type="radio" :columns="[{label:'是',value:1},{label:'否',value:0}]" v-model="formData.flagDeal"/>
@ -28,11 +29,14 @@ export default {
remark:"",
pic:'',
flagDeal:0,
plotId:"",
plotName:"",
},
imgs:[],
rules:{
pic:{required:true,message:"请上传凭证!",trigger:'blur'},
position:{required:true,message:"请输入位置详情!",trigger:"blur"},
plotId:{required:true,message:"请选择地块!"},
},
eventChannel:null,
}
@ -53,6 +57,20 @@ export default {
}
})
},
selectPlot(){
uni.navigateTo({
url:"/pages/patrolGarden/searchPlot",
events:{update:e=>{
this.formData.plotId=e.map(v=>v.id).join(',')
this.formData.plotName=e.map(v=>v.plotName).join(',')
}},
success: e=>{
var id=this.formData.plotId?.split?.(',')?.filter(v=>v)||[]
var name=this.formData.plotName?.split?.(',')?.filter(v=>v)||[]
e.eventChannel.emit("list", id.map((v,k)=>({id:v, plotName:name[k]})))
}
})
},
}
}
</script>

18
pages/patrolGarden/info.vue

@ -63,7 +63,6 @@
<u-form class="card inline" errorType="toast" :model="formData" :rules="rules" ref="form" labelWidth="auto">
<d-form label="基地名称" disabled :value="formData.baseName"/>
<d-form label="记录人" disabled v-model="formData.userName"/>
<d-form label="地块" type="navigate" required field="plotId" :value="formData.plotName" :btnFun="selectPlot"/>
<d-form label="巡园日期" required field="operateDate" type="calendar" v-model="formData.operateDate"/>
<d-form label="是否异常" required type="radio" :columns="[{label:'是',value:1},{label:'否',value:0}]" v-model="formData.flagAbnormal"/>
<u-swipe-action>
@ -98,15 +97,12 @@ export default {
detailList:[],
flagAbnormal:0,
pic:'',
plotId:"",
plotName:"",
remark:"",
},
imgs:[],
rules:{
pic:{required:true,message:"请上传凭证!",trigger:'blur'},
operateDate:{required:true,message:"请选择巡园日期!",trigger:'blur'},
plotId:{required:true,message:"请选择地块!"},
},
host:host('imgUrl'),
eventChannel:null,
@ -162,20 +158,6 @@ export default {
}
})
},
selectPlot(){
uni.navigateTo({
url:"/pages/patrolGarden/searchPlot",
events:{update:e=>{
this.formData.plotId=e.map(v=>v.id).join(',')
this.formData.plotName=e.map(v=>v.plotName).join(',')
}},
success: e=>{
var id=this.formData.plotId?.split?.(',')?.filter(v=>v)||[]
var name=this.formData.plotName?.split?.(',')?.filter(v=>v)||[]
e.eventChannel.emit("list", id.map((v,k)=>({id:v, plotName:name[k]})))
}
})
},
}
}
</script>
Loading…
Cancel
Save