13 changed files with 4185 additions and 15 deletions
@ -0,0 +1,757 @@ |
|||||
|
<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="报事人" |
||||
|
prop="name" |
||||
|
label-width="150px" |
||||
|
style="display: block"> |
||||
|
<el-input class="cell-width-1" |
||||
|
maxlength="10" |
||||
|
placeholder="请输入报事人姓名" |
||||
|
v-model="formData.name"> |
||||
|
</el-input> |
||||
|
<el-button style="margin-left: 10px" |
||||
|
type="primary" |
||||
|
size="mini" |
||||
|
@click="handleShowPersonList">居民信息中选择</el-button> |
||||
|
|
||||
|
</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-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="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> |
||||
|
</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 :class="['avatar-uploader', {'hide': hideUploadBtn}] " |
||||
|
ref="uploadPic" |
||||
|
:action="uploadUlr" |
||||
|
list-type="picture-card" |
||||
|
:on-exceed="exceedPic" |
||||
|
:on-remove="removePic" |
||||
|
:file-list="replayImgList" |
||||
|
:on-change="handleEditChange" |
||||
|
:on-success="handleSuccess" |
||||
|
: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="address" |
||||
|
label-width="150px" |
||||
|
style="display: block"> |
||||
|
|
||||
|
<el-input class="cell-width-1" |
||||
|
v-model="formData.address"> |
||||
|
</el-input> |
||||
|
|
||||
|
</el-form-item> |
||||
|
<el-form-item label="位置坐标" |
||||
|
prop="longitude" |
||||
|
label-width="150px" |
||||
|
style="display: block"> |
||||
|
<div style="width:500px"> |
||||
|
|
||||
|
<div class="div_map"> |
||||
|
<div id="app"> |
||||
|
|
||||
|
</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> |
||||
|
</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="item.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 { 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: '',//维度 |
||||
|
// operationType: '',// 处理方式 |
||||
|
// content: '',//回复内容 |
||||
|
// status: '',// 处理中:processing;已办结:closed_case |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
export default { |
||||
|
data () { |
||||
|
return { |
||||
|
formType: "add", //表单操作类型 add新增,edit编辑,detail详情 |
||||
|
|
||||
|
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, |
||||
|
|
||||
|
formDataSearch: { |
||||
|
gridId: '', |
||||
|
name: '' |
||||
|
}, |
||||
|
personTableShow: false, |
||||
|
selGridId: '', |
||||
|
selPersonIndex: '', |
||||
|
selPerson: {}, |
||||
|
demandUserList: [], |
||||
|
|
||||
|
hideUploadBtn: false |
||||
|
}; |
||||
|
}, |
||||
|
components: {}, |
||||
|
computed: { |
||||
|
dataRule () { |
||||
|
let checkIdCard = (rule, value, callback) => { |
||||
|
if (value === "") { |
||||
|
callback(new Error("请输入身份证")); |
||||
|
} else { |
||||
|
if (!isCard(value)) { |
||||
|
callback(new Error("身份证号格式不正确")); |
||||
|
} |
||||
|
callback(); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
return { |
||||
|
gridId: [ |
||||
|
{ required: true, message: "所属网格不能为空", trigger: "blur" }, |
||||
|
], |
||||
|
name: [ |
||||
|
{ required: true, message: "报事人不能为空", trigger: "blur" }, |
||||
|
], |
||||
|
mobile: [{ required: true, message: "手机号不能为空", trigger: "blur" }], |
||||
|
// idCard: [ |
||||
|
// { required: true, message: "身份证号不能为空", trigger: "blur" }, |
||||
|
// { required: true, validator: checkIdCard, 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 |
||||
|
this.loadGrid(); |
||||
|
this.getCategoryList() |
||||
|
|
||||
|
this.initMap() |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
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: "addorupdate" |
||||
|
} |
||||
|
|
||||
|
const { data, code, msg } = await requestPost(url, params) |
||||
|
|
||||
|
if (code === 0) { |
||||
|
this.gridList = data |
||||
|
|
||||
|
} else { |
||||
|
this.$message.error(msg) |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
async getCategoryList () { |
||||
|
const url = "/gov/issue/issueprojectcategorydict/list" |
||||
|
|
||||
|
let params = {} |
||||
|
|
||||
|
const { data, code, msg } = await requestPost(url, params) |
||||
|
|
||||
|
if (code === 0) { |
||||
|
|
||||
|
let treeDataNew = this.filterTree(data) |
||||
|
// this.categrayList = data |
||||
|
//组织级联数据 |
||||
|
++this.iscascaderShow |
||||
|
this.casOptions = [] |
||||
|
this.selCategoryArray = [] |
||||
|
|
||||
|
this.casOptions = treeDataNew |
||||
|
|
||||
|
} else { |
||||
|
this.$message.error(msg) |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
//重构树,去除网格 |
||||
|
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 |
||||
|
}, |
||||
|
|
||||
|
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张预览图片") |
||||
|
|
||||
|
}, |
||||
|
handleSuccess (response, file, fileList) { |
||||
|
this.replayImgList.push(file) |
||||
|
this.formData.imageList.push(response.data.url) |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
||||
|
initMap () { |
||||
|
// 定义地图中心点坐标 |
||||
|
var center = new window.TMap.LatLng(36.0722275, 120.38945519) |
||||
|
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
||||
|
map = new window.TMap.Map(document.getElementById('app'), { |
||||
|
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) => { |
||||
|
|
||||
|
if (!this.isFirst) {//再次查询时再赋值 |
||||
|
this.formData.address = result.result.address |
||||
|
} |
||||
|
|
||||
|
if (this.isFirst) { |
||||
|
this.isFirst = false |
||||
|
} |
||||
|
// 显示搜索到的地址 |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
resetData () { |
||||
|
|
||||
|
this.formData = iniFmData(); |
||||
|
this.replayImgList = [] |
||||
|
}, |
||||
|
// 开启加载动画 |
||||
|
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/event-info.scss" |
||||
|
scoped |
||||
|
></style> |
||||
|
|
||||
|
|
||||
|
<style lang="scss"> |
||||
|
.el-dialog__body { |
||||
|
padding: 0 10px 20px !important; |
||||
|
} |
||||
|
|
||||
|
.hide { |
||||
|
.el-upload--picture-card { |
||||
|
display: none !important; |
||||
|
} |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,350 @@ |
|||||
|
<template> |
||||
|
<div ref="ref_detail"> |
||||
|
<el-card class="m-card-detail" |
||||
|
v-if="showType==''"> |
||||
|
<h3 class="m-h3">事件详情</h3> |
||||
|
<div class="m-row"> |
||||
|
<div class="m-info"> |
||||
|
<div class="info-prop"> |
||||
|
<span class="info-title-2">所属网格:</span> |
||||
|
<span>{{ info.gridName }}</span> |
||||
|
</div> |
||||
|
<div class="info-prop"> |
||||
|
<span class="info-title-2">上报时间:</span> |
||||
|
<span>{{ info.createdTime }}</span> |
||||
|
</div> |
||||
|
<div class="info-prop"> |
||||
|
<span class="info-title-2">事件内容:</span> |
||||
|
<span>{{ info.eventContent }}</span> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
<div v-if="info.imageList&&info.imageList.length>0" |
||||
|
class="info-prop"> |
||||
|
<span class="info-title-2">图片:</span> |
||||
|
<img :src="src" |
||||
|
:key="src" |
||||
|
style="width:100px;height:100px;padding-right:10px" |
||||
|
v-for="src in info.imageList" |
||||
|
@click="watchImg(src)" /> |
||||
|
</div> |
||||
|
<div v-if="info.voiceList&&info.voiceList.length>0" |
||||
|
class="info-prop"> |
||||
|
<span class="info-title-2">语音:</span> |
||||
|
<audio controls> |
||||
|
<source :src="item" |
||||
|
type="" |
||||
|
:key="item" |
||||
|
v-for="item in info.voiceList" /> |
||||
|
</audio> |
||||
|
</div> |
||||
|
|
||||
|
<div class="info-prop"> |
||||
|
<span class="info-title-2">反映渠道:</span> |
||||
|
<span>{{ info.sourceTypeName }}</span> |
||||
|
</div> |
||||
|
<div class="info-prop"> |
||||
|
<span class="info-title-2">地址:</span> |
||||
|
<span>{{ info.address }}</span> |
||||
|
</div> |
||||
|
<div class="info-prop"> |
||||
|
<span class="info-title-2">报事人:</span> |
||||
|
<span>{{ info.name }}</span> |
||||
|
</div> |
||||
|
<div class="info-prop"> |
||||
|
<span class="info-title-2">手机号:</span> |
||||
|
<span>{{ info.mobile }}</span> |
||||
|
</div> |
||||
|
<div class="info-prop"> |
||||
|
<span class="info-title-2">身份证号:</span> |
||||
|
<span>{{ info.idCard?info.idCard:'--' }}</span> |
||||
|
</div> |
||||
|
<div v-if="info.operationType==='1'" |
||||
|
class="info-prop"> |
||||
|
<span class="info-title-2">已立项:</span> |
||||
|
<div class="line" |
||||
|
@click="handleToProject">查看项目</div> |
||||
|
</div> |
||||
|
<div v-if="info.operationType==='2'" |
||||
|
class="info-prop"> |
||||
|
<span class="info-title-2">已转需求:</span> |
||||
|
<div class="line" |
||||
|
@click="handleToDemand">查看需求</div> |
||||
|
</div> |
||||
|
<div v-if="info.satisfactionName" |
||||
|
class="info-prop"> |
||||
|
<span class="info-title-2">满意度:</span> |
||||
|
<div @click="handleToDemand">{{info.satisfactionName}}</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div v-if="info.operationId&&!(info.status==='closed_case'&&!info.satisfactionName && user.id===info.createdUserId)" |
||||
|
class="div-btn "> |
||||
|
<el-button size="small" |
||||
|
@click="handleCloseEvent">关闭</el-button> |
||||
|
|
||||
|
</div> |
||||
|
<!-- <div class="div-btn "> |
||||
|
<el-button size="small" |
||||
|
@click="handleCloseEvent">关闭</el-button> |
||||
|
|
||||
|
</div> --> |
||||
|
</el-card> |
||||
|
|
||||
|
<el-card v-if="info.status==='closed_case'&&!info.satisfactionName && user.id===info.createdUserId"> |
||||
|
<h3>满意度评价</h3> |
||||
|
<div class="m-row"> |
||||
|
<div class="m-info"> |
||||
|
|
||||
|
<div class="div-satisfy"> |
||||
|
<div> |
||||
|
<img :src="selBad?badurl_light:badurl" |
||||
|
@click="clickSatisfy('bad')" /> |
||||
|
<div class="tip-satisfy">不满意</div> |
||||
|
</div> |
||||
|
<div> |
||||
|
<img :src="selGood?goodurl_light:goodurl" |
||||
|
@click="clickSatisfy('good')" /> |
||||
|
<div class="tip-satisfy">满意</div> |
||||
|
</div> |
||||
|
<div> |
||||
|
<img :src="selPerfect?perfecturl_light:perfecturl" |
||||
|
@click="clickSatisfy('perfect')" /> |
||||
|
<div class="tip-satisfy">非常满意</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
<div class="div-btn "> |
||||
|
|
||||
|
<el-button size="small" |
||||
|
@click="handleCloseEvent">关闭</el-button> |
||||
|
<el-button size="small" |
||||
|
type="primary" |
||||
|
@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"; |
||||
|
import dateFormat from "dai-js/tools/dateFormat"; |
||||
|
|
||||
|
function iniData () { |
||||
|
return { |
||||
|
user: {}, |
||||
|
projectPageType: 'info', |
||||
|
|
||||
|
info: {}, |
||||
|
eventDetailCopy: {}, |
||||
|
showType: '', |
||||
|
|
||||
|
projectId: '', |
||||
|
|
||||
|
demandForm: { |
||||
|
gridId: "", |
||||
|
categoryCode: "", |
||||
|
parentCode: "", |
||||
|
content: "", |
||||
|
reportType: "", |
||||
|
reportUserName: "", |
||||
|
reportUserMobile: "", |
||||
|
reportTime: "", |
||||
|
wantServiceTime: "", |
||||
|
demandUserId: "", |
||||
|
demandUserName: "", |
||||
|
demandUserMobile: "", |
||||
|
}, |
||||
|
|
||||
|
//满意度评价 |
||||
|
showSatisfy: false, |
||||
|
selBad: false, |
||||
|
selGood: false, |
||||
|
selPerfect: false, |
||||
|
badurl: require('@/assets/img/satisfy-images/face1.png'), |
||||
|
badurl_light: require('@/assets/img/satisfy-images/face1_light.png'), |
||||
|
goodurl: require('@/assets/img/satisfy-images/face2.png'), |
||||
|
goodurl_light: require('@/assets/img/satisfy-images/face2_light.png'), |
||||
|
perfecturl: require('@/assets/img/satisfy-images/face3.png'), |
||||
|
perfecturl_light: require('@/assets/img/satisfy-images/face3_light.png'), |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
export default { |
||||
|
name: "issueInfo", |
||||
|
props: { |
||||
|
eventId: { |
||||
|
type: String, |
||||
|
default: "", |
||||
|
}, |
||||
|
pageType: { |
||||
|
type: String, |
||||
|
default: "info", |
||||
|
}, |
||||
|
|
||||
|
eventDetailData: { |
||||
|
|
||||
|
type: Object, |
||||
|
default () { |
||||
|
return {} |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
components: { |
||||
|
foldText, projectInfo |
||||
|
}, |
||||
|
|
||||
|
data: iniData, |
||||
|
|
||||
|
computed: {}, |
||||
|
|
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
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: { |
||||
|
totalHeight () { |
||||
|
return this.$refs.ref_detail.offsetHeight |
||||
|
}, |
||||
|
watchImg (src) { |
||||
|
window.open(src); |
||||
|
}, |
||||
|
|
||||
|
handleClose () { |
||||
|
this.showType = '' |
||||
|
}, |
||||
|
|
||||
|
handleCloseEvent () { |
||||
|
this.$emit("handleClose"); |
||||
|
}, |
||||
|
|
||||
|
async getApiData () { |
||||
|
}, |
||||
|
|
||||
|
handleToProject () { |
||||
|
this.$emit("handleToProject") |
||||
|
// if (this.info.status === 'processing') { |
||||
|
// this.projectPageType = 'edit' |
||||
|
// } else { |
||||
|
// this.projectPageType = 'info' |
||||
|
// } |
||||
|
|
||||
|
// this.showType = 'project' |
||||
|
}, |
||||
|
handleToDemand () { |
||||
|
this.$emit("handleToDemand") |
||||
|
}, |
||||
|
|
||||
|
//满意度评价 |
||||
|
handleSatisfy () { |
||||
|
|
||||
|
this.showSatisfy = true |
||||
|
}, |
||||
|
|
||||
|
clickSatisfy (type) { |
||||
|
if (this.info.satisfactionName) { |
||||
|
return false |
||||
|
} |
||||
|
|
||||
|
this.changeSatisfyType(type) |
||||
|
|
||||
|
}, |
||||
|
changeSatisfyType (type) { |
||||
|
if (type === 'bad') { |
||||
|
this.selGood = false |
||||
|
this.selPerfect = false |
||||
|
this.selBad = true |
||||
|
} else if (type === 'good') { |
||||
|
this.selGood = true |
||||
|
this.selPerfect = false |
||||
|
this.selBad = false |
||||
|
} else if (type === 'perfect') { |
||||
|
this.selGood = false |
||||
|
this.selPerfect = true |
||||
|
this.selBad = false |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
async handleComfirmSatisfy () { |
||||
|
let satisfyLevel = '' |
||||
|
if (!this.selBad && !this.selGood && !this.selPerfect) { |
||||
|
this.$message.info("请选择评价级别"); |
||||
|
} else { |
||||
|
if (this.selBad) { |
||||
|
satisfyLevel = 'bad' |
||||
|
} else if (this.selGood) { |
||||
|
satisfyLevel = 'good' |
||||
|
} else if (this.selPerfect) { |
||||
|
satisfyLevel = 'perfect' |
||||
|
} |
||||
|
} |
||||
|
const url = "/gov/project/icEvent/comment" |
||||
|
|
||||
|
let params = { |
||||
|
icEventId: this.eventId, |
||||
|
satisfaction: satisfyLevel |
||||
|
} |
||||
|
|
||||
|
const { data, code, msg } = await requestPost(url, params) |
||||
|
|
||||
|
if (code === 0) { |
||||
|
this.$message.success("评价成功"); |
||||
|
this.info.satisfactionName = '111' |
||||
|
this.showSatisfy = false |
||||
|
|
||||
|
} else { |
||||
|
this.$message.error(msg) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style |
||||
|
lang="scss" |
||||
|
src="@/assets/scss/modules/shequzhili/event-info.scss" |
||||
|
scoped |
||||
|
></style> |
@ -0,0 +1,624 @@ |
|||||
|
<template> |
||||
|
<div class=""> |
||||
|
<!-- 新增 --> |
||||
|
<div v-if="pageTypeCopy == 'add'"> |
||||
|
<div ref="ref_card_add"> |
||||
|
<el-card> |
||||
|
<h3 class="m-h3">新增事件</h3> |
||||
|
<event-add ref="ref_add" |
||||
|
@changeName="changeName" |
||||
|
@changeMobile="changeMobile" |
||||
|
@changeUserId="changeUserId" |
||||
|
@changeGridId="changeGridId"></event-add> |
||||
|
</el-card> |
||||
|
</div> |
||||
|
|
||||
|
<!-- 处理 --> |
||||
|
<div v-if="addProcessOk" |
||||
|
class="process-form"> |
||||
|
<el-card :style="{minHeight:addProcessHeight+'px'}"> |
||||
|
<h3 class="m-h3">处理</h3> |
||||
|
<process-form ref="ref_processinfo_add" |
||||
|
:demandUserId="demandUserId" |
||||
|
: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="['g-total',{'g-left':projectProcess.length>0}]"> |
||||
|
|
||||
|
<event-detail ref="ref_detail" |
||||
|
:pageType="pageType" |
||||
|
:eventId="eventId" |
||||
|
:eventDetailData="eventDetailData" |
||||
|
@handleToProject="handleToProject" |
||||
|
@handleToDemand="handleToDemand" |
||||
|
@handleClose="handleClose"></event-detail> |
||||
|
|
||||
|
<div v-if="detailProcessOk&&!eventDetailData.operationId &&pageTypeCopy == 'dispose' " |
||||
|
class="process-form"> |
||||
|
<el-card :style="{minHeight:detailProcessHeight+'px'}"> |
||||
|
<h3 class="m-h3">处理</h3> |
||||
|
<process-form ref="ref_processinfo_dispose" |
||||
|
: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"> |
||||
|
<el-card class="m-card m-card-process"> |
||||
|
<h3 class="m-h3">事件处理进展</h3> |
||||
|
<div class="m-process"> |
||||
|
<div class="list"> |
||||
|
<div class="item" |
||||
|
:class="index === 0 ? 'z-on' : ''" |
||||
|
:key="item.processId" |
||||
|
v-for="(item, index) in projectProcess"> |
||||
|
<div class="item-row"> |
||||
|
<div class="name">{{ item.processName }}</div> |
||||
|
<div class="date"> |
||||
|
{{ item.processTime }} |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div v-if="item.type==='event'"> |
||||
|
<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> |
||||
|
|
||||
|
<div v-if="item.type==='project'"> |
||||
|
<div v-if="item.processName==='回复'"> |
||||
|
<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> |
||||
|
<div v-else> |
||||
|
<div class="detail"> |
||||
|
<div class="detail-field">处理部门:</div> |
||||
|
<div class="detail-value">{{ item.departmentName }}</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="detail" |
||||
|
v-if="item.processName == '处理响应' && item.assistanceUnitName"> |
||||
|
<div class="detail-field">协 办:</div> |
||||
|
<div class="detail-value"> |
||||
|
<fold-text :row="3">{{ item.assistanceUnitName }}</fold-text> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="detail" |
||||
|
v-if="item.processName != '转项目' && item.publicReply"> |
||||
|
<div class="detail-field">说 明:</div> |
||||
|
<div class="detail-value"> |
||||
|
<fold-text :row="3">{{ item.publicReply }}</fold-text> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="detail" |
||||
|
v-if="item.processName != '转项目' && item.internalRemark"> |
||||
|
<div class="detail-field">内部备注:</div> |
||||
|
<div class="detail-value"> |
||||
|
<fold-text :row="3">{{ item.internalRemark }}</fold-text> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div v-if="item.internalFile&&item.internalFile.length>0" |
||||
|
class="detail"> |
||||
|
<div class="attachement-list"> |
||||
|
<a :href="att.url" |
||||
|
target="_blank" |
||||
|
:key="att.url" |
||||
|
v-for="att in item.internalFile"> |
||||
|
<i class="el-icon-folder-opened"></i> |
||||
|
{{ att.name }} |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div v-if="item.type==='demand'"> |
||||
|
<div v-if="item.processName==='回复'"> |
||||
|
<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> |
||||
|
<div v-if="item.processName==='需求完成'"> |
||||
|
<div class="detail"> |
||||
|
<div class="detail-field">服务方:</div> |
||||
|
<div class="detail-value">{{ item.serviceParty }}</div> |
||||
|
</div> |
||||
|
<div class="detail"> |
||||
|
<div class="detail-field">实际服务时间:</div> |
||||
|
<div class="detail-value">{{ item.actualServiceTime }}</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div v-if="item.processName==='转服务'"> |
||||
|
<div class="detail"> |
||||
|
<div class="detail-field">服务时间:</div> |
||||
|
<div class="detail-value">{{ item.serviceTime }}</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</el-card> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
<!-- 项目详情 --> |
||||
|
<div v-if="pageTypeCopy == 'project'"> |
||||
|
<project-info-origin ref="eleEditForm" |
||||
|
:type="projectPageType" |
||||
|
:projectId="eventDetailCopy.operationId" |
||||
|
@close="handleCloseProject" |
||||
|
@afterEdit="handleCloseProject" /> |
||||
|
</div> |
||||
|
|
||||
|
<!-- 需求详情 --> |
||||
|
<div v-if="pageTypeCopy == 'demand'"> |
||||
|
<demand-info-origin ref="demandEditForm" |
||||
|
:demandRecId="eventDetailCopy.operationId" |
||||
|
@close="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 { mapGetters } from 'vuex' |
||||
|
|
||||
|
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: {}, |
||||
|
|
||||
|
//新增 |
||||
|
demandUserId: '', |
||||
|
demandUserName: '', |
||||
|
demandUserMobile: '', |
||||
|
gridId: '', |
||||
|
|
||||
|
eventDetailCopy: {}, |
||||
|
|
||||
|
projectProcess: [], |
||||
|
projectPageType: 'info', |
||||
|
pageTypeCopy: '', |
||||
|
|
||||
|
//动态高度相关 |
||||
|
addProcessOk: false, |
||||
|
addProcessHeight: 0, |
||||
|
detailProcessOk: false, |
||||
|
detailProcessHeight: 0, |
||||
|
|
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
export default { |
||||
|
name: "projectInfo", |
||||
|
props: { |
||||
|
eventId: { |
||||
|
type: String, |
||||
|
default: "", |
||||
|
}, |
||||
|
pageType: { |
||||
|
type: String, |
||||
|
default: "", |
||||
|
}, |
||||
|
eventDetailData: { |
||||
|
type: Object, |
||||
|
default () { |
||||
|
return {} |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
components: { |
||||
|
foldText, |
||||
|
|
||||
|
eventAdd, |
||||
|
eventDetail, |
||||
|
processForm, |
||||
|
projectInfoOrigin, |
||||
|
demandInfoOrigin |
||||
|
}, |
||||
|
created () { |
||||
|
this.$nextTick(() => { |
||||
|
if (this.pageTypeCopy === 'add') {//新增+处理 |
||||
|
let addheight = this.$refs.ref_card_add.offsetHeight |
||||
|
console.log('addheight', addheight, this.clientHeight - addheight) |
||||
|
// let clientHeight = document.documentElement.clientHeight |
||||
|
this.addProcessHeight = this.clientHeight - addheight - 380 |
||||
|
this.addProcessOk = true |
||||
|
|
||||
|
} else if (!this.eventDetailData.operationId && this.pageTypeCopy == 'dispose') {//详情+处理 |
||||
|
let detailheight = this.$refs.ref_detail.totalHeight() |
||||
|
console.log('detailheight', detailheight, this.clientHeight - detailheight) |
||||
|
// let clientHeight = document.documentElement.clientHeight |
||||
|
this.detailProcessHeight = this.clientHeight - detailheight - 150 |
||||
|
this.detailProcessOk = true |
||||
|
} else {//详情 |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
data: iniData, |
||||
|
|
||||
|
computed: { |
||||
|
//新增页面的处理部分高度 |
||||
|
// addProcessHeight () { |
||||
|
// this.$nextTick(() => { |
||||
|
|
||||
|
// let aaa = this.$refs.ref_card_add.offsetHeight |
||||
|
// console.log('aaa', aaa, this.clientHeight - aaa) |
||||
|
// // let clientHeight = document.documentElement.clientHeight |
||||
|
// return this.clientHeight - aaa |
||||
|
// this.addProcessOk=true |
||||
|
// }) |
||||
|
|
||||
|
// }, |
||||
|
...mapGetters(['clientHeight']) |
||||
|
}, |
||||
|
|
||||
|
watch: { |
||||
|
eventId () { |
||||
|
let data = iniData(); |
||||
|
Object.keys(data).forEach((k) => { |
||||
|
this[k] = data[k]; |
||||
|
}); |
||||
|
this.getApiData(); |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
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 |
||||
|
}, |
||||
|
|
||||
|
//加载组织数据 |
||||
|
async getProjectProcess () { |
||||
|
const url = "/gov/project/icEvent/process"; |
||||
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/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); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
getEventInfo () { |
||||
|
this.$refs.ref_add.getEventInfo() |
||||
|
if (this.$refs.ref_add.okflag) { |
||||
|
|
||||
|
this.eventInfoData = this.$refs.ref_add.formData |
||||
|
} else { |
||||
|
return false |
||||
|
} |
||||
|
|
||||
|
console.log('eventInfo', this.eventInfoData) |
||||
|
}, |
||||
|
|
||||
|
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 |
||||
|
} |
||||
|
|
||||
|
console.log('eventInfo', this.eventInfoData) |
||||
|
|
||||
|
this.$refs.ref_processinfo_add.getProcessInfo() |
||||
|
if (this.$refs.ref_processinfo_add.okflag) { |
||||
|
|
||||
|
this.formData.operationType = this.$refs.ref_processinfo_add.operationType |
||||
|
this.eventInfoData.operationType = this.$refs.ref_processinfo_add.operationType |
||||
|
|
||||
|
|
||||
|
if (this.formData.operationType === '0') { |
||||
|
this.project = {} |
||||
|
this.demand = {} |
||||
|
this.replayInfo = this.$refs.ref_processinfo_add.replayInfo |
||||
|
console.log('replayInfo', 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 === '1') { |
||||
|
this.replayInfo = {} |
||||
|
this.demand = {} |
||||
|
this.project = this.$refs.ref_processinfo_add.project |
||||
|
//项目的属性同事件一样 |
||||
|
this.project.gridId = this.eventInfoData.gridId |
||||
|
|
||||
|
if (this.project.categoryList && this.project.categoryList.length > 0) { |
||||
|
this.eventInfoData.categoryList = [] |
||||
|
this.eventInfoData.categoryList.push(this.project.categoryList[0].id) |
||||
|
} |
||||
|
|
||||
|
console.log('projectInfo', this.project) |
||||
|
|
||||
|
} else if (this.formData.operationType === '2') { |
||||
|
this.replayInfo = {} |
||||
|
this.project = {} |
||||
|
this.demand = this.$refs.ref_processinfo_add.demand |
||||
|
this.demand.gridId = this.eventInfoData.gridId |
||||
|
//需求的属性同事件一样 |
||||
|
this.eventInfoData.categoryList = [] |
||||
|
this.eventInfoData.categoryList.push(this.demand.categoryId) |
||||
|
console.log('demond', this.demand) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
this.formData = { |
||||
|
...this.eventInfoData, |
||||
|
// replayInfo: this.replayInfo, |
||||
|
project: this.project, |
||||
|
demand: this.demand |
||||
|
} |
||||
|
|
||||
|
console.log('this.formData', this.formData) |
||||
|
await this.submit() |
||||
|
}, |
||||
|
|
||||
|
async submit () { |
||||
|
const url = "/gov/project/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); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
async handelDispose () { |
||||
|
this.$refs.ref_processinfo_dispose.getProcessInfo() |
||||
|
if (this.$refs.ref_processinfo_dispose.okflag) { |
||||
|
|
||||
|
this.formData.operationType = this.$refs.ref_processinfo_dispose.operationType |
||||
|
|
||||
|
if (this.formData.operationType === '0') { |
||||
|
|
||||
|
this.project = {} |
||||
|
this.demand = {} |
||||
|
this.replayInfo = this.$refs.ref_processinfo_dispose.replayInfo |
||||
|
|
||||
|
this.replayInfo.icEventId = this.eventId |
||||
|
console.log('replayInfo', this.replayInfo) |
||||
|
//回复属性赋值 |
||||
|
let url = '/gov/project/icEvent/reply' |
||||
|
await this.submitDispose(url, this.replayInfo) |
||||
|
|
||||
|
} else if (this.formData.operationType === '1') { |
||||
|
this.replayInfo = {} |
||||
|
this.demand = {} |
||||
|
this.project = this.$refs.ref_processinfo_dispose.project |
||||
|
//项目的属性同事件一样 |
||||
|
this.project.icEventId = this.eventId |
||||
|
console.log('projectInfo', this.project) |
||||
|
let url = '/gov/project/icEvent/icEventToProject' |
||||
|
await this.submitDispose(url, this.project) |
||||
|
|
||||
|
} else if (this.formData.operationType === '2') { |
||||
|
this.replayInfo = {} |
||||
|
this.project = {} |
||||
|
this.demand = this.$refs.ref_processinfo_dispose.demand |
||||
|
//需求的属性同事件一样 |
||||
|
this.demand.icEventId = this.eventId |
||||
|
console.log('demond', this.demand) |
||||
|
let url = '/gov/project/icEvent/icEventToDemand' |
||||
|
await this.submitDispose(url, this.demand) |
||||
|
} else { |
||||
|
this.$message.info("请选择一种处理方式"); |
||||
|
} |
||||
|
|
||||
|
} 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 () { |
||||
|
if (this.eventDetailCopy.status === 'processing') { |
||||
|
this.projectPageType = 'edit' |
||||
|
} else { |
||||
|
this.projectPageType = 'info' |
||||
|
} |
||||
|
this.pageTypeCopy = 'project' |
||||
|
|
||||
|
}, |
||||
|
handleToDemand () { |
||||
|
// if (this.eventDetailCopy.status === 'processing') { |
||||
|
// this.projectPageType = 'edit' |
||||
|
// } else { |
||||
|
// this.projectPageType = 'info' |
||||
|
// } |
||||
|
this.pageTypeCopy = 'demand' |
||||
|
|
||||
|
}, |
||||
|
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" |
||||
|
src="@/assets/scss/modules/shequzhili/event-info.scss" |
||||
|
scoped |
||||
|
></style> |
@ -0,0 +1,665 @@ |
|||||
|
<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" |
||||
|
prop="content"> |
||||
|
<el-input v-model="formData.content" |
||||
|
:autosize="{ minRows: 2, maxRows: 10 }" |
||||
|
type="textarea" |
||||
|
clearable |
||||
|
class="cell-width-area" |
||||
|
placeholder="请输入内容"></el-input> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="服务类型" |
||||
|
label-width="150px" |
||||
|
prop="categoryCode"> |
||||
|
|
||||
|
<el-cascader v-model="formData.categoryCode" |
||||
|
:options="demandOptions" |
||||
|
clearable |
||||
|
class="cell-width-1" |
||||
|
@change="handleCateSlect"></el-cascader> |
||||
|
|
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="服务时间" |
||||
|
label-width="150px" |
||||
|
prop="wantServiceTime"> |
||||
|
<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> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="服务人" |
||||
|
label-width="150px" |
||||
|
prop="demandUserName"> |
||||
|
<el-input v-model="formData.demandUserName" |
||||
|
class="cell-width-1"></el-input> |
||||
|
|
||||
|
</el-form-item> |
||||
|
<el-form-item label="联系电话" |
||||
|
label-width="150px" |
||||
|
prop="demandUserMobile"> |
||||
|
<el-input v-model="formData.demandUserMobile" |
||||
|
class="cell-width-1"></el-input> |
||||
|
|
||||
|
</el-form-item> |
||||
|
<el-form-item label="服务地点" |
||||
|
prop="serviceLocation" |
||||
|
label-width="150px" |
||||
|
style="display: block"> |
||||
|
|
||||
|
<el-input class="cell-width-1" |
||||
|
v-model="formData.serviceLocation"> |
||||
|
</el-input> |
||||
|
|
||||
|
</el-form-item> |
||||
|
<el-form-item label="位置坐标" |
||||
|
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="门牌号" |
||||
|
label-width="150px" |
||||
|
prop="locationDetail"> |
||||
|
<el-input v-model="formData.locationDetail" |
||||
|
class="cell-width-1"></el-input> |
||||
|
|
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="服务方" |
||||
|
label-width="150px" |
||||
|
prop="serverId"> |
||||
|
|
||||
|
<template> |
||||
|
<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.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</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 {} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
watch: { |
||||
|
demandUserName: function (val) { |
||||
|
|
||||
|
this.formData.reportUserName = val |
||||
|
this.formData.demandUserName = val |
||||
|
}, |
||||
|
demandUserMobile: function (val) { |
||||
|
|
||||
|
this.formData.reportUserMobile = val |
||||
|
this.formData.demandUserMobile = val |
||||
|
}, |
||||
|
demandUserId: function (val) { |
||||
|
|
||||
|
this.formData.demandUserId = val |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
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 = "/gov/issue/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 = "/heart/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]; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
handleServiceChange (type, val) { |
||||
|
if (val === "social_org") { |
||||
|
if (type === "add") this.getServiceuserList(val, "add_demand"); |
||||
|
else this.getServiceuserList(val, "query_demand"); |
||||
|
} else this.getServiceuserList(val, ""); |
||||
|
}, |
||||
|
|
||||
|
async getServiceuserList (serviceType, query) { |
||||
|
|
||||
|
if (!serviceType) return false; |
||||
|
const { demandUserId } = this.formData; |
||||
|
const params = { |
||||
|
serviceName: "", |
||||
|
serviceType: serviceType, |
||||
|
queryPurpose: query, |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
const url = "/heart/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(36.0722275, 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" |
||||
|
src="@/assets/scss/modules/shequzhili/event-info.scss" |
||||
|
scoped |
||||
|
></style> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<style> |
||||
|
.el-dialog__body { |
||||
|
padding: 0 10px 20px !important; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,603 @@ |
|||||
|
<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="categoryList"> |
||||
|
<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="项目标题" |
||||
|
prop="title" |
||||
|
label-width="150px" |
||||
|
style="display: block"> |
||||
|
<el-input class="cell-width-1" |
||||
|
maxlength="50" |
||||
|
placeholder="请输入项目标题" |
||||
|
v-model="formData.title"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<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="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" |
||||
|
prop="assistanceUnitIndex"> |
||||
|
<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> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="项目方案" |
||||
|
label-width="150px" |
||||
|
prop="publicReply"> |
||||
|
<el-input type="textarea" |
||||
|
class="cell-width-area" |
||||
|
:rows="2" |
||||
|
placeholder="请输入项目方案" |
||||
|
v-model="formData.publicReply"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="内部备注" |
||||
|
label-width="150px" |
||||
|
prop="internalRemark"> |
||||
|
<el-input type="textarea" |
||||
|
class="cell-width-area" |
||||
|
:rows="2" |
||||
|
placeholder="请输入内部备注" |
||||
|
v-model="formData.internalRemark"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="图片/附件:" |
||||
|
label-width="150px" |
||||
|
prop="internalFile"> |
||||
|
<el-upload class="avatar-uploader" |
||||
|
:action="uploadUlr" |
||||
|
:data="{ customerId: customerId }" |
||||
|
:show-file-list="true" |
||||
|
:on-success="handleImgSuccess" |
||||
|
:on-remove="handleImgRemove" |
||||
|
:before-upload="beforeImgUpload"> |
||||
|
<i class="el-icon-plus avatar-uploader-icon"></i> |
||||
|
</el-upload> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="标签" |
||||
|
label-width="150px" |
||||
|
prop="tagList"> |
||||
|
|
||||
|
<fold-text v-if="tagList.length>0" |
||||
|
style="width: 300px" |
||||
|
:row="3"> |
||||
|
<div :key="item.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 size="small" |
||||
|
type="">选择</el-button> |
||||
|
</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 { 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 }, |
||||
|
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 {} |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
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) |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
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 = "/gov/issue/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.categoryList = [] |
||||
|
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 = "/gov/project/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 = "/gov/issue/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/event-info.scss" |
||||
|
scoped |
||||
|
></style> |
||||
|
<style |
||||
|
lang="scss" |
||||
|
src="@/assets/scss/modules/shequzhili/project-info.scss" |
||||
|
scoped |
||||
|
></style> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<style> |
||||
|
.el-dialog__body { |
||||
|
padding: 0 10px 20px !important; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,236 @@ |
|||||
|
<template> |
||||
|
<div class=""> |
||||
|
|
||||
|
<el-form ref="ref_form1" |
||||
|
:inline="false" |
||||
|
:model="formData" |
||||
|
:rules="dataRule" |
||||
|
class="form"> |
||||
|
<el-form-item label="事件分类" |
||||
|
label-width="150px" |
||||
|
prop="categoryList"> |
||||
|
<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="回复内容" |
||||
|
prop="content" |
||||
|
label-width="150px" |
||||
|
style="display: block"> |
||||
|
<el-input class="cell-width-area" |
||||
|
type="textarea" |
||||
|
maxlength="500" |
||||
|
show-word-limit |
||||
|
:rows="5" |
||||
|
placeholder="请输入回复内容,不超过500字" |
||||
|
v-model="formData.content"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="" |
||||
|
label-width="150px" |
||||
|
style="display: block"> |
||||
|
<el-checkbox v-model="status">已完成</el-checkbox> |
||||
|
</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; // 加载动画 |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
export default { |
||||
|
data () { |
||||
|
return { |
||||
|
btnDisable: false, |
||||
|
formData: { |
||||
|
operationType: '0',//处理方式[0:已回复 1:已转项目 2:已转需求] |
||||
|
content: '', |
||||
|
status: '' |
||||
|
}, |
||||
|
|
||||
|
status: false, |
||||
|
okflag: false, |
||||
|
|
||||
|
eventDetailCopy: {}, |
||||
|
|
||||
|
casOptions: [], |
||||
|
iscascaderShow: 0, |
||||
|
selCategoryArray: [], |
||||
|
selCateObj: {}, |
||||
|
optionProps: { |
||||
|
multiple: false, |
||||
|
value: 'id', |
||||
|
label: 'name', |
||||
|
children: 'subCategory', |
||||
|
}, |
||||
|
|
||||
|
}; |
||||
|
}, |
||||
|
components: {}, |
||||
|
computed: { |
||||
|
dataRule () { |
||||
|
|
||||
|
return { |
||||
|
content: [ |
||||
|
{ required: true, message: "回复内容不能为空", trigger: "blur" }, |
||||
|
], |
||||
|
|
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
props: { |
||||
|
eventId: { |
||||
|
type: String, |
||||
|
default: "", |
||||
|
}, |
||||
|
eventDetailData: { |
||||
|
type: Object, |
||||
|
default () { |
||||
|
return {} |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
watch: {}, |
||||
|
|
||||
|
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 = "/gov/issue/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 |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
//重构树,去除网格 |
||||
|
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 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.info("请填写事件分类"); |
||||
|
return false |
||||
|
} |
||||
|
this.formData.status = 'closed_case' |
||||
|
} else { |
||||
|
this.formData.status = 'processing' |
||||
|
} |
||||
|
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" |
||||
|
src="@/assets/scss/modules/shequzhili/event-info.scss" |
||||
|
scoped |
||||
|
></style> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<style> |
||||
|
.el-dialog__body { |
||||
|
padding: 0 10px 20px !important; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,236 @@ |
|||||
|
<template> |
||||
|
<div class=""> |
||||
|
<div class="g-process-info"> |
||||
|
|
||||
|
<el-form ref="ref_form1" |
||||
|
:inline="false" |
||||
|
:rules="dataRule" |
||||
|
class="form"> |
||||
|
|
||||
|
<el-form-item label="处理方式" |
||||
|
label-width="150px" |
||||
|
prop="operationType"> |
||||
|
<el-radio-group v-model="operationType" |
||||
|
@change="handleChangeOperationType"> |
||||
|
<el-radio v-if="!eventId" |
||||
|
label="">暂不处理</el-radio> |
||||
|
<el-radio label="0">回复</el-radio> |
||||
|
<el-radio label="1">立项</el-radio> |
||||
|
<el-radio label="2">转服务</el-radio> |
||||
|
|
||||
|
</el-radio-group> |
||||
|
</el-form-item> |
||||
|
|
||||
|
</el-form> |
||||
|
|
||||
|
<div v-if="operationType==='0'"> |
||||
|
<process-form-replay ref="ref_process_form_replay" |
||||
|
:eventDetailData="eventDetailData" |
||||
|
:eventId="eventId"></process-form-replay> |
||||
|
</div> |
||||
|
|
||||
|
<div v-if="operationType==='1'"> |
||||
|
<process-form-project ref="ref_process_form_project" |
||||
|
:eventDetailData="eventDetailData" |
||||
|
:gridId="gridId" |
||||
|
:eventId="eventId"></process-form-project> |
||||
|
</div> |
||||
|
|
||||
|
<div v-if="operationType==='2'"> |
||||
|
<process-form-demand ref="ref_process_form_demond" |
||||
|
:eventId="eventId" |
||||
|
:demandUserId="demandUserId" |
||||
|
:demandUserName="demandUserName" |
||||
|
:demandUserMobile="demandUserMobile" |
||||
|
:eventDetailData="eventDetailData"></process-form-demand> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { Loading } from "element-ui"; // 引入Loading服务 |
||||
|
import { requestPost } from "@/js/dai/request"; |
||||
|
import processFormReplay from "./process-form-replay"; |
||||
|
import processFormProject from "./process-form-project"; |
||||
|
import processFormDemand from "./process-form-demand"; |
||||
|
|
||||
|
|
||||
|
let loading; // 加载动画 |
||||
|
|
||||
|
export default { |
||||
|
data () { |
||||
|
return { |
||||
|
|
||||
|
casOptions: [], |
||||
|
iscascaderShow: 0, |
||||
|
selCategoryArray: [], |
||||
|
selCateObj: {}, |
||||
|
optionProps: { |
||||
|
multiple: false, |
||||
|
value: 'id', |
||||
|
label: 'name', |
||||
|
children: 'subCategory', |
||||
|
}, |
||||
|
|
||||
|
operationType: '', |
||||
|
|
||||
|
|
||||
|
replayInfo: {}, |
||||
|
demand: {}, |
||||
|
project: {}, |
||||
|
okflag: false, |
||||
|
|
||||
|
eventDetailCopy: {} |
||||
|
|
||||
|
}; |
||||
|
}, |
||||
|
components: { |
||||
|
processFormReplay, |
||||
|
processFormProject, |
||||
|
processFormDemand |
||||
|
}, |
||||
|
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 {} |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
async mounted () { |
||||
|
const { user } = this.$store.state |
||||
|
this.agencyId = user.agencyId |
||||
|
|
||||
|
if (this.eventId) { |
||||
|
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData)); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
handleChangeOperationType (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 { |
||||
|
return false |
||||
|
} |
||||
|
|
||||
|
} else if (this.operationType === '1') { |
||||
|
this.$refs.ref_process_form_project.getProjectInfo() |
||||
|
if (this.$refs.ref_process_form_project.okflag) { |
||||
|
|
||||
|
this.project = this.$refs.ref_process_form_project.formData |
||||
|
|
||||
|
//赋值分类信息 |
||||
|
this.okflag = true |
||||
|
|
||||
|
} else { |
||||
|
return false |
||||
|
} |
||||
|
} else if (this.operationType === '2') { |
||||
|
this.$refs.ref_process_form_demond.getDemandInfo() |
||||
|
if (this.$refs.ref_process_form_demond.okflag) { |
||||
|
this.demand = this.$refs.ref_process_form_demond.formData |
||||
|
|
||||
|
this.okflag = true |
||||
|
|
||||
|
} else { |
||||
|
return false |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
|
||||
|
handleCancle () { |
||||
|
this.resetData(); |
||||
|
|
||||
|
}, |
||||
|
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" |
||||
|
src="@/assets/scss/modules/shequzhili/event-info.scss" |
||||
|
scoped |
||||
|
></style> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<style> |
||||
|
.el-dialog__body { |
||||
|
padding: 0 10px 20px !important; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,663 @@ |
|||||
|
<template> |
||||
|
<div class="div_main"> |
||||
|
<div v-show="pageType == 'list'"> |
||||
|
<div class="div_search"> |
||||
|
<el-form :inline="true" |
||||
|
:model="formData" |
||||
|
ref="ref_searchform" |
||||
|
:label-width="'80px'"> |
||||
|
<div> |
||||
|
|
||||
|
<el-form-item label="所属网格" |
||||
|
prop="gridId"> |
||||
|
<el-select class="item_width_1" |
||||
|
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="item_width_2"> |
||||
|
<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="eventContent"> |
||||
|
<el-input v-model="formData.eventContent" |
||||
|
class="item_width_1" |
||||
|
size="small" |
||||
|
clearable |
||||
|
placeholder="请输入"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="报事人" |
||||
|
prop="name"> |
||||
|
<el-input v-model="formData.name" |
||||
|
class="item_width_2" |
||||
|
size="small" |
||||
|
clearable |
||||
|
placeholder="请输入"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="手机号" |
||||
|
prop="mobile"> |
||||
|
<el-input v-model="formData.mobile" |
||||
|
class="item_width_2" |
||||
|
size="small" |
||||
|
clearable |
||||
|
placeholder="请输入"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="上报时间" |
||||
|
prop="startTime"> |
||||
|
<el-date-picker v-model="formData.startTime" |
||||
|
:picker-options="startPickerOptions" |
||||
|
class="item_width_2" |
||||
|
size="small" |
||||
|
type="date" |
||||
|
value-format="yyyy-MM-dd HH:mm:ss" |
||||
|
value="yyyy-MM-dd" |
||||
|
placeholder="开始时间"> |
||||
|
</el-date-picker> |
||||
|
<span class="data-tag">至</span> |
||||
|
<el-date-picker v-model="formData.endTime" |
||||
|
:picker-options="endPickerOptions" |
||||
|
class="item_width_2 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="status"> |
||||
|
<el-select class="item_width_2" |
||||
|
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-button style="margin-left:30px" |
||||
|
size="small" |
||||
|
class="diy-button--search" |
||||
|
@click="handleSearch">查询</el-button> |
||||
|
<el-button style="margin-left:10px" |
||||
|
size="small" |
||||
|
class="diy-button--reset" |
||||
|
@click="resetSearch">重置</el-button> |
||||
|
</div> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
|
||||
|
<div class="div_table"> |
||||
|
|
||||
|
<div class="div_btn"> |
||||
|
<el-button class="diy-button--add" |
||||
|
size="small" |
||||
|
@click="handleAdd">新增</el-button> |
||||
|
|
||||
|
<el-button @click="handleExport" |
||||
|
class="diy-button--reset" |
||||
|
size="small">导出</el-button> |
||||
|
</div> |
||||
|
|
||||
|
<el-table :data="tableData" |
||||
|
border |
||||
|
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}" |
||||
|
class="table" |
||||
|
style="width: 100%" |
||||
|
:height="maxTableHeight"> |
||||
|
<el-table-column label="序号" |
||||
|
fixed="left" |
||||
|
type="index" |
||||
|
align="center" |
||||
|
width="50" /> |
||||
|
|
||||
|
<el-table-column prop="gridName" |
||||
|
align="center" |
||||
|
label="所属网格" |
||||
|
:show-overflow-tooltip="true"> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column prop="eventContent" |
||||
|
label="事件内容" |
||||
|
align="center" |
||||
|
:show-overflow-tooltip="true"> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<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])" |
||||
|
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="sourceTypeName" |
||||
|
align="center" |
||||
|
width="110" |
||||
|
label="上报渠道" |
||||
|
:show-overflow-tooltip="true"> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column prop="address" |
||||
|
align="center" |
||||
|
:show-overflow-tooltip="true" |
||||
|
label="地址"> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column prop="name" |
||||
|
align="center" |
||||
|
width="100" |
||||
|
label="报事人" |
||||
|
:show-overflow-tooltip="true"> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column prop="mobile" |
||||
|
align="center" |
||||
|
width="110" |
||||
|
label="手机号" |
||||
|
:show-overflow-tooltip="true"> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<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> |
||||
|
|
||||
|
<el-table-column prop="createdTime" |
||||
|
align="center" |
||||
|
width="140" |
||||
|
:show-overflow-tooltip="true" |
||||
|
label="上报时间"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="operationTypeShow" |
||||
|
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 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="div-table-button--edit">处理</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="div-table-button--edit">去评价</el-button> |
||||
|
<el-button v-else |
||||
|
@click="handleWatch(scope.row)" |
||||
|
type="text" |
||||
|
size="small">查看</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: '', |
||||
|
status: '', |
||||
|
|
||||
|
}, |
||||
|
pageNo: 1, |
||||
|
pageSize: window.localStorage.getItem("pageSize") || 20, |
||||
|
total: 1, |
||||
|
endPickerOptions: { |
||||
|
disabledDate: endDisabledDate |
||||
|
}, |
||||
|
startPickerOptions: { |
||||
|
disabledDate: startDisabledDate |
||||
|
}, |
||||
|
eventId: '', |
||||
|
|
||||
|
eventDetailData: {}, |
||||
|
|
||||
|
|
||||
|
showVoice: false, |
||||
|
selVoiceUrl: '', |
||||
|
}; |
||||
|
}, |
||||
|
computed: { |
||||
|
maxTableHeight () { |
||||
|
return this.$store.state.inIframe |
||||
|
? this.clientHeight - 410 + this.iframeHeigh |
||||
|
: this.clientHeight - 410; |
||||
|
}, |
||||
|
...mapGetters(["clientHeight", "iframeHeight"]), |
||||
|
}, |
||||
|
watch: { |
||||
|
"formData.endTime": function (val) { |
||||
|
if (val && val != '') { |
||||
|
let arrayTemp = val.split(' ') |
||||
|
this.formData.endTime = arrayTemp[0] + ' 23:59:59' |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
}, |
||||
|
mounted () { |
||||
|
console.log(this.$store.state) |
||||
|
this.user = this.$store.state.user |
||||
|
|
||||
|
this.agencyId = this.user.agencyId |
||||
|
this.loadGrid(); |
||||
|
this.getTableData(); |
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
handleSearch (val) { |
||||
|
console.log(this.formData); |
||||
|
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 = "/gov/project/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] |
||||
|
); |
||||
|
console.log("filename", fileName); |
||||
|
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) => { |
||||
|
console.log("获取导出情失败", err); |
||||
|
return this.$message.error("网络错误"); |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
async handleAdd () { |
||||
|
|
||||
|
this.pageType = "add"; |
||||
|
}, |
||||
|
|
||||
|
async handleWatch (row) { |
||||
|
this.eventId = row.icEventId |
||||
|
|
||||
|
this.eventId = row.icEventId |
||||
|
const url = "/gov/project/icEvent/detail"; |
||||
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/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 = "/gov/project/icEvent/detail"; |
||||
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/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); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
//显示语音窗口 |
||||
|
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, rowIndex) { |
||||
|
console.log(rowData, rowIndex); |
||||
|
const url = |
||||
|
"/heart/iccommunityselforganization/delcommunityselforganization"; |
||||
|
const { tableData } = this; |
||||
|
|
||||
|
const { data, code, msg } = await requestPost(url, { |
||||
|
orgId: tableData[rowIndex].orgId, |
||||
|
}); |
||||
|
|
||||
|
if (code === 0) { |
||||
|
this.$message.success("删除成功!"); |
||||
|
this.getTableData(); |
||||
|
} else { |
||||
|
this.$message.error("操作失败!"); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
async getTableData () { |
||||
|
const url = "/gov/project/icEvent/list"; |
||||
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/icEvent/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; |
||||
|
}) |
||||
|
: []; |
||||
|
|
||||
|
this.tableData.forEach(item => { |
||||
|
if (item.operationType === '2') { |
||||
|
item.operationTypeShow = '已转需求' |
||||
|
} |
||||
|
if (item.operationType === '1') { |
||||
|
item.operationTypeShow = '已立项' |
||||
|
} |
||||
|
if (item.operationType === '0') { |
||||
|
item.operationTypeShow = '已回复' |
||||
|
} |
||||
|
|
||||
|
}); |
||||
|
} 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: '', |
||||
|
status: '', |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// this.pageNo = 1 |
||||
|
// this.loadTable() |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
@import "@/assets/scss/buttonstyle.scss"; |
||||
|
@import "@/assets/scss/modules/management/list-main.scss"; |
||||
|
@import "@/assets/scss/modules/shequzhili/event-info.scss"; |
||||
|
</style> |
Loading…
Reference in new issue