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 @@ ...@@ -3,15 +3,15 @@
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true" label-width="68px"> <el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true" label-width="68px">
<el-form-item prop="flag"> <el-form-item prop="flag">
<el-select <el-select
v-model="queryParams.flag" v-model="queryParams.type"
placeholder="投诉类型" placeholder="投诉类型"
clearable clearable
size="small" size="small"
style="width: 200px" style="width: 200px"
> >
<el-option <el-option
v-for="dict in statusOptions" v-for="(dict,index) in dictList"
:key="dict.dictValue" :key="index"
:label="dict.dictLabel" :label="dict.dictLabel"
:value="dict.dictValue" :value="dict.dictValue"
/> />
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</el-form-item> </el-form-item>
<el-form-item prop="dictName"> <el-form-item prop="dictName">
<el-input <el-input
v-model="queryParams.dictName" v-model="queryParams.complainant"
placeholder="投诉人" placeholder="投诉人"
clearable clearable
:maxlength="30" :maxlength="30"
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</el-form-item> </el-form-item>
<el-form-item prop="flag"> <el-form-item prop="flag">
<el-select <el-select
v-model="queryParams.flag" v-model="queryParams.status"
placeholder="处理状态" placeholder="处理状态"
clearable clearable
size="small" size="small"
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
range-separator="-" range-separator="-"
start-placeholder="处理开始时间" start-placeholder="处理开始时间"
end-placeholder="处理截止时间" end-placeholder="处理截止时间"
@change="handleTimeChange"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
...@@ -77,13 +78,12 @@ ...@@ -77,13 +78,12 @@
</el-table-column> </el-table-column>
<el-table-column label="投诉类型" prop="type" :show-overflow-tooltip="true"> <el-table-column label="投诉类型" prop="type" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.type === 0">商家</span> <span>{{ replaceType(scope.row.type) }}</span>
<span v-if="scope.row.type === 1">APP</span>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
{{ scope.row.createBy || '-' }} {{ scope.row.complainant || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="处理状态" align="center" prop="status"> <el-table-column label="处理状态" align="center" prop="status">
...@@ -97,9 +97,9 @@ ...@@ -97,9 +97,9 @@
{{ scope.row.phone || '-' }} {{ scope.row.phone || '-' }}
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
{{ scope.row.complaintTime || '-' }} {{ replaceTime(scope.row.createTime) || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="处理时间" prop="dealTime" :show-overflow-tooltip="true"> <el-table-column label="处理时间" prop="dealTime" :show-overflow-tooltip="true">
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
@pagination="getList" @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 ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="处理结果"> <el-form-item label="处理结果">
<el-select <el-select
...@@ -153,8 +153,8 @@ ...@@ -153,8 +153,8 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="处理内容" prop="dictType"> <el-form-item label="处理内容" prop="dealResult">
<el-input v-model.trim="form.dictType" type="textarea" :rows="5" :maxlength="30" placeholder="请输入处理内容" /> <el-input v-model.trim="form.dealResult" type="textarea" :rows="5" :maxlength="30" placeholder="请输入处理内容" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -169,14 +169,13 @@ ...@@ -169,14 +169,13 @@
<span>{{ complaintsDetail.title || '-' }}</span> <span>{{ complaintsDetail.title || '-' }}</span>
</el-form-item> </el-form-item>
<el-form-item label="投诉类型"> <el-form-item label="投诉类型">
<span v-if="complaintsDetail.type === 0">商家</span> <span>{{ replaceTypes(complaintsDetail.type) }}</span>
<span v-if="complaintsDetail.type === 1">APP</span>
</el-form-item> </el-form-item>
<el-form-item label="投诉内容"> <el-form-item label="投诉内容">
<span>{{ complaintsDetail.details || '-' }}</span> <span>{{ complaintsDetail.details || '-' }}</span>
</el-form-item> </el-form-item>
<el-form-item label="投诉人"> <el-form-item label="投诉人">
<span>{{ complaintsDetail.createBy || '-' }}</span> <span>{{ complaintsDetail.complainant || '-' }}</span>
</el-form-item> </el-form-item>
<el-form-item label="联系方式"> <el-form-item label="联系方式">
<span>{{ complaintsDetail.phone || '-' }}</span> <span>{{ complaintsDetail.phone || '-' }}</span>
...@@ -187,22 +186,22 @@ ...@@ -187,22 +186,22 @@
</template> </template>
<script> <script>
import { listType, import { getComplaintList, getComplaintDetailById, handleComplaint } from '@/api/complaint/complaint'
getType, import {
delType, delType,
addType,
updateType, updateType,
exportType, exportType,
clearCache clearCache
} from '@/api/system/dict/type' } 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 { export default {
name: 'Dict', name: 'Dict',
components: { Template },
data() { data() {
return { return {
dictList: [],
value: true, value: true,
test: '', test: '',
options: [], options: [],
...@@ -221,96 +220,6 @@ export default { ...@@ -221,96 +220,6 @@ export default {
complaintsDetail: {}, complaintsDetail: {},
// 投诉建议表格数据 // 投诉建议表格数据
complaintsList: [ 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: '', title: '',
...@@ -342,9 +251,11 @@ export default { ...@@ -342,9 +251,11 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
dictName: undefined, complainant: '',
dictType: undefined, status: '',
flag: undefined type: '',
beginTime: '',
endTime: ''
// status: undefined // status: undefined
}, },
// 表单参数 // 表单参数
...@@ -368,34 +279,82 @@ export default { ...@@ -368,34 +279,82 @@ export default {
manageLoading: false manageLoading: false
} }
}, },
/** 路由离开前存储筛选条件*/ // /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { // beforeRouteLeave(to, from, next) {
this.$store.dispatch('searchSave/searchParamsSet', { // this.$store.dispatch('searchSave/searchParamsSet', {
path: this.$route.path, // path: this.$route.path,
param: { // param: {
...this.queryParams // ...this.queryParams
} // }
}) // })
next() // next()
}, // },
created() { created() {
if (this.$store.getters.searchParams[this.$route.path]) { // if (this.$store.getters.searchParams[this.$route.path]) {
const { searchParams } = this.$store.getters; const { path } = this.$route // const { searchParams } = this.$store.getters; const { path } = this.$route
const param = JSON.parse(searchParams[path]) // 保留着的查询条件 // const param = JSON.parse(searchParams[path]) // 保留着的查询条件
this.queryParams = { ...param } // this.queryParams = { ...param }
} // }
this.getList() setTimeout(() => {
this.getList()
}, 1000)
this.getAllDict()
}, },
methods: { 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() { getList() {
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => { getComplaintList(this.queryParams).then(res => {
this.options = response.rows console.log('投诉列表', res)
// this.typeList = response.rows this.complaintsList = res.rows
// this.total = response.total this.total = res.total
this.loading = false 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) { /* getOptions(val) {
...@@ -441,14 +400,9 @@ export default { ...@@ -441,14 +400,9 @@ export default {
// 表单重置 // 表单重置
reset() { reset() {
this.form = { this.form = {
dataId: '', status: 0,
parentId: '',
businessId: undefined, businessId: undefined,
dictName: undefined, dealResult: ''
dictType: undefined,
status: '0',
remarks: undefined,
flag: '1'
} }
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
...@@ -476,20 +430,34 @@ export default { ...@@ -476,20 +430,34 @@ export default {
}, },
// 详情操作按钮 // 详情操作按钮
handleDetail(row) { handleDetail(row) {
this.complaintsDetail = row const id = row.businessId
this.opendetail = true getComplaintDetailById(id).then(res => {
console.log('res', res)
if (res.code === 200) {
this.complaintsDetail = res.data
this.opendetail = true
}
})
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset() this.reset()
this.open = true this.open = true
this.form.status = '1' this.form.status = '1'
this.form.businessId = row.businessId
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
console.log('form', this.form)
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
this.open = false handleComplaint(this.form).then(res => {
if (res.code === 200) {
this.$message.success('操作成功')
this.getList()
this.open = false
}
})
} }
}) })
}, },
......
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