xiaweibo 3 miesięcy temu
rodzic
commit
d6f4cf03a3

+ 24 - 14
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/oneByOneManagementDept/components/oneByOneManagementDeptDetail.vue

@@ -262,21 +262,31 @@
     return row.statusId === 3;
   }
 
-  /** 第一个待反馈的下发记录,用于底部「提交」按钮 */
-  const pendingFeedbackRow = computed(() => {
-    const records = detailData.value?.issueRecords;
-    if (!Array.isArray(records)) return null;
-    return records.find((r) => r.statusId === 3) ?? null;
-  });
-
-  /** 底部提交:打开部门反馈弹窗并预填附件,若无待反馈任务则提示 */
-  function handleSubmit() {
-    const row = pendingFeedbackRow.value;
-    if (!row) {
-      ElMessage.warning('暂无待反馈任务');
-      return;
+  /** 底部提交:直接调用反馈接口(使用当前详情主记录 id) */
+  async function handleSubmit() {
+    const id = currentId.value;
+    if (!id) return;
+    try {
+      let attachments = '';
+      if (hasProblem.value && materialAttachmentList.value.length) {
+        const formatted = await formatAttachmentList(materialAttachmentList.value);
+        attachments = JSON.stringify(formatted);
+      }
+      const now = new Date();
+      const feedbackTime = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}:${String(now.getSeconds()).padStart(2, '0')}`;
+      await submitDrawLessonsDeptFeedback({
+        id,
+        feedbackHasIssue: hasProblem.value ? 1 : 0,
+        feedbackResult: '',
+        feedbackTime,
+        attachments,
+      });
+      ElMessage.success('反馈提交成功');
+      getDetail();
+    } catch (e) {
+      console.error('反馈提交失败:', e);
+      ElMessage.error('反馈提交失败,请重试');
     }
-    openFeedbackDialog(row);
   }
 
   const getDetail = async () => {

+ 4 - 20
src/views/production-safety/safetyAssessment/evaluationSystem/components/EvaluationTarget.vue

@@ -454,23 +454,7 @@
         if (res) {
           // 映射返回数据字段到表格字段(先进集体排名表格)
           tableData.value = res.records.map((item) => {
-            // 计算总分数、加分项分数、减分项分数
-            let totalScore = 0;
-            let addScore = 0;
-            let subtractScore = 0;
-
-            if (item.scores && item.scores.length > 0) {
-              item.scores.forEach((score: any) => {
-                const scoreValue = Number(score.reviewScore) || 0;
-                totalScore += scoreValue;
-                if (scoreValue >= 0) {
-                  addScore += scoreValue;
-                } else {
-                  subtractScore += Math.abs(scoreValue);
-                }
-              });
-            }
-
+         
             return {
               id: item.id,
               departmentName: item.deptName, // 部门考核结果
@@ -478,9 +462,9 @@
               departmentSort: item.scoreRank || 0, // 部门排序(使用排名)
               departmentLeader: item.deptUserName || '-', // 部门负责人
               baseScore: 100, // 基础分,默认为100
-              totalScore, // 总分数
-              addScore, // 加分项分数
-              subtractScore, // 减分项分数
+              reviewSum: item.reviewSum || 0, // 总分数
+              addSum: item.addSum || 0, // 加分项分数
+              subSum: item.subSum || 0, // 减分项分数
               // 保留原始数据
               psemId: item.psemId,
               deptId: item.deptId,

+ 3 - 3
src/views/production-safety/safetyAssessment/evaluationSystem/configs/targetTables.ts

@@ -96,19 +96,19 @@ export const EVALUATION_ADVANCED_GROUP_TABLE_COLUMNS: TableColumnProps[] = [
   },
   {
     label: '总分数',
-    prop: 'totalScore',
+    prop: 'reviewSum',
     align: 'center',
     minWidth: '100px',
   },
   {
     label: '加分项分数',
-    prop: 'addScore',
+    prop: 'addSum',
     align: 'center',
     minWidth: '120px',
   },
   {
     label: '减分项分数',
-    prop: 'subtractScore',
+    prop: 'subSum',
     align: 'center',
     minWidth: '120px',
   },