6 changed files with 967 additions and 41 deletions
@ -0,0 +1,934 @@ |
|||||
|
<template> |
||||
|
|
||||
|
<div class="g-main"> |
||||
|
<div div v-show="pageType == 'list'"> |
||||
|
<div class="m-search"> |
||||
|
<el-form :inline="true" :model="formData" ref="ref_searchform" :label-width="'120px'"> |
||||
|
<div> |
||||
|
<el-form-item label="事件类别" prop="firstIdList"> |
||||
|
<el-cascader ref="cascaderEvent" v-model.trim="formData.firstIdList" :options="cateOptions" |
||||
|
collapse-tags :show-all-levels="false" :props="{ |
||||
|
multiple: true, |
||||
|
checkStrictly: true, |
||||
|
emitPath: false, |
||||
|
children: 'children', |
||||
|
label: 'categoryName', |
||||
|
value: 'id', |
||||
|
}" clearable class="u-item-width-normal" /> |
||||
|
</el-form-item> |
||||
|
<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="mobile"> |
||||
|
<el-input v-model.trim="formData.mobile" 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 placeholder="请输入"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="最终是否解决" prop="operationType"> |
||||
|
<el-select v-model.trim="formData.ifSolveList" clearable class="u-item-width-normal"> |
||||
|
<el-option v-for="item in ifSolveList" :key="item.value" :label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="最终是否满意" prop="operationType"> |
||||
|
<el-select v-model.trim="formData.ifSolveList" clearable class="u-item-width-normal"> |
||||
|
<el-option v-for="item in ifSatisfiedList" :key="item.value" :label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="派件状态" prop="deliveryStatus"> |
||||
|
<el-select v-model.trim="formData.deliveryStatus" clearable class="u-item-width-normal"> |
||||
|
<el-option v-for="item in ProcessingList" :key="item.value" :label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="办理状态" prop="operationType"> |
||||
|
<el-select v-model.trim="formData.operationType" clearable class="u-item-width-normal"> |
||||
|
<el-option v-for="item in handleList" :key="item.value" :label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="指派部门" prop="departId"> |
||||
|
<el-cascader class="u-item-width-normal" size="small" ref="myCascader" |
||||
|
v-model.trim="formData.departId" :options="orgOptions" :props="orgOptionProps" |
||||
|
:show-all-levels="false" @change="handleChangeAgency" clearable></el-cascader> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="办结时限" prop="limitEndTime"> |
||||
|
<el-date-picker v-model.trim="formData.limitStartTime" class="u-item-width-daterange" |
||||
|
size="small" type="date" value-format="yyyy-MM-dd HH:mm:ss" value="yyyy-MM-dd" |
||||
|
placeholder="开始时间"> |
||||
|
</el-date-picker> |
||||
|
<span class="u-data-tag">至</span> |
||||
|
<el-date-picker v-model.trim="formData.limitEndTime" |
||||
|
class="u-item-width-daterange u-data-tag" size="small" type="date" |
||||
|
value-format="yyyy-MM-dd HH:mm:ss" value="yyyy-MM-dd" placeholder="结束时间"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-row> |
||||
|
<el-col :span="24" align="right"> |
||||
|
<el-button style="margin-left: 30px" size="small" type="primary " |
||||
|
@click="handleSearch">查询</el-button> |
||||
|
<el-button style="margin-left: 10px" size="small" class="diy-button--white" |
||||
|
@click="resetSearch">重置</el-button> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</div> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
|
||||
|
<div class="m-table"> |
||||
|
|
||||
|
<div class="div_btn"> |
||||
|
|
||||
|
<el-button @click="handleExport" class="diy-button--white" size="small">导出</el-button> |
||||
|
<el-button class="diy-button--white" size="small"> |
||||
|
<el-upload :headers="$getElUploadHeaders()" ref="upload" class="upload-btn" |
||||
|
action="uploadUlr" :limit="1" :accept="'.xls,.xlsx'" :with-credentials="true" |
||||
|
:show-file-list="false" :auto-upload="true" :on-progress="handleProgress" |
||||
|
:on-success="handleExcelSuccess" :before-upload="beforeExcelUpload" |
||||
|
:http-request="uploadHttpRequest"> |
||||
|
上传导入 |
||||
|
</el-upload> |
||||
|
</el-button> |
||||
|
|
||||
|
<!-- <el-dropdown size="small" split-button type="primary" style="margin: 0 10px; height: 30px" |
||||
|
@command="(command) => importTypeChange(command)"> |
||||
|
导入 |
||||
|
<el-dropdown-menu slot="dropdown"> --> |
||||
|
<!-- <el-dropdown-item command="0" @click.native="handleExportModule">下载模板</el-dropdown-item> --> |
||||
|
<!-- <el-upload :headers="$getElUploadHeaders()" ref="upload" class="upload-btn" |
||||
|
action="uploadUlr" :limit="1" :accept="'.xls,.xlsx'" :with-credentials="true" |
||||
|
:show-file-list="false" :auto-upload="true" :on-progress="handleProgress" |
||||
|
:on-success="handleExcelSuccess" :before-upload="beforeExcelUpload" |
||||
|
:http-request="uploadHttpRequest"> |
||||
|
<el-dropdown-item command="1">上传导入</el-dropdown-item> |
||||
|
</el-upload> |
||||
|
</el-dropdown-menu> --> |
||||
|
<!-- </el-dropdown> --> |
||||
|
</div> |
||||
|
|
||||
|
<el-table :data="tableData" border class="m-table-item" style="width: 100%" |
||||
|
@selection-change="handleSelectionChange" :height="maxTableHeight"> |
||||
|
|
||||
|
<el-table-column label="" fixed="left" type="selection" align="center" width="50" /> |
||||
|
<!-- <el-table-column label="序号" fixed="left" type="index" align="center" width="50" /> --> |
||||
|
|
||||
|
<el-table-column prop="workOrderNum" align="center" label="工单编号" :show-overflow-tooltip="true"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="categoryAllName" label="事件类别" min-width="140" align="center" |
||||
|
:show-overflow-tooltip="true" /> |
||||
|
<!-- <template slot-scope="scope"> |
||||
|
{{ scope.row.firstName + '-' + scope.row.secondName }} |
||||
|
</template> |
||||
|
</el-table-column> --> |
||||
|
<el-table-column prop="eventContent" label="事件描述" align="center" :show-overflow-tooltip="true"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="name" label="报件人" align="center" :show-overflow-tooltip="true"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="mobile" align="center" width="110" label="联系电话"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="mobile" align="center" width="110" label="最终是否解决"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="mobile" align="center" width="110" label="最终是否满意"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="statusName" align="center" width="110" label="指派状态" |
||||
|
:show-overflow-tooltip="true"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="scope.row.status === 'unassigned'" style="color: #ff6600;">未指派</span> |
||||
|
<span v-else-if="scope.row.status ==='assigned'">已指派</span> |
||||
|
<span v-else-if="scope.row.operationType ==='13'" style="color: #ff0000;">已退件</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="deptName" align="center" width="110" label="指派部门" |
||||
|
:show-overflow-tooltip="true"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="operationTypeName" align="center" width="110" label="办理状态" |
||||
|
:show-overflow-tooltip="true"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span :style="{color: getFontColor(scope.row.operationType)}">{{scope.row.operationTypeName}}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" align="center" width="200px" prop="status"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button @click="handleWatch(scope.row)" type="text" size="small" class="">查看</el-button> |
||||
|
<el-button @click="handleDispose(scope.row,'check')" v-if="scope.row.operationType =='12'" type="text" size="small" class="">修改</el-button> |
||||
|
<!-- <el-button @click="handleDispose(scope.row)" type="text" size="small" class="">{{scope.row.deliverystatus==0?"派件":"办理"}}</el-button> |
||||
|
--> |
||||
|
<!-- <el-button @click="handleDispose(scope.row,'dispose')" type="text" size="small" |
||||
|
v-if="(scope.row.status == 'processing'|| scope.row.status === 'assigned') && scope.row.operationType === '5'">处理</el-button> --> |
||||
|
<el-button @click="handleDispose(scope.row,'resetAssign')" type="text" size="small" |
||||
|
v-if="(scope.row.status == 'processing'|| scope.row.status === 'assigned') && (scope.row.operationType === '5'|| scope.row.operationType === '10')">改派</el-button> |
||||
|
<el-button @click="handleDispose(scope.row,'assign')" type="text" size="small" |
||||
|
v-if="scope.row.status =='unassigned'||scope.row.status =='processing'||scope.row.operationType =='13'">派件</el-button> |
||||
|
<el-button @click="handleDispose(scope.row,'check')" type="text" size="small" |
||||
|
v-if="scope.row.operationType === '11'">审核</el-button> |
||||
|
<el-button @click="handleDel(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 == 'assign' || pageType === 'resetAssign'|| pageType=='check'"> |
||||
|
<event-info ref="eleEditForm" :pageType="pageType" :eventId="eventId" :eventDetailData="eventDetailData" |
||||
|
@handleClose="handleClose" @handleOk="handleOk" @dialogOk="handleEditSuccess" /> |
||||
|
</div> |
||||
|
<canvas id="watermarkCanvas" class="canvas"> </canvas> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { requestPost,requestGet } from "@/js/dai/request"; |
||||
|
import nextTick from "dai-js/tools/nextTick"; |
||||
|
import { mapGetters } from "vuex"; |
||||
|
import eventInfo from "../event/cpts/event-info.vue"; |
||||
|
import axios from "axios"; |
||||
|
|
||||
|
export default { |
||||
|
data() { |
||||
|
let orgOptionProps = { |
||||
|
multiple: false, |
||||
|
value: 'agencyId', |
||||
|
label: 'agencyName', |
||||
|
children: 'subAgencyList', |
||||
|
checkStrictly: true |
||||
|
} |
||||
|
|
||||
|
return { |
||||
|
ifSatisfiedList: [ |
||||
|
{ |
||||
|
label: "满意", |
||||
|
value: "1" |
||||
|
}, |
||||
|
{ |
||||
|
label: "基本满意", |
||||
|
value: "1" |
||||
|
}, |
||||
|
{ |
||||
|
label: "不满意", |
||||
|
value: "0" |
||||
|
} |
||||
|
], |
||||
|
ifSolveList:[ |
||||
|
{label:"已解决", |
||||
|
value:"1" |
||||
|
}, |
||||
|
{label:"未解决", |
||||
|
value:"0" |
||||
|
} |
||||
|
], |
||||
|
pageType: "list", // 列表list 新增add 处理dispose 详情info |
||||
|
user: {}, |
||||
|
agencyId: "", |
||||
|
orgOptions: [], |
||||
|
orgOptionProps, |
||||
|
level: '', |
||||
|
optionsG: [], |
||||
|
sarr: [], |
||||
|
ProcessingList: [ |
||||
|
{ |
||||
|
value: "assigned", |
||||
|
label: "已指派", |
||||
|
}, |
||||
|
{ |
||||
|
value: "unassigned", |
||||
|
label: "未指派", |
||||
|
}, |
||||
|
], |
||||
|
handleList: [ |
||||
|
{ |
||||
|
value: "8", |
||||
|
label: "未联系当事人", |
||||
|
}, |
||||
|
{ |
||||
|
value: "9", |
||||
|
label: "已联系当事人", |
||||
|
}, |
||||
|
{ |
||||
|
value: "10", |
||||
|
label: "办理中", |
||||
|
}, |
||||
|
{ |
||||
|
value: "11", |
||||
|
label: "已办结待审核", |
||||
|
}, |
||||
|
{ |
||||
|
value: "12", |
||||
|
label: "已审核归档", |
||||
|
}, |
||||
|
], |
||||
|
tableData: [], |
||||
|
statusArray: [ |
||||
|
{ |
||||
|
value: "processing", |
||||
|
label: "处理中", |
||||
|
}, |
||||
|
{ |
||||
|
value: "closed_case", |
||||
|
label: "已完成", |
||||
|
}, |
||||
|
], |
||||
|
typeArray: [ |
||||
|
{ |
||||
|
value: "1", |
||||
|
label: "难点痛点", |
||||
|
}, |
||||
|
{ |
||||
|
value: "2", |
||||
|
label: "矛盾纠纷", |
||||
|
}, |
||||
|
{ |
||||
|
value: "3", |
||||
|
label: "自身问题", |
||||
|
}, |
||||
|
{ |
||||
|
value: "4", |
||||
|
label: "超出服务范围", |
||||
|
}, |
||||
|
], |
||||
|
qudaoArray: [ |
||||
|
{ |
||||
|
value: "3", |
||||
|
label: "12345", |
||||
|
} |
||||
|
], |
||||
|
|
||||
|
formData: { |
||||
|
selectType:"gjk", |
||||
|
agencyId: "", |
||||
|
sourceType: "", |
||||
|
departId:'', |
||||
|
eventContent: "", |
||||
|
name: "", |
||||
|
mobile: "", |
||||
|
startTime: "", |
||||
|
endTime: "", |
||||
|
limitStartTime: "", |
||||
|
limitEndTime: "", |
||||
|
status: "", |
||||
|
firstIdList:[], |
||||
|
operationType:'', |
||||
|
workOrderNum: "", |
||||
|
deliveryStatus:"", |
||||
|
handleStatus:"", |
||||
|
}, |
||||
|
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", |
||||
|
phone:"", |
||||
|
realName:"" |
||||
|
}; |
||||
|
}, |
||||
|
components:{eventInfo}, |
||||
|
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() { |
||||
|
console.log(this.$store.state.user,"dslk;djklsg;ljk"); |
||||
|
this.realName = this.$store.state.user.realName; |
||||
|
this.phone = this.$store.state.user.phone; |
||||
|
this.user = this.$store.state.user; |
||||
|
this.agencyId = this.user.agencyId; |
||||
|
this.getCanvas() |
||||
|
this.getOrgTreeList() |
||||
|
this.getGridList() |
||||
|
this.getTableData(); |
||||
|
this.getCateOptions(); |
||||
|
}, |
||||
|
methods: { |
||||
|
getCanvas() { |
||||
|
var canvas = document.getElementById('watermarkCanvas'); |
||||
|
var ctx = canvas.getContext('2d'); |
||||
|
canvas.width = window.innerWidth ; // 设置更高的分辨率 |
||||
|
canvas.height = window.innerHeight ; |
||||
|
var watermarkText = this.realName+ this.phone; //内容 |
||||
|
ctx.font = '12px Arial'; //大小 |
||||
|
ctx.fillStyle = 'rgba(0, 0, 255, 0.2)'; //颜色+透明度 |
||||
|
// ctx.textBaseline = 'middle'; |
||||
|
ctx.scale(2, 2); // 缩放上下文以适应更高分辨率 |
||||
|
var angle = -30 * Math.PI / 180; // 旋转-30度 |
||||
|
var x = canvas.width / 2; |
||||
|
var y = canvas.height / 2; |
||||
|
var space = 150; // 水印间距 |
||||
|
for (var i = 0; i < canvas.width; i += space) { |
||||
|
for (var j = 0; j < canvas.height; j += space) { |
||||
|
ctx.save(); |
||||
|
ctx.translate(i, j); |
||||
|
ctx.rotate(angle); |
||||
|
ctx.fillText(watermarkText, 0, 0); |
||||
|
ctx.restore(); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
async handleDel(rowData) { |
||||
|
let message = "确认删除?"; |
||||
|
this.$confirm(message, "提示", { |
||||
|
confirmButtonText: "确定", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}).then(() => { |
||||
|
this.delEvent(rowData.icEventId); |
||||
|
}).catch((err) => { }); |
||||
|
}, |
||||
|
async delEvent(eventId) { |
||||
|
let parm = { |
||||
|
eventId:eventId |
||||
|
} |
||||
|
let url = '/governance/icEvent/deleteIcEventAndReply' |
||||
|
let {code} = await requestPost(url,parm) |
||||
|
if(code === 0){ |
||||
|
this.$message.success('已删除') |
||||
|
this.getTableData(); |
||||
|
} |
||||
|
}, |
||||
|
handleSelectionChange(val) { |
||||
|
this.multipleSelection = []; |
||||
|
val.forEach((element) => { |
||||
|
this.multipleSelection.push(element.icEventId); |
||||
|
}); |
||||
|
}, |
||||
|
getFontColor(operationType){ |
||||
|
if(operationType=='11'){ |
||||
|
return '#09af44' |
||||
|
}else if(operationType=='13'){ |
||||
|
return '#FF0000' |
||||
|
}else{ |
||||
|
return '#000000' |
||||
|
} |
||||
|
}, |
||||
|
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) { |
||||
|
console.log(val,"skjhfjbhjksdh"); |
||||
|
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/icEventConfig/downloadDataPower"; |
||||
|
let params = { |
||||
|
orgId:this.agencyId |
||||
|
}; |
||||
|
const { data, code, msg } = await requestGet(url, params); |
||||
|
console.log(data,"sdfklk;sfdk"); |
||||
|
if(data){ |
||||
|
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("网络错误"); |
||||
|
}); |
||||
|
}else{ |
||||
|
this.$message.error('暂无权限'); |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
async handleAdd() { |
||||
|
this.pageType = "add"; |
||||
|
}, |
||||
|
|
||||
|
async handleWatch(row) { |
||||
|
console.log("row",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,type) { |
||||
|
console.log(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 = type; |
||||
|
} else { |
||||
|
this.$message.error(msg); |
||||
|
} |
||||
|
}, |
||||
|
//下载模版 |
||||
|
async handleExportModule() { |
||||
|
let url = '/governance/icEvent/downloadTemplate'; |
||||
|
let params = {}; |
||||
|
await this.$http({ |
||||
|
method: 'POST', |
||||
|
url, |
||||
|
responseType: 'blob', |
||||
|
data: params |
||||
|
}) |
||||
|
.then(res => { |
||||
|
if (res.headers['content-disposition']) { |
||||
|
let fileName = window.decodeURI(res.headers['content-disposition'].split(';')[1].split('=')[1]); |
||||
|
let blob = new Blob([res.data], { |
||||
|
type: 'application/vnd.ms-excel' |
||||
|
}); |
||||
|
var url = window.URL.createObjectURL(blob); |
||||
|
var aLink = document.createElement('a'); |
||||
|
aLink.style.display = 'none'; |
||||
|
aLink.href = url; |
||||
|
aLink.setAttribute('download', fileName); |
||||
|
document.body.appendChild(aLink); |
||||
|
aLink.click(); |
||||
|
document.body.removeChild(aLink); //下载完成移除元素 |
||||
|
window.URL.revokeObjectURL(url); //释放掉blob对象 |
||||
|
} else this.$message.error('下载失败'); |
||||
|
}) |
||||
|
.catch(err => { |
||||
|
console.log('err', err); |
||||
|
return this.$message.error('网络错误'); |
||||
|
}); |
||||
|
}, |
||||
|
handleExcelSuccess(res, file) { |
||||
|
if (!res.code === 0 && !res.msg === 'success') { |
||||
|
this.$message.error(res.msg); |
||||
|
} |
||||
|
}, |
||||
|
handleProgress(event, file, fileList) { |
||||
|
|
||||
|
}, |
||||
|
beforeExcelUpload(file) { |
||||
|
const isType = file.type === 'application/vnd.ms-excel'; |
||||
|
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; |
||||
|
const fileType = isType || isTypeComputer; |
||||
|
const isLt1M = file.size / 1024 / 1024 < 10; |
||||
|
if (!fileType) { |
||||
|
this.$message.error('上传文件只能是xls/xlsx格式!'); |
||||
|
} |
||||
|
|
||||
|
if (!isLt1M) { |
||||
|
this.$message.error('上传文件大小不能超过 10MB!'); |
||||
|
} |
||||
|
return fileType && isLt1M; |
||||
|
}, |
||||
|
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 |
||||
|
// } |
||||
|
console.log(this.formData); |
||||
|
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/agencyGridDepttree', {}) |
||||
|
.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('网络错误') |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
handleChangeAgency(val) { |
||||
|
this.sarr = [] |
||||
|
const map = new Map(); |
||||
|
this.getLastItem( |
||||
|
this.orgOptions, |
||||
|
val, |
||||
|
"agencyId" |
||||
|
); |
||||
|
this.level = this.sarr[this.sarr.length - 1].level |
||||
|
this.formData.departId = this.sarr[this.sarr.length - 1].agencyId |
||||
|
}, |
||||
|
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"; |
||||
|
|
||||
|
.m-search { |
||||
|
.u-item-width-normal { |
||||
|
width: 200px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
::v-deep .el-dropdown__caret-button { |
||||
|
height: 30px; |
||||
|
} |
||||
|
|
||||
|
::v-deep .el-image-viewer__close { |
||||
|
top: 129px; |
||||
|
right: 129px; |
||||
|
width: 40px; |
||||
|
height: 40px; |
||||
|
font-size: 40px; |
||||
|
color: #fff; |
||||
|
} |
||||
|
.canvas { |
||||
|
|
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
z-index: 10; |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
left: 0; |
||||
|
pointer-events: none; |
||||
|
/* 确保canvas不干扰其他元素 */ |
||||
|
} |
||||
|
</style> |
Loading…
Reference in new issue