|
|
@@ -5,34 +5,66 @@
|
|
|
<van-row class="cell">
|
|
|
<van-col span="6">会商议题:</van-col>
|
|
|
<van-col span="18">
|
|
|
- <van-field v-model="form.name" :rules="[{ required: true}]" placeholder="请输入会商议题" />
|
|
|
+ <van-field
|
|
|
+ v-model="form.name"
|
|
|
+ :rules="[{ required: true }]"
|
|
|
+ placeholder="请输入会商议题"
|
|
|
+ />
|
|
|
</van-col>
|
|
|
</van-row>
|
|
|
<van-row class="cell">
|
|
|
<van-col span="6">会商时间:</van-col>
|
|
|
<van-col span="18" @click="clickdateshow">
|
|
|
<!-- {{form.workDate?form.workDate:'请选择'}} -->
|
|
|
- <van-field v-model="form.workDate" :rules="[{ required: true}]" placeholder="请选择会商时间" disabled />
|
|
|
+ <van-field
|
|
|
+ v-model="form.workDate"
|
|
|
+ :rules="[{ required: true }]"
|
|
|
+ placeholder="请选择会商时间"
|
|
|
+ />
|
|
|
</van-col>
|
|
|
<van-popup v-model="dateshow" position="bottom" :style="{ height: '50%' }">
|
|
|
- <van-datetime-picker @confirm="dateConfirm" @cancel="dateshow=false" v-model="workDate" type="date" :min-date="minDate" :max-date="maxDate" :columns-order="[ 'year','month', 'day']"
|
|
|
- :formatter="formatter" />
|
|
|
+ <van-datetime-picker
|
|
|
+ @confirm="dateConfirm"
|
|
|
+ @cancel="dateshow = false"
|
|
|
+ v-model="workDate"
|
|
|
+ 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.streetName" @click="clickstreetShow" :rules="[{ required: true}]" placeholder="请选择街道" disabled />
|
|
|
+ <van-field
|
|
|
+ v-model="form.streetName"
|
|
|
+ @click="clickstreetShow"
|
|
|
+ :rules="[{ required: true }]"
|
|
|
+ placeholder="请选择街道"
|
|
|
+ />
|
|
|
</van-col>
|
|
|
<!-- <van-col span="18" @click="streetshowPopup">{{form.streetName?form.streetName:'请选择'}}</van-col> -->
|
|
|
<van-popup v-model="streetShow" position="bottom" :style="{ height: '50%' }">
|
|
|
- <van-picker default-index="2" show-toolbar :columns="streetList" @confirm="onConfirm" @cancel="streetShow=false" value-key="name" />
|
|
|
+ <van-picker
|
|
|
+ default-index="2"
|
|
|
+ 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.address" :rules="[{ required: true}]" placeholder="请输入详细地址" />
|
|
|
+ <van-field
|
|
|
+ v-model="form.address"
|
|
|
+ :rules="[{ required: true }]"
|
|
|
+ placeholder="请输入详细地址"
|
|
|
+ />
|
|
|
</van-col>
|
|
|
</van-row>
|
|
|
<van-row class="cell">
|
|
|
@@ -44,16 +76,27 @@
|
|
|
<van-row class="cell">
|
|
|
<van-col span="6">参与单位:</van-col>
|
|
|
<van-col span="18">
|
|
|
- <van-field v-model="form.participateOrgName" :rules="[{ required: true}]" @click="ownerShow=true" placeholder="请选择参与单位" disabled />
|
|
|
+ <van-field
|
|
|
+ v-model="form.participateOrgName"
|
|
|
+ :rules="[{ required: true }]"
|
|
|
+ @click="ownerShow = true"
|
|
|
+ placeholder="请选择参与单位"
|
|
|
+ />
|
|
|
<van-popup v-model="ownerShow" position="bottom" :style="{ height: '50%' }">
|
|
|
<div class="popup">
|
|
|
<div class="btn">
|
|
|
- <div @click="ownerShow=false" class="cancle">取消</div>
|
|
|
+ <div @click="ownerShow = false" class="cancle">取消</div>
|
|
|
<div @click="ownerConfirm" class="confirm">确定</div>
|
|
|
</div>
|
|
|
<van-checkbox-group class="group" v-model="result">
|
|
|
<van-cell-group>
|
|
|
- <van-cell v-for="(item,index) in orgform" clickable :key="index" :title="item.name" @click="toggle(item,index)">
|
|
|
+ <van-cell
|
|
|
+ v-for="(item, index) in orgform"
|
|
|
+ clickable
|
|
|
+ :key="index"
|
|
|
+ :title="item.name"
|
|
|
+ @click="toggle(item, index)"
|
|
|
+ >
|
|
|
<template #right-icon>
|
|
|
<van-checkbox :name="item.name" ref="checkboxes" />
|
|
|
</template>
|
|
|
@@ -67,13 +110,24 @@
|
|
|
<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-field
|
|
|
+ class="textarea"
|
|
|
+ v-model="form.content"
|
|
|
+ :rules="[{ required: true }]"
|
|
|
+ rows="1"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入活动详情"
|
|
|
+ />
|
|
|
</van-col>
|
|
|
</van-row>
|
|
|
<vanUploader :text="'图片'" ref="vanimg" @getfileList="getfileList"></vanUploader>
|
|
|
- <vanUploader :text="'视频'" ref="vanvideo" @getfileList="getfileList"></vanUploader>
|
|
|
+ <vanUploader
|
|
|
+ :text="'视频'"
|
|
|
+ ref="vanvideo"
|
|
|
+ @getfileList="getfileList"
|
|
|
+ ></vanUploader>
|
|
|
</div>
|
|
|
- <div style="text-align:center;">
|
|
|
+ <div style="text-align: center">
|
|
|
<van-button native-type="submit">确 定</van-button>
|
|
|
</div>
|
|
|
</van-form>
|
|
|
@@ -86,8 +140,8 @@ import {
|
|
|
uploadImage,
|
|
|
getStreetList,
|
|
|
organizationList,
|
|
|
-} from '../../api/index.js'
|
|
|
-import vanUploader from '../../components/vanUploader.vue'
|
|
|
+} from "../../api/index.js";
|
|
|
+import vanUploader from "../../components/vanUploader.vue";
|
|
|
export default {
|
|
|
components: { vanUploader },
|
|
|
data() {
|
|
|
@@ -103,178 +157,178 @@ export default {
|
|
|
fileList: [],
|
|
|
},
|
|
|
dateshow: false,
|
|
|
- appendFile: '',
|
|
|
+ appendFile: "",
|
|
|
workDate: new Date(),
|
|
|
minDate: new Date(2020, 0, 1),
|
|
|
maxDate: new Date(),
|
|
|
- orglist: '',
|
|
|
- positionSearch: '',
|
|
|
+ orglist: "",
|
|
|
+ positionSearch: "",
|
|
|
serviceTarget: [],
|
|
|
childList: [],
|
|
|
- id: '',
|
|
|
+ id: "",
|
|
|
orgform: {},
|
|
|
result: [],
|
|
|
resultId: [],
|
|
|
pics: [],
|
|
|
videos: [],
|
|
|
- }
|
|
|
+ };
|
|
|
},
|
|
|
created() {
|
|
|
- this.getStreetList()
|
|
|
- this.organizationDetail()
|
|
|
- this.organizationList()
|
|
|
+ this.getStreetList();
|
|
|
+ this.organizationDetail();
|
|
|
+ this.organizationList();
|
|
|
},
|
|
|
methods: {
|
|
|
getfileList(v, index) {
|
|
|
if (index == undefined) {
|
|
|
if (
|
|
|
- v.indexOf('.png') != -1 ||
|
|
|
- v.indexOf('.jpg') != -1 ||
|
|
|
- v.indexOf('.jpeg') != -1
|
|
|
+ v.indexOf(".png") != -1 ||
|
|
|
+ v.indexOf(".jpg") != -1 ||
|
|
|
+ v.indexOf(".jpeg") != -1
|
|
|
) {
|
|
|
- this.pics.push(v)
|
|
|
+ this.pics.push(v);
|
|
|
} else {
|
|
|
- this.videos.push(v)
|
|
|
+ this.videos.push(v);
|
|
|
}
|
|
|
} else {
|
|
|
- if (v == '图片') {
|
|
|
- this.pics.splice(index, 1)
|
|
|
+ if (v == "图片") {
|
|
|
+ this.pics.splice(index, 1);
|
|
|
} else {
|
|
|
- this.videos.splice(index, 1)
|
|
|
+ this.videos.splice(index, 1);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
clickdateshow() {
|
|
|
- if (this.id) return
|
|
|
- this.dateshow = !this.dateshow
|
|
|
+ if (this.id) return;
|
|
|
+ this.dateshow = !this.dateshow;
|
|
|
},
|
|
|
clickstreetShow() {
|
|
|
- if (this.id) return
|
|
|
- this.streetShow = !this.streetShow
|
|
|
+ if (this.id) return;
|
|
|
+ this.streetShow = !this.streetShow;
|
|
|
},
|
|
|
async getStreetList() {
|
|
|
- const res = await getStreetList()
|
|
|
- this.streetList = res.data
|
|
|
+ const res = await getStreetList();
|
|
|
+ this.streetList = res.data;
|
|
|
},
|
|
|
async organizationList() {
|
|
|
- const res = await organizationList()
|
|
|
- this.orgform = res.data
|
|
|
+ const res = await organizationList();
|
|
|
+ this.orgform = res.data;
|
|
|
},
|
|
|
toggle(item) {
|
|
|
if (this.result.indexOf(String(item.name)) == -1) {
|
|
|
- this.result.push(String(item.name))
|
|
|
- this.resultId.push(String(item.id))
|
|
|
+ this.result.push(String(item.name));
|
|
|
+ this.resultId.push(String(item.id));
|
|
|
} else {
|
|
|
- var index = this.result.indexOf(String(item.name))
|
|
|
- var id = this.resultId.indexOf(String(item.name))
|
|
|
- this.result.splice(index, 1)
|
|
|
- this.resultId.splice(id, 1)
|
|
|
+ var index = this.result.indexOf(String(item.name));
|
|
|
+ var id = this.resultId.indexOf(String(item.name));
|
|
|
+ this.result.splice(index, 1);
|
|
|
+ this.resultId.splice(id, 1);
|
|
|
}
|
|
|
},
|
|
|
async organizationDetail() {
|
|
|
- const res = await organizationDetail({ id: '' })
|
|
|
- this.orglist = res.data
|
|
|
+ const res = await organizationDetail({ id: "" });
|
|
|
+ this.orglist = res.data;
|
|
|
},
|
|
|
onConfirm(value) {
|
|
|
- this.form.streetName = value.name
|
|
|
- this.form.areaId = value.id
|
|
|
- this.streetShow = false
|
|
|
+ this.form.streetName = value.name;
|
|
|
+ this.form.areaId = value.id;
|
|
|
+ this.streetShow = false;
|
|
|
},
|
|
|
ownerConfirm() {
|
|
|
- this.form.participateOrgName = this.result.join(',')
|
|
|
- this.form.participateOrgId = this.resultId.join(',')
|
|
|
- this.ownerShow = false
|
|
|
+ this.form.participateOrgName = this.result.join(",");
|
|
|
+ this.form.participateOrgId = this.resultId.join(",");
|
|
|
+ this.ownerShow = false;
|
|
|
},
|
|
|
dateConfirm(v) {
|
|
|
- this.form.workDate = this.timeFormat(v)
|
|
|
- this.dateshow = false
|
|
|
+ this.form.workDate = this.timeFormat(v);
|
|
|
+ this.dateshow = false;
|
|
|
},
|
|
|
onConfirmPicker(value) {
|
|
|
- this.serviceTarget.push(value.name)
|
|
|
- this.$set(this.form, 'helpChildren', this.serviceTarget.join(','))
|
|
|
- this.childList = []
|
|
|
- this.positionSearch = ''
|
|
|
+ this.serviceTarget.push(value.name);
|
|
|
+ this.$set(this.form, "helpChildren", this.serviceTarget.join(","));
|
|
|
+ this.childList = [];
|
|
|
+ this.positionSearch = "";
|
|
|
},
|
|
|
async consultationSave() {
|
|
|
if (this.pics.length == 0) {
|
|
|
- this.$toast.fail('请选择至少一张图片')
|
|
|
- return
|
|
|
+ this.$toast.fail("请选择至少一张图片");
|
|
|
+ return;
|
|
|
}
|
|
|
- this.form.pics = this.pics.join(',')
|
|
|
- this.form.videos = this.videos.join(',')
|
|
|
- var data = JSON.parse(JSON.stringify(this.form))
|
|
|
- data.workDate = data.workDate + ' 00:00:00'
|
|
|
- const res = await consultationSave(data)
|
|
|
- if (res.code == '0000') {
|
|
|
- this.$toast.success('成功')
|
|
|
- this.$emit('changactive', 1)
|
|
|
- this.form = { pics: [], videos: [] }
|
|
|
- this.pics = []
|
|
|
- this.videos = []
|
|
|
- this.$refs.vanimg.childrenClear()
|
|
|
- this.$refs.vanvideo.childrenClear()
|
|
|
+ this.form.pics = this.pics.join(",");
|
|
|
+ this.form.videos = this.videos.join(",");
|
|
|
+ var data = JSON.parse(JSON.stringify(this.form));
|
|
|
+ data.workDate = data.workDate + " 00:00:00";
|
|
|
+ const res = await consultationSave(data);
|
|
|
+ if (res.code == "0000") {
|
|
|
+ this.$toast.success("成功");
|
|
|
+ this.$emit("changactive", 1);
|
|
|
+ this.form = { pics: [], videos: [] };
|
|
|
+ this.pics = [];
|
|
|
+ this.videos = [];
|
|
|
+ this.$refs.vanimg.childrenClear();
|
|
|
+ this.$refs.vanvideo.childrenClear();
|
|
|
}
|
|
|
},
|
|
|
showPopup() {
|
|
|
- this.show = true
|
|
|
+ this.show = true;
|
|
|
},
|
|
|
getPositionList() {},
|
|
|
async afterRead(file) {
|
|
|
- file.status = 'uploading'
|
|
|
- file.message = '上传中...'
|
|
|
- let formDate = new FormData()
|
|
|
+ file.status = "uploading";
|
|
|
+ file.message = "上传中...";
|
|
|
+ let formDate = new FormData();
|
|
|
//添加入参
|
|
|
- formDate.append('file', file.file)
|
|
|
- const res = await uploadImage(formDate)
|
|
|
- if (res.code == '0000') {
|
|
|
- file.status = 'success'
|
|
|
- file.message = '成功'
|
|
|
+ formDate.append("file", file.file);
|
|
|
+ const res = await uploadImage(formDate);
|
|
|
+ if (res.code == "0000") {
|
|
|
+ file.status = "success";
|
|
|
+ file.message = "成功";
|
|
|
this.form.fileList.push({
|
|
|
url: res.data,
|
|
|
type: file.file.type,
|
|
|
- })
|
|
|
+ });
|
|
|
// 上传图片 设置col高度
|
|
|
if (this.form.fileList.length % 2 == 0) {
|
|
|
- var index = 3.2 * (this.form.fileList.length / 2 + 1) + 'rem'
|
|
|
- this.$refs.boxlist.style.height = index
|
|
|
+ var index = 3.2 * (this.form.fileList.length / 2 + 1) + "rem";
|
|
|
+ this.$refs.boxlist.style.height = index;
|
|
|
}
|
|
|
} else {
|
|
|
- file.status = 'failed'
|
|
|
- file.message = '上传失败'
|
|
|
+ file.status = "failed";
|
|
|
+ file.message = "上传失败";
|
|
|
}
|
|
|
},
|
|
|
deleteUploader(v, index) {
|
|
|
- console.log(index)
|
|
|
- this.form.fileList.splice(index.index, 1)
|
|
|
+ console.log(index);
|
|
|
+ this.form.fileList.splice(index.index, 1);
|
|
|
},
|
|
|
formatter(type, val) {
|
|
|
- if (type === 'year') {
|
|
|
- return val + '年'
|
|
|
+ if (type === "year") {
|
|
|
+ return val + "年";
|
|
|
}
|
|
|
- if (type === 'month') {
|
|
|
- return val + '月'
|
|
|
+ if (type === "month") {
|
|
|
+ return val + "月";
|
|
|
}
|
|
|
- if (type === 'day') {
|
|
|
- return val + '日'
|
|
|
+ if (type === "day") {
|
|
|
+ return val + "日";
|
|
|
}
|
|
|
- return val
|
|
|
+ return val;
|
|
|
},
|
|
|
timeFormat(time) {
|
|
|
// 时间格式化 2019-09-08
|
|
|
- let year = time.getFullYear()
|
|
|
- let month = time.getMonth() + 1
|
|
|
+ let year = time.getFullYear();
|
|
|
+ let month = time.getMonth() + 1;
|
|
|
if (month < 10) {
|
|
|
- month = '0' + month
|
|
|
+ month = "0" + month;
|
|
|
}
|
|
|
|
|
|
- let day = time.getDate()
|
|
|
+ let day = time.getDate();
|
|
|
if (day < 10) {
|
|
|
- day = '0' + day
|
|
|
+ day = "0" + day;
|
|
|
}
|
|
|
- return year + '-' + month + '-' + day
|
|
|
+ return year + "-" + month + "-" + day;
|
|
|
},
|
|
|
},
|
|
|
-}
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.case {
|
|
|
@@ -411,4 +465,4 @@ export default {
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|