Files
cmanager/src/views/manage/superviseComplaintInfo/index.vue

272 lines
6.4 KiB
Vue
Raw Normal View History

2024-03-05 18:26:05 +08:00
<template>
<basic-container>
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
:page.sync="page"
ref="crud"
@search-change="searchChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@search-reset="searchReset"
@on-load="onLoad"
>
2024-05-06 16:28:21 +08:00
<template slot-scope="{ row }" slot="menu">
<el-button
type="text"
size="small"
@click.stop="updateRow(row)"
><i class="el-icon-share"></i>处理
</el-button>
</template>
2024-03-05 18:26:05 +08:00
</avue-crud>
</basic-container>
</template>
<script>
import {dateFormat} from '@/util/date'
import Tinymce from "@/components/Tinymce";
2024-05-06 16:28:21 +08:00
import {getList, getInfo, updateSuperviseComplaintInfo} from '@/api/manage/superviseComplaintInfo'
2024-04-28 22:18:03 +08:00
const initPages = {
pageSize: 10,
currentPage: 1,
total: 100,
}
2024-03-05 18:26:05 +08:00
const classEnum = {
2024-04-28 22:18:03 +08:00
"1": '一般投诉',
"2": '较难投诉',
"3": '困难投诉',
"4": '特殊投诉',
}
const classIsDeleted = {
0: '否',
1: '是',
}
const classStatus = {
2024-04-29 21:40:01 +08:00
0: '未处理',
1: '已处理',
2024-04-28 22:18:03 +08:00
2: '关闭'
2024-03-05 18:26:05 +08:00
}
const classEnumList = Object.keys(classEnum).map((item) => ({
2024-04-28 22:18:03 +08:00
label: classEnum[item], value: item
}))
const classEnumDeleted = Object.keys(classIsDeleted).map((item) => ({
label: classIsDeleted[item], value: Number(item)
}))
const classEnumStatus = Object.keys(classStatus).map((item) => ({
label: classStatus[item], value: Number(item)
2024-03-05 18:26:05 +08:00
}))
const columnList = [
{
label: "投诉标题",
prop: "complaintTitle",
2024-04-28 22:18:03 +08:00
search: true
2024-03-05 18:26:05 +08:00
},
{
label: "投诉对象",
prop: "complaintObject",
2024-04-28 22:18:03 +08:00
search: true
2024-03-05 18:26:05 +08:00
},
{
label: "联系方式",
prop: "complaintPhone",
2024-04-28 22:18:03 +08:00
search: true
2024-03-05 18:26:05 +08:00
},
{
label: "投诉类型",
prop: "complaintType",
2024-04-28 22:18:03 +08:00
type: "select",
dataType: "number",
2024-03-05 18:26:05 +08:00
dicData: classEnumList,
2024-04-28 22:18:03 +08:00
display: false,
search: true
},
{
label: "是否处理",
prop: "status",
type: "select",
dicData: classEnumStatus,
search: true,
},
2024-05-06 16:28:21 +08:00
{
label: "处置情况",
prop: "disposalSituation",
search: true,
},
2024-03-05 18:26:05 +08:00
{
label: "创建时间",
prop: "complaintTime",
2024-04-28 22:18:03 +08:00
type: 'datetime',
searchSpan: 8,
searchRange: true,
2024-03-05 18:26:05 +08:00
}
]
const rules = {
name: [
2024-04-28 22:18:03 +08:00
{required: true, message: '请输入内容标题', trigger: 'blur'}
2024-03-05 18:26:05 +08:00
],
type: [
2024-04-28 22:18:03 +08:00
{required: true, message: '请选择分类', trigger: 'blur'}
2024-03-05 18:26:05 +08:00
],
content: [
2024-04-28 22:18:03 +08:00
{required: true, message: '请输入内容', trigger: 'blur'}
2024-03-05 18:26:05 +08:00
],
}
export default {
name: "index",
components: {
Tinymce
},
2024-04-28 22:18:03 +08:00
created() {
// this.seeDetail({id: '1783485236359442433'})
2024-03-05 18:26:05 +08:00
},
2024-04-28 22:18:03 +08:00
data() {
2024-03-05 18:26:05 +08:00
return {
applTime: '',
2024-04-28 22:18:03 +08:00
loading: false,
viewDrawer: false,
2024-03-05 18:26:05 +08:00
drawerTitle: '新增内容',
formOption: {},
query: {},
rules: Object.assign({}, rules),
2024-04-28 22:18:03 +08:00
data: [],
lookData: {},
classEnum,
page: Object.assign({}, initPages),
}
},
computed: {
option() {
return {
2024-03-05 18:26:05 +08:00
height: "auto",
tip: false,
searchShow: true,
searchMenuSpan: 6,
border: true,
index: true,
indexLabel: "序号",
selection: false,
2024-04-28 22:18:03 +08:00
viewBtn: true,
2024-03-05 18:26:05 +08:00
addBtn: false,
2024-04-28 22:18:03 +08:00
editBtn: false,
2024-03-05 18:26:05 +08:00
delBtn: false,
columnBtn: false,
2024-04-28 22:18:03 +08:00
menuWidth: 140,
2024-03-05 18:26:05 +08:00
labelWidth: 151,
dialogClickModal: false,
dialogType: "drawer",
dialogFullscreen: true,
column: columnList,
2024-04-28 22:18:03 +08:00
}
2024-03-05 18:26:05 +08:00
}
},
methods: {
dateFormat,
2024-05-06 16:28:21 +08:00
updateRow(row) {
const _this = this
let h = this.$createElement;
this.$prompt("回复处理", // "请核对信息后",
{
distinguishCancelAndClose: true,
confirmButtonText: "完 成",
cancelButtonText: "取 消",
center: true,
inputType: "textarea",
inputPlaceholder: "处理内容",
beforeClose: async function (action, instance, done) {
if (action === 'confirm') {
const disposalSituation = instance.inputValue
if (!disposalSituation) {
this.$message({type: "info", message: "请输入处理内容"});
} else {
let resData = await updateSuperviseComplaintInfo({id: row.id, disposalSituation, status: 1})
if (resData.data.code === 200) {
this.$message({type: "success", message: "操作成功"});
done()
_this.onLoad();
}
}
} else {
done()
}
}
}
)
},
2024-03-05 18:26:05 +08:00
resetForm(formName) {
this.$refs[formName].resetFields();
this.viewDrawer = false
},
searchReset() {
this.query = {};
2024-04-28 22:18:03 +08:00
this.onLoad();
2024-03-05 18:26:05 +08:00
},
2024-04-28 22:18:03 +08:00
searchChange(params, done) {
2024-03-05 18:26:05 +08:00
console.log(params);
if (params.applTime) {
var val = JSON.parse(JSON.stringify(params.applTime))
params.applTimeStart = val[0] + " 00:00:00";
params.applTimeEnd = val[1] + " 23:59:59";
delete params.applTime
}
this.query = params;
console.log(this.query);
this.page.currentPage = 1;
2024-04-28 22:18:03 +08:00
this.onLoad();
2024-03-05 18:26:05 +08:00
done();
},
currentChange(val) {
this.page.currentPage = val
},
sizeChange(val) {
this.page.currentPage = 1
this.page.pageSize = val
},
2024-04-28 22:18:03 +08:00
refreshChange() {
2024-03-05 18:26:05 +08:00
this.page.currentPage = 1;
2024-04-28 22:18:03 +08:00
this.onLoad()
},
/* 表格方法 */
onLoad() {
return new Promise(async (resolve, reject) => {
this.loading = true;
let params = {
current: this.page.currentPage,
size: this.page.pageSize,
...this.query,
}
let resData = await getList(params)
if (resData.data.code === 200) {
const {current, records, total, size} = resData.data.data
this.data = records;
this.page.total = total;
this.loading = false;
}
resolve()
})
},
seeDetail(row) {
return new Promise(async (resolve, reject) => {
let params = {
id: row.id
}
let resData = await getInfo(params)
if (resData.data.code === 200) {
this.drawerTitle = '查看'
this.lookData = JSON.parse(JSON.stringify(resData.data.data))
this.formOption = JSON.parse(JSON.stringify(resData.data.data))
this.viewDrawer = true
}
})
2024-03-05 18:26:05 +08:00
}
}
}
</script>
<style scoped>
</style>