|
|
|
@ -4,24 +4,24 @@ |
|
|
|
<div class="m-search"> |
|
|
|
<el-form :inline="true" :model="formData" ref="ref_searchform" :label-width="'100px'"> |
|
|
|
<div> |
|
|
|
<el-form-item label="事件类型" prop="agencyId"> |
|
|
|
<el-cascader class="u-item-width-normal" |
|
|
|
size="small" |
|
|
|
ref="myCascader" |
|
|
|
v-model.trim="formData.agencyId" |
|
|
|
:options="orgOptions" |
|
|
|
:props="orgOptionProps" |
|
|
|
:show-all-levels="false" |
|
|
|
@change="handleChangeAgency" |
|
|
|
clearable></el-cascader> |
|
|
|
<el-form-item label="事件类别" prop="firstIdList"> |
|
|
|
<el-cascader ref="cascaderEvent" v-model.trim="eventTypeCheck" :options="cateOptions" collapse-tags |
|
|
|
:show-all-levels="false" :props="{ |
|
|
|
multiple: true, |
|
|
|
checkStrictly: false, |
|
|
|
emitPath: false, |
|
|
|
children: 'children', |
|
|
|
label: 'categoryName', |
|
|
|
value: 'id', |
|
|
|
}" clearable class="u-item-width-normal" @change="handleEventType" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="工单编号" prop="eventContent"> |
|
|
|
<el-input v-model.trim="formData.eventContent" class="u-item-width-normal" size="small" clearable |
|
|
|
<el-form-item label="工单编号" prop="workOrderNum"> |
|
|
|
<el-input v-model.trim="formData.workOrderNum" class="u-item-width-normal" size="small" clearable |
|
|
|
placeholder="请输入"> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="报件人电话" prop="eventContent"> |
|
|
|
<el-input v-model.trim="formData.eventContent" class="u-item-width-normal" size="small" clearable |
|
|
|
<el-form-item label="报件人电话" prop="mobile"> |
|
|
|
<el-input v-model.trim="formData.mobile" class="u-item-width-normal" size="small" clearable |
|
|
|
placeholder="请输入"> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
@ -30,36 +30,37 @@ |
|
|
|
placeholder="请输入"> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="派件状态" prop="firstIdList"> |
|
|
|
<el-cascader ref="cascaderEvent" v-model.trim="eventTypeCheck" :options="cateOptions" collapse-tags |
|
|
|
:show-all-levels="false" :props="optionProps" clearable class="u-item-width-normal" @change="handleEventType" /> |
|
|
|
<!-- <template slot-scope="{ node, data }"> |
|
|
|
<div @click="cascaderClick(node, data)"> |
|
|
|
<span>{{ data.name }}</span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-cascader> --> |
|
|
|
<el-form-item label="指派部门" prop="firstIdList"> |
|
|
|
<el-cascader ref="cascaderEvent" v-model.trim="formData.firstIdList" :options="cateOptions" collapse-tags |
|
|
|
:show-all-levels="false" clearable class="u-item-width-normal" @change="handleEventType" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="指派部门" prop="agencyId"> |
|
|
|
<el-form-item label="办理状态" prop="status"> |
|
|
|
<el-cascader class="u-item-width-normal" |
|
|
|
size="small" |
|
|
|
ref="myCascader" |
|
|
|
v-model.trim="formData.agencyId" |
|
|
|
:options="orgOptions" |
|
|
|
:props="orgOptionProps" |
|
|
|
v-model.trim="formData.status" |
|
|
|
:options="ProcessingList" |
|
|
|
:show-all-levels="false" |
|
|
|
@change="handleChangeAgency" |
|
|
|
clearable></el-cascader> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="办结时限" prop="startTime"> |
|
|
|
<el-date-picker v-model.trim="formData.startTime" :picker-options="startPickerOptions" |
|
|
|
class="u-item-width-daterange" size="small" type="date" value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
value="yyyy-MM-dd" placeholder="开始时间"> |
|
|
|
<el-form-item label="超时状态" prop="Timeoutstatus"> |
|
|
|
<el-cascader class="u-item-width-normal" |
|
|
|
size="small" |
|
|
|
ref="myCascader" |
|
|
|
v-model.trim="formData.Timeoutstatus" |
|
|
|
:options="timeoutList" |
|
|
|
:show-all-levels="false" |
|
|
|
clearable></el-cascader> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="办结时限" prop="limitStartTime"> |
|
|
|
<el-date-picker v-model.trim="formData.startTime" |
|
|
|
class="u-item-width-daterange" size="small" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
value="yyyy-MM-dd HH:mm:ss" placeholder="开始时间"> |
|
|
|
</el-date-picker> |
|
|
|
<span class="u-data-tag">至</span> |
|
|
|
<el-date-picker v-model.trim="formData.endTime" :picker-options="endPickerOptions" |
|
|
|
class="u-item-width-daterange u-data-tag" size="small" type="date" |
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" value="yyyy-MM-dd" placeholder="结束时间"> |
|
|
|
<el-date-picker v-model.trim="formData.endTime" |
|
|
|
class="u-item-width-daterange u-data-tag" size="small" type="datetime" |
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" value="yyyy-MM-dd HH:mm:ss" placeholder="结束时间"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<el-row> |
|
|
|
@ -79,14 +80,14 @@ |
|
|
|
|
|
|
|
<el-button @click="handleExport" class="diy-button--white" size="small">导出</el-button> |
|
|
|
|
|
|
|
<el-dropdown size="small" split-button type="primary" style="margin: 0 10px; height: 30px" |
|
|
|
<!-- <el-dropdown size="small" split-button type="primary" style="margin: 0 10px; height: 30px" |
|
|
|
@command="(command) => handleMarkDiffcult(command)"> |
|
|
|
导入 |
|
|
|
<el-dropdown-menu slot="dropdown"> |
|
|
|
<el-dropdown-item command="1">下载模板</el-dropdown-item> |
|
|
|
<el-dropdown-item command="2">上传导入</el-dropdown-item> |
|
|
|
</el-dropdown-menu> |
|
|
|
</el-dropdown> |
|
|
|
</el-dropdown> --> |
|
|
|
</div> |
|
|
|
|
|
|
|
<el-table :data="tableData" border class="m-table-item" style="width: 100%" |
|
|
|
@ -94,9 +95,9 @@ |
|
|
|
<el-table-column label="" fixed="left" type="selection" align="center" width="50" /> |
|
|
|
<!-- <el-table-column label="序号" fixed="left" type="index" align="center" width="50" /> --> |
|
|
|
|
|
|
|
<el-table-column prop="gridName" align="center" label="工单编号" :show-overflow-tooltip="true"> |
|
|
|
<el-table-column prop="workOrder" align="center" label="工单编号" :show-overflow-tooltip="true"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="categoryName" label="事件类别" min-width="140" align="center" |
|
|
|
<el-table-column prop="eventType" label="事件类别" min-width="140" align="center" |
|
|
|
:show-overflow-tooltip="true" /> |
|
|
|
<!-- <template slot-scope="scope"> |
|
|
|
{{ scope.row.firstName + '-' + scope.row.secondName }} |
|
|
|
@ -104,9 +105,9 @@ |
|
|
|
</el-table-column> --> |
|
|
|
<el-table-column prop="eventContent" label="事件描述" align="center" :show-overflow-tooltip="true"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="eventContent" label="报件人" align="center" :show-overflow-tooltip="true"> |
|
|
|
<el-table-column prop="eventName" label="联系来电人时限" align="center" :show-overflow-tooltip="true"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="mobile" align="center" width="110" label="联系电话" :show-overflow-tooltip="true"> |
|
|
|
<!-- <el-table-column prop="phone" align="center" width="110" label="联系电话" :show-overflow-tooltip="true"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button |
|
|
|
v-if="scope.row.reportUserId !== null && scope.row.reportUserId !== ''" |
|
|
|
@ -114,28 +115,35 @@ |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
> |
|
|
|
{{ scope.row.mobile }} |
|
|
|
{{ scope.row.phone }} |
|
|
|
</el-button> |
|
|
|
<span v-else> |
|
|
|
{{ scope.row.mobile }} |
|
|
|
{{ scope.row.phone }} |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</el-table-column> --> |
|
|
|
<el-table-column prop="date" align="center" width="110" 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="mobile" align="center" width="110" label="指定部门" :show-overflow-tooltip="true"> |
|
|
|
<el-table-column prop="deliverystatus" align="center" width="110" label="办理超期" :show-overflow-tooltip="true"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.deliverystatus === 0">联系当事人超期</span> |
|
|
|
<span v-else-if="scope.row.deliverystatus ===1">部门办结超期</span> |
|
|
|
<span v-else>--</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="mobile" align="center" width="110" label="办结时间" :show-overflow-tooltip="true"> |
|
|
|
<el-table-column prop="handlestatus" align="center" width="110" label="办理状态" :show-overflow-tooltip="true"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.handlestatus === 0">联系当事人超期</span> |
|
|
|
<span v-else-if="scope.row.handlestatus ===1">部门办结超期</span> |
|
|
|
<span v-else>--</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column fixed="right" label="操作" align="center" width="200px"> |
|
|
|
|
|
|
|
<el-table-column fixed="right" label="操作" align="center" width="200px" prop="status"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button v-if="scope.row.status === 'processing' && !scope.row.operationId |
|
|
|
" @click="handleDispose(scope.row)" type="text" size="small" class="">查看</el-button> |
|
|
|
|
|
|
|
<el-button v-else-if="scope.row.status === 'closed_case' && |
|
|
|
!scope.row.satisfactionName && |
|
|
|
user.id === scope.row.createdUserId |
|
|
|
" @click="handleWatch(scope.row)" type="text" size="small" class="">{{scope.row.paijian === 0 ? '派件' : '查看'}}</el-button> |
|
|
|
<el-button type="text" size="small" class="">查看</el-button> |
|
|
|
<el-button @click="handleDispose(scope.row)" type="text" size="small" class="">催办</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
@ -148,43 +156,658 @@ |
|
|
|
</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="dialogVisible" width="650px" top="5vh" class="dialog-h" :before-close="handleClose"> |
|
|
|
|
|
|
|
<Urging ref="ref_form" v-if="dialogVisible" @dialogCancle="addFormCancle" |
|
|
|
@dialogOk="addFormOk"></Urging> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="dialogVisible = false">确 定</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { requestPost } from "@/js/dai/request"; |
|
|
|
import nextTick from "dai-js/tools/nextTick"; |
|
|
|
import { mapGetters } from "vuex"; |
|
|
|
import axios from "axios"; |
|
|
|
import Urging from "./Urging.vue" |
|
|
|
export default { |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return{ |
|
|
|
// 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; |
|
|
|
// }; |
|
|
|
let orgOptionProps = { |
|
|
|
multiple: false, |
|
|
|
value: 'agencyId', |
|
|
|
label: 'agencyName', |
|
|
|
children: 'subAgencyList', |
|
|
|
checkStrictly: true |
|
|
|
} |
|
|
|
|
|
|
|
return { |
|
|
|
pageType: "list", // 列表list 新增add 处理dispose 详情info |
|
|
|
user: {}, |
|
|
|
|
|
|
|
agencyId: "", |
|
|
|
ProcessingList: [ |
|
|
|
{ |
|
|
|
value: "1", |
|
|
|
label: "未联系当事人", |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: "2", |
|
|
|
label: "已联系当事人", |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: "3", |
|
|
|
label: "办理中", |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: "4", |
|
|
|
label: "已办结待审核", |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: "5", |
|
|
|
label: "已审核归档", |
|
|
|
}, |
|
|
|
], |
|
|
|
orgOptionProps, |
|
|
|
level: '', |
|
|
|
optionsG: [], |
|
|
|
sarr: [], |
|
|
|
dialogVisible:false, |
|
|
|
|
|
|
|
tableData: [ |
|
|
|
{ |
|
|
|
workOrder:"5131133113213213213", |
|
|
|
eventType:"城乡建设-住房", |
|
|
|
eventContent:"王先生反映:市北区有一家黄焖鸡不好吃", |
|
|
|
eventName:"王先生", |
|
|
|
phone:"15666628220", |
|
|
|
deliverystatus:0, |
|
|
|
handleStatus:0, |
|
|
|
department:"城建办", |
|
|
|
date:"2024-8-1 11:50", |
|
|
|
status:0 |
|
|
|
}, |
|
|
|
{ |
|
|
|
workOrder:"5131133113213213213", |
|
|
|
eventType:"城乡建设-住房", |
|
|
|
eventContent:"王先生反映:市北区有一家黄焖鸡不好吃", |
|
|
|
eventName:"王先生", |
|
|
|
phone:"15666628220", |
|
|
|
deliverystatus:1, |
|
|
|
handleStatus:0, |
|
|
|
department:"城建办", |
|
|
|
date:"2024-8-1 11:50", |
|
|
|
status:0 |
|
|
|
}, |
|
|
|
{ |
|
|
|
workOrder:"5131133113213213213", |
|
|
|
eventType:"城乡建设-住房", |
|
|
|
eventContent:"王先生反映:市北区有一家黄焖鸡不好吃", |
|
|
|
eventName:"王先生", |
|
|
|
phone:"15666628220", |
|
|
|
deliverystatus:1, |
|
|
|
handleStatus:1, |
|
|
|
department:"城建办", |
|
|
|
date:"2024-8-1 11:50", |
|
|
|
status:0 |
|
|
|
} |
|
|
|
], |
|
|
|
statusArray: [ |
|
|
|
{ |
|
|
|
value: "processing", |
|
|
|
label: "处理中", |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: "closed_case", |
|
|
|
label: "已完成", |
|
|
|
}, |
|
|
|
], |
|
|
|
timeoutList: [ |
|
|
|
{ |
|
|
|
value: "1", |
|
|
|
label: "响应超时", |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: "2", |
|
|
|
label: "办理超时", |
|
|
|
} |
|
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
formData: { |
|
|
|
agencyId: "", |
|
|
|
gridId:"", |
|
|
|
sourceType: "", |
|
|
|
eventContent: "", |
|
|
|
name: "", |
|
|
|
mobile: "", |
|
|
|
startTime: "", |
|
|
|
endTime: "", |
|
|
|
limitStartTime: "", |
|
|
|
limitEndTime: "", |
|
|
|
status: "", |
|
|
|
firstIdList: [], |
|
|
|
secondIdList: [], |
|
|
|
openFlag:'' |
|
|
|
workOrderNum: "", |
|
|
|
Timeoutstatus:"" |
|
|
|
}, |
|
|
|
tableData:{ |
|
|
|
|
|
|
|
cateOptions: [], |
|
|
|
eventTypeCheck: [], |
|
|
|
pageNo: 1, |
|
|
|
pageSize: window.localStorage.getItem("pageSize") || 20, |
|
|
|
total: 1, |
|
|
|
// endPickerOptions: { |
|
|
|
// disabledDate: endDisabledDate, |
|
|
|
// }, |
|
|
|
// startPickerOptions: { |
|
|
|
// disabledDate: startDisabledDate, |
|
|
|
// }, |
|
|
|
eventId: "", |
|
|
|
searchH: 180, |
|
|
|
eventDetailData: {}, |
|
|
|
showVoice: false, |
|
|
|
selVoiceUrl: "", |
|
|
|
multipleSelection: [], |
|
|
|
importLoading: false, |
|
|
|
importType: "1" |
|
|
|
}; |
|
|
|
}, |
|
|
|
components:{Urging}, |
|
|
|
computed: { |
|
|
|
maxTableHeight() { |
|
|
|
const h = this.clientHeight - this.searchH - 275 + this.iframeHeight; |
|
|
|
const _h = this.clientHeight - 275 - this.searchH; |
|
|
|
return this.$store.state.inIframe ? h : _h; |
|
|
|
}, |
|
|
|
...mapGetters(["clientHeight", "iframeHeight"]), |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
"formData.endTime": function (val) { |
|
|
|
if (val && val != "") { |
|
|
|
let arrayTemp = val.split(" "); |
|
|
|
this.formData.endTime = arrayTemp[0] + " 23:59:59"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
"formData.limitEndTime": function (val) { |
|
|
|
if (val && val != "") { |
|
|
|
let arrayTemp = val.split(" "); |
|
|
|
this.formData.limitEndTime = arrayTemp[0] + " 23:59:59"; |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.user = this.$store.state.user; |
|
|
|
this.agencyId = this.user.agencyId; |
|
|
|
|
|
|
|
} |
|
|
|
</script> |
|
|
|
this.getOrgTreeList() |
|
|
|
this.getGridList() |
|
|
|
this.getTableData(); |
|
|
|
this.getCateOptions(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleEventType(val) { |
|
|
|
const nodes = this.$refs.cascaderEvent.getCheckedNodes(); |
|
|
|
this.formData.firstIdList = []; |
|
|
|
this.formData.secondIdList = []; |
|
|
|
let level1 = nodes.filter((item) => item.level === 1); |
|
|
|
let level2 = nodes.filter((item) => item.level === 2); |
|
|
|
level1.forEach((item) => { |
|
|
|
if (item.hasChildren) { |
|
|
|
for (let i = level2.length - 1; i >= 0; i--) { |
|
|
|
if (level2[i].parent.value === item.value) level2.splice(i, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
this.formData.firstIdList = level1.map((item) => item.value); |
|
|
|
this.formData.secondIdList = level2.map((item) => item.value); |
|
|
|
}, |
|
|
|
handleSelectionChange(val) { |
|
|
|
this.multipleSelection = []; |
|
|
|
val.forEach((element) => { |
|
|
|
this.multipleSelection.push(element.icEventId); |
|
|
|
}); |
|
|
|
}, |
|
|
|
async handleMarkDiffcult(command) { |
|
|
|
const url = "/governance/icEvent/difficultpointevent"; |
|
|
|
if (this.multipleSelection.length == 0) { |
|
|
|
this.$message.warning('请选择需要标记的事件') |
|
|
|
return |
|
|
|
} |
|
|
|
let params = { |
|
|
|
icEventIdList: this.multipleSelection, |
|
|
|
type: command, |
|
|
|
}; |
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
if (code === 0) { |
|
|
|
this.$message.success("标记成功"); |
|
|
|
this.getTableData(); |
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
async handleCancalDiffcult() { |
|
|
|
const url = "/governance/icEvent/difficultpointevent"; |
|
|
|
if (this.multipleSelection.length == 0) { |
|
|
|
this.$message.warning('请选择取消标记的事件') |
|
|
|
return |
|
|
|
} |
|
|
|
let params = { |
|
|
|
icEventIdList: this.multipleSelection, |
|
|
|
type: "0", |
|
|
|
}; |
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
if (code === 0) { |
|
|
|
this.$message.success("取消标记成功"); |
|
|
|
this.getTableData(); |
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleSearch(val) { |
|
|
|
this.pageNo = 1; |
|
|
|
this.getTableData(); |
|
|
|
}, |
|
|
|
|
|
|
|
// 查看 |
|
|
|
async handleLook(row) { |
|
|
|
|
|
|
|
let { agencyId, gridId, gridName, name, reportUserId } = row |
|
|
|
const resiId = reportUserId; |
|
|
|
this.$store.dispatch('saveData', { agencyId, gridId, gridName, name, resiId }); |
|
|
|
this.$router.push({ name: 'jumin-huaxiang' }); |
|
|
|
this.$store.state.contentTabs = this.$store.state.contentTabs.map(item => { |
|
|
|
if (item.name === "jumin-huaxiang") { |
|
|
|
return {...item, title: name }; |
|
|
|
} |
|
|
|
return item; |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
async handleExport() { |
|
|
|
const url = "/governance/icEvent/export"; |
|
|
|
const { pageSize, pageNo, formData } = this; |
|
|
|
axios({ |
|
|
|
url: window.SITE_CONFIG["apiURL"] + url, |
|
|
|
method: "post", |
|
|
|
data: { |
|
|
|
pageSize, |
|
|
|
pageNo, |
|
|
|
...formData, |
|
|
|
}, |
|
|
|
responseType: "blob", |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
let fileName = window.decodeURI( |
|
|
|
res.headers["content-disposition"].split(";")[1].split("=")[1] |
|
|
|
); |
|
|
|
let blob = new Blob([res.data], { type: "application/vnd.ms-excel" }); |
|
|
|
var url = window.URL.createObjectURL(blob); |
|
|
|
var aLink = document.createElement("a"); |
|
|
|
aLink.style.display = "none"; |
|
|
|
aLink.href = url; |
|
|
|
aLink.setAttribute("download", fileName); |
|
|
|
document.body.appendChild(aLink); |
|
|
|
aLink.click(); |
|
|
|
document.body.removeChild(aLink); //下载完成移除元素 |
|
|
|
window.URL.revokeObjectURL(url); //释放掉blob对象 |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
return this.$message.error("网络错误"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
async handleAdd() { |
|
|
|
this.pageType = "add"; |
|
|
|
}, |
|
|
|
|
|
|
|
async handleWatch(row) { |
|
|
|
this.eventId = row.icEventId; |
|
|
|
const url = "/governance/icEvent/detail"; |
|
|
|
const { data, code, msg } = await requestPost(url, { |
|
|
|
icEventId: this.eventId, |
|
|
|
}); |
|
|
|
if (code === 0) { |
|
|
|
this.eventDetailData = { ...data }; |
|
|
|
this.pageType = "info"; |
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
async handleDispose(row) { |
|
|
|
console.log(row,"row"); |
|
|
|
this.dialogVisible=true |
|
|
|
|
|
|
|
}, |
|
|
|
//下载模版 |
|
|
|
async handleExportModule() { |
|
|
|
let url = '/governance/icEvent/downloadTemplate'; |
|
|
|
let params = {}; |
|
|
|
await this.$http({ |
|
|
|
method: 'POST', |
|
|
|
url, |
|
|
|
responseType: 'blob', |
|
|
|
data: params |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
if (res.headers['content-disposition']) { |
|
|
|
let fileName = window.decodeURI(res.headers['content-disposition'].split(';')[1].split('=')[1]); |
|
|
|
let blob = new Blob([res.data], { |
|
|
|
type: 'application/vnd.ms-excel' |
|
|
|
}); |
|
|
|
var url = window.URL.createObjectURL(blob); |
|
|
|
var aLink = document.createElement('a'); |
|
|
|
aLink.style.display = 'none'; |
|
|
|
aLink.href = url; |
|
|
|
aLink.setAttribute('download', fileName); |
|
|
|
document.body.appendChild(aLink); |
|
|
|
aLink.click(); |
|
|
|
document.body.removeChild(aLink); //下载完成移除元素 |
|
|
|
window.URL.revokeObjectURL(url); //释放掉blob对象 |
|
|
|
} else this.$message.error('下载失败'); |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.log('err', err); |
|
|
|
return this.$message.error('网络错误'); |
|
|
|
}); |
|
|
|
}, |
|
|
|
handleExcelSuccess(res, file) { |
|
|
|
if (!res.code === 0 && !res.msg === 'success') { |
|
|
|
this.$message.error(res.msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
handleProgress(event, file, fileList) { |
|
|
|
|
|
|
|
}, |
|
|
|
beforeExcelUpload(file) { |
|
|
|
const isType = file.type === 'application/vnd.ms-excel'; |
|
|
|
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; |
|
|
|
const fileType = isType || isTypeComputer; |
|
|
|
const isLt1M = file.size / 1024 / 1024 < 10; |
|
|
|
if (!fileType) { |
|
|
|
this.$message.error('上传文件只能是xls/xlsx格式!'); |
|
|
|
} |
|
|
|
|
|
|
|
if (!isLt1M) { |
|
|
|
this.$message.error('上传文件大小不能超过 10MB!'); |
|
|
|
} |
|
|
|
return fileType && isLt1M; |
|
|
|
}, |
|
|
|
importTypeChange(val) { |
|
|
|
this.importType = val |
|
|
|
}, |
|
|
|
async uploadHttpRequest(file) { |
|
|
|
this.importLoading = true; |
|
|
|
this.importBtnTitle = '正在上传中...'; |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
dangerouslyUseHTMLString: true, |
|
|
|
message: "导入中,请到系统管理-<a id='clickA' style='cursor: pointer;'>导入记录</a>中查看进度", |
|
|
|
duration: 3000 |
|
|
|
}); |
|
|
|
let than = this; |
|
|
|
document.getElementById('clickA').addEventListener('click', function () { |
|
|
|
than.$router.replace('/main/importRecord-index'); |
|
|
|
}); |
|
|
|
const formData = new FormData(); //FormData对象,添加参数只能通过append('key', value)的形式添加 |
|
|
|
formData.append('file', file.file); //添加文件对象 |
|
|
|
formData.append('code', ''); //添加文件对象 |
|
|
|
let url = '/governance/icEvent/importEvent' |
|
|
|
if (this.importType == 2) { |
|
|
|
url = '/governance/icEvent/importAwo' |
|
|
|
} |
|
|
|
console.log(url) |
|
|
|
await this.$http |
|
|
|
.post(url, formData) |
|
|
|
.then(res => { |
|
|
|
if (res.data.code == 0 && res.data.msg == 'success') { |
|
|
|
const data = res.data.data; |
|
|
|
this.dataList = [ |
|
|
|
...Object.keys(data.option.exist).map(k => { |
|
|
|
return { |
|
|
|
index: k, |
|
|
|
srcField: data.option.exist[k], |
|
|
|
exist: true, |
|
|
|
field: data.option.exist[k] |
|
|
|
}; |
|
|
|
}), |
|
|
|
...Object.keys(data.option.notExist).map(k => { |
|
|
|
return { |
|
|
|
index: k, |
|
|
|
srcField: data.option.notExist[k], |
|
|
|
exist: false, |
|
|
|
field: '' |
|
|
|
}; |
|
|
|
}) |
|
|
|
]; |
|
|
|
this.importOption = data.option; |
|
|
|
this.importCode = data.code; |
|
|
|
this.fileData = file; |
|
|
|
} else this.$message.error(res.data.msg); |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.log('失败', err); |
|
|
|
file.onError(); //上传失败的文件会从文件列表中删除 |
|
|
|
}); |
|
|
|
this.importLoading = false; |
|
|
|
this.importBtnTitle = '导入'; |
|
|
|
this.$refs.upload.clearFiles(); |
|
|
|
this.getTableData(); |
|
|
|
}, |
|
|
|
|
|
|
|
//显示语音窗口 |
|
|
|
handleShowVoice(url) { |
|
|
|
this.selVoiceUrl = url; |
|
|
|
this.showVoice = true; |
|
|
|
}, |
|
|
|
|
|
|
|
handleClose() { |
|
|
|
this.pageType = "list"; |
|
|
|
this.eventId = ""; |
|
|
|
this.getTableData(); |
|
|
|
}, |
|
|
|
handleOk() { |
|
|
|
this.pageType = "list"; |
|
|
|
this.eventId = ""; |
|
|
|
this.pageNo = 1; |
|
|
|
this.getTableData(); |
|
|
|
}, |
|
|
|
|
|
|
|
handleEditSuccess() { |
|
|
|
this.handleClose(); |
|
|
|
this.getTableData(); |
|
|
|
}, |
|
|
|
|
|
|
|
async handleDel(rowData) { |
|
|
|
let message = "确认删除?"; |
|
|
|
this.$confirm(message, "提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning", |
|
|
|
}).then(() => { |
|
|
|
this.delEvent(rowData.icEventId); |
|
|
|
}).catch((err) => { }); |
|
|
|
}, |
|
|
|
async delEvent(eventId) { |
|
|
|
const url = "/governance/icEvent/delete"; |
|
|
|
let idsArr = [eventId]; |
|
|
|
const { data, code, msg } = await requestPost(url, idsArr); |
|
|
|
if (code === 0) { |
|
|
|
this.$message.success("删除成功!"); |
|
|
|
this.getTableData(); |
|
|
|
} else { |
|
|
|
this.$message.error("操作失败!"); |
|
|
|
} |
|
|
|
}, |
|
|
|
async getTableData() { |
|
|
|
const url = "/governance/icEvent/list"; |
|
|
|
if (this.eventTypeCheck) { |
|
|
|
this.formData.secondIdList = this.eventTypeCheck |
|
|
|
} |
|
|
|
|
|
|
|
const { pageSize, pageNo, formData } = this; |
|
|
|
// 创建新的 formData 对象,保留原始值 |
|
|
|
const newFormData = { ...formData }; |
|
|
|
|
|
|
|
// 处理 agencyId |
|
|
|
if (Array.isArray(newFormData.agencyId) && newFormData.agencyId.length) { |
|
|
|
if (this.level == "grid") { |
|
|
|
newFormData.gridId = newFormData.agencyId[newFormData.agencyId.length - 1]; |
|
|
|
newFormData.agencyId = ""; |
|
|
|
} else { |
|
|
|
newFormData.agencyId = newFormData.agencyId[newFormData.agencyId.length - 1]; |
|
|
|
newFormData.gridId = ""; |
|
|
|
} |
|
|
|
} else { |
|
|
|
newFormData.agencyId = ""; |
|
|
|
newFormData.gridId = ""; |
|
|
|
} |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, { |
|
|
|
pageSize, |
|
|
|
pageNo, |
|
|
|
...newFormData, |
|
|
|
}); |
|
|
|
if (code === 0) { |
|
|
|
this.total = data.total || 0; |
|
|
|
// this.tableData = data.list ? data.list.map((item) => { return item; }) : []; |
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
async getCateOptions() { |
|
|
|
const url = "/governance/icEvent/getCategoryTree"; |
|
|
|
const { data, code, msg } = await requestPost(url, {}); |
|
|
|
if (code === 0) { |
|
|
|
this.cateOptions = this.deepTree(data, "children"); |
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleSizeChange(val) { |
|
|
|
this.pageSize = val; |
|
|
|
window.localStorage.setItem("pageSize", val); |
|
|
|
this.getTableData(); |
|
|
|
}, |
|
|
|
handleCurrentChange(val) { |
|
|
|
this.pageNo = val; |
|
|
|
this.getTableData(); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getOrgTreeList() { |
|
|
|
this.$http |
|
|
|
.post('/gov/org/customeragency/agencygridtree', {}) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} else { |
|
|
|
console.log('获取组织树成功', res.data) |
|
|
|
this.orgOptions = [] |
|
|
|
this.orgOptions.push(res.data) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}, |
|
|
|
getGridList() { |
|
|
|
this.$http |
|
|
|
.post('/gov/org/customergrid/gridoption', { agencyId: this.agencyId, purpose: 'addorupdate' }) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} else { |
|
|
|
console.log('获取查询详情成功', res.data) |
|
|
|
this.optionsG = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getLastItem(list, vals, key) { |
|
|
|
let LIST = list || []; |
|
|
|
for (let item of LIST) { |
|
|
|
// console.log(item[key]); |
|
|
|
for (let i of vals) { |
|
|
|
if (item[key] === i) { |
|
|
|
this.sarr.push(item); |
|
|
|
} else { |
|
|
|
this.getLastItem(item.subAgencyList, vals, key); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
resetSearch() { |
|
|
|
this.formData = { |
|
|
|
agencyId: "", |
|
|
|
gridId: "", |
|
|
|
sourceType: "", |
|
|
|
eventContent: "", |
|
|
|
name: "", |
|
|
|
mobile: "", |
|
|
|
startTime: "", |
|
|
|
endTime: "", |
|
|
|
limitStartTime: "", |
|
|
|
limitEndTime: "", |
|
|
|
status: "", |
|
|
|
firstIdList: [], |
|
|
|
secondIdList: [], |
|
|
|
}; |
|
|
|
this.eventTypeCheck = []; |
|
|
|
this.pageNo = 1; |
|
|
|
this.getTableData(); |
|
|
|
// this.loadTable() |
|
|
|
}, |
|
|
|
deepTree(arr, children) { |
|
|
|
if (Array.isArray(arr) && arr.length > 0) { |
|
|
|
return arr.map((item) => { |
|
|
|
return { |
|
|
|
...item, |
|
|
|
[children]: |
|
|
|
(item[children] && |
|
|
|
item[children].length > 0 && |
|
|
|
this.deepTree(item[children], children)) || |
|
|
|
null, |
|
|
|
}; |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
showAwoList(row) { |
|
|
|
this.$refs.awoList.open(row) |
|
|
|
} |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
|
|
@import "@/assets/scss/modules/management/list-main.scss"; |
|
|
|
|
|
|
|
|