Browse Source

巡园信息 修改异常表单

master
邓宏 11 months ago
parent
commit
17866039c3
  1. 6
      pages/patrolGarden/abnoReport.vue
  2. 32
      pages/patrolGarden/info.vue

6
pages/patrolGarden/abnoReport.vue

@ -10,7 +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="凭证" required field="pic" :value="imgs" type="upImg" @imgs="formData.pic=$event"/>
<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"/>
</u-form>
@ -39,6 +39,10 @@ export default {
},
onLoad(){
this.eventChannel=this.getOpenerEventChannel()
this.eventChannel.on("detail",e=>{
this.formData=e
this.imgs=(e.pic||"").split(',').filter(v=>v)
})
},
methods:{
submit(){

32
pages/patrolGarden/info.vue

@ -65,12 +65,17 @@
<d-form label="记录人" disabled v-model="formData.userName"/>
<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"/>
<view class="handle" :class="{un:v.flagDeal==0}" v-for="(v,k) in formData.detailList" :key="k">
<image :src="`${host}/${(v.pic||'').split(',').filter(v=>v)[0]}`"/>
<view class="content">
<view class="doubleLine" style="--n:3;">{{v.remark}}</view>
</view>
</view>
<u-swipe-action>
<u-swipe-action-item v-for="(v,k) in formData.detailList" :key="k" :options="[{text:'删除',style:{backgroundColor:'#EE263A'}}]" @click="formData.detailList.splice($event.index,1)">
<view class="handle" :class="{un:v.flagDeal==0}" v-for="(v,k) in formData.detailList" :key="k" @click="toAbnormal(k)">
<image :src="`${host}/${(v.pic||'').split(',').filter(v=>v)[0]}`"/>
<view class="content">
<view class="position">详情地址{{v.position}}</view>
<view class="doubleLine" style="--n:3;">{{v.remark}}</view>
</view>
</view>
</u-swipe-action-item>
</u-swipe-action>
<button class="cu-btn round bg-green shadow add" v-if="formData.flagAbnormal==1" @click="toAbnormal">+{{formData.detailList.length>0?'继续':''}}添加异常</button>
<d-form label="凭证" :required="formData.flagAbnormal==0" field="pic" type="upImg" :value="imgs" @imgs="formData.pic=$event" :num="3"/>
@ -116,10 +121,21 @@ export default {
this.eventChannel=this.getOpenerEventChannel()
},
methods:{
toAbnormal(){
toAbnormal(index){
uni.navigateTo({
url:"/pages/patrolGarden/abnoReport",
events:{update:e=>this.formData.detailList.push(e)}
events:{update:e=>{
if(/\d+/.test(index)){
this.formData.detailList[index]=e
}else{
this.formData.detailList.push(e)
}
}},
success:e=>{
if(/\d+/.test(index)){
e.eventChannel.emit("detail",this.formData.detailList[index])
}
}
})
},
submit(){

Loading…
Cancel
Save