13 changed files with 4893 additions and 1 deletions
@ -0,0 +1,559 @@ |
|||
<template> |
|||
<div class="g-add"> |
|||
<div class="g-add-page"> |
|||
<div class="g-left"> |
|||
<el-form ref="ref_form1" :inline="true" :model="formData" :rules="dataRule" class="form"> |
|||
<el-form-item label="所属组织" prop="gridId" label-width="150px" style="display: block"> |
|||
<el-select v-model.trim="formData.gridId" placeholder="请选择" clearable class="cell-width-1"> |
|||
<el-option v-for="item in gridList" :key="item.value" :label="item.label" :value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="上报渠道" label-width="150px" prop="sourceType"> |
|||
<el-select v-model="formData.sourceType" placeholder="请选择" size="small" clearable |
|||
class="cell-width-1"> |
|||
<el-option v-for="item in qudaoArray" :key="item.value" :label="item.label" :value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="工单号" prop="workOrderNum" label-width="150px" style="display: block"> |
|||
<el-input class="cell-width-1" maxlength="10" placeholder="请输入工单号" v-model="formData.workOrderNum" /> |
|||
</el-form-item> |
|||
<el-form-item label="接收时间" prop="happenTime" label-width="150px" style="display: block"> |
|||
<el-date-picker v-model="formData.happenTime" class="cell-width-1" type="datetime" |
|||
placeholder="接收时间" value-format="yyyy-MM-dd HH:mm:ss"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="问题描述" prop="eventContent" label-width="150px" style="display: block"> |
|||
<el-input class="cell-width-2" type="textarea" maxlength="500" show-word-limit :rows="5" |
|||
placeholder="请输入事件问题描述,不超过500字" v-model="formData.eventContent"></el-input> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="联系人" prop="name" label-width="150px" style="display: block"> |
|||
<el-input class="cell-width-1" maxlength="10" placeholder="请输入联系人姓名" v-model="formData.name" /> |
|||
</el-form-item> |
|||
<el-form-item label="联系电话" prop="mobile" label-width="150px" style="display: block"> |
|||
<el-input class="cell-width-1" maxlength="30" placeholder="请输入联系电话 " v-model="formData.mobile"> |
|||
</el-input> |
|||
</el-form-item> |
|||
<!-- |
|||
<el-form-item label="证件号" prop="idCard" label-width="150px" style="display: block"> |
|||
<el-input class="cell-width-1" maxlength="30" placeholder="请输入证件号" |
|||
v-model="formData.idCard"></el-input> |
|||
</el-form-item> --> |
|||
</el-form> |
|||
</div> |
|||
<div class="g-right"> |
|||
<el-form ref="ref_form2" :inline="true" :model="formData" :rules="dataRule" class="form"> |
|||
<el-form-item label="图片" label-width="150px" style="display: block"> |
|||
<el-upload :headers="$getElUploadHeaders()" :class="['avatar-uploader', { hide: hideUploadBtn }]" |
|||
ref="uploadPic" :action="uploadUlr" :disabled="uploadStatus" list-type="picture-card" |
|||
:on-exceed="exceedPic" :on-remove="removePic" :file-list="replayImgList" |
|||
:on-change="handleEditChange" :on-success="handleSuccess" :before-upload="handleBefore" |
|||
:limit="3"> |
|||
<span class="font-14">选择图片</span> |
|||
<div slot="tip" class="upload_tip"> |
|||
最多上传3张图片,图片支持jpg、jpeg、bmp、git或png格式 |
|||
</div> |
|||
</el-upload> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="地图位置" prop="longitude" label-width="150px" style="display: block"> |
|||
<div style="width: 500px"> |
|||
<el-form-item prop="location" style="display: block"> |
|||
<el-select v-model="formData.location" filterable remote :reserve-keyword="true" |
|||
placeholder="请输入关键词" :remote-method="remoteMethod" :loading="loading" |
|||
@keyup.enter.native="remoteMethod(formData.location)"> |
|||
<el-option v-for="(item, index) in searchOptions" @click.native="handleClickKey(index)" |
|||
:key="item.value" :label="item.label" :value="item.value"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<div id="app_event" class="div_map"></div> |
|||
</div> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="详细地址" prop="address" label-width="150px" style="display: block"> |
|||
<el-input class="cell-width-1" v-model="formData.address"> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 新增弹出框 --> |
|||
<!-- <el-dialog :visible.sync="personTableShow" :close-on-click-modal="false" :close-on-press-escape="false" |
|||
:destroy-on-close="true" title="选择居民" width="550px" top="5vh" class="dialog-h" @closed="diaClose"> |
|||
<div style="padding: 10px 30px"> |
|||
<el-form :inline="false" ref="ref_formSearch" :label-width="'90px'"> |
|||
<el-form-item label="所属网格" label-width="150px"> |
|||
<el-select class="cell-width-1" v-model.trim="selGridId" placeholder="请选择" clearable> |
|||
<el-option v-for="item in gridList" @click.native="handleChangeGrid" :key="`abc-${value}`" |
|||
:label="item.label" :value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="居民" label-width="150px" prop="selPersonIndex"> |
|||
<el-select v-model="selPersonIndex" class="cell-width-1" filterable placeholder="请选择" clearable> |
|||
<el-option v-for="(item, index) in demandUserList" :key="item.demandUserId" :label="item.label" |
|||
:value="index"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="div-btn"> |
|||
<el-button style="margin-left: 20px" type="primary" size="small" |
|||
@click="handleComfirmSelPerson">确定</el-button> |
|||
</div> |
|||
</div> |
|||
</el-dialog> --> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { Loading } from "element-ui"; // 引入Loading服务 |
|||
import { requestPost } from "@/js/dai/request"; |
|||
import formVltHelper from "dai-js/tools/formVltHelper"; |
|||
import daiMap from "@/utils/dai-map"; |
|||
import { isCard } from "@/utils/validate"; |
|||
let loading; // 加载动画 |
|||
var map; |
|||
var search; |
|||
var markers; |
|||
var infoWindowList; |
|||
var geocoder; // 新建一个正逆地址解析类 |
|||
|
|||
function iniFmData() { |
|||
return { |
|||
gridId: "", //所属网格 |
|||
reportUserId: "", // 上报人ID |
|||
name: "", // 上报人姓名 |
|||
mobile: "", // 联系电话 |
|||
idCard: "", // 证件号 |
|||
sourceType: "", // 反映渠道 |
|||
happenTime: "", //上报时间 |
|||
eventContent: "", // 事件内容 |
|||
imageList: [], // 图片集合 |
|||
// categoryList: [],// 二类分类Id |
|||
address: "", //事件地址 |
|||
latitude: "", // 经度 |
|||
longitude: "", //维度 |
|||
workOrderNum : "" //工单号 |
|||
// operationType: '0',// 处理方式 |
|||
// content: '',//回复内容 |
|||
// status: '',// 处理中:processing;已办结:closed_case |
|||
}; |
|||
} |
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
formType: "add", //表单操作类型 add新增,edit编辑,detail详情 |
|||
searchOptions: [], |
|||
searchValue: '', |
|||
resultList: [], |
|||
loading: false, |
|||
btnDisable: false, |
|||
gridList: [], //所属网格list--场所区域 |
|||
qudaoArray: [ |
|||
// { |
|||
// value: "1", |
|||
// label: "多媒体反应", |
|||
// }, |
|||
// { |
|||
// value: "2", |
|||
// label: "社区电话", |
|||
// }, |
|||
{ |
|||
value: "3", |
|||
label: "12345", |
|||
}, |
|||
// { |
|||
// value: "4", |
|||
// label: "网络员手持终端", |
|||
// }, |
|||
], |
|||
|
|||
formData: iniFmData(), |
|||
|
|||
//地图相关 |
|||
keyWords: "", |
|||
isFirst: true, //地图是否首次加载,首次加载不给地址赋值 |
|||
|
|||
//图片相关 oss/file/uploadvariedfile |
|||
dialogImageUrl: "oss/file/uploadvariedfile", |
|||
uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadvariedfile", |
|||
// upload_url: '', // 上传URL |
|||
upload_name: "", // 图片或视频名称 |
|||
replayImgList: [], |
|||
|
|||
okflag: false, |
|||
uploadStatus: false, |
|||
|
|||
formDataSearch: { |
|||
gridId: "", |
|||
name: "", |
|||
}, |
|||
personTableShow: false, |
|||
selGridId: "", |
|||
selPersonIndex: "", |
|||
selPerson: {}, |
|||
demandUserList: [], |
|||
|
|||
hideUploadBtn: false, |
|||
}; |
|||
}, |
|||
components: {}, |
|||
computed: { |
|||
dataRule() { |
|||
return { |
|||
gridId: [ |
|||
{ required: true, message: "所属组织不能为空", trigger: "blur" }, |
|||
], |
|||
workOrderNum :[ |
|||
{ required: true, message: "工单号不能为空", trigger: "blur" } |
|||
], |
|||
name: [ |
|||
{ required: true, message: "联系人不能为空", trigger: "blur" } |
|||
], |
|||
sourceType: [ |
|||
{ required: true, message: "反映渠道不能为空", trigger: "blur" }, |
|||
], |
|||
eventContent: [ |
|||
{ required: true, message: "事件内容不能为空", trigger: "blur" }, |
|||
], |
|||
happenTime: [ |
|||
{ required: true, message: "上报时间不能为空", trigger: "blur" }, |
|||
], |
|||
address: [ |
|||
{ required: true, message: "事件地址不能为空", trigger: "blur" }, |
|||
], |
|||
longitude: [ |
|||
{ required: true, message: "坐标位置不能为空", trigger: "blur" }, |
|||
], |
|||
}; |
|||
}, |
|||
}, |
|||
props: {}, |
|||
watch: { |
|||
"formData.name": function (val) { |
|||
this.$emit("changeName", val); |
|||
}, |
|||
"formData.mobile": function (val) { |
|||
this.$emit("changeMobile", val); |
|||
}, |
|||
"formData.reportUserId": function (val) { |
|||
this.$emit("changeUserId", val); |
|||
}, |
|||
"formData.gridId": function (val) { |
|||
this.selGridId = val; |
|||
this.$emit("changeGridId", val); |
|||
}, |
|||
}, |
|||
|
|||
async mounted() { |
|||
const { user } = this.$store.state; |
|||
this.agencyId = user.agencyId; |
|||
let { latitude, longitude } = this.$store.state.user; |
|||
if (!latitude || latitude == "" || latitude == "0") { |
|||
latitude = 39.9088810666821; |
|||
longitude = 116.39743841556731; |
|||
} |
|||
this.formData.latitude = latitude; |
|||
this.formData.longitude = longitude; |
|||
this.initMap(this.formData.latitude, this.formData.longitude); |
|||
this.loadGrid(); |
|||
this.getCategoryList(); |
|||
}, |
|||
|
|||
methods: { |
|||
async handleShowPersonList() { |
|||
if (this.formData.gridId) { |
|||
await this.handleChangeGrid(); |
|||
this.personTableShow = true; |
|||
} else { |
|||
this.$message.info("请先选择网格"); |
|||
} |
|||
}, |
|||
diaClose() { |
|||
this.personTableShow = false; |
|||
}, |
|||
handleComfirmSelPerson() { |
|||
if (this.selPersonIndex === 0 || this.selPersonIndex) { |
|||
let selPerson = this.demandUserList[this.selPersonIndex]; |
|||
this.formData.name = selPerson.demandUserName; |
|||
this.formData.mobile = selPerson.demandUserMobile; |
|||
this.formData.reportUserId = selPerson.demandUserId; |
|||
this.formData.idCard = selPerson.idCard; |
|||
|
|||
this.personTableShow = false; |
|||
} else { |
|||
this.$message.info("请选择人员"); |
|||
} |
|||
}, |
|||
|
|||
async handleChangeGrid() { |
|||
const url = "/epmetuser/icresiuser/demandusers"; |
|||
// const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/epidemicPrevention/page" |
|||
let params = { |
|||
agencyId: "", |
|||
gridId: this.selGridId, |
|||
name: "", |
|||
}; |
|||
|
|||
const { data, code, msg } = await requestPost(url, params); |
|||
|
|||
if (code === 0) { |
|||
this.demandUserList = data; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
this.tableLoading = false; |
|||
}, |
|||
|
|||
async loadGrid() { |
|||
const url = "/gov/org/customergrid/gridoption"; |
|||
let params = { |
|||
agencyId: this.agencyId, |
|||
purpose: "query", |
|||
}; |
|||
const { data, code, msg } = await requestPost(url, params); |
|||
if (code === 0) { |
|||
this.gridList = data; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
async getCategoryList() { |
|||
const url = "/governance/icEvent/getCategoryTree"; |
|||
let params = {}; |
|||
const { data, code, msg } = await requestPost(url, params); |
|||
if (code === 0) { |
|||
let treeDataNew = this.deepTree(data, "children"); |
|||
// this.categrayList = data |
|||
//组织级联数据 |
|||
++this.iscascaderShow; |
|||
this.casOptions = []; |
|||
this.selCategoryArray = []; |
|||
this.casOptions = treeDataNew; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
|
|||
//重构树,去除网格 |
|||
deepTree(arr, children) { |
|||
if (Array.isArray(arr) && arr.length > 0) { |
|||
return arr.map((item) => { |
|||
return { |
|||
...item, |
|||
[children]: |
|||
(item[children] && |
|||
item[children].length > 0 && |
|||
this.deepTree(item[children], children)) || |
|||
null, |
|||
}; |
|||
}); |
|||
} |
|||
}, |
|||
|
|||
handleChangeAgency(value) { |
|||
// this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label |
|||
// this.orgId = this.selCategoryArray.length > 0 ? this.selCategoryArray[this.selCategoryArray.length - 1] : '' |
|||
}, |
|||
|
|||
async getEventInfo() { |
|||
this.okflag = false; |
|||
this.$refs["ref_form1"].validate((valid, messageObj) => { |
|||
if (!valid) { |
|||
app.util.validateRule(messageObj); |
|||
return false; |
|||
} else { |
|||
this.$refs["ref_form2"].validate((valid, messageObj) => { |
|||
if (!valid) { |
|||
app.util.validateRule(messageObj); |
|||
return false; |
|||
} else { |
|||
if (!formVltHelper.userOrMobile(this.formData.mobile)) { |
|||
this.$message({ |
|||
type: "error", |
|||
message: "联系电话格式有误", |
|||
}); |
|||
return false; |
|||
} |
|||
|
|||
const regCard = /(^\d{15}$)|(^\d{17}(\d|X)$)/; //证件号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X |
|||
if ( |
|||
this.formData.idCard && |
|||
regCard.test(this.formData.idCard) === false |
|||
) { |
|||
this.$message({ |
|||
type: "warning", |
|||
message: "请输入正确的证件号码", |
|||
}); |
|||
return false; |
|||
} |
|||
this.okflag = true; |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
removePic(file, fileList) { |
|||
this.formData.imageList.splice( |
|||
this.formData.imageList.findIndex((item) => item === file.url), |
|||
1 |
|||
); |
|||
this.replayImgList.splice( |
|||
this.replayImgList.findIndex((item) => item.uid === file.uid), |
|||
1 |
|||
); |
|||
this.hideUploadBtn = fileList.length >= 3; |
|||
}, |
|||
// 最多上传3张图,超过时隐藏上传按钮 |
|||
handleEditChange(file, fileList) { |
|||
this.hideUploadBtn = fileList.length >= 3; |
|||
}, |
|||
exceedPic() { |
|||
this.$message.warning("最多上传3张预览图片"); |
|||
}, |
|||
handleBefore(file) { |
|||
if (this.uploadStatus) { |
|||
return false |
|||
} |
|||
this.uploadStatus = true |
|||
return true |
|||
}, |
|||
handleSuccess(response, file, fileList) { |
|||
this.uploadStatus = false |
|||
this.replayImgList.push(file); |
|||
this.formData.imageList.push(response.data.url); |
|||
}, |
|||
|
|||
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|||
initMap(latitude, longitude) { |
|||
this.$nextTick(() => { |
|||
map = new daiMap( |
|||
document.getElementById("app_event"), |
|||
{ latitude, longitude }, |
|||
{ |
|||
zoom: 17.2, // 设置地图缩放级别 |
|||
pitch: 43.5, // 设置俯仰角 |
|||
rotation: 45, // 设置地图旋转角度 |
|||
} |
|||
); |
|||
|
|||
// 监听地图平移结束 |
|||
map.on("dragend", (e) => { |
|||
this.handleMoveCenter(e); |
|||
}); |
|||
|
|||
map.setCenter(latitude, longitude); |
|||
map.setMarker(latitude, longitude); |
|||
}) |
|||
|
|||
}, |
|||
|
|||
|
|||
async handleMoveCenter() { |
|||
//修改地图中心点 |
|||
const { lat, lng } = map.getCenter(); |
|||
this.formData.latitude = lat; |
|||
this.formData.longitude = lng; |
|||
map.setMarker(lat, lng); |
|||
this.$EventBus.$emit('map', { lat, lng }) |
|||
let { msg, data } = await map.getAddress(lat, lng); |
|||
if (msg == "success") { |
|||
this.formData.address = data.address |
|||
this.searchValue = data.address |
|||
this.searchOptions = [] |
|||
|
|||
} |
|||
}, |
|||
|
|||
async remoteMethod(query) { |
|||
if (query !== '') { |
|||
this.loading = true; |
|||
const { msg, data } = await map.searchNearby(query); |
|||
this.loading = false; |
|||
this.resultList = []; |
|||
if (msg == 'success' && data.resultList && data.resultList.length > 0) { |
|||
if (data.resultList && data.resultList.length > 0) { |
|||
this.resultList = data.resultList; |
|||
this.searchOptions = this.resultList.map(item => { |
|||
return { value: `${item.id}`, label: `${item.address + item.name}` }; |
|||
}); |
|||
} |
|||
} else { |
|||
this.searchOptions = [ |
|||
{ |
|||
value: '0', |
|||
label: '未检索到结果' |
|||
} |
|||
]; |
|||
} |
|||
} else { |
|||
this.searchOptions = []; |
|||
} |
|||
}, |
|||
|
|||
handleClickKey(index) { |
|||
let selPosition = this.resultList[index] |
|||
let lonlat = selPosition.lonlat.split(" ") |
|||
map.setCenter(lonlat[1], lonlat[0]); |
|||
map.setMarker(lonlat[1], lonlat[0]); |
|||
this.formData.latitude = lonlat[1]; |
|||
this.formData.longitude = lonlat[0]; |
|||
this.formData.address = selPosition.address + selPosition.name |
|||
}, |
|||
|
|||
resetData() { |
|||
this.formData = iniFmData(); |
|||
this.replayImgList = []; |
|||
this.searchValue = '' |
|||
this.searchOptions = [] |
|||
this.resultList = [] |
|||
}, |
|||
// 开启加载动画 |
|||
startLoading() { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: "正在加载……", // 加载中需要显示的文字 |
|||
background: "rgba(0,0,0,.7)", // 背景颜色 |
|||
}); |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading() { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close(); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
@import "@/assets/scss/modules/shequzhili/event-info.scss"; |
|||
|
|||
.item_width_4 { |
|||
width: 350px; |
|||
} |
|||
|
|||
.div_map { |
|||
margin-top: 10px; |
|||
} |
|||
</style> |
|||
|
|||
<style lang="scss" scoped> |
|||
.el-dialog__body { |
|||
padding: 0 10px 20px !important; |
|||
} |
|||
|
|||
.hide { |
|||
.el-upload--picture-card { |
|||
display: none !important; |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,283 @@ |
|||
<template> |
|||
<div class=""> |
|||
<el-card :style="containerStyle" :class="{ 'box-card': source === 'visiual' }" v-if="showType == ''"> |
|||
<h3 v-if="source === 'manage'" class="h3-title"> |
|||
<img src="../../../../../assets/images/index/title-icon-sqzl.png" width="30px" height="30px" alt="" /> |
|||
事件详情 |
|||
</h3> |
|||
<div class="m-detail-main"> |
|||
<div class="m-info"> |
|||
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]"> |
|||
<span class="u-info-title-2">所属组织:</span> |
|||
<span>{{ info.gridName }}</span> |
|||
</div> |
|||
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]"> |
|||
<span class="u-info-title-2">接收时间:</span> |
|||
<span>{{ info.happenTime }}</span> |
|||
</div> |
|||
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]"> |
|||
<span class="u-info-title-2">工单号:</span> |
|||
<span>{{ info.workOrderNum }}</span> |
|||
</div> |
|||
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]"> |
|||
<span class="u-info-title-2">事件内容:</span> |
|||
<span>{{ info.eventContent }}</span> |
|||
</div> |
|||
|
|||
<div v-if="info.imageList && info.imageList.length > 0" |
|||
:class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]"> |
|||
<span class="u-info-title-2">图片:</span> |
|||
<img :src="src" :key="src" style="width: 150px; height: 150px; padding-right: 10px" |
|||
v-for="src in info.imageList" @click="watchImg(src)" /> |
|||
</div> |
|||
<div v-if="info.voiceList && info.voiceList.length > 0" |
|||
:class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]"> |
|||
<span class="u-info-title-2">语音:</span> |
|||
<audio controls> |
|||
<source :src="item.url" type="" :key="item.url" v-for="item in info.voiceList" /> |
|||
</audio> |
|||
</div> |
|||
|
|||
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]"> |
|||
<span class="u-info-title-2">上报渠道:</span> |
|||
<span>{{ info.sourceTypeName }}</span> |
|||
</div> |
|||
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]"> |
|||
<span class="u-info-title-2">详细地址</span> |
|||
<span>{{ info.address }}</span> |
|||
</div> |
|||
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]"> |
|||
<span class="u-info-title-2">联系人:</span> |
|||
<span>{{ info.name }}</span> |
|||
</div> |
|||
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]"> |
|||
<span class="u-info-title-2">联系电话:</span> |
|||
<span>{{ info.mobile }}</span> |
|||
</div> |
|||
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]"> |
|||
<span class="u-info-title-2">标记:</span> |
|||
<span>{{ info.markTypeName || "--" }}</span> |
|||
</div> |
|||
<div v-if="info.satisfactionName" |
|||
:class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]"> |
|||
<span class="u-info-title-2">满意度:</span> |
|||
<div>{{ info.satisfactionName }}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- |
|||
显示关闭: |
|||
1、状态=完成 (已评价)||(没评价&&不是本人) |
|||
2、状态=未完成 (有操作id) |
|||
--> |
|||
<div v-if="(info.status === 'processing' && info.operationId) || (info.status === 'closed_case' && |
|||
(info.satisfactionName || (!info.satisfactionName && user.id != info.createdUserId)))" |
|||
class="div-btn-info"> |
|||
<el-button size="small" @click="handleCloseEvent">关闭</el-button> |
|||
</div> |
|||
</el-card> |
|||
<el-card :class="{ 'box-card': source === 'visiual' }" v-if="info.status === 'closed_case' && !info.satisfactionName |
|||
&& user.id === info.createdUserId" style="width: 184%;"> |
|||
<h3>满意度评价</h3> |
|||
<div class="m-detail-main"> |
|||
<div class="m-info"> |
|||
<div class="div-satisfy"> |
|||
<el-radio-group :class="{ 'form-item': source === 'visiual' }" v-model="satisfyLevel" |
|||
@change="clickSatisfy"> |
|||
<el-radio label="good">满意</el-radio> |
|||
<el-radio label="perfect">基本满意</el-radio> |
|||
<el-radio label="bad">不满意</el-radio> |
|||
</el-radio-group> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="div-btn"> |
|||
<el-button size="small" @click="handleCloseEvent">关闭</el-button> |
|||
<el-button style="margin-left: 20px" type="primary" size="small" |
|||
@click="handleComfirmSatisfy">确定</el-button> |
|||
</div> |
|||
</el-card> |
|||
<el-dialog :visible.sync="showSatisfy" :close-on-click-modal="false" :close-on-press-escape="false" title="满意度评价" |
|||
width="550px" top="15vh" class="dialog-h" @closed="showSatisfy = false"> |
|||
<div class="div-btn"> |
|||
<el-button size="small" @click="showSatisfy = false">关闭</el-button> |
|||
<el-button style="margin-left: 20px" type="primary" size="small" |
|||
@click="handleComfirmSatisfy">确定</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { requestPost } from "@/js/dai/request"; |
|||
import foldText from "@/views/components/foldText"; |
|||
import projectInfo from "../../xiangmu/cpts/project-info"; |
|||
|
|||
function iniData() { |
|||
return { |
|||
user: {}, |
|||
projectPageType: "info", |
|||
info: {}, |
|||
eventDetailCopy: {}, |
|||
showType: "", |
|||
projectId: "", |
|||
demandForm: { |
|||
gridId: "", |
|||
categoryCode: "", |
|||
parentCode: "", |
|||
content: "", |
|||
reportType: "", |
|||
reportUserName: "", |
|||
reportUserMobile: "", |
|||
reportTime: "", |
|||
wantServiceTime: "", |
|||
demandUserId: "", |
|||
demandUserName: "", |
|||
demandUserMobile: "", |
|||
}, |
|||
satisfyLevel: "", |
|||
//满意度评价 |
|||
showSatisfy: false, |
|||
}; |
|||
} |
|||
|
|||
export default { |
|||
name: "issueInfo", |
|||
props: { |
|||
eventId: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
type: { |
|||
type: String, |
|||
default: "info", |
|||
}, |
|||
|
|||
eventDetailData: { |
|||
type: Object, |
|||
default() { |
|||
return {}; |
|||
}, |
|||
}, |
|||
source: { |
|||
//展示来源:manage 管理平台 visiual 可视化平台 |
|||
type: String, |
|||
default: "manage", |
|||
}, |
|||
}, |
|||
|
|||
components: { |
|||
foldText, |
|||
projectInfo, |
|||
}, |
|||
|
|||
data: iniData, |
|||
|
|||
|
|||
watch: {}, |
|||
created() { }, |
|||
computed: { |
|||
containerStyle() { |
|||
if (this.type === 'info') { |
|||
return { |
|||
minHeight: 'calc(88vh - 50px)', |
|||
overflow: 'auto', |
|||
position: 'relative' |
|||
} |
|||
} else { |
|||
return {} |
|||
} |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.user = this.$store.state.user; |
|||
if (this.eventId) { |
|||
this.info = JSON.parse(JSON.stringify(this.eventDetailData)); |
|||
|
|||
//如果已经评价过,进行回显 |
|||
// if (this.info.status === 'closed_case' && this.info.satisfactionName) { |
|||
// this.changeSatisfyType(this.info.satisfaction) |
|||
// } |
|||
} |
|||
// this.getApiData(); |
|||
}, |
|||
|
|||
methods: { |
|||
watchImg(src) { |
|||
window.open(src); |
|||
}, |
|||
|
|||
handleClose() { |
|||
this.showType = ""; |
|||
}, |
|||
|
|||
handleCloseEvent() { |
|||
this.$emit("handleClose"); |
|||
}, |
|||
|
|||
async getApiData() { }, |
|||
|
|||
//满意度评价 |
|||
handleSatisfy() { |
|||
this.showSatisfy = true; |
|||
}, |
|||
|
|||
clickSatisfy(type) { |
|||
if (this.info.satisfactionName) { |
|||
return false; |
|||
} |
|||
this.satisfyLevel = type; |
|||
}, |
|||
|
|||
async handleComfirmSatisfy() { |
|||
if (!this.satisfyLevel) { |
|||
this.$message.info("请选择评价级别"); |
|||
} |
|||
const url = "/governance/icEvent/comment"; |
|||
let params = { |
|||
icEventId: this.eventId, |
|||
satisfaction: this.satisfyLevel, |
|||
}; |
|||
const { data, code, msg } = await requestPost(url, params); |
|||
if (code === 0) { |
|||
this.$message.success("评价成功"); |
|||
this.info.satisfactionName = |
|||
this.satisfyLevel == "bad" |
|||
? "不满意" |
|||
: this.satisfyLevel == "good" |
|||
? "满意" |
|||
: "非常满意"; |
|||
this.showSatisfy = false; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
@import "@/assets/scss/modules/shequzhili/event-info.scss"; |
|||
|
|||
.m-info { |
|||
padding-left: 0px !important; |
|||
} |
|||
|
|||
.m-info-prop { |
|||
margin: 25px 0 !important; |
|||
padding-left: 0px !important; |
|||
|
|||
&::before { |
|||
content: ""; |
|||
display: block; |
|||
position: absolute; |
|||
top: 9px; |
|||
left: 0; |
|||
width: 7px; |
|||
height: 7px; |
|||
background: none !important; |
|||
border-radius: 3px; |
|||
margin-right: 10px; |
|||
} |
|||
} |
|||
</style> |
|||
|
|||
@ -0,0 +1,572 @@ |
|||
<template> |
|||
<div class=""> |
|||
<div v-if="pageTypeCopy == 'add'"> |
|||
<el-card> |
|||
<h3 class="h3-title"><img src="../../../../../assets/images/index/title-icon-zntb.png" width="30px" |
|||
height="30px" alt=""> 新增事件</h3> |
|||
<event-add ref="ref_add" @changeName="changeName" @changeMobile="changeMobile" @changeUserId="changeUserId" |
|||
@changeGridId="changeGridId"></event-add> |
|||
</el-card> |
|||
|
|||
<div class="process-form"> |
|||
<el-card> |
|||
<h3 class="h3-title"><img src="../../../../../assets/images/index/title-icon-chuli.png" width="30px" |
|||
height="30px" alt=""> 处理</h3> |
|||
<process-form ref="ref_processinfo_add" :demandUserId="demandUserId" :eventDetailData="eventDetailData" |
|||
:demandUserName="demandUserName" :demandUserMobile="demandUserMobile" |
|||
:gridId="gridId"></process-form> |
|||
|
|||
<div class="div-btn"> |
|||
<el-button size="small" @click="handleClose">关闭</el-button> |
|||
<el-button style="margin-left: 20px" type="primary" size="small" |
|||
@click="handleComfirm">保存</el-button> |
|||
</div> |
|||
</el-card> |
|||
</div> |
|||
</div> |
|||
|
|||
<div v-if="pageTypeCopy == 'dispose' || pageTypeCopy == 'info'" class="g-page"> |
|||
<!-- 面包屑放到这里--> |
|||
<div class="tabs" v-if="pageTypeCopy == 'info'"> |
|||
<i class="el-icon-arrow-left"></i> |
|||
<el-button class="diy-button--white" style="height: 20px" @click="handleClose"> |
|||
查看详情</el-button> |
|||
</div> |
|||
<div :class="['g-total', { 'g-left': projectProcess.length > 0, 'g-left-top40': pageType == 'info' }]" |
|||
style="z-index: 1;"> |
|||
<event-detail ref="ref_detail" :type="pageType" :eventId="eventId" :eventDetailData="eventDetailData" |
|||
:source="source" @handleToProject="handleToProject" @handleToDemand="handleToDemand" |
|||
@handleToIssue="handleToIssue" @handleClose="handleClose"></event-detail> |
|||
|
|||
<div v-if="!eventDetailData.operationId && pageTypeCopy == 'dispose'" class="process-form"> |
|||
<el-card :class="{ 'box-card': source === 'visiual' }"> |
|||
<div :class="['process-title', { 'process-title-vis': source === 'visiual' },]"> |
|||
<img src="../../../../../assets/images/index/title-icon-chuli.png" width="30px" height="30px" |
|||
alt=""> 处理 |
|||
</div> |
|||
<process-form ref="ref_processinfo_dispose" :source="source" :eventId="eventId" |
|||
:eventDetailData="eventDetailData"></process-form> |
|||
<div class="div-btn"> |
|||
<el-button size="small" @click="handleClose">关闭</el-button> |
|||
<el-button style="margin-left: 20px" type="primary" size="small" |
|||
@click="handleComfirm">保存</el-button> |
|||
</div> |
|||
</el-card> |
|||
</div> |
|||
</div> |
|||
|
|||
<div v-if="projectProcess.length > 0" :class="['g-right', pageType == 'info' ? 'g-right-top40' : '']"> |
|||
<el-card :class="{ 'box-card': source === 'visiual' }" |
|||
style="min-height: calc(88vh - 50px); overflow: auto"> |
|||
<div class="m-process"> |
|||
<div :class="['process-title', { 'process-title-vis': source === 'visiual' },]"> |
|||
<img src="../../../../../assets/images/index/title-icon-cljz.png" width="30px" height="30px" |
|||
alt="" /> |
|||
处理进展 |
|||
</div> |
|||
<div class="list"> |
|||
<div class="item" :class="[index === 0 ? 'z-on' : '', { 'item-vis': source === 'visiual' }, |
|||
]" :key="item.processId" v-for="(item, index) in projectProcess"> |
|||
<div class="item-row"> |
|||
<template v-if="item.agencyId"> |
|||
<div class="name">指派</div> |
|||
</template> |
|||
<template v-if="!item.timeLimit"> |
|||
<div class="name">完成并回复</div> |
|||
</template> |
|||
<template v-if="!item.agencyId && item.timeLimit"> |
|||
<div class="name">{{ item.processName }}</div> |
|||
</template> |
|||
<div class="date"> |
|||
{{ item.processTime }} |
|||
</div> |
|||
</div> |
|||
<div v-if="item.type === 'event'"> |
|||
<template v-if="item.agencyId"> |
|||
<div class="detail"> |
|||
<div class="detail-field">指派人:</div> |
|||
<div class="detail-value">{{ item.departmentName }}</div> |
|||
</div> |
|||
<div class="detail"> |
|||
<div class="detail-field">指派部门:</div> |
|||
<div class="detail-value">{{ item.agencyName }}</div> |
|||
</div> |
|||
<div class="detail"> |
|||
<div class="detail-field">转办意见:</div> |
|||
<div class="detail-value">{{ item.publicReply }}</div> |
|||
</div> |
|||
<div class="detail"> |
|||
<div class="detail-field">办结时限:</div> |
|||
<div class="detail-value">{{ formTimeLimit(item.timeLimit) }}</div> |
|||
</div> |
|||
<template v-if="item.internalFile && item.internalFile.length > 0" |
|||
v-for="i in item.internalFile"> |
|||
<template v-if="i.type === 'image'"> |
|||
<div class="detail"> |
|||
<div class="detail-field">图片:</div> |
|||
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]"> |
|||
<img :src="i.url" :key="i.url" |
|||
style="width: 50px; height: 50px; padding-right: 10px" |
|||
@click="watchImg(i.url)" /> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
<template v-if="i.type === 'voice'"> |
|||
<div class="detail"> |
|||
<div class="detail-field">语音:</div> |
|||
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]"> |
|||
<audio controls> |
|||
<source :src="i.url" type="" :key="i.url" /> |
|||
</audio> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
<template v-if="i.type === 'doc'"> |
|||
<div class="detail"> |
|||
<div class="detail-field">附件:</div> |
|||
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]"> |
|||
<a :href="i.url">{{ i.name }}</a> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
</template> |
|||
</template> |
|||
<template v-else> |
|||
<div class="detail"> |
|||
<div class="detail-field">回复人:</div> |
|||
<div class="detail-value">{{ item.departmentName }}</div> |
|||
</div> |
|||
<div class="detail"> |
|||
<div class="detail-field">回复内容:</div> |
|||
<div class="detail-value">{{ item.publicReply }}</div> |
|||
</div> |
|||
<div class="detail" v-if="item.timeLimit"> |
|||
<div class="detail-field">办结时限:</div> |
|||
<div class="detail-value">{{ formTimeLimit(item.timeLimit) }}</div> |
|||
</div> |
|||
<template v-if="item.internalFile && item.internalFile.length > 0" |
|||
v-for="i in item.internalFile"> |
|||
<template v-if="i.type === 'image'"> |
|||
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]"> |
|||
<span class="u-info-title-2">图片:</span> |
|||
<img :src="i.url" :key="i.url" |
|||
style="width: 150px; height: 150px; padding-right: 10px" |
|||
@click="watchImg(i.url)" /> |
|||
</div> |
|||
</template> |
|||
<template v-if="i.type === 'voice'"> |
|||
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]"> |
|||
<span class="u-info-title-2">语音:</span> |
|||
<audio controls> |
|||
<source :src="i.url" type="" :key="i.url" /> |
|||
</audio> |
|||
</div> |
|||
</template> |
|||
<template v-if="i.type === 'doc'"> |
|||
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]"> |
|||
<span class="u-info-title-2">语音:</span> |
|||
<audio controls> |
|||
<source :src="i.url" type="" :key="i.url" /> |
|||
</audio> |
|||
</div> |
|||
</template> |
|||
</template> |
|||
</template> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</el-card> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- <div v-if="pageTypeCopy == 'project'"> |
|||
<project-info-origin ref="eleEditForm" :source="source" :sourceType="sourceType" :type="projectPageType" |
|||
:eventId="eventId" :projectId="eventDetailCopy.operationId" @close="handleCloseProject" |
|||
@afterEdit="handleCloseProject" /> |
|||
</div> |
|||
<div v-if="pageTypeCopy == 'demand'"> |
|||
<demand-info-origin ref="demandEditForm" :source="source" :demandRecId="eventDetailCopy.operationId" |
|||
@close="handleCloseProject" /> |
|||
</div> |
|||
<div v-if="pageTypeCopy == 'issue'"> |
|||
<issue-info-origin ref="eleEditForm" :pageType="issuePageType" :issueId="eventDetailCopy.operationId" |
|||
:issueDetailData="issueDetailData" @handleClose="handleCloseProject" @handleOk="handleCloseProject" |
|||
@dialogOk="handleCloseProject" /> |
|||
</div> --> |
|||
<!-- <div v-if="pageTypeCopy == 'issue'"> |
|||
<issue-info-origin ref="eleEditForm" :pageType="issuePageType" :issueId="eventDetailCopy.operationId" |
|||
:issueDetailData="issueDetailData" @handleClose="handleCloseProject" @handleOk="handleCloseProject" |
|||
@dialogOk="handleCloseProject" /> |
|||
</div> --> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { requestPost } from "@/js/dai/request"; |
|||
import { Loading } from "element-ui"; // 引入Loading服务 |
|||
import foldText from "@/views/components/foldText"; |
|||
import projectInfoOrigin from "../../xiangmu/cpts/project-info"; |
|||
import demandInfoOrigin from "@/views/modules/communityService/measure/info"; |
|||
import issueInfoOrigin from "../../issue/cpts/issue-info"; |
|||
import dateFormat from "dai-js/tools/dateFormat"; |
|||
import eventAdd from "./add"; |
|||
import eventDetail from "./event-detail"; |
|||
import processForm from "./process-form"; |
|||
|
|||
let loading; // 加载动画 |
|||
function iniData() { |
|||
return { |
|||
formData: { |
|||
operationType: "", |
|||
}, |
|||
eventInfoData: {}, |
|||
replayInfo: {}, |
|||
demand: {}, |
|||
project: {}, |
|||
issueInfo: {}, |
|||
|
|||
//新增 |
|||
demandUserId: "", |
|||
demandUserName: "", |
|||
demandUserMobile: "", |
|||
gridId: "", |
|||
|
|||
eventDetailCopy: {}, |
|||
|
|||
projectProcess: [], |
|||
projectPageType: "info", |
|||
pageTypeCopy: "", |
|||
|
|||
issuePageType: "", |
|||
issueDetailData: {}, |
|||
|
|||
sourceType: "", |
|||
}; |
|||
} |
|||
|
|||
export default { |
|||
name: "projectInfo", |
|||
props: { |
|||
eventId: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
pageType: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
eventDetailData: { |
|||
type: Object, |
|||
default() { |
|||
return {}; |
|||
}, |
|||
}, |
|||
|
|||
source: { |
|||
//展示来源:manage 管理平台 visiual 可视化平台 |
|||
type: String, |
|||
default: "manage", |
|||
}, |
|||
}, |
|||
|
|||
components: { |
|||
foldText, |
|||
eventAdd, |
|||
eventDetail, |
|||
processForm, |
|||
projectInfoOrigin, |
|||
demandInfoOrigin, |
|||
issueInfoOrigin, |
|||
}, |
|||
|
|||
data: iniData, |
|||
|
|||
computed: {}, |
|||
|
|||
watch: { |
|||
eventId() { |
|||
let data = iniData(); |
|||
Object.keys(data).forEach((k) => { |
|||
this[k] = data[k]; |
|||
}); |
|||
// this.getApiData(); |
|||
}, |
|||
}, |
|||
created() { }, |
|||
mounted() { |
|||
this.pageTypeCopy = this.pageType; |
|||
if (this.pageTypeCopy !== "add") { |
|||
this.getProjectProcess(); |
|||
} |
|||
if (this.eventId) { |
|||
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData)); |
|||
} |
|||
}, |
|||
|
|||
methods: { |
|||
changeName(val) { |
|||
this.demandUserName = val; |
|||
}, |
|||
changeMobile(val) { |
|||
this.demandUserMobile = val; |
|||
}, |
|||
changeUserId(val) { |
|||
this.demandUserId = val; |
|||
}, |
|||
changeGridId(val) { |
|||
this.gridId = val; |
|||
}, |
|||
watchImg(src) { |
|||
window.open(src); |
|||
}, |
|||
|
|||
//加载组织数据 |
|||
async getProjectProcess() { |
|||
const url = "/governance/icEvent/process"; |
|||
const { data, code, msg } = await requestPost(url, { |
|||
icEventId: this.eventId, |
|||
}); |
|||
if (code === 0) { |
|||
this.projectProcess = data.map((item) => { |
|||
item.processTime = dateFormat( |
|||
new Date(item.processTime * 1000), |
|||
"yyyy-MM-dd hh:mm" |
|||
); |
|||
return item; |
|||
}); |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
formTimeLimit(val) { |
|||
return dateFormat( |
|||
new Date(val * 1000), |
|||
"yyyy-MM-dd hh:mm" |
|||
); |
|||
}, |
|||
getEventInfo() { |
|||
this.$refs.ref_add.getEventInfo(); |
|||
if (this.$refs.ref_add.okflag) { |
|||
this.eventInfoData = this.$refs.ref_add.formData; |
|||
} else { |
|||
return false; |
|||
} |
|||
}, |
|||
|
|||
async handleComfirm() { |
|||
this.startLoading(); |
|||
if (this.pageTypeCopy === "add") { |
|||
await this.handelAdd(); |
|||
} |
|||
if (this.pageTypeCopy === "dispose") { |
|||
await this.handelDispose(); |
|||
} |
|||
this.endLoading(); |
|||
}, |
|||
|
|||
async handelAdd() { |
|||
this.$refs.ref_add.getEventInfo(); |
|||
if (this.$refs.ref_add.okflag) { |
|||
this.eventInfoData = this.$refs.ref_add.formData; |
|||
} else { |
|||
return false; |
|||
} |
|||
this.$refs.ref_processinfo_add.getProcessInfo(); |
|||
this.formData.operationType = this.$refs.ref_processinfo_add.operationType; |
|||
this.eventInfoData.operationType = this.$refs.ref_processinfo_add.operationType; |
|||
if (this.formData.operationType === '0' || this.formData.operationType === '6') { |
|||
this.project = {}; |
|||
this.demand = {}; |
|||
this.replayInfo = this.$refs.ref_processinfo_add.replayInfo; |
|||
console.log(this.replayInfo); |
|||
//回复属性赋值 |
|||
this.eventInfoData.content = this.replayInfo.content; |
|||
this.eventInfoData.status = this.replayInfo.status; |
|||
if (this.replayInfo.categoryId) { |
|||
this.eventInfoData.categoryList = []; |
|||
this.eventInfoData.categoryList.push(this.replayInfo.categoryId); |
|||
} |
|||
} else if (this.formData.operationType === '5') { |
|||
this.project = {}; |
|||
this.demand = {}; |
|||
console.log(this.$refs.ref_process_form_designate.replayInfo); |
|||
this.replayInfo = this.$refs.ref_process_form_designate.replayInfo; |
|||
console.log(this.replayInfo); |
|||
//回复属性赋值 |
|||
this.eventInfoData.content = this.replayInfo.content; |
|||
this.eventInfoData.status = this.replayInfo.status; |
|||
if (this.replayInfo.categoryId) { |
|||
this.eventInfoData.categoryList = []; |
|||
this.eventInfoData.categoryList.push(this.replayInfo.categoryId); |
|||
} |
|||
} else if (this.formData.operationType === '4') { |
|||
this.project = {}; |
|||
this.demand = {}; |
|||
this.replayInfo = {}; |
|||
} |
|||
this.formData = { |
|||
...this.eventInfoData, |
|||
project: this.project, |
|||
demand: this.demand, |
|||
issueInfo: this.issueInfo, |
|||
}; |
|||
await this.submit(); |
|||
}, |
|||
|
|||
async submit() { |
|||
if (this.formData.operationType === '0' || this.formData.operationType === '5' |
|||
|| this.formData.operationType === '6' || this.formData.operationType === '4') { |
|||
const url = "/governance/icEvent/add"; |
|||
const { formData } = this; |
|||
const { data, code, msg } = await requestPost(url, { |
|||
...formData, |
|||
}); |
|||
if (code === 0) { |
|||
this.$message.success("操作成功!"); |
|||
if (this.pageTypeCopy === "add") { |
|||
this.eventInfo = this.$refs.ref_add.resetData(); |
|||
} |
|||
this.$emit("handleOk"); |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
} else if (this.formData.operationType == "") { |
|||
this.$message.error("请选择处理方式!"); |
|||
} |
|||
}, |
|||
|
|||
async handelDispose() { |
|||
this.$refs.ref_processinfo_dispose.getProcessInfo(); |
|||
if (this.$refs.ref_processinfo_dispose.okflag) { |
|||
this.formData.operationType = this.$refs.ref_processinfo_dispose.operationType; |
|||
this.replayInfo = this.$refs.ref_processinfo_dispose.replayInfo; |
|||
this.replayInfo.icEventId = this.eventId; |
|||
await this.submitDispose('/governance/icEvent/reply', this.replayInfo); |
|||
} else { |
|||
return false; |
|||
} |
|||
}, |
|||
async submitDispose(url, params) { |
|||
const { data, code, msg } = await requestPost(url, { |
|||
...params, |
|||
}); |
|||
if (code === 0) { |
|||
this.$message.success("操作成功!"); |
|||
|
|||
this.$emit("handleOk"); |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
|
|||
handleClose() { |
|||
if (this.pageTypeCopy === "add") { |
|||
this.eventInfo = this.$refs.ref_add.resetData(); |
|||
} |
|||
|
|||
this.$emit("handleClose"); |
|||
}, |
|||
handleToProject(type) { |
|||
if (this.eventDetailCopy.status === "processing") { |
|||
this.projectPageType = "edit"; |
|||
} else { |
|||
this.projectPageType = "info"; |
|||
} |
|||
this.sourceType = "event"; |
|||
this.pageTypeCopy = "project"; |
|||
}, |
|||
handleToDemand() { |
|||
// if (this.eventDetailCopy.status === 'processing') { |
|||
// this.projectPageType = 'edit' |
|||
// } else { |
|||
// this.projectPageType = 'info' |
|||
// } |
|||
this.pageTypeCopy = "demand"; |
|||
}, |
|||
async handleToIssue() { |
|||
const url = "/governance/manage/votingissuedetail"; |
|||
|
|||
const { data, code, msg } = await requestPost(url, { |
|||
issueId: this.eventDetailCopy.operationId, |
|||
}); |
|||
|
|||
if (code === 0) { |
|||
this.issueDetailData = { ...data }; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
|
|||
if (this.issueDetailData.issueStatus === "voting") { |
|||
this.issuePageType = "dispose"; |
|||
} else { |
|||
this.issuePageType = "info"; |
|||
} |
|||
this.pageTypeCopy = "issue"; |
|||
}, |
|||
handleCloseProject() { |
|||
this.getProjectProcess(); |
|||
this.pageTypeCopy = "info"; |
|||
}, |
|||
|
|||
// 开启加载动画 |
|||
startLoading() { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: "正在加载……", // 加载中需要显示的文字 |
|||
background: "rgba(0,0,0,.7)", // 背景颜色 |
|||
}); |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading() { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close(); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
@import "@/assets/scss/modules/shequzhili/event-info.scss"; |
|||
|
|||
.tabs { |
|||
position: absolute; |
|||
margin-left: 30px; |
|||
height: 50px; |
|||
line-height: 50px; |
|||
|
|||
.diy-button--white { |
|||
border: none !important; |
|||
color: rgba(0, 0, 0, 0.65) !important; |
|||
height: 30px !important; |
|||
padding: 0 12px !important; |
|||
margin-left: 10px; |
|||
} |
|||
} |
|||
|
|||
.list { |
|||
&> :last-child { |
|||
border: none !important; |
|||
} |
|||
|
|||
&> :first-child { |
|||
.name { |
|||
background: url("../../../../../assets/images/index/bubble.png") no-repeat; |
|||
color: #fff !important; |
|||
padding: 0px 10px 3px 13px !important; |
|||
background-size: 100% 100%; |
|||
border: none !important; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.g-left-top40 { |
|||
margin-top: 40px; |
|||
} |
|||
|
|||
.g-right-top40 { |
|||
margin-top: 40px; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,54 @@ |
|||
<template> |
|||
<div> |
|||
<el-form :model="form"> |
|||
<el-form-item> |
|||
<el-cascader class="cell-width-2" ref="myCascader" v-model="form.selCategoryArray" :key="iscascaderShow" |
|||
:options="casOptions" :props="optionProps" :show-all-levels="false" clearable |
|||
@change="handleChangeCate"></el-cascader> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
form: { |
|||
selCategoryArray: {} |
|||
}, |
|||
selCateObj: {}, |
|||
iscascaderShow: 0 |
|||
}; |
|||
}, |
|||
props: { |
|||
casOptions: { |
|||
type: Array, |
|||
default: () => [] |
|||
}, |
|||
optionProps: { |
|||
type: Object, |
|||
default: () => { } |
|||
} |
|||
}, |
|||
created() { }, |
|||
methods: { |
|||
handleChangeCate() { |
|||
if (this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0]) { |
|||
this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data |
|||
} else { |
|||
this.selCateObj = {} |
|||
} |
|||
|
|||
this.$emit('handleChangeCate', this.selCateObj) |
|||
} |
|||
}, |
|||
mounted() { |
|||
++this.iscascaderShow; |
|||
}, |
|||
components: {}, |
|||
computed: {}, |
|||
watch: {}, |
|||
}; |
|||
</script> |
|||
<style lang="scss" scoped></style> |
|||
@ -0,0 +1,725 @@ |
|||
<template> |
|||
<div class=""> |
|||
<el-form ref="ref_form" |
|||
:inline="false" |
|||
:model="formData" |
|||
:rules="dataRule" |
|||
label-width="100px"> |
|||
<!-- <el-form-item label="事件分类" |
|||
label-width="150px" |
|||
prop="categoryId"> |
|||
<el-cascader class="cell-width-2" |
|||
ref="myCascader" |
|||
v-model="selCategoryArray" |
|||
:key="iscascaderShow" |
|||
:options="casOptions" |
|||
:props="optionProps" |
|||
:show-all-levels="false" |
|||
@change="handleChangeCate"></el-cascader> |
|||
</el-form-item> --> |
|||
<el-form-item label="服务内容" |
|||
label-width="150px" |
|||
:class="{'form-item':source==='visiual'}" |
|||
prop="content"> |
|||
<div :class="{'visiual-form':source==='visiual'}"> |
|||
<el-input v-model="formData.content" |
|||
:autosize="{ minRows: 2, maxRows: 10 }" |
|||
type="textarea" |
|||
clearable |
|||
class="cell-width-area" |
|||
placeholder="请输入内容"></el-input> |
|||
</div> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="服务类型" |
|||
label-width="150px" |
|||
:class="{'form-item':source==='visiual'}" |
|||
prop="categoryCode"> |
|||
<div :class="{'visiual-form':source==='visiual'}"> |
|||
|
|||
<el-cascader v-model="formData.categoryCode" |
|||
:options="demandOptions" |
|||
clearable |
|||
class="cell-width-1" |
|||
@change="handleCateSlect"></el-cascader> |
|||
</div> |
|||
|
|||
</el-form-item> |
|||
|
|||
<el-form-item label="服务时间" |
|||
label-width="150px" |
|||
:class="{'form-item':source==='visiual'}" |
|||
prop="wantServiceTime"> |
|||
<div :class="{'visiual-form':source==='visiual'}"> |
|||
<el-date-picker v-model="formData.wantServiceTime" |
|||
type="datetime" |
|||
class="cell-width-1" |
|||
clearable |
|||
value-format="yyyy-MM-dd HH:mm:ss" |
|||
placeholder="选择日期时间"> |
|||
</el-date-picker> |
|||
</div> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="需求人" |
|||
label-width="150px" |
|||
:class="{'form-item':source==='visiual'}" |
|||
prop="demandUserName"> |
|||
<div :class="{'visiual-form':source==='visiual'}"> |
|||
<el-input v-model="formData.demandUserName" |
|||
class="cell-width-1"></el-input> |
|||
</div> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="联系电话" |
|||
label-width="150px" |
|||
:class="{'form-item':source==='visiual'}" |
|||
prop="demandUserMobile"> |
|||
<div :class="{'visiual-form':source==='visiual'}"> |
|||
<el-input v-model="formData.demandUserMobile" |
|||
class="cell-width-1"></el-input> |
|||
</div> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="服务地点" |
|||
prop="serviceLocation" |
|||
:class="{'form-item':source==='visiual'}" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
|
|||
<div :class="{'visiual-form':source==='visiual'}"> |
|||
<el-input class="cell-width-1" |
|||
v-model="formData.serviceLocation"> |
|||
</el-input> |
|||
</div> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="位置坐标" |
|||
:class="{'form-item':source==='visiual'}" |
|||
prop="longitude" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
<div style="width:500px"> |
|||
|
|||
<div class="div_map"> |
|||
<div id="app_map"> |
|||
|
|||
</div> |
|||
<div class="div_searchmap"> |
|||
<el-input class="cell-width-map" |
|||
maxlength="50" |
|||
size="mini" |
|||
placeholder="请输入关键字" |
|||
v-model="keyWords"> |
|||
</el-input> |
|||
<el-button style="margin-left: 10px" |
|||
type="primary" |
|||
size="mini" |
|||
@click="handleSearchMap">查询</el-button> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- <div style="margin-top: 10px"> |
|||
<span>经度</span> |
|||
<el-input class="item_width_3" |
|||
maxlength="50" |
|||
placeholder="请输入经度" |
|||
v-model="formData.longitude"> |
|||
</el-input> |
|||
<span style="margin-left: 20px">纬度</span> |
|||
<el-input class="item_width_3" |
|||
maxlength="50" |
|||
placeholder="请输入纬度" |
|||
v-model="formData.latitude"> |
|||
</el-input> |
|||
</div> --> |
|||
</div> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="门牌号" |
|||
:class="{'form-item':source==='visiual'}" |
|||
label-width="150px" |
|||
prop="locationDetail"> |
|||
<div :class="{'visiual-form':source==='visiual'}"> |
|||
<el-input v-model="formData.locationDetail" |
|||
class="cell-width-1"></el-input> |
|||
</div> |
|||
|
|||
</el-form-item> |
|||
|
|||
<el-form-item label="服务方" |
|||
:class="{'form-item':source==='visiual'}" |
|||
label-width="150px" |
|||
prop="serverId"> |
|||
|
|||
<template> |
|||
<div :class="[{'single-select':source==='visiual'},'sel-service']"> |
|||
<el-select v-model="formData.serviceType" |
|||
class="cell-width-1" |
|||
placeholder="请选择" |
|||
clearable |
|||
@change="handleServiceChange('add', $event)"> |
|||
<el-option v-for="item in serviceOptions" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
- |
|||
<el-select v-model="formData.serverId" |
|||
class="cell-width-1" |
|||
filterable |
|||
placeholder="请选择" |
|||
clearable> |
|||
<el-option v-for="item in serviceOptiondList" |
|||
:key="item.id" |
|||
:label="item.name" |
|||
:value="item.id"> |
|||
</el-option> |
|||
</el-select> |
|||
</div> |
|||
</template> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { Loading } from "element-ui"; // 引入Loading服务 |
|||
import { requestPost } from "@/js/dai/request"; |
|||
import formVltHelper from "dai-js/tools/formVltHelper"; |
|||
|
|||
import { isCard } from "@/utils/validate"; |
|||
|
|||
let loading; // 加载动画 |
|||
var map |
|||
var search |
|||
var markers |
|||
var infoWindowList |
|||
var geocoder // 新建一个正逆地址解析类 |
|||
|
|||
function iniFmData () { |
|||
return { |
|||
operationType: '2',//处理方式[0:已回复 1:已转项目 2:已转服务] |
|||
icEventId: '',//事件Id |
|||
gridId: '',// |
|||
categoryCode: '',// 二级服务分类编码 |
|||
parentCode: '',// 父级服务分类编码 |
|||
content: '',// 服务内容1000字 |
|||
reportType: 'self_help',// 社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help |
|||
reportUserName: '',// 上报人姓名 |
|||
reportUserMobile: '',// 自身上报时存储注册居民的联系电话 |
|||
reportTime: '',// 上报时间 |
|||
demandUserId: '',// 需求人:user.id或者ic_resi_user.id |
|||
demandUserName: '',// 需求人姓名 |
|||
demandUserMobile: '',//需求人联系电话 |
|||
wantServiceTime: '',// 希望服务时间 |
|||
serviceType: '', |
|||
serverId: '', |
|||
locationDetail: '', |
|||
serviceLocation: '',//事件地址 |
|||
latitude: '',// 经度 |
|||
longitude: '',//维度 |
|||
// categoryId: '' |
|||
}; |
|||
} |
|||
export default { |
|||
data () { |
|||
return { |
|||
btnDisable: false, |
|||
customerId: localStorage.getItem("customerId"), |
|||
demandOptions: [], |
|||
serviceOptions: [ |
|||
], |
|||
serviceOptiondList: [], |
|||
|
|||
casOptions: [], |
|||
iscascaderShow: 0, |
|||
selCategoryArray: [], |
|||
selCateObj: {}, |
|||
optionProps: { |
|||
multiple: false, |
|||
value: 'id', |
|||
label: 'name', |
|||
children: 'subCategory', |
|||
}, |
|||
|
|||
formData: iniFmData(), |
|||
|
|||
|
|||
okflag: false, |
|||
//地图相关 |
|||
keyWords: '', |
|||
|
|||
eventDetailCopy: {} |
|||
}; |
|||
}, |
|||
components: {}, |
|||
computed: { |
|||
dataRule () { |
|||
|
|||
return { |
|||
// categoryId: [ |
|||
// { required: true, message: "请填写事件分类", trigger: "blur" }, |
|||
// ], |
|||
content: [ |
|||
{ required: true, message: "服务内容不能为空", trigger: "blur" }, |
|||
], |
|||
categoryCode: [ |
|||
{ required: true, message: "服务类型不能为空", trigger: "blur" }, |
|||
], |
|||
wantServiceTime: [ |
|||
{ required: true, message: "服务时间不能为空", trigger: "blur" }, |
|||
], |
|||
demandUserName: [ |
|||
{ required: true, message: "需求人不能为空", trigger: "blur" }, |
|||
], |
|||
demandUserMobile: [ |
|||
{ required: true, message: "联系电话不能为空", trigger: "blur" }, |
|||
], |
|||
serviceLocation: [ |
|||
{ required: true, message: "服务地点不能为空", trigger: "blur" }, |
|||
], |
|||
serverId: [ |
|||
{ required: true, message: "服务方不能为空", trigger: "blur" }, |
|||
], |
|||
|
|||
}; |
|||
}, |
|||
|
|||
|
|||
}, |
|||
props: { |
|||
|
|||
demandUserId: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
demandUserName: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
demandUserMobile: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
eventId: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
|
|||
eventDetailData: { |
|||
type: Object, |
|||
default () { |
|||
return {} |
|||
} |
|||
}, |
|||
transferObj: { |
|||
type: Object, |
|||
default () { |
|||
return {} |
|||
} |
|||
}, |
|||
source: {//展示来源:manage 管理平台 visiual 可视化平台 |
|||
type: String, |
|||
default: 'manage' |
|||
} |
|||
|
|||
}, |
|||
watch: { |
|||
demandUserName: function (val) { |
|||
|
|||
this.formData.reportUserName = val |
|||
this.formData.demandUserName = val |
|||
}, |
|||
demandUserMobile: function (val) { |
|||
|
|||
this.formData.reportUserMobile = val |
|||
this.formData.demandUserMobile = val |
|||
}, |
|||
"transferObj.longitude":{ |
|||
handler(newVal,oldVal){ |
|||
this.$nextTick(()=>{ |
|||
map.setCenter(new TMap.LatLng(this.transferObj.latitude,this.transferObj.longitude)) |
|||
}) |
|||
}, |
|||
immediate: true // 页面加载立即执行 |
|||
}, |
|||
|
|||
|
|||
demandUserId: function (val) { |
|||
|
|||
this.formData.demandUserId = val |
|||
}, |
|||
}, |
|||
created () { |
|||
|
|||
|
|||
}, |
|||
|
|||
async mounted () { |
|||
const { user } = this.$store.state |
|||
this.agencyId = user.agencyId |
|||
this.getCategoryList(); |
|||
this.getDemandOptions(); |
|||
this.getServiceOption() |
|||
// this.formData = { ...this.formDataTemp } |
|||
this.initMap() |
|||
|
|||
if (this.eventId) { |
|||
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData)); |
|||
this.formData.reportUserMobile = this.eventDetailCopy.mobile |
|||
this.formData.reportUserName = this.eventDetailCopy.name |
|||
this.formData.reportTime = this.eventDetailCopy.happenTime |
|||
this.formData.gridId = this.eventDetailCopy.gridId |
|||
this.formData.demandUserId = this.eventDetailCopy.reportUserId |
|||
this.formData.demandUserName = this.eventDetailCopy.name |
|||
this.formData.demandUserMobile = this.eventDetailCopy.mobile |
|||
|
|||
if (this.eventDetailCopy.parentCategoryId && this.eventDetailCopy.categoryId) { |
|||
// this.selCategoryArray = [] |
|||
// this.selCategoryArray.push(this.eventDetailCopy.parentCategoryId) |
|||
// this.selCategoryArray.push(this.eventDetailCopy.categoryId) |
|||
// this.formData.categoryId = this.eventDetailCopy.categoryId |
|||
|
|||
// this.selCateObj = { |
|||
// name: this.eventDetailCopy.categoryName, |
|||
// id: this.eventDetailCopy.categoryId |
|||
// } |
|||
} |
|||
|
|||
} else { |
|||
this.formData.demandUserName = this.demandUserName |
|||
this.formData.demandUserMobile = this.demandUserMobile |
|||
this.formData.demandUserId = this.demandUserId |
|||
} |
|||
|
|||
}, |
|||
|
|||
methods: { |
|||
|
|||
async getCategoryList () { |
|||
const url = "/governance/issueprojectcategorydict/list" |
|||
|
|||
let params = {} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
|
|||
let treeDataNew = this.filterTree(data) |
|||
|
|||
//组织级联数据 |
|||
++this.iscascaderShow |
|||
this.casOptions = [] |
|||
|
|||
|
|||
this.casOptions = treeDataNew |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
}, |
|||
|
|||
handleChangeCate () { |
|||
console.log(this.$refs["myCascader"].getCheckedNodes()[0].data) |
|||
this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data |
|||
this.formData.categoryId = this.selCateObj.id |
|||
}, |
|||
|
|||
//重构树,去除网格 |
|||
filterTree (arr) { |
|||
let childs = arr |
|||
for (let i = childs.length; i--; i > 0) { |
|||
if (childs[i].subCategory) { |
|||
if (childs[i].subCategory.length) { |
|||
this.filterTree(childs[i].subCategory) |
|||
} else { |
|||
delete childs[i].subCategory |
|||
} |
|||
} |
|||
} |
|||
return arr |
|||
}, |
|||
|
|||
async getDemandOptions () { |
|||
const url = "/governance/icresidemanddict/demandoption" |
|||
let params = {} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
if (code === 0) { |
|||
this.demandOptions = this.getFlagData( |
|||
this.getTreeData(data), |
|||
"usableFlag" |
|||
); |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
}, |
|||
|
|||
async getServiceOption () { |
|||
const url = "/sys/dict/data/dictlist" |
|||
let params = { dictType: "user_demand_service_type", } |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
if (code === 0) { |
|||
this.serviceOptions = data; |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
}, |
|||
|
|||
getTreeData (data) { |
|||
if (!Array.isArray(data)) return []; |
|||
let arr = data.map((item) => { |
|||
let _item = {}; |
|||
if (item.children) { |
|||
if (item.children.length === 0) |
|||
_item = { ...item, children: undefined }; |
|||
else _item = { ...item, children: this.getTreeData(item.children) }; |
|||
} else { |
|||
_item = { ...item }; |
|||
} |
|||
return _item; |
|||
}); |
|||
return arr; |
|||
}, |
|||
getFlagData (data, flag) { |
|||
if (!Array.isArray(data)) return []; |
|||
let arr1 = data.filter((item) => item[flag]); |
|||
let arr2 = arr1.map((item) => { |
|||
if (item.children) |
|||
return { ...item, children: this.getFlagData(item.children, flag) }; |
|||
else return item; |
|||
}); |
|||
// console.log('arrr-oppp', arr2) |
|||
return arr2; |
|||
}, |
|||
|
|||
handleCateSlect (val) { |
|||
console.log("val", val); |
|||
if (val.length === 1) { |
|||
this.demandOptions.forEach((item) => { |
|||
if (item.value == val[0]) this.formData.parentCode = item.pvalue; |
|||
}); |
|||
this.formData.categoryCode = val[0]; |
|||
} else { |
|||
this.formData.parentCode = val[0]; |
|||
this.formData.categoryCode = val[1]; |
|||
} |
|||
}, |
|||
|
|||
async handleServiceChange(serverOrgType,val) { |
|||
if (!val) return false; |
|||
if (this.formData.categoryCode == "") { |
|||
this.$message.error("请先选择服务类型!"); |
|||
return; |
|||
} |
|||
const url = "/actual/base/serviceitem/listServerOrg"; |
|||
let params = { |
|||
serviceTypeId: this.formData.categoryCode, |
|||
serverOrgType: val, |
|||
businessType: "resi_service", |
|||
}; |
|||
let { data, code, msg } = await requestPost(url, params); |
|||
if (code == 0) { |
|||
this.serviceOptiondList = data; |
|||
} else if (code >= 8000) { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
async getServiceuserList (serviceType) { |
|||
|
|||
if (!serviceType) return false; |
|||
const { demandUserId } = this.formData; |
|||
const params = { |
|||
serviceName: this.formData.categoryCode, |
|||
serviceType: serviceType, |
|||
queryPurpose: 'query', |
|||
}; |
|||
|
|||
|
|||
const url = "/governance/userdemand/servicelist" |
|||
|
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
if (code === 0) { |
|||
this.serviceOptiondList = data.filter( |
|||
(item) => item.value != demandUserId |
|||
); |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
|
|||
}, |
|||
|
|||
async getDemandInfo () { |
|||
this.okflag = false |
|||
this.$refs["ref_form"].validate((valid, messageObj) => { |
|||
if (!valid) { |
|||
app.util.validateRule(messageObj); |
|||
// this.formData.categoryId = this.selCateObj.id |
|||
} else { |
|||
|
|||
this.okflag = true |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
|
|||
resetData () { |
|||
|
|||
}, |
|||
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|||
initMap () { |
|||
// 定义地图中心点坐标 |
|||
var center = new window.TMap.LatLng(this.transferObj.latitude||36.0722275,this.transferObj.longitude|| 120.38945519) |
|||
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
|||
map = new window.TMap.Map(document.getElementById('app_map'), { |
|||
center: center, // 设置地图中心点坐标 |
|||
zoom: 17.2, // 设置地图缩放级别 |
|||
pitch: 43.5, // 设置俯仰角 |
|||
rotation: 45 // 设置地图旋转角度 |
|||
}) |
|||
|
|||
search = new window.TMap.service.Search({ pageSize: 10 }) |
|||
// 新建一个地点搜索类 |
|||
markers = new TMap.MultiMarker({ |
|||
map: map, |
|||
geometries: [] |
|||
}) |
|||
infoWindowList = Array(10) |
|||
|
|||
geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类 |
|||
|
|||
// 监听地图平移结束 |
|||
map.on('panend', () => { |
|||
this.handleMoveCenter() |
|||
}) |
|||
this.handleMoveCenter() |
|||
this.convert() |
|||
}, |
|||
|
|||
setMarker (lat, lng) { |
|||
markers.setGeometries([]) |
|||
markers.add([ |
|||
{ |
|||
id: '4', |
|||
styleId: 'marker', |
|||
position: new TMap.LatLng(lat, lng), |
|||
properties: { |
|||
title: 'marker4' |
|||
} |
|||
} |
|||
]) |
|||
}, |
|||
|
|||
handleSearchMap () { |
|||
infoWindowList.forEach((infoWindow) => { |
|||
infoWindow.close() |
|||
}) |
|||
infoWindowList.length = 0 |
|||
markers.setGeometries([]) |
|||
// 在地图显示范围内以给定的关键字搜索地点 |
|||
search |
|||
.searchRectangle({ |
|||
keyword: this.keyWords, |
|||
bounds: map.getBounds() |
|||
}) |
|||
.then((result) => { |
|||
let { data } = result |
|||
if (Array.isArray(data) && data.length > 0) { |
|||
const { |
|||
location: { lat, lng } |
|||
} = data[0] |
|||
|
|||
|
|||
map.setCenter(new TMap.LatLng(lat, lng)) |
|||
this.setMarker(lat, lng) |
|||
this.formData.latitude = lat |
|||
this.formData.longitude = lng |
|||
this.convert() |
|||
} else { |
|||
this.$message.error('未检索到相关位置坐标') |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
handleMoveCenter () { |
|||
//修改地图中心点 |
|||
const center = map.getCenter() |
|||
const lat = center.getLat() |
|||
const lng = center.getLng() |
|||
this.formData.latitude = lat |
|||
this.formData.longitude = lng |
|||
this.setMarker(lat, lng) |
|||
this.convert(lat, lng) |
|||
}, |
|||
|
|||
convert (lat, lng) { |
|||
markers.setGeometries([]); |
|||
// var input = document.getElementById('location').value.split(','); |
|||
let location |
|||
if (lat && lng) { |
|||
location = new TMap.LatLng(lat, lng); |
|||
} else { |
|||
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude); |
|||
} |
|||
|
|||
// map.setCenter(location); |
|||
markers.updateGeometries([ |
|||
{ |
|||
id: 'main', // 点标注数据数组 |
|||
position: location, |
|||
}, |
|||
]); |
|||
geocoder |
|||
.getAddress({ location: location }) // 将给定的坐标位置转换为地址 |
|||
.then((result) => { |
|||
this.formData.serviceLocation = result.result.address |
|||
// 显示搜索到的地址 |
|||
}); |
|||
}, |
|||
|
|||
|
|||
|
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: "正在加载……", // 加载中需要显示的文字 |
|||
background: "rgba(0,0,0,.7)", // 背景颜色 |
|||
}); |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close(); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang='scss' scoped> |
|||
@import "@/assets/scss/modules/visual/a_customize.scss"; |
|||
@import "@/assets/scss/modules/shequzhili/event-info.scss"; |
|||
</style> |
|||
|
|||
|
|||
|
|||
|
|||
<style scoped > |
|||
.el-dialog__body { |
|||
padding: 0 10px 20px !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,331 @@ |
|||
<!-- |
|||
* @Author: yanLu xgktv007@163.com |
|||
* @Date: 2023-09-05 10:21:34 |
|||
* @LastEditors: mk 2403457699@qq.com |
|||
* @LastEditTime: 2023-09-18 17:16:40 |
|||
* @Description: 事件转办表单 |
|||
* |
|||
--> |
|||
<template> |
|||
<div class="search"> |
|||
<el-form ref="ref_form2" :inline="false" :model="formData" :rules="dataRule"> |
|||
<el-form-item label="事件分类" label-width="150px" :class="{ 'form-item': source === 'visiual' }" |
|||
prop="categoryList"> |
|||
<div :class="{ 'visiual-form': source === 'visiual' }"> |
|||
<el-cascader class="cell-width-2" ref="myCascader" v-model="selCategoryArray" :key="iscascaderShow" |
|||
:options="casOptions" :props="optionProps" :show-all-levels="false" |
|||
@change="handleChangeCate"></el-cascader> |
|||
</div> |
|||
</el-form-item> |
|||
<el-form-item label="处理部门" prop="deptId" label-width="150px" :class="{ 'form-item': source === 'visiual' }"> |
|||
<el-cascader class="cell-width-2" ref="agencyIdArray" v-model="agencyIdArray" :options="orgOptions" |
|||
:props="orgOptionProps" :show-all-levels="false" @change="handleChangeAgency"></el-cascader> |
|||
</el-form-item> |
|||
<el-form-item label="转办意见" prop="content" label-width="150px" :class="{ 'form-item': source === 'visiual' }" |
|||
style="display: block"> |
|||
<div :class="{ 'visiual-form': source === 'visiual' }"> |
|||
<el-input class="cell-width-area" type="textarea" maxlength="500" show-word-limit :rows="5" |
|||
placeholder="请输入转办意见,不超过500字" v-model="formData.content"></el-input> |
|||
</div> |
|||
</el-form-item> |
|||
<el-form-item style="display: block" label="附件" label-width="150px" prop="attach"> |
|||
<el-upload :headers="$getElUploadHeaders()" class="upload-demo" :action="uploadUlr" |
|||
accept=".doc,.pdf,.xls,.docx,.xlsx,.jpg,.png,.jpeg,.bmp,.mp4,.wma,.m4a,.mp3" |
|||
:on-success="handleFileSuccess" :on-remove="handleFileRemove" :on-preview="handleFileDownload" |
|||
:limit="3" :before-upload="beforeUpload" :file-list="fileList"> |
|||
<el-button size="small" :disabled="fileList.length === 3" type="primary">点击上传</el-button> |
|||
<div slot="tip" class="el-upload__tip">支持图片、word、pdf</div> |
|||
</el-upload> |
|||
</el-form-item> |
|||
<el-form-item label="办结时限" prop="timeLimit" label-width="150px" :class="{ 'form-item': source === 'visiual' }" |
|||
style="display: block"> |
|||
<div :class="{ 'visiual-form': source === 'visiual' }"> |
|||
<el-date-picker v-model="formData.timeLimit" class="cell-width-1" type="datetime" placeholder="办结时限" |
|||
value-format="yyyy-MM-dd HH:mm:ss"> |
|||
</el-date-picker> |
|||
</div> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { Loading } from "element-ui"; // 引入Loading服务 |
|||
import { requestPost } from "@/js/dai/request"; |
|||
let loading; // 加载动画 |
|||
export default { |
|||
data() { |
|||
return { |
|||
btnDisable: false, |
|||
formData: { |
|||
operationType: "5", //处理方式[0:已回复 5、指派 6、完成并回复] |
|||
content: "",//转办意见 |
|||
timeLimit: "",//办结时限 |
|||
categoryId: "",//事件分类 |
|||
deptId: "", //指派部门 |
|||
deptName: "", |
|||
categoryList: [], |
|||
files: [] //附件 |
|||
}, |
|||
orgOptions: [], |
|||
orgOptionProps: { |
|||
multiple: false, |
|||
value: 'agencyId', |
|||
label: 'agencyName', |
|||
children: 'subAgencyList', |
|||
checkStrictly: true |
|||
}, |
|||
agencyIdArray: [], |
|||
status: false, |
|||
okflag: false, |
|||
eventDetailCopy: {}, |
|||
selCategoryArray: [], |
|||
casOptions: [], |
|||
fileList: [], |
|||
uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadvariedfile", |
|||
iscascaderShow: 0, |
|||
optionProps: { |
|||
multiple: false, |
|||
value: "id", |
|||
label: "categoryName", |
|||
children: "children", |
|||
}, |
|||
dataRule: { |
|||
content: [ |
|||
{ required: true, message: "回复内容不能为空", trigger: "blur" }, |
|||
], |
|||
categoryId: [ |
|||
{ required: true, message: "事件分类不能为空", trigger: "blur" }, |
|||
], |
|||
deptId: [ |
|||
{ required: true, message: "处理部门不能为空", trigger: "blur" }, |
|||
], |
|||
timeLimit: [ |
|||
{ required: true, message: "办结时限不能为空", trigger: "blur" }, |
|||
] |
|||
}, |
|||
selCateObj: { |
|||
id: "" |
|||
}, |
|||
}; |
|||
}, |
|||
components: {}, |
|||
computed: {}, |
|||
props: { |
|||
eventId: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
eventDetailData: { |
|||
type: Object, |
|||
default() { |
|||
return {}; |
|||
}, |
|||
}, |
|||
source: { |
|||
//展示来源:manage 管理平台 visiual 可视化平台 |
|||
type: String, |
|||
default: "manage", |
|||
}, |
|||
}, |
|||
created() { |
|||
|
|||
}, |
|||
async mounted() { |
|||
const { user } = this.$store.state; |
|||
this.agencyId = user.agencyId; |
|||
this.getOrgTreeList(); |
|||
this.getCategoryList(); |
|||
if (this.eventId) { |
|||
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData)); |
|||
// 这一步接收到eventDetailCopy在这里回填 |
|||
if (this.eventDetailCopy.parentCategoryId && this.eventDetailCopy.categoryId) { |
|||
this.selCateObj.id = this.eventDetailCopy.categoryId |
|||
this.formData.categoryId = this.eventDetailCopy.categoryId |
|||
this.selCategoryArray.push(this.eventDetailCopy.parentCategoryId, this.eventDetailCopy.categoryId) |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
//组织机构树 |
|||
async getOrgTreeList() { |
|||
const url = "/gov/org/customeragency/agencygridtree" |
|||
let params = { |
|||
agencyId: this.agencyId, |
|||
purpose: "query" |
|||
} |
|||
const { data, code, msg } = await requestPost(url, params) |
|||
if (code === 0) { |
|||
this.orgOptions = [] |
|||
this.orgOptions.push(data) |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
async getCategoryList() { |
|||
const url = '/governance/icEvent/getCategoryTree'; |
|||
let params = {}; |
|||
const { data, code, msg } = await requestPost(url, params); |
|||
if (code === 0) { |
|||
let treeDataNew = this.deepTree(data, "children"); |
|||
++this.iscascaderShow; |
|||
this.casOptions = []; |
|||
this.casOptions = treeDataNew; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
handleChangeAgency(val) { |
|||
let obj = this.$refs["agencyIdArray"].getCheckedNodes()[0].data |
|||
if (obj) { |
|||
this.formData.orgType = obj.level === 'grid' ? 'grid' : 'agency' |
|||
this.formData.deptId = obj.agencyId |
|||
this.formData.deptName = obj.agencyName |
|||
} else { |
|||
this.form.orgType = '' |
|||
this.form.orgId = '' |
|||
} |
|||
}, |
|||
handleChangeCate() { |
|||
if (this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0]) { |
|||
this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data |
|||
this.formData.categoryId = this.selCateObj.id |
|||
console.log(this.formData.categoryId, 'this.formData.categoryId'); |
|||
} else { |
|||
this.selCateObj = {} |
|||
} |
|||
}, |
|||
//重构树,去除网格 |
|||
deepTree(arr, children) { |
|||
if (Array.isArray(arr) && arr.length > 0) { |
|||
return arr.map((item) => { |
|||
return { |
|||
...item, |
|||
[children]: |
|||
(item[children] && |
|||
item[children].length > 0 && |
|||
this.deepTree(item[children], children)) || |
|||
null, |
|||
}; |
|||
}); |
|||
} |
|||
}, |
|||
async getReplayInfo() { |
|||
this.okflag = false; |
|||
this.$refs["ref_form2"].validate((valid, messageObj) => { |
|||
if (!valid) { |
|||
app.util.validateRule(messageObj); |
|||
} else { |
|||
if (!this.selCateObj || !this.selCateObj.id) { |
|||
this.$message.error("请选择事件分类"); |
|||
return false; |
|||
} |
|||
if(this.fileList){ |
|||
this.formData.files = this.fileList |
|||
} |
|||
this.formData.status = "processing"; |
|||
this.formData.categoryId = this.selCateObj.id; |
|||
this.formData.categoryList = []; |
|||
this.formData.categoryList.push(this.selCateObj); |
|||
this.okflag = true; |
|||
} |
|||
}); |
|||
}, |
|||
resetData() { |
|||
this.agencyIdArray = [] |
|||
}, |
|||
beforeUpload(file) { |
|||
const array = file.name.split("."); |
|||
const extension = array[array.length - 1]; |
|||
const formatarray = [ |
|||
"jpg", |
|||
"png", |
|||
"jpeg", |
|||
"bmp", |
|||
"mp4", |
|||
"wma", |
|||
"m4a", |
|||
"mp3", |
|||
"doc", |
|||
"docx", |
|||
"xls", |
|||
"xlsx", |
|||
"pdf", |
|||
]; |
|||
if (formatarray.indexOf(extension) === -1) { |
|||
this.$message.error("只支持图片、word、pdf"); |
|||
return false; |
|||
} |
|||
}, |
|||
handleFileRemove(file) { |
|||
if (file && file.status === "success") { |
|||
this.fileList.splice( |
|||
this.fileList.findIndex((item) => item.uid === file.uid), |
|||
1 |
|||
); |
|||
} |
|||
}, |
|||
handleFileSuccess(res, file) { |
|||
if (res.code === 0 && res.msg === "success") { |
|||
const array = file.name.split("."); |
|||
const fileType = array[array.length - 1]; |
|||
const picArray = ["jpg", "png", "jpeg", "bmp"]; |
|||
const videoarray = ["mp4", "wma", "m4a"]; |
|||
const docArray = ["doc", "docx", "xls", "xlsx", "pdf"]; |
|||
const mp3Array = ["mp3"]; |
|||
|
|||
if (picArray.indexOf(fileType) > -1) { |
|||
file.attachmentFormat = "image"; |
|||
} else if (videoarray.indexOf(fileType) > -1) { |
|||
file.attachmentFormat = "video"; |
|||
} else if (docArray.indexOf(fileType) > -1) { |
|||
file.attachmentFormat = "doc"; |
|||
} else if (mp3Array.indexOf(fileType) > -1) { |
|||
file.attachmentFormat = "voice"; |
|||
} |
|||
|
|||
file.url = res.data.url; |
|||
file.type = fileType; |
|||
|
|||
file.attachmentName = file.name; |
|||
file.attachmentType = file.type; |
|||
file.attachmentUrl = file.url; |
|||
|
|||
this.fileList.push(file); |
|||
} else this.$message.error(res.msg); |
|||
}, |
|||
//下载 |
|||
handleFileDownload(file) { |
|||
var a = document.createElement("a"); |
|||
var event = new MouseEvent("click"); |
|||
a.download = file.name; |
|||
a.href = file.url; |
|||
a.dispatchEvent(event); |
|||
}, |
|||
// 开启加载动画 |
|||
startLoading() { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: "正在加载……", // 加载中需要显示的文字 |
|||
background: "rgba(0,0,0,.7)", // 背景颜色 |
|||
}); |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading() { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close(); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang='scss' scoped> |
|||
@import "@/assets/scss/modules/visual/a_customize.scss"; |
|||
@import "@/assets/scss/modules/shequzhili/event-info.scss"; |
|||
|
|||
.el-dialog__body { |
|||
padding: 0 10px 20px !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,265 @@ |
|||
<template> |
|||
<div class="search"> |
|||
|
|||
<el-form ref="ref_form1" |
|||
:inline="false" |
|||
:model="formData" |
|||
:rules="dataRule"> |
|||
<el-form-item label="事件分类" |
|||
label-width="150px" |
|||
:class="{'form-item':source==='visiual'}" |
|||
prop="categoryList"> |
|||
<div :class="{'visiual-form':source==='visiual'}"> |
|||
<!-- <el-cascader class="cell-width-2" |
|||
ref="myCascader" |
|||
v-model="selCategoryArray" |
|||
:key="iscascaderShow" |
|||
:options="casOptions" |
|||
:props="optionProps" |
|||
:show-all-levels="false" |
|||
@change="handleChangeCate"></el-cascader> --> |
|||
<my-cascader v-model="formData.categoryList" |
|||
:casOptions="casOptions" |
|||
:optionProps="optionProps" |
|||
@handleChangeCate="handleChangeCate"> |
|||
|
|||
</my-cascader> |
|||
</div> |
|||
</el-form-item> |
|||
<el-form-item label="议题标题" |
|||
prop="issueTitle" |
|||
label-width="150px" |
|||
:class="{'form-item':source==='visiual'}" |
|||
style="display: block"> |
|||
<div :class="{'visiual-form':source==='visiual'}"> |
|||
<el-input v-model="formData.issueTitle" |
|||
class="cell-width-2" |
|||
clearable |
|||
placeholder="请输入议题标题"> |
|||
</el-input> |
|||
</div> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="处理意见" |
|||
prop="suggestion" |
|||
label-width="150px" |
|||
:class="{'form-item':source==='visiual'}" |
|||
style="display: block"> |
|||
<div :class="{'visiual-form':source==='visiual'}"> |
|||
<el-input class="cell-width-area" |
|||
type="textarea" |
|||
maxlength="500" |
|||
show-word-limit |
|||
:rows="5" |
|||
placeholder="请输入处理意见,不超过500字" |
|||
v-model="formData.suggestion"></el-input> |
|||
</div> |
|||
|
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { Loading } from "element-ui"; // 引入Loading服务 |
|||
import { requestPost } from "@/js/dai/request"; |
|||
import formVltHelper from "dai-js/tools/formVltHelper"; |
|||
import myCascader from "./myCascader.vue"; |
|||
import { isCard } from "@/utils/validate"; |
|||
|
|||
let loading; // 加载动画 |
|||
|
|||
|
|||
export default { |
|||
data () { |
|||
return { |
|||
btnDisable: false, |
|||
formData: { |
|||
operationType: '3',//处理方式[0:已回复 1:已转项目 2:已转需求 3:转议题] |
|||
suggestion: '', |
|||
issueTitle: '', |
|||
categoryList:'' |
|||
}, |
|||
|
|||
|
|||
okflag: false, |
|||
|
|||
eventDetailCopy: {}, |
|||
|
|||
casOptions: [], |
|||
iscascaderShow: 0, |
|||
selCategoryArray: [], |
|||
selCateObj: {}, |
|||
optionProps: { |
|||
multiple: false, |
|||
value: 'id', |
|||
label: 'name', |
|||
children: 'subCategory', |
|||
}, |
|||
|
|||
}; |
|||
}, |
|||
components: {myCascader}, |
|||
computed: { |
|||
dataRule () { |
|||
|
|||
return { |
|||
issueTitle: [ |
|||
{ required: true, message: "议题标题不能为空", trigger: "blur" }, |
|||
], |
|||
suggestion: [ |
|||
{ required: true, message: "处理建议不能为空", trigger: "blur" }, |
|||
], |
|||
categoryList:[ |
|||
{required:true,message:"事件分类不能为空",trigger:"blur"} |
|||
] |
|||
}; |
|||
}, |
|||
|
|||
|
|||
}, |
|||
props: { |
|||
eventId: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
eventDetailData: { |
|||
type: Object, |
|||
default () { |
|||
return {} |
|||
} |
|||
}, |
|||
source: {//展示来源:manage 管理平台 visiual 可视化平台 |
|||
type: String, |
|||
default: 'manage' |
|||
} |
|||
}, |
|||
watch: {}, |
|||
|
|||
created () { |
|||
|
|||
console.log(this.source) |
|||
|
|||
}, |
|||
|
|||
async mounted () { |
|||
|
|||
this.getCategoryList() |
|||
if (this.eventId) { |
|||
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData)); |
|||
|
|||
if (this.eventDetailCopy.parentCategoryId && this.eventDetailCopy.categoryId) { |
|||
this.selCategoryArray = [] |
|||
this.selCategoryArray.push(this.eventDetailCopy.parentCategoryId) |
|||
this.selCategoryArray.push(this.eventDetailCopy.categoryId) |
|||
|
|||
this.selCateObj = { |
|||
name: this.eventDetailCopy.categoryName, |
|||
id: this.eventDetailCopy.categoryId |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
|
|||
methods: { |
|||
async getCategoryList () { |
|||
const url = "/governance/issueprojectcategorydict/list" |
|||
|
|||
let params = {} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
|
|||
let treeDataNew = this.filterTree(data) |
|||
|
|||
//组织级联数据 |
|||
++this.iscascaderShow |
|||
this.casOptions = [] |
|||
|
|||
this.casOptions = treeDataNew |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
}, |
|||
|
|||
handleChangeCate (obj) { |
|||
// console.log(this.$refs["myCascader"].getCheckedNodes()[0].data) |
|||
// this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data |
|||
this.selCateObj = obj |
|||
this.formData.categoryList = []; |
|||
let flag = JSON.stringify(obj) == '{}' |
|||
if(flag) this.formData.categoryList = [] |
|||
else this.formData.categoryList.push(this.selCateObj); |
|||
}, |
|||
|
|||
//重构树,去除网格 |
|||
filterTree (arr) { |
|||
let childs = arr |
|||
for (let i = childs.length; i--; i > 0) { |
|||
if (childs[i].subCategory) { |
|||
if (childs[i].subCategory.length) { |
|||
this.filterTree(childs[i].subCategory) |
|||
} else { |
|||
delete childs[i].subCategory |
|||
} |
|||
} |
|||
} |
|||
return arr |
|||
}, |
|||
async getIssueInfo () { |
|||
this.okflag = false |
|||
this.$refs["ref_form1"].validate((valid, messageObj) => { |
|||
if (!valid) { |
|||
app.util.validateRule(messageObj); |
|||
|
|||
} else { |
|||
this.formData.icEventId = this.eventId |
|||
this.formData.categoryId = this.selCateObj.id |
|||
this.formData.categoryList = [] |
|||
this.formData.categoryList.push(this.selCateObj) |
|||
|
|||
this.okflag = true |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
resetData () { |
|||
|
|||
}, |
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: "正在加载……", // 加载中需要显示的文字 |
|||
background: "rgba(0,0,0,.7)", // 背景颜色 |
|||
}); |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close(); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang='scss' scoped> |
|||
@import "@/assets/scss/modules/visual/a_customize.scss"; |
|||
@import "@/assets/scss/modules/shequzhili/event-info.scss"; |
|||
</style> |
|||
|
|||
|
|||
|
|||
<style scoped> |
|||
.el-dialog__body { |
|||
padding: 0 10px 20px !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,667 @@ |
|||
<template> |
|||
<div class=""> |
|||
<el-form |
|||
ref="ref_form" |
|||
:inline="false" |
|||
:model="formData" |
|||
:rules="dataRule" |
|||
label-width="100px" |
|||
> |
|||
<el-form-item |
|||
label="事件分类" |
|||
label-width="150px" |
|||
:class="{ 'form-item': source === 'visiual' }" |
|||
prop="categoryList" |
|||
> |
|||
<div :class="{ 'visiual-form': source === 'visiual' }"> |
|||
<!-- <el-cascader class="cell-width-2" |
|||
ref="myCascader" |
|||
v-model="selCategoryArray" |
|||
:key="iscascaderShow" |
|||
:options="casOptions" |
|||
:props="optionProps" |
|||
:show-all-levels="false" |
|||
@change="handleChangeCate"></el-cascader> --> |
|||
<my-cascader |
|||
v-model="formData.categoryList" |
|||
:casOptions="casOptions" |
|||
:props="optionProps" |
|||
:optionProps="optionProps" |
|||
@handleChangeCate="handleChangeCate" |
|||
></my-cascader> |
|||
</div> |
|||
</el-form-item> |
|||
<el-form-item |
|||
label="项目标题" |
|||
prop="title" |
|||
:class="{ 'form-item': source === 'visiual' }" |
|||
label-width="150px" |
|||
style="display: block" |
|||
> |
|||
<div :class="{ 'visiual-form': source === 'visiual' }"> |
|||
<el-input |
|||
class="cell-width-1" |
|||
maxlength="50" |
|||
placeholder="请输入项目标题" |
|||
v-model="formData.title" |
|||
> |
|||
</el-input> |
|||
</div> |
|||
</el-form-item> |
|||
|
|||
<el-form-item |
|||
label="所属网格 " |
|||
prop="gridId" |
|||
:class="{ 'form-item': source === 'visiual' }" |
|||
label-width="150px" |
|||
style="display: block" |
|||
> |
|||
<div :class="{ 'visiual-form': source === 'visiual' }"> |
|||
<el-select |
|||
v-model.trim="formData.gridId" |
|||
placeholder="请选择" |
|||
clearable |
|||
class="cell-width-1" |
|||
> |
|||
<el-option |
|||
v-for="item in gridList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
> |
|||
</el-option> |
|||
</el-select> |
|||
</div> |
|||
</el-form-item> |
|||
|
|||
<el-form-item |
|||
label="处理部门" |
|||
label-width="150px" |
|||
:class="{ 'form-item': source === 'visiual' }" |
|||
prop="staffList" |
|||
> |
|||
<el-popover |
|||
placement="bottom" |
|||
width="400" |
|||
height="400" |
|||
v-model="visibleStaffPanel" |
|||
> |
|||
<div class="f"> |
|||
<select-staff |
|||
@confirm="(ret) => (formData.staffList = ret)" |
|||
@close="visibleStaffPanel = false" |
|||
/> |
|||
</div> |
|||
|
|||
<div slot="reference"> |
|||
<a v-if="formData.staffList.length == 0" style="cursor: pointer" |
|||
>点击选择</a |
|||
> |
|||
<a v-else style="cursor: pointer" |
|||
>已选 {{ formData.staffList.length }} 人</a |
|||
> |
|||
</div> |
|||
</el-popover> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item label="协办单位" |
|||
label-width="150px" |
|||
:class="{'form-item':source==='visiual'}" |
|||
prop="assistanceUnitIndex"> |
|||
<div :class="{'visiual-form':source==='visiual'}"> |
|||
<el-select v-model.trim="formData.assistanceUnitIndex" |
|||
placeholder="请选择" |
|||
class="cell-width-1"> |
|||
<el-option v-for="(item, index) in assistanceUnitList" |
|||
:key="item.assistanceUnitId" |
|||
:label="item.assistanceUnitName" |
|||
:value="index"> |
|||
</el-option> |
|||
</el-select> |
|||
</div> |
|||
</el-form-item> --> |
|||
|
|||
<el-form-item |
|||
label="项目方案" |
|||
label-width="150px" |
|||
:class="{ 'form-item': source === 'visiual' }" |
|||
prop="publicReply" |
|||
> |
|||
<div :class="{ 'visiual-form': source === 'visiual' }"> |
|||
<el-input |
|||
type="textarea" |
|||
class="cell-width-area" |
|||
:rows="2" |
|||
placeholder="请输入项目方案" |
|||
v-model="formData.publicReply" |
|||
> |
|||
</el-input> |
|||
</div> |
|||
</el-form-item> |
|||
|
|||
<el-form-item |
|||
label="内部备注" |
|||
label-width="150px" |
|||
:class="{ 'form-item': source === 'visiual' }" |
|||
prop="internalRemark" |
|||
> |
|||
<div :class="{ 'visiual-form': source === 'visiual' }"> |
|||
<el-input |
|||
type="textarea" |
|||
class="cell-width-area" |
|||
:rows="2" |
|||
placeholder="请输入内部备注" |
|||
v-model="formData.internalRemark" |
|||
> |
|||
</el-input> |
|||
</div> |
|||
</el-form-item> |
|||
|
|||
<el-form-item |
|||
label="图片/附件" |
|||
label-width="150px" |
|||
:class="{ 'form-item': source === 'visiual' }" |
|||
prop="internalFile" |
|||
> |
|||
<el-upload |
|||
:headers="$getElUploadHeaders()" |
|||
class="avatar-uploader" |
|||
:action="uploadUlr" |
|||
:data="{ customerId: customerId }" |
|||
:show-file-list="true" |
|||
:on-success="handleImgSuccess" |
|||
:on-remove="handleImgRemove" |
|||
:before-upload="beforeImgUpload" |
|||
> |
|||
<i v-if="source === 'manage'" :class="['el-icon-plus']"></i> |
|||
<img |
|||
v-else |
|||
style="width: 27px; height: 27px" |
|||
src="@/assets/img/file-add.png" |
|||
/> |
|||
</el-upload> |
|||
</el-form-item> |
|||
|
|||
<el-form-item |
|||
label="标签" |
|||
label-width="150px" |
|||
:class="{ 'form-item': source === 'visiual' }" |
|||
prop="tagList" |
|||
> |
|||
<fold-text v-if="tagList.length > 0" style="width: 300px" :row="3"> |
|||
<div :key="item.name" class="tag-name" v-for="item in tagList"> |
|||
{{ item.name }} |
|||
</div> |
|||
</fold-text> |
|||
|
|||
<el-popover |
|||
placement="top" |
|||
width="450" |
|||
height="450" |
|||
v-model="visibleTagPanel" |
|||
> |
|||
<div class="f" style="min-height: 120px"> |
|||
<h2>选择标签</h2> |
|||
<el-select |
|||
style="width: 350px" |
|||
v-model="selectedTagData" |
|||
multiple |
|||
allow-create |
|||
filterable |
|||
placeholder="请选择" |
|||
@change="handleTagChange" |
|||
> |
|||
<el-option-group label="自定义标签"> |
|||
<el-option |
|||
v-for="item in tagOptions.customized" |
|||
:key="item.id" |
|||
:label="item.name" |
|||
:value="item.id" |
|||
> |
|||
</el-option> |
|||
</el-option-group> |
|||
|
|||
<el-option-group label="常用标签"> |
|||
<el-option |
|||
v-for="item in tagOptions.defaulted" |
|||
:key="item.id" |
|||
:label="item.name" |
|||
:value="item.id" |
|||
> |
|||
</el-option> |
|||
</el-option-group> |
|||
</el-select> |
|||
|
|||
<el-button |
|||
style="margin-left: 10px" |
|||
size="small" |
|||
type="danger" |
|||
@click="updateProjectTag" |
|||
>关闭</el-button |
|||
> |
|||
</div> |
|||
<div slot="reference"> |
|||
<el-button v-if="source === 'manage'" size="small" type="" |
|||
>选择</el-button |
|||
> |
|||
<div v-else class="one-btn">选择</div> |
|||
</div> |
|||
</el-popover> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { Loading } from "element-ui"; // 引入Loading服务 |
|||
import { requestPost } from "@/js/dai/request"; |
|||
import selectStaff from "@/views/components/selectStaff"; |
|||
import formVltHelper from "dai-js/tools/formVltHelper"; |
|||
import foldText from "@/views/components/foldText"; |
|||
import myCascader from "./myCascader.vue"; |
|||
import { isCard } from "@/utils/validate"; |
|||
|
|||
let loading; // 加载动画 |
|||
function iniFmData() { |
|||
return { |
|||
operationType: "1", //处理方式[0:已回复 1:已转项目 2:已转需求] |
|||
publicReply: "", //项目方案 1000 |
|||
internalRemark: "", // 内部备注 1000 |
|||
gridId: "", // |
|||
assistanceUnitIndex: "", |
|||
assistanceUnitId: "", // 协办单位Id |
|||
assistanceUnitType: "", // 协办单位类型,1社区自组织,2联建单位 |
|||
staffList: [], // 勾选人员信息 |
|||
categoryList: [], // |
|||
tagList: [], // |
|||
|
|||
internalFile: [], // |
|||
title: "", // |
|||
|
|||
publicFile: [], // |
|||
locateAddress: "", // |
|||
locateLongitude: "", // |
|||
locateDimension: "", // |
|||
eventId: "", // |
|||
}; |
|||
} |
|||
export default { |
|||
data() { |
|||
return { |
|||
btnDisable: false, |
|||
customerId: localStorage.getItem("customerId"), |
|||
gridList: [], //所属网格list--场所区域 |
|||
myDepartmentList: [], //部门数组 |
|||
visibleStaffPanel: false, |
|||
assistanceUnitList: [], //协办单位数组 |
|||
tagList: [], //标签数组 |
|||
|
|||
tagOptions: [], |
|||
visibleTagPanel: false, |
|||
selectedTagData: [], |
|||
|
|||
casOptions: [], |
|||
// iscascaderShow: 0, |
|||
selCategoryArray: [], |
|||
selCateObj: {}, |
|||
optionProps: { |
|||
multiple: false, |
|||
value: "id", |
|||
label: "name", |
|||
children: "subCategory", |
|||
}, |
|||
|
|||
formData: iniFmData(), |
|||
formDataTemp: { |
|||
assistanceUnitIndex: 0, |
|||
assistanceUnitId: "", // 协办单位Id |
|||
assistanceUnitType: "", // 协办单位类型,1社区自组织,2联建单位 |
|||
|
|||
eventId: "", |
|||
gridId: "63d5ff92ea981b1c58e4914ac894c610", |
|||
internalRemark: "内部备注", |
|||
operationType: "1", |
|||
projectStaffId: "1514068005825622017", |
|||
publicReply: "项目方案", |
|||
title: "3123123", |
|||
|
|||
internalFile: [], |
|||
staffList: [], |
|||
tagList: [ |
|||
{ |
|||
id: "46294b3c9f96ee4d0b00e997e06c8f97", |
|||
isDisable: "enable", |
|||
name: "车行道、人行道、盲道、无障碍通道、路名牌", |
|||
}, |
|||
{ |
|||
id: "953bafc1191f784841d9b8da61ec7b9b", |
|||
isDisable: "enable", |
|||
name: "城市广场管理", |
|||
}, |
|||
], |
|||
}, |
|||
|
|||
okflag: false, |
|||
|
|||
uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadqrcodeV2", |
|||
eventDetailCopy: {}, |
|||
}; |
|||
}, |
|||
components: { selectStaff, foldText, myCascader }, |
|||
computed: { |
|||
dataRule() { |
|||
return { |
|||
categoryList: [ |
|||
{ required: true, message: "事件分类不能为空", trigger: "blur" }, |
|||
], |
|||
title: [{ required: true, message: "标题不能为空", trigger: "blur" }], |
|||
gridId: [ |
|||
{ required: true, message: "所属网格不能为空", trigger: "blur" }, |
|||
], |
|||
staffList: [ |
|||
{ required: true, message: "处理部门不能为空", trigger: "blur" }, |
|||
], |
|||
publicReply: [ |
|||
{ required: true, message: "项目方案不能为空", trigger: "blur" }, |
|||
], |
|||
}; |
|||
}, |
|||
}, |
|||
props: { |
|||
gridId: { |
|||
//新增是选择的网格id |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
eventId: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
eventDetailData: { |
|||
type: Object, |
|||
default() { |
|||
return {}; |
|||
}, |
|||
}, |
|||
source: { |
|||
//展示来源:manage 管理平台 visiual 可视化平台 |
|||
type: String, |
|||
default: "manage", |
|||
}, |
|||
}, |
|||
watch: { |
|||
gridId: function (val) { |
|||
this.formData.gridId = val; |
|||
}, |
|||
"formData.assistanceUnitIndex": function (val) { |
|||
if (val === "" || this.assistanceUnitList.length === 0) { |
|||
this.formData.assistanceUnitId = ""; |
|||
this.formData.assistanceUnitType = ""; |
|||
} else { |
|||
this.formData.assistanceUnitId = |
|||
this.assistanceUnitList[val].assistanceUnitId; |
|||
this.formData.assistanceUnitType = |
|||
this.assistanceUnitList[val].assistanceUnitType; |
|||
} |
|||
}, |
|||
|
|||
async selectedTagData(val) { |
|||
const { tagOptions } = this; |
|||
this.tagList = await Promise.all( |
|||
val.map(async (id) => { |
|||
let ele = [...tagOptions.customized, ...tagOptions.defaulted].find( |
|||
(item) => item.id == id || item.name == id |
|||
); |
|||
if (!ele) { |
|||
await this.createTag(id); |
|||
ele = [ |
|||
...this.tagOptions.customized, |
|||
...this.tagOptions.defaulted, |
|||
].find((item) => item.name == id); |
|||
if (!ele) |
|||
return { |
|||
id: "", |
|||
name: ele.name, |
|||
}; |
|||
} |
|||
return { |
|||
id: ele.id, |
|||
name: ele.name, |
|||
}; |
|||
}) |
|||
); |
|||
|
|||
this.tagList = this.tagList.filter((item) => item.id); |
|||
console.log(this.tagList); |
|||
}, |
|||
}, |
|||
created() {}, |
|||
|
|||
async mounted() { |
|||
const { user } = this.$store.state; |
|||
this.agencyId = user.agencyId; |
|||
this.getCategoryList(); |
|||
this.loadGrid(); |
|||
this.getMyDepartmentList(); |
|||
// this.getAssistanceUnitList(); |
|||
this.getTagList(); |
|||
// this.formData = { ...this.formDataTemp } |
|||
if (this.eventId) { |
|||
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData)); |
|||
this.formData.gridId = this.eventDetailCopy.gridId; |
|||
|
|||
if ( |
|||
this.eventDetailCopy.parentCategoryId && |
|||
this.eventDetailCopy.categoryId |
|||
) { |
|||
this.selCategoryArray = []; |
|||
this.selCategoryArray.push(this.eventDetailCopy.parentCategoryId); |
|||
this.selCategoryArray.push(this.eventDetailCopy.categoryId); |
|||
|
|||
this.selCateObj = { |
|||
name: this.eventDetailCopy.categoryName, |
|||
id: this.eventDetailCopy.categoryId, |
|||
}; |
|||
|
|||
this.formData.categoryList = []; |
|||
this.formData.categoryList.push(this.selCateObj); |
|||
} |
|||
} else { |
|||
this.formData.gridId = this.gridId; |
|||
} |
|||
}, |
|||
|
|||
methods: { |
|||
async getCategoryList() { |
|||
const url = "/governance/issueprojectcategorydict/list"; |
|||
|
|||
let params = {}; |
|||
|
|||
const { data, code, msg } = await requestPost(url, params); |
|||
|
|||
if (code === 0) { |
|||
let treeDataNew = this.filterTree(data); |
|||
|
|||
//组织级联数据 |
|||
// ++this.iscascaderShow; |
|||
this.casOptions = []; |
|||
this.casOptions = treeDataNew; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
|
|||
handleChangeCate(obj) { |
|||
// console.log(this.$refs["myCascader"].getCheckedNodes()[0].data); |
|||
// this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data; |
|||
this.selCateObj = obj |
|||
this.formData.categoryList = []; |
|||
let flag = JSON.stringify(obj) == '{}' |
|||
if(flag) this.formData.categoryList = [] |
|||
else this.formData.categoryList.push(this.selCateObj); |
|||
|
|||
}, |
|||
|
|||
//重构树,去除网格 |
|||
filterTree(arr) { |
|||
let childs = arr; |
|||
for (let i = childs.length; i--; i > 0) { |
|||
if (childs[i].subCategory) { |
|||
if (childs[i].subCategory.length) { |
|||
this.filterTree(childs[i].subCategory); |
|||
} else { |
|||
delete childs[i].subCategory; |
|||
} |
|||
} |
|||
} |
|||
return arr; |
|||
}, |
|||
async loadGrid() { |
|||
const url = "/gov/org/customergrid/gridoption"; |
|||
let params = { |
|||
agencyId: this.agencyId, |
|||
}; |
|||
|
|||
const { data, code, msg } = await requestPost(url, params); |
|||
|
|||
if (code === 0) { |
|||
this.gridList = data; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
|
|||
//加载处理部门数据 |
|||
async getMyDepartmentList() { |
|||
const url = "/governance/trace/approvalagencylist"; |
|||
|
|||
const { data, code, msg } = await requestPost(url, { |
|||
issueId: "", |
|||
projectStaffId: "", |
|||
}); |
|||
|
|||
if (code === 0) { |
|||
this.myDepartmentList = data.subAgencyList; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
|
|||
//加载协同单位数据 |
|||
async getAssistanceUnitList() { |
|||
const url = "/heart/icpartyunit/assistanceUnitList"; |
|||
|
|||
const { data, code, msg } = await requestPost(url, { |
|||
// projectId: this.projectIdCopy, |
|||
}); |
|||
|
|||
if (code === 0) { |
|||
this.assistanceUnitList = data; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
//加载标签 |
|||
async getTagList() { |
|||
const url = "/governance/issueprojecttagdict/list"; |
|||
const { data, code, msg } = await requestPost(url, {}); |
|||
|
|||
if (code === 0) { |
|||
this.tagOptions = { |
|||
customized: data.customized, |
|||
defaulted: data.defaulted, |
|||
}; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
|
|||
handleTagChange(val) { |
|||
console.log(val); |
|||
}, |
|||
updateProjectTag() { |
|||
this.visibleTagPanel = false; |
|||
}, |
|||
|
|||
async getProjectInfo() { |
|||
this.okflag = false; |
|||
this.$refs["ref_form"].validate((valid, messageObj) => { |
|||
if (!valid) { |
|||
app.util.validateRule(messageObj); |
|||
} else { |
|||
this.formData.tagList = this.tagList; |
|||
this.okflag = true; |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
beforeImgUpload(file) { |
|||
const isLt1M = file.size / 1024 / 1024 < 10; |
|||
|
|||
if (!isLt1M) { |
|||
this.$message.error("上传文件大小不能超过 10MB!"); |
|||
} |
|||
return isLt1M; |
|||
}, |
|||
resetData() {}, |
|||
handleImgSuccess(res, file, fileList) { |
|||
console.log("res.data.url", file); |
|||
if (res.code === 0 && res.msg === "success") { |
|||
console.log("res.data.url", res.data.url); |
|||
this.formData.internalFile.push({ |
|||
format: file.name.split(".").pop(), |
|||
name: file.name, |
|||
size: file.size, |
|||
type: file.raw.type, |
|||
url: res.data.url, |
|||
}); |
|||
console.log(this.formData.internalFile); |
|||
} else { |
|||
this.$message.error(res.msg); |
|||
} |
|||
}, |
|||
|
|||
handleImgRemove(file) { |
|||
let index = this.formData.internalFile.findIndex( |
|||
(item) => item.url == file.response.data.url |
|||
); |
|||
this.formData.internalFile.splice(index, 1); |
|||
console.log(this.formData.internalFile); |
|||
}, |
|||
|
|||
// 开启加载动画 |
|||
startLoading() { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: "正在加载……", // 加载中需要显示的文字 |
|||
background: "rgba(0,0,0,.7)", // 背景颜色 |
|||
}); |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading() { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close(); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style |
|||
lang="scss" |
|||
src="@/assets/scss/modules/shequzhili/project-info.scss" |
|||
scoped |
|||
></style> |
|||
|
|||
<style lang='scss' scoped> |
|||
@import "@/assets/scss/modules/visual/a_customize.scss"; |
|||
@import "@/assets/scss/modules/shequzhili/event-info.scss"; |
|||
</style> |
|||
|
|||
|
|||
<style scoped> |
|||
.el-dialog__body { |
|||
padding: 0 10px 20px !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,272 @@ |
|||
<!-- |
|||
* @Author: yanLu xgktv007@163.com |
|||
* @Date: 2023-09-05 10:21:34 |
|||
* @LastEditors: yanLu xgktv007@163.com |
|||
* @LastEditTime: 2023-09-05 10:21:34 |
|||
* @Description: 事件回复 |
|||
* |
|||
* |
|||
--> |
|||
<template> |
|||
<div class="search"> |
|||
<el-form ref="ref_form2" :inline="false" :model="formData" :rules="dataRule"> |
|||
<el-form-item label="事件分类" label-width="150px" :class="{ 'form-item': source === 'visiual' }" |
|||
prop="categoryList"> |
|||
<div :class="{ 'visiual-form': source === 'visiual' }"> |
|||
<el-cascader class="cell-width-2" ref="myCascader" v-model="selCategoryArray" :key="iscascaderShow" |
|||
:options="casOptions" :props="optionProps" :show-all-levels="false" |
|||
@change="handleChangeCate"></el-cascader> |
|||
</div> |
|||
</el-form-item> |
|||
<el-form-item label="回复内容" prop="content" label-width="150px" :class="{ 'form-item': source === 'visiual' }" |
|||
style="display: block"> |
|||
<div :class="{ 'visiual-form': source === 'visiual' }"> |
|||
<el-input class="cell-width-area" type="textarea" maxlength="500" show-word-limit :rows="5" |
|||
placeholder="请输入回复内容,不超过500字" v-model="formData.content"></el-input> |
|||
</div> |
|||
</el-form-item> |
|||
<el-form-item style="display: block" label="附件" label-width="150px" prop="attach"> |
|||
<el-upload :headers="$getElUploadHeaders()" class="upload-demo" :action="uploadUlr" |
|||
accept=".doc,.pdf,.xls,.docx,.xlsx,.jpg,.png,.jpeg,.bmp,.mp4,.wma,.m4a,.mp3" |
|||
:on-success="handleFileSuccess" :on-remove="handleFileRemove" :on-preview="handleFileDownload" |
|||
:limit="3" :before-upload="beforeUpload" :file-list="fileList"> |
|||
<el-button size="small" :disabled="fileList.length === 3" type="primary">点击上传</el-button> |
|||
<div slot="tip" class="el-upload__tip">支持图片、word、pdf</div> |
|||
</el-upload> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { Loading } from "element-ui"; // 引入Loading服务 |
|||
import { requestPost } from "@/js/dai/request"; |
|||
let loading; // 加载动画 |
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
btnDisable: false, |
|||
formData: { |
|||
operationType: '6', //处理方式[0:已回复 5、指派 6、完成并回复] |
|||
content: '', |
|||
status: 'closed_case', |
|||
categoryList: [], |
|||
files: [] |
|||
}, |
|||
status: false, |
|||
okflag: false, |
|||
eventDetailCopy: {}, |
|||
selCategoryArray: [], |
|||
casOptions: [], |
|||
fileList: [], |
|||
uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadvariedfile", |
|||
iscascaderShow: 0, |
|||
optionProps: { |
|||
multiple: false, |
|||
value: "id", |
|||
label: "categoryName", |
|||
children: "children", |
|||
}, |
|||
dataRule: { |
|||
content: [ |
|||
{ required: true, message: '回复内容不能为空', trigger: 'blur' }, |
|||
], |
|||
categoryList: [ |
|||
// { required: true, message: '事件分类不能为空', trigger: 'blur' }, |
|||
] |
|||
} |
|||
}; |
|||
}, |
|||
components: {}, |
|||
computed: {}, |
|||
props: { |
|||
eventId: { |
|||
type: String, |
|||
default: '', |
|||
}, |
|||
eventDetailData: { |
|||
type: Object, |
|||
default() { |
|||
return {}; |
|||
}, |
|||
}, |
|||
source: { |
|||
//展示来源:manage 管理平台 visiual 可视化平台 |
|||
type: String, |
|||
default: 'manage', |
|||
}, |
|||
}, |
|||
watch: {}, |
|||
|
|||
created() { }, |
|||
|
|||
async mounted() { |
|||
this.getCategoryList(); |
|||
if (this.eventId) { |
|||
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData)); |
|||
// 这一步接收到eventDetailCopy在这里回填 |
|||
if (this.eventDetailCopy.parentCategoryId && this.eventDetailCopy.categoryId) { |
|||
this.formData.categoryId = this.eventDetailCopy.categoryId |
|||
this.selCategoryArray.push(this.eventDetailCopy.parentCategoryId, this.eventDetailCopy.categoryId) |
|||
} |
|||
} |
|||
}, |
|||
|
|||
methods: { |
|||
async getCategoryList() { |
|||
const url = '/governance/icEvent/getCategoryTree'; |
|||
let params = {}; |
|||
const { data, code, msg } = await requestPost(url, params); |
|||
if (code === 0) { |
|||
let treeDataNew = this.deepTree(data, "children"); |
|||
//组织级联数据 |
|||
++this.iscascaderShow; |
|||
this.casOptions = []; |
|||
this.casOptions = treeDataNew; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
handleChangeCate() { |
|||
if (this.selCateObj = this.$refs['myCascader'].getCheckedNodes()[0]) { |
|||
this.selCateObj = this.$refs['myCascader'].getCheckedNodes()[0].data |
|||
} else { |
|||
this.selCateObj = {} |
|||
} |
|||
}, |
|||
//重构树,去除网格 |
|||
deepTree(arr, children) { |
|||
if (Array.isArray(arr) && arr.length > 0) { |
|||
return arr.map((item) => { |
|||
return { |
|||
...item, |
|||
[children]: |
|||
(item[children] && |
|||
item[children].length > 0 && |
|||
this.deepTree(item[children], children)) || |
|||
null, |
|||
}; |
|||
}); |
|||
} |
|||
}, |
|||
async getReplayInfo() { |
|||
this.okflag = false; |
|||
this.$refs['ref_form2'].validate((valid, messageObj) => { |
|||
if (!valid) { |
|||
app.util.validateRule(messageObj); |
|||
} else { |
|||
if (this.status) { |
|||
if (!this.selCateObj || !this.selCateObj.id) { |
|||
this.$message.error('请选择事件分类'); |
|||
return false; |
|||
} |
|||
} |
|||
if (!this.formData.categoryId) { |
|||
this.formData.categoryId = this.selCateObj.id; |
|||
} |
|||
if(this.fileList){ |
|||
this.formData.files = this.fileList |
|||
} |
|||
this.formData.categoryList = []; |
|||
this.formData.categoryList.push(this.selCateObj); |
|||
this.okflag = true; |
|||
} |
|||
}); |
|||
}, |
|||
resetData() { }, |
|||
beforeUpload(file) { |
|||
const array = file.name.split("."); |
|||
const extension = array[array.length - 1]; |
|||
const formatarray = [ |
|||
"jpg", |
|||
"png", |
|||
"jpeg", |
|||
"bmp", |
|||
"mp4", |
|||
"wma", |
|||
"m4a", |
|||
"mp3", |
|||
"doc", |
|||
"docx", |
|||
"xls", |
|||
"xlsx", |
|||
"pdf", |
|||
]; |
|||
if (formatarray.indexOf(extension) === -1) { |
|||
this.$message.error("只支持图片、word、pdf"); |
|||
return false; |
|||
} |
|||
}, |
|||
handleFileRemove(file) { |
|||
if (file && file.status === "success") { |
|||
this.fileList.splice( |
|||
this.fileList.findIndex((item) => item.uid === file.uid), |
|||
1 |
|||
); |
|||
} |
|||
}, |
|||
handleFileSuccess(res, file) { |
|||
if (res.code === 0 && res.msg === "success") { |
|||
const array = file.name.split("."); |
|||
const fileType = array[array.length - 1]; |
|||
const picArray = ["jpg", "png", "jpeg", "bmp"]; |
|||
const videoarray = ["mp4", "wma", "m4a"]; |
|||
const docArray = ["doc", "docx", "xls", "xlsx", "pdf"]; |
|||
const mp3Array = ["mp3"]; |
|||
|
|||
if (picArray.indexOf(fileType) > -1) { |
|||
file.attachmentFormat = "image"; |
|||
} else if (videoarray.indexOf(fileType) > -1) { |
|||
file.attachmentFormat = "video"; |
|||
} else if (docArray.indexOf(fileType) > -1) { |
|||
file.attachmentFormat = "doc"; |
|||
} else if (mp3Array.indexOf(fileType) > -1) { |
|||
file.attachmentFormat = "voice"; |
|||
} |
|||
|
|||
file.url = res.data.url; |
|||
file.type = fileType; |
|||
|
|||
file.attachmentName = file.name; |
|||
file.attachmentType = file.type; |
|||
file.attachmentUrl = file.url; |
|||
|
|||
this.fileList.push(file); |
|||
} else this.$message.error(res.msg); |
|||
}, |
|||
//下载 |
|||
handleFileDownload(file) { |
|||
var a = document.createElement("a"); |
|||
var event = new MouseEvent("click"); |
|||
a.download = file.name; |
|||
a.href = file.url; |
|||
a.dispatchEvent(event); |
|||
}, |
|||
// 开启加载动画 |
|||
startLoading() { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)', // 背景颜色 |
|||
}); |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading() { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close(); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang='scss' scoped> |
|||
@import '@/assets/scss/modules/visual/a_customize.scss'; |
|||
@import '@/assets/scss/modules/shequzhili/event-info.scss'; |
|||
|
|||
.el-dialog__body { |
|||
padding: 0 10px 20px !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,215 @@ |
|||
<template> |
|||
<div class="search"> |
|||
<el-form ref="ref_form1" :inline="false" :model="formData" :rules="dataRule"> |
|||
<el-form-item label="事件分类" label-width="150px" :class="{ 'form-item': source === 'visiual' }" |
|||
prop="categoryList"> |
|||
<div :class="{ 'visiual-form': source === 'visiual' }"> |
|||
<el-cascader class="cell-width-2" ref="myCascader" v-model="selCategoryArray" :key="iscascaderShow" |
|||
:options="casOptions" :props="optionProps" :show-all-levels="false" |
|||
@change="handleChangeCate"></el-cascader> |
|||
</div> |
|||
</el-form-item> |
|||
<el-form-item label="回复内容" prop="content" label-width="150px" :class="{ 'form-item': source === 'visiual' }" |
|||
style="display: block"> |
|||
<div :class="{ 'visiual-form': source === 'visiual' }"> |
|||
<el-input class="cell-width-area" type="textarea" maxlength="500" show-word-limit :rows="5" |
|||
placeholder="请输入回复内容,不超过500字" v-model="formData.content"></el-input> |
|||
</div> |
|||
</el-form-item> |
|||
<el-form-item label="办结时限" prop="timeLimit" label-width="150px" :class="{ 'form-item': source === 'visiual' }" |
|||
style="display: block"> |
|||
<div :class="{ 'visiual-form': source === 'visiual' }"> |
|||
<el-date-picker v-model="formData.timeLimit" class="cell-width-1" type="datetime" placeholder="办结时限" |
|||
value-format="yyyy-MM-dd HH:mm:ss"> |
|||
</el-date-picker> |
|||
</div> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { Loading } from "element-ui"; // 引入Loading服务 |
|||
import { requestPost } from "@/js/dai/request"; |
|||
let loading; // 加载动画 |
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
btnDisable: false, |
|||
formData: { |
|||
operationType: '0', //处理方式[0:已回复 5、指派 6、完成并回复] |
|||
content: '', |
|||
status: 'processing', |
|||
timeLimit: '',//办结时限 |
|||
categoryList: [], |
|||
}, |
|||
status: false, |
|||
okflag: false, |
|||
eventDetailCopy: {}, |
|||
selCategoryArray: [], |
|||
casOptions: [], |
|||
iscascaderShow: 0, |
|||
optionProps: { |
|||
multiple: false, |
|||
value: "id", |
|||
label: "categoryName", |
|||
children: "children", |
|||
level: 'categoryType' |
|||
}, |
|||
dataRule: { |
|||
content: [ |
|||
{ required: true, message: '回复内容不能为空', trigger: 'blur' }, |
|||
], |
|||
categoryList: [ |
|||
// { required: true, message: '事件分类不能为空', trigger: 'blur' }, |
|||
], |
|||
timeLimit: [ |
|||
{ required: true, message: "办结时限不能为空", trigger: "blur" }, |
|||
] |
|||
} |
|||
}; |
|||
}, |
|||
components: {}, |
|||
computed: {}, |
|||
props: { |
|||
eventId: { |
|||
type: String, |
|||
default: '', |
|||
}, |
|||
eventDetailData: { |
|||
type: Object, |
|||
default() { |
|||
return {}; |
|||
}, |
|||
}, |
|||
source: { |
|||
//展示来源:manage 管理平台 visiual 可视化平台 |
|||
type: String, |
|||
default: 'manage', |
|||
}, |
|||
}, |
|||
watch: { |
|||
|
|||
}, |
|||
|
|||
created() { |
|||
|
|||
}, |
|||
|
|||
async mounted() { |
|||
this.getCategoryList(); |
|||
if (this.eventId) { |
|||
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData)); |
|||
console.log('this.eventDetailCopy', this.eventDetailCopy); |
|||
let value = this.eventDetailCopy.parentCategoryId.split(","); |
|||
value.push(this.eventDetailCopy.categoryId); |
|||
this.handleChangeCate(value) |
|||
} |
|||
}, |
|||
|
|||
methods: { |
|||
async getCategoryList() { |
|||
const url = '/governance/icEvent/getCategoryTree'; |
|||
let params = {}; |
|||
const { data, code, msg } = await requestPost(url, params); |
|||
if (code === 0) { |
|||
let treeDataNew = this.deepTree(data, "children"); |
|||
//组织级联数据 |
|||
++this.iscascaderShow; |
|||
this.casOptions = []; |
|||
this.casOptions = treeDataNew; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
if (this.eventDetailCopy.parentCategoryId) { |
|||
let pids = this.eventDetailCopy.parentCategoryId.split(','); |
|||
pids.push(this.eventDetailCopy.categoryId) |
|||
pids.forEach(id => { |
|||
let node = this.buildTree(this.casOptions, toString(id)); |
|||
this.selCategoryArray.push(node) |
|||
}); |
|||
let node = this.buildTree(this.casOptions, this.eventDetailCopy.categoryId); |
|||
this.selCategoryArray.push(node); |
|||
console.log(this.selCategoryArray); |
|||
} |
|||
}, |
|||
buildTree(nodes, treeId) { |
|||
nodes.forEach(item => { |
|||
if (treeId === item.id) { |
|||
return item; |
|||
} else { |
|||
this.buildTree(item.children, treeId) |
|||
} |
|||
}) |
|||
}, |
|||
handleChangeCate(value) { |
|||
if (this.selCateObj = this.$refs['myCascader'].getCheckedNodes()[0]) { |
|||
this.selCateObj = this.$refs['myCascader'].getCheckedNodes()[0].data |
|||
} else { |
|||
this.selCateObj = {} |
|||
} |
|||
if(!value) return |
|||
this.selCategoryArray = value |
|||
}, |
|||
//重构树,去除网格 |
|||
deepTree(arr, children) { |
|||
if (Array.isArray(arr) && arr.length > 0) { |
|||
return arr.map((item) => { |
|||
return { |
|||
...item, |
|||
[children]: |
|||
(item[children] && |
|||
item[children].length > 0 && |
|||
this.deepTree(item[children], children)) || |
|||
null, |
|||
}; |
|||
}); |
|||
} |
|||
}, |
|||
async getReplayInfo() { |
|||
this.okflag = false; |
|||
this.$refs['ref_form1'].validate((valid, messageObj) => { |
|||
if (!valid) { |
|||
app.util.validateRule(messageObj); |
|||
} else { |
|||
if (this.status) { |
|||
if (!this.selCateObj || !this.selCateObj.id) { |
|||
this.$message.error('请选择事件分类'); |
|||
return false; |
|||
} |
|||
} |
|||
this.formData.categoryList = []; |
|||
this.formData.categoryList.push(this.selCateObj); |
|||
this.okflag = true; |
|||
} |
|||
}); |
|||
}, |
|||
resetData() { }, |
|||
// 开启加载动画 |
|||
startLoading() { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)', // 背景颜色 |
|||
}); |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading() { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close(); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang='scss' scoped> |
|||
@import '@/assets/scss/modules/visual/a_customize.scss'; |
|||
@import '@/assets/scss/modules/shequzhili/event-info.scss'; |
|||
|
|||
.el-dialog__body { |
|||
padding: 0 10px 20px !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,201 @@ |
|||
<template> |
|||
<div class=""> |
|||
<div> |
|||
<el-form ref="ref_form1" :inline="false" :rules="dataRule" class="form"> |
|||
<el-form-item label="处理方式" label-width="150px" :class="{ 'form-item': source === 'visiual' }" |
|||
prop="operationType"> |
|||
<el-radio-group :class="{ 'form-item': source === 'visiual' }" v-model="operationType" |
|||
@change="handleChangeOperationType"> |
|||
<el-radio v-if="!eventId" label="4">暂不处理</el-radio> |
|||
<el-radio label="0">回复</el-radio> |
|||
<el-radio label="5">指派</el-radio> |
|||
<el-radio label="6">完成并回复</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div v-if="operationType === '0'"> |
|||
<process-form-replay ref="ref_process_form_replay" :source="source" :eventDetailData="eventDetailData" |
|||
:eventId="eventId"></process-form-replay> |
|||
</div> |
|||
<div v-if="operationType === '6'"> |
|||
<process-form-replay-end ref="ref_process_form_replay_end" :source="source" |
|||
:eventDetailData="eventDetailData" :eventId="eventId"></process-form-replay-end> |
|||
</div> |
|||
<div v-if="operationType === '5'"> |
|||
<process-form-designate ref="ref_process_form_designate" :source="source" :eventDetailData="eventDetailData" |
|||
:eventId="eventId"></process-form-designate> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { Loading } from "element-ui"; // 引入Loading服务 |
|||
import { requestPost } from "@/js/dai/request"; |
|||
import processFormReplay from "./process-form-replay"; |
|||
import processFormReplayEnd from "./process-form-replay-end"; |
|||
import processFormProject from "./process-form-project"; |
|||
import processFormDemand from "./process-form-demand"; |
|||
import processFormIssue from "./process-form-issue"; |
|||
import processFormDesignate from "./process-form-designate"; |
|||
|
|||
|
|||
let loading; // 加载动画 |
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
casOptions: [], |
|||
iscascaderShow: 0, |
|||
selCategoryArray: [], |
|||
selCateObj: {}, |
|||
optionProps: { |
|||
multiple: false, |
|||
value: 'id', |
|||
label: 'name', |
|||
children: 'subCategory', |
|||
}, |
|||
operationType: '', |
|||
replayInfo: {}, |
|||
demand: {}, |
|||
project: {}, |
|||
issueInfo: {}, |
|||
okflag: false, |
|||
eventDetailCopy: {}, |
|||
transferObj: { |
|||
latitude: "", |
|||
longitude: "" |
|||
} |
|||
}; |
|||
}, |
|||
components: { |
|||
processFormReplay, |
|||
processFormProject, |
|||
processFormDemand, |
|||
processFormIssue, |
|||
processFormDesignate, |
|||
processFormReplayEnd |
|||
}, |
|||
computed: { |
|||
dataRule() { |
|||
return { |
|||
operationType: [ |
|||
{ required: true, message: "处理方式不能为空", trigger: "blur" }, |
|||
], |
|||
}; |
|||
}, |
|||
}, |
|||
props: { |
|||
demandUserId: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
demandUserName: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
demandUserMobile: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
gridId: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
eventId: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
eventDetailData: { |
|||
type: Object, |
|||
default() { |
|||
return {} |
|||
} |
|||
}, |
|||
source: {//展示来源:manage 管理平台 visiual 可视化平台 |
|||
type: String, |
|||
default: 'manage' |
|||
} |
|||
}, |
|||
|
|||
watch: {}, |
|||
|
|||
created() { }, |
|||
|
|||
async mounted() { |
|||
const { user } = this.$store.state |
|||
this.agencyId = user.agencyId |
|||
if (this.eventId) { |
|||
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData)); |
|||
} |
|||
if (this.eventDetailData.operationType) { |
|||
this.operationType = this.eventDetailCopy.operationType |
|||
} |
|||
this.$EventBus.$on('map', (val) => { |
|||
this.transferObj.latitude = val.lat |
|||
this.transferObj.longitude = val.lng |
|||
}) |
|||
}, |
|||
|
|||
methods: { |
|||
handleChangeOperationType(val) { |
|||
this.operationType = val; |
|||
}, |
|||
async getProcessInfo() { |
|||
this.okflag = false |
|||
if (this.operationType === '0') { |
|||
this.$refs.ref_process_form_replay.getReplayInfo() |
|||
if (this.$refs.ref_process_form_replay.okflag) { |
|||
this.replayInfo = this.$refs.ref_process_form_replay.formData; |
|||
this.okflag = true; |
|||
} |
|||
} else if (this.operationType === '5') { |
|||
this.$refs.ref_process_form_designate.getReplayInfo() |
|||
this.replayInfo = this.$refs.ref_process_form_designate.formData |
|||
if (this.$refs.ref_process_form_designate.okflag) { |
|||
this.replayInfo = this.$refs.ref_process_form_designate.formData |
|||
this.okflag = true |
|||
} |
|||
} else if (this.operationType === '6') { |
|||
this.$refs.ref_process_form_replay_end.getReplayInfo() |
|||
this.replayInfo = this.$refs.ref_process_form_replay_end.formData |
|||
if (this.$refs.ref_process_form_replay_end.okflag) { |
|||
this.replayInfo = this.$refs.ref_process_form_replay_end.formData |
|||
this.okflag = true |
|||
} |
|||
}else { |
|||
return false |
|||
} |
|||
}, |
|||
handleCancle() { |
|||
this.resetData(); |
|||
}, |
|||
// 开启加载动画 |
|||
startLoading() { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: "正在加载……", // 加载中需要显示的文字 |
|||
background: "rgba(0,0,0,.7)", // 背景颜色 |
|||
}); |
|||
}, |
|||
resetData() { |
|||
|
|||
}, |
|||
// 结束加载动画 |
|||
endLoading() { |
|||
if (loading) { |
|||
loading.close(); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang="scss" scoped> |
|||
@import "@/assets/scss/modules/shequzhili/event-info.scss"; |
|||
|
|||
.el-dialog__body { |
|||
padding: 0 10px 20px !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,749 @@ |
|||
<template> |
|||
<div class="g-main"> |
|||
<div v-show="pageType == 'list'"> |
|||
<div class="m-search"> |
|||
<el-form :inline="true" :model="formData" ref="ref_searchform" :label-width="'100px'"> |
|||
<div> |
|||
<el-form-item label="所属组织" prop="gridId"> |
|||
<el-select class="u-item-width-normal" v-model="formData.gridId" placeholder="全部" size="small" |
|||
clearable> |
|||
<el-option v-for="item in gridList" :key="item.value" :label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="上报渠道" prop="sourceType"> |
|||
<el-select v-model="formData.sourceType" placeholder="请选择" size="small" clearable |
|||
class="u-item-width-normal"> |
|||
<el-option v-for="item in qudaoArray" :key="item.value" :label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="事件分类" prop="firstIdList"> |
|||
<el-cascader ref="cascaderEvent" v-model="eventTypeCheck" :options="cateOptions" collapse-tags |
|||
:show-all-levels="false" :props="{ |
|||
multiple: true, |
|||
checkStrictly: false, |
|||
emitPath: false, |
|||
children: 'children', |
|||
label: 'categoryName', |
|||
value: 'id', |
|||
}" clearable class="u-item-width-normal" @change="handleEventType" /> |
|||
<!-- <template slot-scope="{ node, data }"> |
|||
<div @click="cascaderClick(node, data)"> |
|||
<span>{{ data.name }}</span> |
|||
</div> |
|||
</template> |
|||
</el-cascader> --> |
|||
</el-form-item> |
|||
<el-form-item label="接收时间" prop="startTime"> |
|||
<el-date-picker v-model="formData.startTime" class="u-item-width-daterange" size="small" |
|||
type="date" value-format="yyyy-MM-dd HH:mm:ss" value="yyyy-MM-dd" placeholder="开始时间"> |
|||
</el-date-picker> |
|||
<span class="u-data-tag">至</span> |
|||
<el-date-picker v-model="formData.endTime" class="u-item-width-daterange u-data-tag" |
|||
size="small" type="date" value-format="yyyy-MM-dd HH:mm:ss" value="yyyy-MM-dd" |
|||
placeholder="结束时间"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="工单号" prop="workOrderNum"> |
|||
<el-input v-model="formData.workOrderNum" class="u-item-width-normal" size="small" clearable |
|||
placeholder="请输入工单号"> |
|||
</el-input> |
|||
</el-form-item> |
|||
<el-form-item label="问题描述" prop="eventContent"> |
|||
<el-input v-model="formData.eventContent" class="u-item-width-normal" size="small" clearable |
|||
placeholder="请输入事件问题描述"> |
|||
</el-input> |
|||
</el-form-item> |
|||
<el-form-item label="联系人" prop="name"> |
|||
<el-input v-model="formData.name" class="u-item-width-normal" size="small" clearable |
|||
placeholder="请输入联系人"> |
|||
</el-input> |
|||
</el-form-item> |
|||
<el-form-item label="联系电话" prop="mobile"> |
|||
<el-input v-model="formData.mobile" class="u-item-width-normal" size="small" clearable |
|||
placeholder="请输入联系电话"> |
|||
</el-input> |
|||
</el-form-item> |
|||
<el-form-item label="处理状态" prop="status"> |
|||
<el-select class="u-item-width-normal" v-model="formData.status" placeholder="全部" size="small" |
|||
clearable> |
|||
<el-option v-for="item in statusArray" :key="item.value" :label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="办结时限" prop="limitStartTime"> |
|||
<el-date-picker v-model="formData.limitStartTime" class="u-item-width-daterange" size="small" |
|||
type="date" value-format="yyyy-MM-dd HH:mm:ss" value="yyyy-MM-dd" placeholder="开始时间"> |
|||
</el-date-picker> |
|||
<span class="u-data-tag">至</span> |
|||
<el-date-picker v-model="formData.limitEndTime" class="u-item-width-daterange u-data-tag" |
|||
size="small" type="date" value-format="yyyy-MM-dd HH:mm:ss" value="yyyy-MM-dd" |
|||
placeholder="结束时间"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-row> |
|||
<el-col :span="24" align="right"> |
|||
<el-button style="margin-left: 30px" size="small" type="primary " |
|||
@click="handleSearch">查询</el-button> |
|||
<el-button style="margin-left: 10px" size="small" class="diy-button--white" |
|||
@click="resetSearch">重置</el-button> |
|||
</el-col> |
|||
</el-row> |
|||
</div> |
|||
</el-form> |
|||
</div> |
|||
|
|||
<div class="m-table"> |
|||
<div class="div_btn"> |
|||
<el-button size="small" type="primary" @click="handleAdd">新增</el-button> |
|||
<el-button class="diy-button--white" size="small" @click="handleExportModule('room')">下载模板</el-button> |
|||
<el-upload :headers="$getElUploadHeaders()" ref="upload" class="upload-btn" action="uploadUlr" |
|||
:limit="1" :accept="'.xls,.xlsx'" :with-credentials="true" :show-file-list="false" |
|||
:auto-upload="true" :on-progress="handleProgress" :on-success="handleExcelSuccess" |
|||
:before-upload="beforeExcelUpload" :http-request="uploadHttpRequest" |
|||
style="display: inline-block;margin:0px 10px"> |
|||
<el-button size="small" class="diy-button--white" :loading="importLoading">导入</el-button> |
|||
</el-upload> |
|||
<el-button @click="handleExport" class="diy-button--white" size="small">导出</el-button> |
|||
<el-dropdown size="small" split-button type="primary" style="margin: 0 10px; height: 30px" |
|||
@command="(command) => handleMarkDiffcult(command)"> |
|||
标记 |
|||
<el-dropdown-menu slot="dropdown"> |
|||
<el-dropdown-item command="1">标记为难点痛点</el-dropdown-item> |
|||
<el-dropdown-item command="2">标记为矛盾纠纷</el-dropdown-item> |
|||
<el-dropdown-item command="3">标记为自身问题</el-dropdown-item> |
|||
</el-dropdown-menu> |
|||
</el-dropdown> |
|||
<el-button @click="handleCancalDiffcult" class="diy-button--red" size="small">取消标记</el-button> |
|||
</div> |
|||
|
|||
<el-table :data="tableData" class="m-table-item" style="width: 100%" |
|||
@selection-change="handleSelectionChange" :height="maxTableHeight"> |
|||
<el-table-column label="" fixed="left" type="selection" align="center" width="50" /> |
|||
<el-table-column label="序号" fixed="left" type="index" align="center" width="50" /> |
|||
<el-table-column prop="workOrderNum" align="center" label="工单号" :show-overflow-tooltip="true" /> |
|||
<el-table-column prop="gridName" align="center" min-width="140" label="所属组织" |
|||
:show-overflow-tooltip="true" /> |
|||
<el-table-column prop="sourceTypeName" align="center" width="100" label="上报渠道" |
|||
:show-overflow-tooltip="true" /> |
|||
<el-table-column prop="categoryName" label="事件分类" min-width="100" align="center" |
|||
:show-overflow-tooltip="true" /> |
|||
<!-- <template slot-scope="scope"> |
|||
{{ scope.row.firstName + '-' + scope.row.secondName }} |
|||
</template> |
|||
</el-table-column> --> |
|||
<el-table-column prop="happenTime" align="center" width="110" :show-overflow-tooltip="true" |
|||
label="接收时间" /> |
|||
<el-table-column prop="eventContent" label="问题描述" width="140" align="center" |
|||
:show-overflow-tooltip="true" /> |
|||
<!-- <el-table-column prop="imageList" align="center" width="80" label="图片"> |
|||
<template slot-scope="scope"> |
|||
<el-image v-if="scope.row.imageList && scope.row.imageList.length > 0" |
|||
style="width: 40px; height: 40px" :src="scope.row.imageList[0]" |
|||
:preview-src-list="scope.row.imageList"> |
|||
</el-image> |
|||
<span v-else></span> |
|||
</template> |
|||
</el-table-column> --> |
|||
<el-table-column prop="voiceList" align="center" width="80" label="语音"> |
|||
<template slot-scope="scope"> |
|||
<img @click="handleShowVoice(scope.row.voiceList[0].url)" class="img-voice" |
|||
v-if="scope.row.voiceList && scope.row.voiceList.length > 0" |
|||
src="@/assets/img/icon-voice.png" /> |
|||
<span v-else></span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="timeLimit" align="center" width="110" :show-overflow-tooltip="true" |
|||
label="办结时限" /> |
|||
<el-table-column prop="name" align="center" width="100" label="联系人" :show-overflow-tooltip="true" /> |
|||
<el-table-column prop="mobile" align="center" width="110" label="联系电话" :show-overflow-tooltip="true" /> |
|||
<el-table-column prop="address" align="center" :show-overflow-tooltip="true" label="详细地址" /> |
|||
<!-- <el-table-column prop="satisfactionName" align="center" width="100" label="满意度" |
|||
:show-overflow-tooltip="true" /> --> |
|||
<!-- <template slot-scope="scope"> |
|||
<span v-if="scope.row.satisfactionName">--</span> |
|||
</template> --> |
|||
<!-- <el-table-column prop="operationTypeName" align="center" width="100" :show-overflow-tooltip="true" |
|||
label="办理结点"> |
|||
</el-table-column> --> |
|||
<el-table-column prop="status" align="center" label="状态" width="80" :show-overflow-tooltip="true"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="scope.row.status === 'processing'">处理中</span> |
|||
<span v-else-if="scope.row.status === 'closed_case'">已完成</span> |
|||
<span v-else>--</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="markTypeName" align="center" label="标记" width="80" |
|||
:show-overflow-tooltip="true" /> |
|||
<el-table-column fixed="right" label="操作" align="center" width="100"> |
|||
<template slot-scope="scope"> |
|||
<el-button v-if="scope.row.status === 'processing' && !scope.row.operationId |
|||
" @click="handleDispose(scope.row)" type="text" size="small" class="">处理</el-button> |
|||
<el-button v-else-if="scope.row.status === 'closed_case' && !scope.row.satisfactionName |
|||
&& user.id === scope.row.createdUserId" @click="handleWatch(scope.row)" type="text" |
|||
size="small" class="">去评价</el-button> |
|||
<el-button v-else @click="handleWatch(scope.row)" type="text" size="small">查看</el-button> |
|||
<el-button @click="handleDel(scope.row)" type="text" size="small" class="">删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div> |
|||
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" |
|||
:current-page.sync="pageNo" :page-sizes="[20, 50, 100, 200]" :page-size="parseInt(pageSize)" |
|||
layout="sizes, prev, pager, next, total" :total="total"> |
|||
</el-pagination> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div v-if="pageType == 'dispose' || pageType == 'info' || pageType == 'add'"> |
|||
<event-info ref="eleEditForm" :pageType="pageType" :eventId="eventId" :eventDetailData="eventDetailData" |
|||
@handleClose="handleClose" @handleOk="handleOk" @dialogOk="handleEditSuccess" /> |
|||
</div> |
|||
|
|||
<el-dialog :title="'播放语音'" :visible.sync="showVoice" width="40%" top="5vh" append-to-body class="dialog-h" |
|||
:close-on-click-modal="false"> |
|||
<div class="dialog-h-content scroll-h"> |
|||
<div style="display: flex; justify-content: center; margin: 50px"> |
|||
<audio controls> |
|||
<source :src="selVoiceUrl" type="" /> |
|||
</audio> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="resi-btns"> |
|||
<el-button size="small" @click="showVoice = false">取消</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { requestPost } from "@/js/dai/request"; |
|||
import nextTick from "dai-js/tools/nextTick"; |
|||
import { mapGetters } from "vuex"; |
|||
import eventInfo from "./cpts/event-info"; |
|||
import axios from "axios"; |
|||
|
|||
export default { |
|||
components: { eventInfo }, |
|||
|
|||
data() { |
|||
// let endDisabledDate = (time) => { |
|||
// //这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键 |
|||
// let nowData = Date.now(); |
|||
// if (this.formData.startTime) { |
|||
// let startTime = new Date(this.formData.startTime); |
|||
// return ( |
|||
// time.getTime() > nowData || |
|||
// time.getTime() < startTime || |
|||
// time.getTime() === startTime |
|||
// ); |
|||
// } else { |
|||
// return time.getTime() > nowData; |
|||
// } |
|||
// }; |
|||
// let startDisabledDate = (time) => { |
|||
// //这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键 |
|||
// let nowData = Date.now(); |
|||
// return time.getTime() > nowData; |
|||
// }; |
|||
|
|||
return { |
|||
pageType: "list", // 列表list 新增add 处理dispose 详情info |
|||
user: {}, |
|||
agencyId: "", |
|||
gridList: [], //所属网格list--场所区域 |
|||
tableData: [], |
|||
statusArray: [ |
|||
{ |
|||
value: "processing", |
|||
label: "处理中", |
|||
}, |
|||
{ |
|||
value: "closed_case", |
|||
label: "已完成", |
|||
}, |
|||
], |
|||
qudaoArray: [ |
|||
// { |
|||
// value: "0", |
|||
// label: "随手拍/随时讲", |
|||
// }, |
|||
// { |
|||
// value: "1", |
|||
// label: "多媒体反应", |
|||
// }, |
|||
// { |
|||
// value: "2", |
|||
// label: "社区电话", |
|||
// }, |
|||
{ |
|||
value: "3", |
|||
label: "12345", |
|||
}, |
|||
// { |
|||
// value: "4", |
|||
// label: "网络员手持终端", |
|||
// }, |
|||
], |
|||
|
|||
formData: { |
|||
gridId: "", |
|||
sourceType: "", |
|||
eventContent: "", |
|||
name: "", |
|||
mobile: "", |
|||
startTime: "", |
|||
endTime: "", |
|||
limitStartTime: "", |
|||
limitEndTime: "", |
|||
status: "", |
|||
firstIdList: [], |
|||
secondIdList: [], |
|||
workOrderNum: "" |
|||
}, |
|||
cateOptions: [], |
|||
eventTypeCheck: [], |
|||
pageNo: 1, |
|||
pageSize: window.localStorage.getItem("pageSize") || 20, |
|||
total: 1, |
|||
// endPickerOptions: { |
|||
// disabledDate: endDisabledDate, |
|||
// }, |
|||
// startPickerOptions: { |
|||
// disabledDate: startDisabledDate, |
|||
// }, |
|||
eventId: "", |
|||
searchH: 180, |
|||
eventDetailData: {}, |
|||
showVoice: false, |
|||
selVoiceUrl: "", |
|||
multipleSelection: [], |
|||
importLoading: false |
|||
}; |
|||
}, |
|||
computed: { |
|||
maxTableHeight() { |
|||
const h = this.clientHeight - this.searchH - 275 + this.iframeHeight; |
|||
const _h = this.clientHeight - 275 - this.searchH; |
|||
return this.$store.state.inIframe ? h : _h; |
|||
}, |
|||
...mapGetters(["clientHeight", "iframeHeight"]), |
|||
}, |
|||
watch: { |
|||
"formData.endTime": function (val) { |
|||
if (val && val != "") { |
|||
let arrayTemp = val.split(" "); |
|||
this.formData.endTime = arrayTemp[0] + " 23:59:59"; |
|||
} |
|||
}, |
|||
"formData.limitEndTime": function (val) { |
|||
if (val && val != "") { |
|||
let arrayTemp = val.split(" "); |
|||
this.formData.limitEndTime = arrayTemp[0] + " 23:59:59"; |
|||
} |
|||
}, |
|||
}, |
|||
mounted() { |
|||
this.user = this.$store.state.user; |
|||
this.agencyId = this.user.agencyId; |
|||
this.loadGrid(); |
|||
this.getTableData(); |
|||
this.getCateOptions(); |
|||
}, |
|||
methods: { |
|||
handleEventType(val) { |
|||
const nodes = this.$refs.cascaderEvent.getCheckedNodes(); |
|||
this.formData.firstIdList = []; |
|||
this.formData.secondIdList = []; |
|||
let level1 = nodes.filter((item) => item.level === 1); |
|||
let level2 = nodes.filter((item) => item.level === 2); |
|||
level1.forEach((item) => { |
|||
if (item.hasChildren) { |
|||
for (let i = level2.length - 1; i >= 0; i--) { |
|||
if (level2[i].parent.value === item.value) level2.splice(i, 1); |
|||
} |
|||
} |
|||
}); |
|||
this.formData.firstIdList = level1.map((item) => item.value); |
|||
this.formData.secondIdList = level2.map((item) => item.value); |
|||
}, |
|||
handleSelectionChange(val) { |
|||
this.multipleSelection = []; |
|||
val.forEach((element) => { |
|||
this.multipleSelection.push(element.icEventId); |
|||
}); |
|||
}, |
|||
async handleMarkDiffcult(command) { |
|||
const url = "/governance/icEvent/difficultpointevent"; |
|||
if (this.multipleSelection.length == 0) { |
|||
this.$message.warning('请选择需要标记的事件') |
|||
return |
|||
} |
|||
let params = { |
|||
icEventIdList: this.multipleSelection, |
|||
type: command, |
|||
}; |
|||
const { data, code, msg } = await requestPost(url, params); |
|||
if (code === 0) { |
|||
this.$message.success("标记成功"); |
|||
this.getTableData(); |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
async handleCancalDiffcult() { |
|||
const url = "/governance/icEvent/difficultpointevent"; |
|||
if (this.multipleSelection.length == 0) { |
|||
this.$message.warning('请选择取消标记的事件') |
|||
return |
|||
} |
|||
let params = { |
|||
icEventIdList: this.multipleSelection, |
|||
type: "0", |
|||
}; |
|||
const { data, code, msg } = await requestPost(url, params); |
|||
if (code === 0) { |
|||
this.$message.success("取消标记成功"); |
|||
this.getTableData(); |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
|
|||
handleSearch(val) { |
|||
this.pageNo = 1; |
|||
this.getTableData(); |
|||
}, |
|||
|
|||
async loadGrid() { |
|||
const url = "/gov/org/customergrid/gridoption"; |
|||
let params = { |
|||
agencyId: this.agencyId, |
|||
purpose: "query", |
|||
}; |
|||
const { data, code, msg } = await requestPost(url, params); |
|||
if (code === 0) { |
|||
this.gridList = data; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
|
|||
async handleExport() { |
|||
const url = "/governance/icEvent/export"; |
|||
const { pageSize, pageNo, formData } = this; |
|||
axios({ |
|||
url: window.SITE_CONFIG["apiURL"] + url, |
|||
method: "post", |
|||
data: { |
|||
pageSize, |
|||
pageNo, |
|||
...formData, |
|||
}, |
|||
responseType: "blob", |
|||
}) |
|||
.then((res) => { |
|||
let fileName = window.decodeURI( |
|||
res.headers["content-disposition"].split(";")[1].split("=")[1] |
|||
); |
|||
let blob = new Blob([res.data], { type: "application/vnd.ms-excel" }); |
|||
var url = window.URL.createObjectURL(blob); |
|||
var aLink = document.createElement("a"); |
|||
aLink.style.display = "none"; |
|||
aLink.href = url; |
|||
aLink.setAttribute("download", fileName); |
|||
document.body.appendChild(aLink); |
|||
aLink.click(); |
|||
document.body.removeChild(aLink); //下载完成移除元素 |
|||
window.URL.revokeObjectURL(url); //释放掉blob对象 |
|||
}) |
|||
.catch((err) => { |
|||
return this.$message.error("网络错误"); |
|||
}); |
|||
}, |
|||
|
|||
async handleAdd() { |
|||
this.pageType = "add"; |
|||
}, |
|||
|
|||
async handleWatch(row) { |
|||
this.eventId = row.icEventId; |
|||
const url = "/governance/icEvent/detail"; |
|||
const { data, code, msg } = await requestPost(url, { |
|||
icEventId: this.eventId, |
|||
}); |
|||
if (code === 0) { |
|||
this.eventDetailData = { ...data }; |
|||
this.pageType = "info"; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
|
|||
//加载组织数据 |
|||
async handleDispose(row) { |
|||
this.eventId = row.icEventId; |
|||
const url = "/governance/icEvent/detail"; |
|||
const { data, code, msg } = await requestPost(url, { |
|||
icEventId: this.eventId, |
|||
}); |
|||
if (code === 0) { |
|||
this.eventDetailData = { ...data }; |
|||
this.pageType = "dispose"; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
//下载模版 |
|||
async handleExportModule() { |
|||
let url = '/governance/icEvent/downloadTemplate'; |
|||
let params = {}; |
|||
await this.$http({ |
|||
method: 'POST', |
|||
url, |
|||
responseType: 'blob', |
|||
data: params |
|||
}) |
|||
.then(res => { |
|||
if (res.headers['content-disposition']) { |
|||
let fileName = window.decodeURI(res.headers['content-disposition'].split(';')[1].split('=')[1]); |
|||
let blob = new Blob([res.data], { |
|||
type: 'application/vnd.ms-excel' |
|||
}); |
|||
var url = window.URL.createObjectURL(blob); |
|||
var aLink = document.createElement('a'); |
|||
aLink.style.display = 'none'; |
|||
aLink.href = url; |
|||
aLink.setAttribute('download', fileName); |
|||
document.body.appendChild(aLink); |
|||
aLink.click(); |
|||
document.body.removeChild(aLink); //下载完成移除元素 |
|||
window.URL.revokeObjectURL(url); //释放掉blob对象 |
|||
} else this.$message.error('下载失败'); |
|||
}) |
|||
.catch(err => { |
|||
console.log('err', err); |
|||
return this.$message.error('网络错误'); |
|||
}); |
|||
}, |
|||
handleExcelSuccess(res, file) { |
|||
if (!res.code === 0 && !res.msg === 'success') { |
|||
this.$message.error(res.msg); |
|||
} |
|||
}, |
|||
handleProgress(event, file, fileList) { |
|||
|
|||
}, |
|||
beforeExcelUpload(file) { |
|||
const isType = file.type === 'application/vnd.ms-excel'; |
|||
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; |
|||
const fileType = isType || isTypeComputer; |
|||
const isLt1M = file.size / 1024 / 1024 < 10; |
|||
if (!fileType) { |
|||
this.$message.error('上传文件只能是xls/xlsx格式!'); |
|||
} |
|||
|
|||
if (!isLt1M) { |
|||
this.$message.error('上传文件大小不能超过 10MB!'); |
|||
} |
|||
return fileType && isLt1M; |
|||
}, |
|||
async uploadHttpRequest(file) { |
|||
this.importLoading = true; |
|||
this.importBtnTitle = '正在上传中...'; |
|||
this.$message({ |
|||
showClose: true, |
|||
dangerouslyUseHTMLString: true, |
|||
message: "导入中,请到系统管理-<a id='clickA' style='cursor: pointer;'>导入记录</a>中查看进度", |
|||
duration: 3000 |
|||
}); |
|||
let than = this; |
|||
document.getElementById('clickA').addEventListener('click', function () { |
|||
than.$router.replace('/main/importRecord-index'); |
|||
}); |
|||
const formData = new FormData(); //FormData对象,添加参数只能通过append('key', value)的形式添加 |
|||
formData.append('file', file.file); //添加文件对象 |
|||
formData.append('code', ''); //添加文件对象 |
|||
await this.$http |
|||
.post('/governance/icEvent/importEvent', formData) |
|||
.then(res => { |
|||
console.log('res-up', res); |
|||
if (res.data.code == 0 && res.data.msg == 'success') { |
|||
const data = res.data.data; |
|||
this.dataList = [ |
|||
...Object.keys(data.option.exist).map(k => { |
|||
return { |
|||
index: k, |
|||
srcField: data.option.exist[k], |
|||
exist: true, |
|||
field: data.option.exist[k] |
|||
}; |
|||
}), |
|||
...Object.keys(data.option.notExist).map(k => { |
|||
return { |
|||
index: k, |
|||
srcField: data.option.notExist[k], |
|||
exist: false, |
|||
field: '' |
|||
}; |
|||
}) |
|||
]; |
|||
this.importOption = data.option; |
|||
this.importCode = data.code; |
|||
this.fileData = file; |
|||
} else this.$message.error(res.data.msg); |
|||
}) |
|||
.catch(err => { |
|||
console.log('失败', err); |
|||
file.onError(); //上传失败的文件会从文件列表中删除 |
|||
}); |
|||
this.importLoading = false; |
|||
this.importBtnTitle = '导入'; |
|||
this.$refs.upload.clearFiles(); |
|||
}, |
|||
|
|||
//显示语音窗口 |
|||
handleShowVoice(url) { |
|||
this.selVoiceUrl = url; |
|||
this.showVoice = true; |
|||
}, |
|||
|
|||
handleClose() { |
|||
this.pageType = "list"; |
|||
this.eventId = ""; |
|||
this.getTableData(); |
|||
}, |
|||
handleOk() { |
|||
this.pageType = "list"; |
|||
this.eventId = ""; |
|||
this.pageNo = 1; |
|||
this.getTableData(); |
|||
}, |
|||
|
|||
handleEditSuccess() { |
|||
this.handleClose(); |
|||
this.getTableData(); |
|||
}, |
|||
|
|||
async handleDel(rowData) { |
|||
let message = "确认删除?"; |
|||
this.$confirm(message, "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}).then(() => { |
|||
this.delEvent(rowData.icEventId); |
|||
}).catch((err) => { }); |
|||
}, |
|||
async delEvent(eventId) { |
|||
const url = "/governance/icEvent/delete"; |
|||
let idsArr = [eventId]; |
|||
const { data, code, msg } = await requestPost(url, idsArr); |
|||
if (code === 0) { |
|||
this.$message.success("删除成功!"); |
|||
this.getTableData(); |
|||
} else { |
|||
this.$message.error("操作失败!"); |
|||
} |
|||
}, |
|||
async getTableData() { |
|||
const url = "/governance/icEventOld/list"; |
|||
const { pageSize, pageNo, formData } = this; |
|||
const { data, code, msg } = await requestPost(url, { |
|||
pageSize, |
|||
pageNo, |
|||
...formData, |
|||
}); |
|||
if (code === 0) { |
|||
this.total = data.total || 0; |
|||
this.tableData = data.list ? data.list.map((item) => { return item; }) : []; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
async getCateOptions() { |
|||
const url = "/governance/icEvent/getCategoryTree"; |
|||
const { data, code, msg } = await requestPost(url, {}); |
|||
if (code === 0) { |
|||
this.cateOptions = this.deepTree(data, "children"); |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
|
|||
handleSizeChange(val) { |
|||
this.pageSize = val; |
|||
window.localStorage.setItem("pageSize", val); |
|||
this.getTableData(); |
|||
}, |
|||
handleCurrentChange(val) { |
|||
this.pageNo = val; |
|||
this.getTableData(); |
|||
}, |
|||
|
|||
resetSearch() { |
|||
this.formData = { |
|||
gridId: "", |
|||
sourceType: "", |
|||
eventContent: "", |
|||
name: "", |
|||
mobile: "", |
|||
startTime: "", |
|||
endTime: "", |
|||
limitStartTime: "", |
|||
limitEndTime: "", |
|||
status: "", |
|||
firstIdList: [], |
|||
secondIdList: [], |
|||
}; |
|||
this.eventTypeCheck = []; |
|||
this.pageNo = 1; |
|||
this.getTableData(); |
|||
// this.loadTable() |
|||
}, |
|||
deepTree(arr, children) { |
|||
if (Array.isArray(arr) && arr.length > 0) { |
|||
return arr.map((item) => { |
|||
return { |
|||
...item, |
|||
[children]: |
|||
(item[children] && |
|||
item[children].length > 0 && |
|||
this.deepTree(item[children], children)) || |
|||
null, |
|||
}; |
|||
}); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
@import "@/assets/scss/modules/management/list-main.scss"; |
|||
|
|||
.m-search { |
|||
.u-item-width-normal { |
|||
width: 200px; |
|||
} |
|||
} |
|||
|
|||
::v-deep .el-dropdown__caret-button { |
|||
height: 30px; |
|||
} |
|||
|
|||
::v-deep .el-image-viewer__close { |
|||
top: 129px; |
|||
right: 129px; |
|||
width: 40px; |
|||
height: 40px; |
|||
font-size: 40px; |
|||
color: #fff; |
|||
} |
|||
</style> |
|||
Loading…
Reference in new issue