4 Commits 2ed246b2de ... 342a26dc89

Auteur SHA1 Message Date
  wangxy 342a26dc89 需求 il y a 14 heures
  wangxy 4b3520aa9f Merge remote-tracking branch 'origin/红德堂' into 红德堂-test il y a 3 jours
  wangxy fa5d61b9fd 小节备注 il y a 1 semaine
  wangxy 328dbff72c 直播设置 il y a 1 semaine

+ 8 - 8
src/api/course/userCourseComplaintRecord.js

@@ -34,14 +34,14 @@ export function getUserCourseComplaintRecordByUserId(userId) {
 //   })
 // }
 //
-// // 修改看课投诉记录
-// export function updateUserCourseComplaintRecord(data) {
-//   return request({
-//     url: '/course/userCourseComplaintRecord',
-//     method: 'put',
-//     data: data
-//   })
-// }
+// 修改看课投诉记录
+export function updateUserCourseComplaintRecord(data) {
+  return request({
+    url: '/course/userCourseComplaintRecord',
+    method: 'put',
+    data: data
+  })
+}
 
 // 删除看课投诉记录
 export function delUserCourseComplaintRecord(recordId) {

+ 7 - 1
src/views/components/course/userCourseCatalogDetails.vue

@@ -51,6 +51,7 @@
           {{ formatDuration(row.duration) }}
         </template>
       </el-table-column>
+      <el-table-column label="视频备注" align="center" show-overflow-tooltip prop="remark" />
       <el-table-column label="看课开始时间" align="center" prop="duration">
         <template slot-scope="{ row }">
           <el-tag v-if="row.viewStartTime">{{ row.viewStartTime }}</el-tag>
@@ -94,6 +95,9 @@
         <el-form-item label="视频描述" prop="description">
           <el-input v-model="form.description" type="textarea" :rows="2" placeholder="请输入内容" />
         </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" type="textarea" :rows="2" placeholder="请输入备注" />
+        </el-form-item>
         <el-form-item label="课程排序" prop="courseSort">
           <el-input-number v-model="form.courseSort" :min="1"></el-input-number>
         </el-form-item>
@@ -431,7 +435,8 @@ export default {
       openVideoSort: false,
       // 表单参数
       form: {
-        courseProducts: []
+        courseProducts: [],
+        remark: null,
       },
       updateBatchData: {
         open: false,
@@ -653,6 +658,7 @@ export default {
         title: null,
         description: null,
         url: null,
+        remark: null,
         thumbnail: null,
         duration: null,
         createTime: null,

+ 174 - 1
src/views/course/userCourseComplaintRecord/index.vue

@@ -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>