From b7ddb64be82d402dca628e92fa432558fd712289 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期一, 02 二月 2026 13:29:41 +0800
Subject: [PATCH] 巡检管理频次字段回显问题

---
 src/views/safeProduction/accidentReportingRecord/index.vue |   62 ++++++++++++++++--------------
 1 files changed, 33 insertions(+), 29 deletions(-)

diff --git a/src/views/safeProduction/accidentReportingRecord/index.vue b/src/views/safeProduction/accidentReportingRecord/index.vue
index bf064cd..e362ba5 100644
--- a/src/views/safeProduction/accidentReportingRecord/index.vue
+++ b/src/views/safeProduction/accidentReportingRecord/index.vue
@@ -52,7 +52,8 @@
       <el-form ref="formRef"
                :model="form"
                :rules="rules"
-               label-width="140px">
+               label-position="top"
+               label-width="150px">
         <el-row :gutter="20">
           <el-col :span="12">
             <el-form-item label="浜嬫晠缂栧彿"
@@ -202,9 +203,9 @@
       </el-form>
       <template #footer>
         <span class="dialog-footer">
-          <el-button @click="dialogVisible = false">鍙栨秷</el-button>
           <el-button type="primary"
                      @click="submitForm">纭畾</el-button>
+          <el-button @click="dialogVisible = false">鍙栨秷</el-button>
         </span>
       </template>
     </el-dialog>
@@ -229,10 +230,10 @@
             {{ currentKnowledge.happenLocation }}
           </el-descriptions-item>
           <el-descriptions-item label="浜嬫晠绛夌骇">
-            {{ currentKnowledge.accidentGrade }}
+            <el-tag :type="accidentGradeType(currentKnowledge.accidentGrade)">{{ currentKnowledge.accidentGrade }}</el-tag>
           </el-descriptions-item>
           <el-descriptions-item label="浜嬫晠绫诲瀷">
-            {{ currentKnowledge.accidentType }}
+            <el-tag type="info">{{ accidentTypeLabel(currentKnowledge.accidentType) }}</el-tag>
           </el-descriptions-item>
           <el-descriptions-item label="浜哄憳浼や骸鎯呭喌">
             {{ currentKnowledge.personLoss }}
@@ -409,6 +410,9 @@
       label: "浜嬫晠绫诲瀷",
       prop: "accidentType",
       showOverflowTooltip: true,
+      formatData: params => {
+        return accidentTypeLabel(params);
+      },
     },
     {
       dataType: "action",
@@ -462,6 +466,20 @@
     page.value.current = 1;
     getList();
   };
+  const accidentGradeType = val => {
+    switch (val) {
+      case "杞诲井浜嬫晠":
+        return "info";
+      case "涓�鑸簨鏁�":
+        return "info";
+      case "杈冨ぇ浜嬫晠":
+        return "warning";
+      case "閲嶅ぇ浜嬫晠":
+        return "danger";
+      default:
+        return "info";
+    }
+  };
   const accidentGradeOptions = [
     {
       label: "杞诲井浜嬫晠",
@@ -480,32 +498,22 @@
       value: "閲嶅ぇ浜嬫晠",
     },
   ];
-  const accidentTypeOptions = [
-    {
-      label: "璐d换浜嬫晠",
-      value: "璐d换浜嬫晠",
-    },
-    {
-      label: "闈炶矗浠讳簨鏁�",
-      value: "闈炶矗浠讳簨鏁�",
-    },
-    {
-      label: "鐮村潖鎬т簨鏁�",
-      value: "鐮村潖鎬т簨鏁�",
-    },
-    {
-      label: "閲嶅ぇ浜嬫晠",
-      value: "閲嶅ぇ浜嬫晠",
-    },
-  ];
-
+  const { proxy } = getCurrentInstance();
+  const { accident_type } = proxy.useDict("accident_type");
+  const accidentTypeOptions = computed(() => accident_type?.value || []);
+  const accidentTypeLabel = val => {
+    const item = accidentTypeOptions.value.find(
+      i => String(i.value) === String(val)
+    );
+    return item ? item.label : val;
+  };
   const getList = () => {
     tableLoading.value = true;
     safeAccidentListPage({ ...page.value, ...searchForm.value })
       .then(res => {
         tableLoading.value = false;
         tableData.value = res.data.records;
-        page.total = res.data.total;
+        page.value.total = res.data.total;
       })
       .catch(err => {
         tableLoading.value = false;
@@ -516,7 +524,7 @@
   const pagination = obj => {
     page.value.current = obj.page;
     page.value.size = obj.limit;
-    handleQuery();
+    getList();
   };
   const currentUserId = ref("");
   const currentUserName = ref("");
@@ -711,10 +719,6 @@
         // 鐢ㄦ埛鍙栨秷
       });
   };
-
-  // 瀵煎嚭
-  const { proxy } = getCurrentInstance();
-  const { knowledge_type } = proxy.useDict("knowledge_type");
 
   // 瀛楀吀宸ュ叿
   const knowledgeTypeOptions = computed(() => knowledge_type?.value || []);

--
Gitblit v1.9.3