|
|
@@ -1,74 +1,76 @@
|
|
|
<template>
|
|
|
<div class="case">
|
|
|
- <div class="main">
|
|
|
- <van-row class="cell">
|
|
|
- <van-col span="6">报告事件:</van-col>
|
|
|
- <van-col span="18">
|
|
|
- <van-field v-model="form.event" placeholder="报告事件" />
|
|
|
- </van-col>
|
|
|
- </van-row>
|
|
|
-
|
|
|
- <van-row class="cell">
|
|
|
- <van-col span="6">报告时间:</van-col>
|
|
|
- <van-col span="18" @click="dateshow=true">{{form.mandatoryDate?form.mandatoryDate:'请选择'}}</van-col>
|
|
|
- <van-popup v-model="dateshow" position="bottom" :style="{ height: '30%' }">
|
|
|
- <van-datetime-picker @confirm="dateConfirm" @cancel="dateshow=false" v-model="mandatoryDate" type="date" :min-date="minDate" :max-date="maxDate" :columns-order="[ 'year','month', 'day']"
|
|
|
- :formatter="formatter" />
|
|
|
- </van-popup>
|
|
|
- </van-row>
|
|
|
- <van-row class="cell">
|
|
|
- <van-col span="6">报告人:</van-col>
|
|
|
- <van-col span="18">
|
|
|
- <van-field v-model="form.operator" placeholder="请输入" />
|
|
|
- </van-col>
|
|
|
- </van-row>
|
|
|
- <van-row class="cell">
|
|
|
- <van-col span="8">报告所在地:</van-col>
|
|
|
- <van-col span="16">
|
|
|
- <van-field v-model="form.streetName" @click="streetShow=true" placeholder="请选择" disabled />
|
|
|
- </van-col>
|
|
|
- <van-popup v-model="streetShow" position="bottom" :style="{ height: '30%' }">
|
|
|
- <van-picker show-toolbar :columns="streetList" @confirm="onConfirm" @cancel="streetShow=false" value-key="name" />
|
|
|
- </van-popup>
|
|
|
- </van-row>
|
|
|
- <van-row class="cell">
|
|
|
- <van-col span="6">联系电话:</van-col>
|
|
|
- <van-col span="18">
|
|
|
- <van-field v-model="form.phone" placeholder="请输入" />
|
|
|
- </van-col>
|
|
|
- </van-row>
|
|
|
- <van-row class="cell">
|
|
|
- <van-col span="6">报告内容:</van-col>
|
|
|
- <van-col span="18">
|
|
|
- <van-field class="textarea" v-model="form.content" rows="1" type="textarea" placeholder="请输入活动详情" />
|
|
|
- </van-col>
|
|
|
- </van-row>
|
|
|
- <van-row class="cell">
|
|
|
- <van-col span="6">图片视频:</van-col>
|
|
|
- <van-col span="18">
|
|
|
- <div class="box" ref="boxlist">
|
|
|
- <div class="boxlist">
|
|
|
- <div v-for="(item,index) in form.fileList" :key="index">
|
|
|
- <img v-if="item.type.indexOf('image') !== -1" :src="item.url" alt="">
|
|
|
- <video v-else style="object-fit:cover;" :src="item.url"></video>
|
|
|
+ <van-form @submit="mandatorySave">
|
|
|
+ <div class="main">
|
|
|
+ <van-row class="cell">
|
|
|
+ <van-col span="6">报告事件:</van-col>
|
|
|
+ <van-col span="18">
|
|
|
+ <van-field v-model="form.event" :rules="[{ required: true}]" placeholder="请输入报告事件" />
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ <van-row class="cell">
|
|
|
+ <van-col span="6">报告时间:</van-col>
|
|
|
+ <van-col span="18" @click="dateshow=true">
|
|
|
+ <van-field v-model="form.mandatoryDate" :rules="[{ required: true}]" placeholder="请输入报告时间" />
|
|
|
+ <!-- {{form.mandatoryDate?form.mandatoryDate:'请选择'}} -->
|
|
|
+ </van-col>
|
|
|
+ <van-popup v-model="dateshow" position="bottom" :style="{ height: '30%' }">
|
|
|
+ <van-datetime-picker @confirm="dateConfirm" @cancel="dateshow=false" v-model="mandatoryDate" type="date" :min-date="minDate" :max-date="maxDate" :columns-order="[ 'year','month', 'day']"
|
|
|
+ :formatter="formatter" />
|
|
|
+ </van-popup>
|
|
|
+ </van-row>
|
|
|
+ <van-row class="cell">
|
|
|
+ <van-col span="6">报告人:</van-col>
|
|
|
+ <van-col span="18">
|
|
|
+ <van-field v-model="form.operator" :rules="[{ required: true}]" placeholder="请输入报告人" />
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ <van-row class="cell">
|
|
|
+ <van-col span="8">报告所在地:</van-col>
|
|
|
+ <van-col span="16">
|
|
|
+ <van-field v-model="form.streetName" :rules="[{ required: true}]" @click="streetShow=true" placeholder="请选择报告所在地" disabled />
|
|
|
+ </van-col>
|
|
|
+ <van-popup v-model="streetShow" position="bottom" :style="{ height: '30%' }">
|
|
|
+ <van-picker show-toolbar :columns="streetList" @confirm="onConfirm" @cancel="streetShow=false" value-key="name" />
|
|
|
+ </van-popup>
|
|
|
+ </van-row>
|
|
|
+ <van-row class="cell">
|
|
|
+ <van-col span="6">联系电话:</van-col>
|
|
|
+ <van-col span="18">
|
|
|
+ <van-field v-model="form.phone" :rules="[{validator, required: true,message:'手机号格式不正确'}]" placeholder="请输入联系电话" />
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ <van-row class="cell">
|
|
|
+ <van-col span="6">报告内容:</van-col>
|
|
|
+ <van-col span="18">
|
|
|
+ <van-field class="textarea" v-model="form.content" :rules="[{ required: true}]" rows="1" type="textarea" placeholder="请输入报告内容" />
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ <van-row class="cell">
|
|
|
+ <van-col span="6">图片视频:</van-col>
|
|
|
+ <van-col span="18">
|
|
|
+ <div class="box" ref="boxlist">
|
|
|
+ <div class="boxlist">
|
|
|
+ <div v-for="(item,index) in form.fileList" :key="index">
|
|
|
+ <img v-if="item.type.indexOf('image') !== -1" :src="item.url" alt="">
|
|
|
+ <video v-else style="object-fit:cover;" :src="item.url"></video>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <van-uploader v-model="fileList" accept="*" :after-read="afterRead" @delete='deleteUploader'>
|
|
|
+ </van-uploader>
|
|
|
</div>
|
|
|
- <van-uploader v-model="fileList" accept="*" :after-read="afterRead" @delete='deleteUploader'>
|
|
|
- </van-uploader>
|
|
|
- </div>
|
|
|
-
|
|
|
- </van-col>
|
|
|
- </van-row>
|
|
|
- </div>
|
|
|
- <div style="text-align:center;">
|
|
|
- <van-button @click="mandatorySave">确 定</van-button>
|
|
|
- </div>
|
|
|
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ </div>
|
|
|
+ <div style="text-align:center;">
|
|
|
+ <van-button native-type="submit">确 定</van-button>
|
|
|
+ </div>
|
|
|
+ </van-form>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import {
|
|
|
- organizationDetail,
|
|
|
mandatorySave,
|
|
|
uploadImage,
|
|
|
getStreetList,
|
|
|
@@ -92,7 +94,6 @@ export default {
|
|
|
mandatoryDate: new Date(),
|
|
|
minDate: new Date(2020, 0, 1),
|
|
|
maxDate: new Date(2025, 10, 1),
|
|
|
- orglist: '',
|
|
|
positionSearch: '',
|
|
|
serviceTarget: [],
|
|
|
childList: [],
|
|
|
@@ -104,10 +105,12 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.getStreetList()
|
|
|
- this.organizationDetail()
|
|
|
this.organizationList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ validator(val) {
|
|
|
+ return /^1(3|4|5|6|7|8|9)\d{9}$/.test(val)
|
|
|
+ },
|
|
|
async getStreetList() {
|
|
|
const res = await getStreetList()
|
|
|
this.streetList = res.data
|
|
|
@@ -127,10 +130,6 @@ export default {
|
|
|
this.resultId.splice(id, 1)
|
|
|
}
|
|
|
},
|
|
|
- async organizationDetail() {
|
|
|
- const res = await organizationDetail()
|
|
|
- this.orglist = res.data
|
|
|
- },
|
|
|
onConfirm(value) {
|
|
|
this.form.streetName = value.name
|
|
|
this.form.areaId = value.id
|