Commit ce8115da authored by 高宇's avatar 高宇

会员权益

parent dee08c22
import request from '@/utils/request'
// 分页查询投诉建议列表
export function getComplaintList(params) {
return request({
url: '/system/ComplaintSuggestion/selectComplaintInfoByPagination',
method: 'get',
params
})
}
// 根据id查询详情
export function getComplaintDetailById(id) {
return request({
url: '/system/ComplaintSuggestion/detail/' + id,
method: 'get'
})
}
// 处理投诉建议
export function handleComplaint(data) {
return request({
url: '/system/ComplaintSuggestion/update',
method: 'put',
data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
......@@ -3,15 +3,15 @@
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true" label-width="68px">
<el-form-item prop="flag">
<el-select
v-model="queryParams.flag"
v-model="queryParams.type"
placeholder="投诉类型"
clearable
size="small"
style="width: 200px"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
v-for="(dict,index) in dictList"
:key="index"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
......@@ -19,7 +19,7 @@
</el-form-item>
<el-form-item prop="dictName">
<el-input
v-model="queryParams.dictName"
v-model="queryParams.complainant"
placeholder="投诉人"
clearable
:maxlength="30"
......@@ -30,7 +30,7 @@
</el-form-item>
<el-form-item prop="flag">
<el-select
v-model="queryParams.flag"
v-model="queryParams.status"
placeholder="处理状态"
clearable
size="small"
......@@ -54,6 +54,7 @@
range-separator="-"
start-placeholder="处理开始时间"
end-placeholder="处理截止时间"
@change="handleTimeChange"
/>
</el-form-item>
<el-form-item>
......@@ -77,13 +78,12 @@
</el-table-column>
<el-table-column label="投诉类型" prop="type" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.type === 0">商家</span>
<span v-if="scope.row.type === 1">APP</span>
<span>{{ replaceType(scope.row.type) }}</span>
</template>
</el-table-column>
<el-table-column label="投诉人" prop="createBy" :show-overflow-tooltip="true">
<el-table-column label="投诉人" prop="complainant" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.createBy || '-' }}
{{ scope.row.complainant || '-' }}
</template>
</el-table-column>
<el-table-column label="处理状态" align="center" prop="status">
......@@ -97,9 +97,9 @@
{{ scope.row.phone || '-' }}
</template>
</el-table-column>
<el-table-column label="投诉时间" prop="complaintTime" :show-overflow-tooltip="true">
<el-table-column label="投诉时间" prop="createTime" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.complaintTime || '-' }}
{{ replaceTime(scope.row.createTime) || '-' }}
</template>
</el-table-column>
<el-table-column label="处理时间" prop="dealTime" :show-overflow-tooltip="true">
......@@ -134,7 +134,7 @@
@pagination="getList"
/>
<!-- 处理对话框 -->
<el-dialog title="处理" :visible.sync="open" width="779px" append-to-body @close="reset">
<el-dialog title="处理" :close-on-click-modal="false" :visible.sync="open" width="779px" append-to-body @close="reset">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="处理结果">
<el-select
......@@ -153,8 +153,8 @@
/>
</el-select>
</el-form-item>
<el-form-item label="处理内容" prop="dictType">
<el-input v-model.trim="form.dictType" type="textarea" :rows="5" :maxlength="30" placeholder="请输入处理内容" />
<el-form-item label="处理内容" prop="dealResult">
<el-input v-model.trim="form.dealResult" type="textarea" :rows="5" :maxlength="30" placeholder="请输入处理内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -169,14 +169,13 @@
<span>{{ complaintsDetail.title || '-' }}</span>
</el-form-item>
<el-form-item label="投诉类型">
<span v-if="complaintsDetail.type === 0">商家</span>
<span v-if="complaintsDetail.type === 1">APP</span>
<span>{{ replaceTypes(complaintsDetail.type) }}</span>
</el-form-item>
<el-form-item label="投诉内容">
<span>{{ complaintsDetail.details || '-' }}</span>
</el-form-item>
<el-form-item label="投诉人">
<span>{{ complaintsDetail.createBy || '-' }}</span>
<span>{{ complaintsDetail.complainant || '-' }}</span>
</el-form-item>
<el-form-item label="联系方式">
<span>{{ complaintsDetail.phone || '-' }}</span>
......@@ -187,22 +186,22 @@
</template>
<script>
import { listType,
getType,
import { getComplaintList, getComplaintDetailById, handleComplaint } from '@/api/complaint/complaint'
import {
delType,
addType,
updateType,
exportType,
clearCache
} from '@/api/system/dict/type'
import dictCons from '@/utils/dictCons'
import Template from '@/views/instance/Template'
import { getDicts } from '@/api/system/dict/data'
import { parseTime } from '@/utils'
export default {
name: 'Dict',
components: { Template },
data() {
return {
dictList: [],
value: true,
test: '',
options: [],
......@@ -221,96 +220,6 @@ export default {
complaintsDetail: {},
// 投诉建议表格数据
complaintsList: [
{
title: '商家坐地起价,有额外收费项目',
type: 0,
phone: '13002006789',
complaintTime: '2023-4-23',
dealTime: '2023-4-24',
status: 0,
createBy: '赵依依'
},
{
title: '商家坐地起价,有额外收费项目',
type: 0,
phone: '13002006789',
complaintTime: '2023-4-23',
dealTime: '2023-4-24',
status: 1,
createBy: '赵依依'
},
{
title: '商家坐地起价,有额外收费项目',
type: 0,
phone: '13002006789',
complaintTime: '2023-4-23',
dealTime: '2023-4-24',
status: 1,
createBy: '赵依依'
},
{
title: '商家坐地起价,有额外收费项目',
type: 0,
phone: '13002006789',
complaintTime: '2023-4-23',
dealTime: '2023-4-24',
status: 1,
createBy: '赵依依'
},
{
title: '商家坐地起价,有额外收费项目',
type: 0,
phone: '13002006789',
complaintTime: '2023-4-23',
dealTime: '2023-4-24',
status: 1,
createBy: '赵依依'
},
{
title: '商家坐地起价,有额外收费项目',
type: 0,
phone: '13002006789',
complaintTime: '2023-4-23',
dealTime: '2023-4-24',
status: 1,
createBy: '赵依依'
},
{
title: '商家坐地起价,有额外收费项目',
type: 0,
phone: '13002006789',
complaintTime: '2023-4-23',
dealTime: '2023-4-24',
status: 0,
createBy: '赵依依'
},
{
title: '商家坐地起价,有额外收费项目',
type: 0,
phone: '13002006789',
complaintTime: '2023-4-23',
dealTime: '2023-4-24',
status: 1,
createBy: '赵依依'
},
{
title: '商家坐地起价,有额外收费项目',
type: 0,
phone: '13002006789',
complaintTime: '2023-4-23',
dealTime: '2023-4-24',
status: 1,
createBy: '赵依依'
},
{
title: '商家坐地起价,有额外收费项目',
type: 0,
phone: '13002006789',
complaintTime: '2023-4-23',
dealTime: '2023-4-24',
status: 1,
createBy: '赵依依'
}
],
// 弹出层标题
title: '',
......@@ -342,9 +251,11 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
flag: undefined
complainant: '',
status: '',
type: '',
beginTime: '',
endTime: ''
// status: undefined
},
// 表单参数
......@@ -368,34 +279,82 @@ export default {
manageLoading: false
}
},
/** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) {
this.$store.dispatch('searchSave/searchParamsSet', {
path: this.$route.path,
param: {
...this.queryParams
}
})
next()
},
// /** 路由离开前存储筛选条件*/
// beforeRouteLeave(to, from, next) {
// this.$store.dispatch('searchSave/searchParamsSet', {
// path: this.$route.path,
// param: {
// ...this.queryParams
// }
// })
// next()
// },
created() {
if (this.$store.getters.searchParams[this.$route.path]) {
const { searchParams } = this.$store.getters; const { path } = this.$route
const param = JSON.parse(searchParams[path]) // 保留着的查询条件
this.queryParams = { ...param }
}
// if (this.$store.getters.searchParams[this.$route.path]) {
// const { searchParams } = this.$store.getters; const { path } = this.$route
// const param = JSON.parse(searchParams[path]) // 保留着的查询条件
// this.queryParams = { ...param }
// }
setTimeout(() => {
this.getList()
}, 1000)
this.getAllDict()
},
methods: {
replaceTypes(type) {
console.log('type', type)
if (type !== undefined) {
const retype = String(type)
const label = this.dictList.find(item => item.dictValue === retype).dictLabel
if (label) {
return label
} else {
return '-'
}
}
},
handleTimeChange() {
if (this.dateRange !== null) {
this.queryParams.beginTime = this.dateRange[0]
this.queryParams.endTime = this.dateRange[1]
} else {
this.queryParams.beginTime = ''
this.queryParams.endTime = ''
}
},
replaceTime(time) {
return parseTime(time, '{y}-{m}-{d}')
},
replaceType(value) {
const type = String(value)
const label = this.dictList.find(item => item.dictValue === type).dictLabel
if (label) {
return label
} else {
return '-'
}
},
getAllDict() {
getDicts('complaintType').then(res => {
console.log('投诉类型', res)
this.dictList = res.data
})
},
/** 查询字典类型列表 */
getList() {
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.options = response.rows
// this.typeList = response.rows
// this.total = response.total
getComplaintList(this.queryParams).then(res => {
console.log('投诉列表', res)
this.complaintsList = res.rows
this.total = res.total
this.loading = false
}
)
})
// listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
// this.options = response.rows
// // this.typeList = response.rows
// // this.total = response.total
//
// }
// )
},
// 获取当前父字典数据
/* getOptions(val) {
......@@ -441,14 +400,9 @@ export default {
// 表单重置
reset() {
this.form = {
dataId: '',
parentId: '',
status: 0,
businessId: undefined,
dictName: undefined,
dictType: undefined,
status: '0',
remarks: undefined,
flag: '1'
dealResult: ''
}
},
/** 搜索按钮操作 */
......@@ -476,22 +430,36 @@ export default {
},
// 详情操作按钮
handleDetail(row) {
this.complaintsDetail = row
const id = row.businessId
getComplaintDetailById(id).then(res => {
console.log('res', res)
if (res.code === 200) {
this.complaintsDetail = res.data
this.opendetail = true
}
})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
this.open = true
this.form.status = '1'
this.form.businessId = row.businessId
},
/** 提交按钮 */
submitForm() {
console.log('form', this.form)
this.$refs['form'].validate(valid => {
if (valid) {
handleComplaint(this.form).then(res => {
if (res.code === 200) {
this.$message.success('操作成功')
this.getList()
this.open = false
}
})
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment