|
|
@@ -19,6 +19,21 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="投诉状态" prop="recordStatus">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.recordStatus"
|
|
|
+ placeholder="请选择投诉状态"
|
|
|
+ clearable
|
|
|
+ size="small" style="width: 140px"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="dict in statusOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="创建时间" prop="dateRange">
|
|
|
<el-date-picker
|
|
|
v-model="dateRange"
|
|
|
@@ -93,6 +108,11 @@
|
|
|
<el-table-column label="所属小节" align="center" prop="title" />
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="160px" />
|
|
|
<el-table-column label="看课状态" align="center" prop="status" />
|
|
|
+ <el-table-column label="投诉状态" align="center" prop="recordStatus">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ statusFormat(scope.row.recordStatus) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
<!-- <el-button-->
|
|
|
@@ -130,6 +150,14 @@
|
|
|
@click="handleAddBlack(scope.row)"
|
|
|
v-if="scope.row.status !== '已拉黑' "
|
|
|
>拉黑</el-button>
|
|
|
+ <!-- 新增修改状态按钮 -->
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleUpdateStatus(scope.row)"
|
|
|
+ v-hasPermi="['course:userCourseComplaintRecord:edit']"
|
|
|
+ >修改状态</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -191,6 +219,7 @@
|
|
|
<el-table border :data="formQwList">
|
|
|
<el-table-column label="员工账号" align="center" prop="userId" />
|
|
|
<el-table-column label="员工名称" align="center" prop="qwUserName" />
|
|
|
+ <el-table-column label="销售公司" align="center" prop="company" />
|
|
|
<el-table-column label="销售账号" align="center" prop="userName" />
|
|
|
<el-table-column label="销售昵称" align="center" prop="nickName" />
|
|
|
<el-table-column label="客户名称" align="center" prop="name" />
|
|
|
@@ -210,6 +239,38 @@
|
|
|
<el-table-column label="描述信息" align="center" prop="description" />
|
|
|
</el-table>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog :title="title" :visible.sync="openUpdateStatus" width="500px" append-to-body>
|
|
|
+ <el-form ref="updateStatusForm" :model="updateStatusForm" :rules="updateStatusRules" label-width="100px">
|
|
|
+ <el-form-item label="投诉状态" prop="recordStatus">
|
|
|
+ <el-select
|
|
|
+ v-model="updateStatusForm.recordStatus"
|
|
|
+ placeholder="请选择投诉状态"
|
|
|
+ @change="handleStatusChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="dict in statusOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- 处理结果字段,仅在状态为"已处理"时显示 -->
|
|
|
+ <el-form-item label="处理结果" prop="handleResult" v-if="isHandleResultVisible">
|
|
|
+ <el-input
|
|
|
+ v-model="updateStatusForm.handleResult"
|
|
|
+ type="textarea"
|
|
|
+ :rows="4"
|
|
|
+ placeholder="请输入处理结果"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="cancelUpdateStatus">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitUpdateStatus">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -219,7 +280,8 @@ import {
|
|
|
delUserCourseComplaintRecord,
|
|
|
exportUserCourseComplaintRecord,
|
|
|
getUserCourseComplaintRecord,
|
|
|
- getUserCourseComplaintRecordByUserId
|
|
|
+ getUserCourseComplaintRecordByUserId,
|
|
|
+ updateUserCourseComplaintRecord
|
|
|
} from '@/api/course/userCourseComplaintRecord'
|
|
|
import { addBlack } from "@/api/course/courseWatchComment";
|
|
|
export default {
|
|
|
@@ -247,10 +309,22 @@ export default {
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
openQw: false,
|
|
|
+ // 修改状态对话框
|
|
|
+ openUpdateStatus: false,
|
|
|
// 图片列表
|
|
|
imageList: [],
|
|
|
// 日期范围
|
|
|
dateRange: [],
|
|
|
+ // 状态选项(字典)
|
|
|
+ statusOptions: [],
|
|
|
+ // 更新状态表单
|
|
|
+ updateStatusForm: {
|
|
|
+ recordId: null,
|
|
|
+ recordStatus: null,
|
|
|
+ handleResult: null
|
|
|
+ },
|
|
|
+ // 是否显示处理结果字段
|
|
|
+ isHandleResultVisible: false,
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
@@ -260,6 +334,7 @@ export default {
|
|
|
complaintTypeName: null,
|
|
|
startCreateTime: null,
|
|
|
endCreateTime: null,
|
|
|
+ recordStatus: null,
|
|
|
// complaintTypeId: null,
|
|
|
// complaintContent: null,
|
|
|
// courseId: null,
|
|
|
@@ -270,10 +345,19 @@ export default {
|
|
|
formQwList:[],
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
+ },
|
|
|
+ // 更新状态表单校验规则
|
|
|
+ updateStatusRules: {
|
|
|
+ recordStatus: [
|
|
|
+ { required: true, message: "投诉状态不能为空", trigger: "change" }
|
|
|
+ ]
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+ this.getDicts("sys_complaint_status").then(response => {
|
|
|
+ this.statusOptions = response.data;
|
|
|
+ });
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -330,6 +414,7 @@ export default {
|
|
|
this.dateRange = [];
|
|
|
this.queryParams.startCreateTime = null;
|
|
|
this.queryParams.endCreateTime = null;
|
|
|
+ this.queryParams.status = null;
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
@@ -448,6 +533,94 @@ export default {
|
|
|
// 用户取消操作
|
|
|
});
|
|
|
},
|
|
|
+ /** 修改状态按钮操作 */
|
|
|
+ handleUpdateStatus(row) {
|
|
|
+ this.resetUpdateStatusForm();
|
|
|
+ this.updateStatusForm.recordId = row.recordId;
|
|
|
+
|
|
|
+ // 确保传递给下拉框的值与字典选项匹配,这将确保显示正确的中文标签
|
|
|
+ // 将值转换为与字典选项匹配的类型
|
|
|
+ this.updateStatusForm.recordStatus = String(row.recordStatus);
|
|
|
+ this.updateStatusForm.handleResult = row.handleResult || null;
|
|
|
+
|
|
|
+ // 根据当前状态判断是否显示处理结果字段
|
|
|
+ this.isHandleResultVisible = this.getDictLabelByValue(this.updateStatusForm.recordStatus) === '已处理';
|
|
|
+
|
|
|
+ this.openUpdateStatus = true;
|
|
|
+ this.title = "修改投诉状态";
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 处理状态改变事件 */
|
|
|
+ handleStatusChange(value) {
|
|
|
+ // 如果选择"已处理"状态,则显示处理结果字段,否则隐藏
|
|
|
+ this.isHandleResultVisible = this.getDictLabelByValue(String(value)) === '已处理';
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 获取字典标签 */
|
|
|
+ getDictLabelByValue(value) {
|
|
|
+ const dict = this.statusOptions.find(item => item.dictValue === value);
|
|
|
+ return dict ? dict.dictLabel : '';
|
|
|
+ },
|
|
|
+ /** 投诉状态格式化 */
|
|
|
+ statusFormat(status) {
|
|
|
+ switch (status) {
|
|
|
+ case 0:
|
|
|
+ return '待处理';
|
|
|
+ case 1:
|
|
|
+ return '已分配';
|
|
|
+ case 2:
|
|
|
+ return '已处理';
|
|
|
+ default:
|
|
|
+ return status;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 提交修改状态 */
|
|
|
+ submitUpdateStatus() {
|
|
|
+ this.$refs["updateStatusForm"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ // 验证是否选择了"已处理"状态但未填写处理结果
|
|
|
+ if (this.isHandleResultVisible && !this.updateStatusForm.handleResult) {
|
|
|
+ this.msgError("请选择已处理状态时,请填写处理结果");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 确保传递给后端的值是正确的类型
|
|
|
+ const submitData = {
|
|
|
+ ...this.updateStatusForm,
|
|
|
+ recordStatus: Number(this.updateStatusForm.recordStatus) // 确保传递数字类型给后端
|
|
|
+ };
|
|
|
+
|
|
|
+ // 调用API更新状态
|
|
|
+ updateUserCourseComplaintRecord(submitData).then(response => {
|
|
|
+ this.msgSuccess("状态修改成功");
|
|
|
+ this.openUpdateStatus = false;
|
|
|
+ this.getList(); // 重新加载列表
|
|
|
+ }).catch(error => {
|
|
|
+ this.msgError("状态修改失败");
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 取消修改状态 */
|
|
|
+ cancelUpdateStatus() {
|
|
|
+ this.openUpdateStatus = false;
|
|
|
+ this.resetUpdateStatusForm();
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 重置修改状态表单 */
|
|
|
+ resetUpdateStatusForm() {
|
|
|
+ this.updateStatusForm = {
|
|
|
+ recordId: null,
|
|
|
+ recordStatus: null,
|
|
|
+ handleResult: null
|
|
|
+ };
|
|
|
+ this.isHandleResultVisible = false;
|
|
|
+ if (this.$refs.updateStatusForm) {
|
|
|
+ this.$refs.updateStatusForm.resetFields();
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|