You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.6 KiB

12 months ago
<style scoped>
.container{
min-height: 100%;
background:#f6f6f6;
padding:30rpx;
}
</style>
<template>
<view class="container">
<u-form class="card inline" errorType="toast" :model="formData" ref="form" :rules="rules" labelWidth="auto">
12 months ago
<d-form label="当前位置" type="map" @position="formData.lat=$event.latitude;formData.lng=$event.longitude"/>
11 months ago
<d-form label="位置详情" required field="position" v-model="formData.position"/>
<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"/>
12 months ago
</u-form>
11 months ago
<button class="cu-btn round bg-green shadow submit" @click="submit">保存</button>
12 months ago
</view>
</template>
<script>
export default {
data(){
return{
formData:{
lng:"",
lat:"",
11 months ago
position:"",
remark:"",
pic:'',
flagDeal:0,
12 months ago
},
imgs:[],
rules:{
11 months ago
pic:{required:true,message:"请上传凭证!",trigger:'blur'},
position:{required:true,message:"请输入位置详情!",trigger:"blur"},
},
eventChannel:null,
12 months ago
}
},
onLoad(){
this.eventChannel=this.getOpenerEventChannel()
this.eventChannel.on("detail",e=>{
this.formData=e
this.imgs=(e.pic||"").split(',').filter(v=>v)
})
},
12 months ago
methods:{
11 months ago
submit(){
this.$refs.form.validate().then(async valid=>{
if(valid){
this.eventChannel.emit('update',this.formData)
uni.navigateBack()
}
})
},
12 months ago
}
}
</script>