6 changed files with 1312 additions and 155 deletions
@ -0,0 +1,941 @@ |
|||
<template> |
|||
<div class="g-main"> |
|||
<div v-show="pageType == 'list'"> |
|||
<div class="m-search"> |
|||
<el-form :inline="true" :model="formData" ref="ref_searchform" :label-width="'120px'"> |
|||
<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> |
|||
<el-form-item label="征集领域" prop="typeCode" > |
|||
<el-select v-model="formData.typeCode" placeholder="请选择" class="u-item-width-normal"> |
|||
<el-option v-for="item in SpecialList" :key="item.value" :label="item.label" clearable |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="意见标题" prop="subjectTitle"> |
|||
<el-input v-model.trim="formData.subjectTitle" class="u-item-width-normal" size="small" |
|||
clearable placeholder="请输入"> |
|||
</el-input> |
|||
</el-form-item> |
|||
<el-form-item label="提交人姓名" prop="name"> |
|||
<el-input v-model.trim="formData.name" class="u-item-width-normal" size="small" clearable |
|||
placeholder="请输入"> |
|||
</el-input> |
|||
</el-form-item> |
|||
<el-form-item label="报件人电话" prop="mobile"> |
|||
<el-input v-model.trim="formData.mobile" class="u-item-width-normal" size="small" clearable |
|||
placeholder="请输入"> |
|||
</el-input> |
|||
</el-form-item> |
|||
<el-form-item label="是否愿意公开" prop="openFlag"> |
|||
<el-select v-model.trim="formData.openFlag" clearable class="u-item-width-normal"> |
|||
<el-option v-for="item in openList" :key="item.value" :label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="是否设为金点子" prop="goldenIdeaFlag"> |
|||
<el-select v-model.trim="formData.goldenIdeaFlag" clearable class="u-item-width-normal"> |
|||
<el-option v-for="item in goldListType" :key="item.value" :label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
|
|||
<el-form-item label="提交时间" prop="startSubmitTime"> |
|||
<el-date-picker v-model.trim="formData.startSubmitTime" 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.endSubmitTime" |
|||
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> |
|||
|
|||
</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="agencyName" align="center" label="所属组织" :show-overflow-tooltip="true"> |
|||
</el-table-column> |
|||
<el-table-column prop="typeCode" 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="subjectTitle" 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> |
|||
<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="提交人电话"> |
|||
<!-- <template slot-scope="scope"> |
|||
<el-button |
|||
v-if="scope.row.reportUserId !== null && scope.row.reportUserId !== ''" |
|||
@click="handleLook(scope.row)" |
|||
type="text" |
|||
size="small" |
|||
> |
|||
{{ scope.row.phone }} |
|||
</el-button> |
|||
<span v-else> |
|||
{{ scope.row.phone }} |
|||
</span> |
|||
</template> --> |
|||
</el-table-column> |
|||
<el-table-column prop="openFlag" align="center" width="110" label="是否愿意公开" |
|||
:show-overflow-tooltip="true"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="scope.row.openFlag === 0" style="color: #ff6600;">否</span> |
|||
<span v-else-if="scope.row.openFlag ===1">是</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="goldenIdeaFlag" align="center" width="110" label="是否金点子建议" |
|||
:show-overflow-tooltip="true"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="scope.row.goldenIdeaFlag === 0" style="color: #ff6600;">否</span> |
|||
<span v-else-if="scope.row.goldenIdeaFlag ===1">是</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="submitTime" align="center" width="110" label="提交时间" |
|||
:show-overflow-tooltip="true"> |
|||
</el-table-column> |
|||
<el-table-column fixed="right" label="操作" align="center" width="200px" prop="status"> |
|||
<template slot-scope="scope"> |
|||
<el-button @click="handleDispose(scope.row,'dispose')" type="text" size="small" |
|||
>办理</el-button> |
|||
<el-button @click="handleDispose(scope.row,'info')" 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> |
|||
<el-dialog :title="'催办'" :visible.sync="showSupervise" width="40%" top="5vh" append-to-body class="dialog-h" |
|||
:close-on-click-modal="false"> |
|||
<el-form :model="superviseFrom" ref="superviseFrom"> |
|||
<el-form-item label="催办说明" prop="content"> |
|||
<el-input v-model.trim="superviseFrom.content" class="cell-width-2" type="textarea" maxlength="500" |
|||
show-word-limit :rows="5" placeholder="请填写催办说明,不超过500字"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="showSupervise = false">取 消</el-button> |
|||
<el-button type="primary" @click="doSuperviseEvent">确 定</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 "../../peopleOpinons/cpts/eventInfo.vue"; |
|||
import axios from "axios"; |
|||
|
|||
export default { |
|||
props: { |
|||
message: { |
|||
type: String, |
|||
required: true |
|||
}, |
|||
optionDate: { |
|||
type: Object, |
|||
required: true |
|||
} |
|||
}, |
|||
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; |
|||
}; |
|||
|
|||
let orgOptionProps = { |
|||
emitPath: false, |
|||
multiple: false, |
|||
value: 'agencyId', |
|||
label: 'agencyName', |
|||
children: 'subAgencyList', |
|||
checkStrictly: true |
|||
} |
|||
|
|||
return { |
|||
pageType: "list", // 列表list 新增add 处理dispose 详情info |
|||
user: {}, |
|||
agencyId: "", |
|||
gridList: [], //所属网格list--场所区域 |
|||
tableData: [], |
|||
online: 0, |
|||
orgOptions: [], |
|||
orgOptionProps, |
|||
level: '', |
|||
optionsG: [], |
|||
sarr: [], |
|||
openList:[ |
|||
{ |
|||
value: 0, |
|||
label: "已催办", |
|||
}, |
|||
{ |
|||
value: 1, |
|||
label: "未催办", |
|||
}, |
|||
], |
|||
statusArray: [ |
|||
{ |
|||
value: "processing", |
|||
label: "处理中", |
|||
}, |
|||
{ |
|||
value: "closed_case", |
|||
label: "已完成", |
|||
}, |
|||
], |
|||
Publicvoting:[ |
|||
{ |
|||
value: 0, |
|||
label: "否", |
|||
}, |
|||
{ |
|||
value: 1, |
|||
label: "是", |
|||
}, |
|||
], |
|||
statusArray: [ |
|||
{ |
|||
value: "processing", |
|||
label: "处理中", |
|||
}, |
|||
{ |
|||
value: "closed_case", |
|||
label: "已完成", |
|||
}, |
|||
], |
|||
|
|||
typeArray: [ |
|||
{ |
|||
value: "1", |
|||
label: "难点痛点", |
|||
}, |
|||
{ |
|||
value: "2", |
|||
label: "矛盾纠纷", |
|||
}, |
|||
{ |
|||
value: "3", |
|||
label: "自身问题", |
|||
}, |
|||
{ |
|||
value: "4", |
|||
label: "超出服务范围", |
|||
}, |
|||
], |
|||
|
|||
overPeriodArray: [ |
|||
{ |
|||
value: "0", |
|||
label: "2天以下", |
|||
}, |
|||
{ |
|||
value: "1", |
|||
label: "3-4天", |
|||
}, |
|||
{ |
|||
value: "2", |
|||
label: "4天以上", |
|||
}, |
|||
], |
|||
|
|||
qudaoArray: [ |
|||
{ |
|||
value: "0", |
|||
label: "综治网格事件", |
|||
}, |
|||
{ |
|||
value: "1", |
|||
label: "诚心办事件", |
|||
}, |
|||
{ |
|||
value: "2", |
|||
label: "城管事件", |
|||
}, |
|||
{ |
|||
value: "3", |
|||
label: "信访事件", |
|||
} |
|||
], |
|||
keyProblemList:[ |
|||
{label:'违章拉客',value:'0'}, |
|||
{label:'违章停车',value:'1'} |
|||
], |
|||
formData: { |
|||
openFlag:"", |
|||
publicationPeople:"", |
|||
typeCode:"", |
|||
demandType: "", |
|||
name: "", |
|||
mobile: "", |
|||
eventContent: "", |
|||
operationType: 4, |
|||
openFlag: "", |
|||
specialSubjectId: "", |
|||
subjectTitle: "", |
|||
goldenIdeaFlag: "", |
|||
agencyId: "", |
|||
clientType: "web", |
|||
startSubmitTime:"", |
|||
endSubmitTime:"" |
|||
}, |
|||
openList:[ |
|||
{ |
|||
value: 0, |
|||
label: "否", |
|||
}, |
|||
{ |
|||
value: 1, |
|||
label: "是", |
|||
}, |
|||
], |
|||
goldListType:[ |
|||
{ |
|||
value: 0, |
|||
label: "否", |
|||
}, |
|||
{ |
|||
value: 1, |
|||
label: "是", |
|||
}, |
|||
], |
|||
cateOptions: [], |
|||
optionProps: { |
|||
multiple: true, |
|||
checkStrictly: false, |
|||
emitPath: false, |
|||
children: 'children', |
|||
label: 'categoryName', |
|||
value: 'id', |
|||
}, |
|||
eventTypeCheck: [], |
|||
pageNo: 1, |
|||
pageSize: window.localStorage.getItem("pageSize") || 20, |
|||
total: 1, |
|||
endPickerOptions: { |
|||
disabledDate: endDisabledDate, |
|||
}, |
|||
startPickerOptions: { |
|||
disabledDate: startDisabledDate, |
|||
}, |
|||
eventId: "", |
|||
|
|||
searchH: 180, |
|||
SpecialList:[], |
|||
eventDetailData: {}, |
|||
|
|||
showVoice: false, |
|||
showSupervise: false, |
|||
selVoiceUrl: "", |
|||
|
|||
multipleSelection: [], |
|||
|
|||
superviseFrom:{ |
|||
content: "", |
|||
}, |
|||
}; |
|||
}, |
|||
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"; |
|||
} |
|||
}, |
|||
}, |
|||
mounted() { |
|||
console.log(this.optionDate.id,"sdflkjsdlkfjkls"); |
|||
this.formData.specialSubjectId=this.optionDate.id |
|||
console.log(this.formData.specialSubjectId,"sdglk;jsdljgk"); |
|||
|
|||
this.user = this.$store.state.user; |
|||
this.formData.agencyId = this.user.agencyId; |
|||
this.getOrgTreeList() |
|||
// this.getGridList() |
|||
this.getTableData(); |
|||
this.getCateOptions(); |
|||
this.getSpecialList() |
|||
}, |
|||
methods: { |
|||
//获取征集领域字典 |
|||
async getSpecialList() { |
|||
const url = "/sys/dict/data/dictlist"; |
|||
|
|||
const { data, code, msg } = await requestPost(url, { |
|||
dictType: "solicitation_fields", |
|||
}); |
|||
|
|||
if (code === 0) { |
|||
this.SpecialList = data || []; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
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); |
|||
}); |
|||
}, |
|||
|
|||
tableRowClassName({ row }) { |
|||
switch (row.overPeriod) { |
|||
case '0': |
|||
return 'row-over-period-0'; |
|||
case '1': |
|||
return 'row-over-period-1'; |
|||
case '2': |
|||
return 'row-over-period-2'; |
|||
default: |
|||
return 'row-default'; |
|||
} |
|||
}, |
|||
|
|||
// 查看 |
|||
handleLook(row) { |
|||
let { name,reportUserId } = row |
|||
const resiId = reportUserId; |
|||
this.$store.dispatch('saveData', { 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 handleMarkDiffcult(command) { |
|||
const url = "/governance/icEventOld/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/icEventOld/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); |
|||
} |
|||
}, |
|||
async handleSuperviseEvent(){ |
|||
this.showSupervise = true; |
|||
}, |
|||
|
|||
async doSuperviseEvent() { |
|||
const url = "/governance/icEventOld/doSuperviseEvent"; |
|||
if (this.multipleSelection.length == 0) { |
|||
this.$message.warning('请选择催办的事件') |
|||
return |
|||
} |
|||
let params = { |
|||
icEventIdList: this.multipleSelection, |
|||
content: this.superviseFrom.content, |
|||
operationType:21 // 21:催办 |
|||
}; |
|||
const { data, code, msg } = await requestPost(url, params); |
|||
if (code === 0) { |
|||
this.$message.success("催办成功"); |
|||
this.getTableData(); |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
this.showSupervise = false; |
|||
}, |
|||
|
|||
handleSearch(val) { |
|||
this.pageNo = 1; |
|||
this.getTableData(); |
|||
}, |
|||
|
|||
async loadGrid() { |
|||
const url = "/gov/org/customergrid/gridoption"; |
|||
let params = { |
|||
agencyId: this.agencyId, |
|||
purpose: "query", |
|||
}; |
|||
|
|||
const { data, code, msg } = await requestPost(url, params); |
|||
|
|||
if (code === 0) { |
|||
this.gridList = data; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
|
|||
async handleExport() { |
|||
const url = "/governance/icEventOld/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; |
|||
const url = "/governance/icEventOld/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) { |
|||
// this.eventDetailData = { ...data }; |
|||
// this.pageType = type |
|||
this.eventId = row.icEventId; |
|||
const url = "/governance/icEventOld/detail"; |
|||
const { data, code, msg } = await requestPost(url, { |
|||
icEventId: this.eventId, |
|||
specialSubjectId:this.formData.specialSubjectId |
|||
}); |
|||
if (code === 0) { |
|||
this.eventDetailData = { ...data }; |
|||
this.pageType = type |
|||
; |
|||
} 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 handleVote(row){ |
|||
const url = "/governance/icEventOld/updateSpecialColumn"; |
|||
let params = { |
|||
icEventId:row.icEventId, |
|||
openFlag:row.openFlag==1?0:1, |
|||
} |
|||
const { data, code, msg } = await requestPost(url, params); |
|||
|
|||
if (code === 0) { |
|||
this.$message.success("操作成功!"); |
|||
this.getTableData(); |
|||
} else { |
|||
this.$message.error("操作失败!"); |
|||
} |
|||
}, |
|||
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/icEventOld/delete"; |
|||
let idsArr = [eventId]; |
|||
const { data, code, msg } = await requestPost(url, idsArr); |
|||
if (code === 0) { |
|||
this.$message.success("删除成功!"); |
|||
this.getTableData(); |
|||
} else { |
|||
this.$message.error("操作失败!"); |
|||
} |
|||
}, |
|||
|
|||
async getTableData() { |
|||
const url = "/governance/icEventOld/ideaList"; |
|||
console.log(this.formData,"formData"); |
|||
// if (this.eventTypeCheck) { |
|||
// this.formData.secondIdList = this.eventTypeCheck |
|||
// } |
|||
// // 处理 agencyId |
|||
// if (Array.isArray(this.formData.agencyId) && this.formData.agencyId.length) { |
|||
// if(this.level=="grid"){ |
|||
// this.formData.gridId = this.formData.agencyId[this.formData.agencyId.length - 1]; |
|||
// this.formData.agencyId = ""; |
|||
// }else{ |
|||
// this.formData.agencyId = this.formData.agencyId[this.formData.agencyId.length - 1]; |
|||
// this.formData.gridId = ""; |
|||
// } |
|||
// } else { |
|||
// this.formData.agencyId = ""; |
|||
// this.formData.gridId = ""; |
|||
// } |
|||
|
|||
const { pageSize, pageNo, formData } = this; |
|||
const { data, code, msg } = await requestPost(url, { |
|||
pageSize, |
|||
pageNo, |
|||
...formData, |
|||
}); |
|||
if (code === 0) { |
|||
this.total = data.total || 0; |
|||
this.tableData = data.list |
|||
? data.list.map((item) => { |
|||
return item; |
|||
}) |
|||
: []; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
async getCateOptions() { |
|||
const url = '/governance/icEvent/getCategoryTree'; |
|||
let params = {}; |
|||
const { data, code, msg } = await requestPost(url, params); |
|||
if (code === 0) { |
|||
let treeDataNew = this.deepTree(data, "children"); |
|||
//组织级联数据 |
|||
++this.iscascaderShow; |
|||
this.cateOptions = []; |
|||
this.cateOptions = treeDataNew; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
if (this.eventDetailCopy.parentCategoryId) { |
|||
const pids = this.eventDetailCopy.parentCategoryId.split(','); |
|||
pids.push(this.eventDetailCopy.categoryId); |
|||
let nodes = this.cateOptions; |
|||
for (let i = 0; i < pids.length; i++) { |
|||
nodes = this.buildNode(nodes, pids[i]) |
|||
} |
|||
if (nodes) { |
|||
this.formData.categoryList.push(nodes) |
|||
} |
|||
} |
|||
}, |
|||
buildNode(nodes, treeId) { |
|||
for (let i = 0; i < nodes.length; i++) { |
|||
if (nodes[i].id === treeId) { |
|||
if (nodes[i].children) { |
|||
return nodes[i].children |
|||
} else { |
|||
return nodes[i] |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
handleSizeChange(val) { |
|||
this.pageSize = val; |
|||
window.localStorage.setItem("pageSize", val); |
|||
this.getTableData(); |
|||
}, |
|||
handleCurrentChange(val) { |
|||
this.pageNo = val; |
|||
this.getTableData(); |
|||
}, |
|||
resetSearch() { |
|||
this.formData = { |
|||
agencyId: "", |
|||
gridId: "", |
|||
sourceType: "", |
|||
eventContent: "", |
|||
name: "", |
|||
mobile: "", |
|||
startTime: "", |
|||
endTime: "", |
|||
status: "", |
|||
firstIdList: [], |
|||
secondIdList: [], |
|||
keyProblem:'', |
|||
}; |
|||
this.eventTypeCheck = []; |
|||
|
|||
this.pageNo = 1; |
|||
this.getTableData(); |
|||
// this.loadTable() |
|||
}, |
|||
|
|||
|
|||
getOrgTreeList () { |
|||
this.$http |
|||
.post('/gov/org/customeragency/agencygridtree', {}) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
|
|||
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 { |
|||
|
|||
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 |
|||
}, |
|||
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); |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
|
|||
//重构树,去除网格 |
|||
deepTree(arr, children) { |
|||
if (Array.isArray(arr) && arr.length > 0) { |
|||
return arr.map((item) => { |
|||
return { |
|||
...item, |
|||
[children]: |
|||
(item[children] && |
|||
item[children].length > 0 && |
|||
this.deepTree(item[children], children)) || |
|||
null, |
|||
}; |
|||
}); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
@import "@/assets/scss/modules/management/list-main.scss"; |
|||
|
|||
.m-search { |
|||
.u-item-width-normal { |
|||
width: 200px; |
|||
} |
|||
} |
|||
|
|||
::v-deep .el-dropdown__caret-button { |
|||
height: 30px; |
|||
} |
|||
|
|||
::v-deep .el-image-viewer__close { |
|||
top: 129px; |
|||
right: 129px; |
|||
width: 40px; |
|||
height: 40px; |
|||
font-size: 40px; |
|||
color: #fff; |
|||
} |
|||
</style> |
|||
|
|||
<style> |
|||
.row-over-period-0 { |
|||
background-color: #ffffe0 !important; /* 淡黄色 */ |
|||
} |
|||
.row-over-period-1 { |
|||
background-color: #ffebcd !important; /* 淡橙色 */ |
|||
} |
|||
.row-over-period-2 { |
|||
background-color: #ffc0cb !important; /* 淡红色 */ |
|||
} |
|||
.row-default { |
|||
background-color: #e0ffe0 !important; /* 淡绿色 */ |
|||
} |
|||
</style> |
Loading…
Reference in new issue