|
|
@ -61,59 +61,90 @@ |
|
|
|
<template> |
|
|
|
<view class="container"> |
|
|
|
<u-form class="card inline" errorType="toast" :model="formData" :rules="rules" ref="form" labelWidth="auto"> |
|
|
|
<d-form label="基地名称" required/> |
|
|
|
<d-form label="记录人" required/> |
|
|
|
<d-form label="巡园日期" required type="calendar"/> |
|
|
|
<d-form label="是否异常" required type="radio" :columns="[{label:'是',value:1},{label:'否',value:0}]" v-model="formData.abnormal"/> |
|
|
|
<view class="handle"> |
|
|
|
<image src="https://alipic.lanhuapp.com/XDSlicePNGMAX194db53bfba98d0b8dd7897e8aa3b92427509704376c5621dac3520f49ce3d9a.png"/> |
|
|
|
<view class="content"> |
|
|
|
<view class="doubleLine" style="--n:3;">柑橘黄斑病,是子囊菌亚门球腔菌属的柑橘球腔菌侵染所致,病菌以菌丝体在病叶和落叶中越冬柑橘黄斑病,是子囊菌亚门球腔菌属的柑橘球腔菌侵染所致,病菌以菌丝体在病叶和落叶中越冬</view> |
|
|
|
<d-form label="基地名称" disabled :value="formData.baseName"/> |
|
|
|
<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" v-if="v.flagDeal==1"> |
|
|
|
<view class="doubleLine" style="--n:3;">{{v.remark}}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="handle un"> |
|
|
|
<image src="https://alipic.lanhuapp.com/XDSlicePNGMAX194db53bfba98d0b8dd7897e8aa3b92427509704376c5621dac3520f49ce3d9a.png"/> |
|
|
|
<view class="content"> |
|
|
|
<view class="doubleLine">柑橘黄斑病,是子囊菌亚门球腔菌属的柑橘球腔菌侵染所致,病菌以菌丝体在病叶和落叶中越冬柑橘黄斑病,是子囊菌亚门球腔菌属的柑橘球腔菌侵染所致,病菌以菌丝体在病叶和落叶中越冬</view> |
|
|
|
<view class="content" v-else> |
|
|
|
<view class="doubleLine">{{v.remark}}</view> |
|
|
|
<button class="cu-btn shadow">立即处理</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<button class="cu-btn round bg-green shadow add">+继续添加异常</button> |
|
|
|
<button class="cu-btn round bg-green shadow add" v-if="formData.flagAbnormal==1" @click="toAbnormal">+{{formData.detailList.length>0?'继续':''}}添加异常</button> |
|
|
|
|
|
|
|
<d-form label="凭证" type="upImg" :value="formData.pic"/> |
|
|
|
<d-form label="备注" type="textarea" v-model="remark"/> |
|
|
|
<d-form label="凭证" :required="formData.flagAbnormal==0" field="pic" type="upImg" :value="imgs" @imgs="formData.pic=$event" :num="3"/> |
|
|
|
<d-form label="备注" type="textarea" v-model="formData.remark"/> |
|
|
|
</u-form> |
|
|
|
<button class="cu-btn round bg-green shadow submit" @click="sumbit">保存</button> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import request,{host} from '@/common/request' |
|
|
|
export default { |
|
|
|
data(){ |
|
|
|
return{ |
|
|
|
formData:{ |
|
|
|
pic:[], |
|
|
|
abnormal:0, |
|
|
|
baseId: this.$store.state.baseInfo.id, |
|
|
|
baseName: this.$store.state.baseInfo.name, |
|
|
|
userName: this.$store.getters['userInfo'].realname, |
|
|
|
operateDate:"", |
|
|
|
detailList:[], |
|
|
|
flagAbnormal:0, |
|
|
|
pic:'', |
|
|
|
remark:"", |
|
|
|
}, |
|
|
|
imgs:[], |
|
|
|
rules:{ |
|
|
|
|
|
|
|
pic:{required:true,message:"请上传凭证!",trigger:'blur'}, |
|
|
|
operateDate:{required:true,message:"请选择巡园日期!",trigger:'blur'} |
|
|
|
}, |
|
|
|
host:host('imgUrl'), |
|
|
|
eventChannel:null, |
|
|
|
} |
|
|
|
}, |
|
|
|
watch:{ |
|
|
|
"formData.abnormal"(n){ |
|
|
|
"formData.flagAbnormal"(n){ |
|
|
|
if(n==1){ |
|
|
|
uni.navigateTo({ |
|
|
|
url:"/pages/patrolGarden/abnoReport" |
|
|
|
}) |
|
|
|
this.toAbnormal() |
|
|
|
}else{ |
|
|
|
this.formData.detailList=[] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(){ |
|
|
|
this.eventChannel=this.getOpenerEventChannel() |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
demo(e){ |
|
|
|
console.log(e,'----e-------') |
|
|
|
toAbnormal(){ |
|
|
|
uni.navigateTo({ |
|
|
|
url:"/pages/patrolGarden/abnoReport", |
|
|
|
events:{update:e=>this.formData.detailList.push(e)} |
|
|
|
}) |
|
|
|
}, |
|
|
|
sumbit(){ |
|
|
|
|
|
|
|
this.$refs.form.validate().then(async valid=>{ |
|
|
|
if(valid){ |
|
|
|
var res=await request("/api/basetour/addBaseTourInfo",{ |
|
|
|
method:"post", |
|
|
|
body:this.formData |
|
|
|
}) |
|
|
|
if(res.statu){ |
|
|
|
this.eventChannel.emit('update') |
|
|
|
uni.navigateBack() |
|
|
|
}else{ |
|
|
|
uni.showModal({ |
|
|
|
title:"提示", |
|
|
|
content:res.msg||"获取保持失败!", |
|
|
|
showCancel:false, |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|