From eef75ceaa14dd7a27394e0823ff8d708794fa22e Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期一, 02 二月 2026 10:40:15 +0800
Subject: [PATCH] 整改限制

---
 src/views/safeProduction/dangerInvestigation/index.vue |  139 ++++++++++++++++++++++++++++++---------------
 1 files changed, 92 insertions(+), 47 deletions(-)

diff --git a/src/views/safeProduction/dangerInvestigation/index.vue b/src/views/safeProduction/dangerInvestigation/index.vue
index a918bef..7ff2a64 100644
--- a/src/views/safeProduction/dangerInvestigation/index.vue
+++ b/src/views/safeProduction/dangerInvestigation/index.vue
@@ -125,6 +125,7 @@
             <el-button link
                        type="primary"
                        size="small"
+                       :disabled="!isPeople(scope.row.rectifyUserId)"
                        @click="openForm('edit2', scope.row)">鏁存敼</el-button>
             <el-button link
                        type="primary"
@@ -215,7 +216,7 @@
                           prop="createUser">
               <el-select v-model="form.createUser"
                          placeholder="璇烽�夋嫨"
-                         @change="handleChange"
+                         disabled
                          clearable>
                 <el-option v-for="item in userList"
                            :key="item.userId"
@@ -228,14 +229,13 @@
             <el-form-item label="涓婃姤鏃堕棿锛�"
                           prop="createTime">
               <el-date-picker style="width: 100%"
-                              readonly
+                              disabled
                               v-model="form.createTime"
                               value-format="YYYY-MM-DD"
                               format="YYYY-MM-DD"
                               type="date"
                               placeholder="璇烽�夋嫨"
-                              clearable
-                              :disabled="operationType === 'view'" />
+                              clearable />
             </el-form-item>
           </el-col>
         </el-row>
@@ -263,16 +263,16 @@
                               format="YYYY-MM-DD"
                               type="date"
                               placeholder="璇烽�夋嫨"
-                              clearable
-                              :disabled="operationType === 'view'" />
+                              clearable />
             </el-form-item>
           </el-col>
         </el-row>
       </el-form>
+      <div v-if="operationType === 'edit2' || operationType === 'edit3'"
+           class="classtitle">闅愭偅璇︽儏</div>
       <el-descriptions :column="2"
                        style="margin-bottom: 20px;"
                        v-if="operationType === 'edit2' || operationType === 'edit3'"
-                       title="闅愭偅璇︽儏"
                        border>
         <el-descriptions-item label="闅愭偅缂栧彿">
           <span class="detail-title">{{ form.hiddenCode }}</span>
@@ -285,10 +285,12 @@
           <span class="detail-title">{{ form.hiddenDesc }}</span>
         </el-descriptions-item>
         <el-descriptions-item label="闅愭偅绫诲瀷">
-          <span class="detail-title">{{ form.type }}</span>
+          <span class="detail-title">{{ TypeLabel(form.type) }}</span>
         </el-descriptions-item>
         <el-descriptions-item label="闅愭偅椋庨櫓绛夌骇">
-          <span class="detail-title">{{ form.riskLevel }}</span>
+          <el-tag :type="getTypeTagType(form.riskLevel)">
+            {{ form.riskLevel }}
+          </el-tag>
         </el-descriptions-item>
         <el-descriptions-item label="涓婃姤浜�">
           <span class="detail-title">{{ form.createUserName }}</span>
@@ -306,10 +308,12 @@
           <span class="detail-title">{{ form.rectifyTime }}</span>
         </el-descriptions-item>
       </el-descriptions>
+      <div class="classtitle"
+           v-if="operationType === 'edit3'"
+           style="margin-top: 40px;">鏁存敼璇︽儏</div>
       <el-descriptions :column="2"
                        style="margin-bottom: 20px;"
                        v-if="operationType === 'edit3'"
-                       title="鏁存敼璇︽儏"
                        border>
         <el-descriptions-item label="鏁存敼鍏蜂綋鎺柦"
                               :span="2">
@@ -319,6 +323,9 @@
           <span class="detail-title">{{ form2.rectifyActualTime }}</span>
         </el-descriptions-item>
       </el-descriptions>
+      <div class="classtitle"
+           v-if="operationType === 'edit2' || operationType === 'edit3'"
+           style="margin-top: 40px;margin-bottom: 30px;">楠屾敹鎯呭喌</div>
       <el-form :model="form2"
                v-if="operationType === 'edit2'"
                label-width="140px"
@@ -343,8 +350,7 @@
                               format="YYYY-MM-DD"
                               type="date"
                               placeholder="璇烽�夋嫨"
-                              clearable
-                              :disabled="operationType === 'view'" />
+                              clearable />
             </el-form-item>
           </el-col>
         </el-row>
@@ -414,8 +420,11 @@
                     v-model="fileListDialogVisible"
                     :show-upload-button="true"
                     :show-delete-button="true"
+                    :is-show-pagination="true"
+                    :page="filePagination"
                     :upload-method="handleUpload"
                     :delete-method="handleFileDelete"
+                    @pagination="paginationSearch"
                     title="闄勪欢鍒楄〃" />
   </div>
 </template>
@@ -423,7 +432,7 @@
 <script setup>
   import { getToken } from "@/utils/auth";
   import pagination from "@/components/PIMTable/Pagination.vue";
-  import { onMounted, ref, getCurrentInstance } from "vue";
+  import { onMounted, ref, getCurrentInstance, computed } from "vue";
   import { ElMessageBox, ElMessage } from "element-plus";
   import useUserStore from "@/store/modules/user";
   import { userListNoPage } from "@/api/system/user.js";
@@ -465,6 +474,16 @@
     } else if (type === "edit3") {
       return "楠屾敹椤甸潰";
     }
+  };
+  // 鑾峰彇绫诲瀷鏍囩绫诲瀷
+  const getTypeTagType = type => {
+    const typeMap = {
+      杈冨ぇ椋庨櫓: "warning",
+      浣庨闄�: "info",
+      涓�鑸闄�: "info",
+      閲嶅ぇ椋庨櫓: "danger",
+    };
+    return typeMap[type] || "info";
   };
   // 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
   const operationType = ref("");
@@ -508,28 +527,12 @@
     verifyResult: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
     acceptDesc: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
   };
-  const typeList = ref([
-    {
-      value: "璁惧瀹夊叏",
-      label: "璁惧瀹夊叏",
-    },
-    {
-      value: "浜哄憳鎿嶄綔",
-      label: "浜哄憳鎿嶄綔",
-    },
-    {
-      value: "鐜椋庨櫓",
-      label: "鐜椋庨櫓",
-    },
-    {
-      value: "鐗╂枡绠℃帶",
-      label: "鐗╂枡绠℃帶",
-    },
-    {
-      value: "鍏朵粬",
-      label: "鍏朵粬",
-    },
-  ]);
+  const { hidden_danger_type } = proxy.useDict("hidden_danger_type");
+  const typeList = computed(() => hidden_danger_type?.value || []);
+  const TypeLabel = val => {
+    const item = typeList.value.find(i => String(i.value) === String(val));
+    return item ? item.label : val;
+  };
   const form2 = ref({
     rectifyActualTime: "", // 瀹為檯鏁存敼瀹屾垚鏃堕棿
     rectifyMeasures: "", // 鏁存敼鍏蜂綋鎺柦
@@ -560,8 +563,6 @@
       label: "浣庨闄�",
     },
   ]);
-  // 闅愭偅绫诲瀷閫夐」
-  const { type_qualification } = proxy.useDict("type_qualification");
   const { form, rules } = toRefs(data);
   const { form: searchForm } = useFormData(data.searchForm);
   // 浜у搧琛ㄥ崟寮规鏁版嵁
@@ -574,12 +575,6 @@
     customer: "",
   });
 
-  const handleChange = userId => {
-    const selectedUser = userList.value.find(user => user.userId === userId);
-    if (selectedUser) {
-      form.value.createUserName = selectedUser.nickName;
-    }
-  };
   const handleChange2 = userId => {
     const selectedUser = userList.value.find(user => user.userId === userId);
     if (selectedUser) {
@@ -710,8 +705,8 @@
         hiddenCode: "", // 闅愭偅缂栧彿
         location: "", // 闅愭偅浣嶇疆
         hiddenDesc: "", // 闅愭偅鎻忚堪
-        createUser: "", // 涓婃姤浜�
-        createUserName: "",
+        createUser: Number(currentUserId.value), // 涓婃姤浜�
+        createUserName: currentUserName.value,
         createTime: dayjs().format("YYYY-MM-DD HH:mm:ss"), // 涓婃姤鏃堕棿
         rectifyUserId: "", // 鏁存敼璐d换浜�
         rectifyUserName: "",
@@ -898,6 +893,9 @@
         proxy.$modal.msg("宸插彇娑�");
       });
   };
+  const isPeople = row => {
+    return row.rectifyUserId === Number(currentUserId.value);
+  };
 
   /**
    * 鍒ゆ柇鏄惁鍙互鍙戣揣
@@ -922,6 +920,11 @@
     const statusStr = shippingStatus ? String(shippingStatus).trim() : "";
     return statusStr === "寰呭彂璐�" || statusStr === "瀹℃牳鎷掔粷";
   };
+  const filePagination = ref({
+    current: 1,
+    size: 10,
+    total: 0,
+  });
 
   /**
    * 涓嬭浇鏂囦欢
@@ -933,16 +936,24 @@
   const currentFileRow = ref(null);
   const downLoadFile = row => {
     currentFileRow.value = row;
-    fileListPage({ safeHiddenId: row.id }).then(res => {
+    fileListPage({
+      safeHiddenId: row.id,
+      current: filePagination.value.current,
+      size: filePagination.value.size,
+    }).then(res => {
       if (fileListRef.value) {
-        fileListRef.value.open(res.data.records);
+        fileListRef.value.open(res.data.records || []);
+        console.log("res.data", res.data);
+        filePagination.value.total = res.data.total || 0;
       }
     });
   };
   const currentUserId = ref("");
+  const currentUserName = ref("");
   const getCurrentFactoryName = async () => {
     let res = await userStore.getInfo();
     currentUserId.value = res.user.userId;
+    currentUserName.value = res.user.nickName;
   };
 
   /**
@@ -1019,6 +1030,8 @@
               // 閲嶆柊鍔犺浇鏂囦欢鍒楄〃
               const listRes = await fileListPage({
                 safeHiddenId: currentFileRow.value.id,
+                current: filePagination.value.current,
+                size: filePagination.value.size,
               });
               if (listRes.code === 200 && fileListRef.value) {
                 const fileList = (listRes.data?.records || []).map(item => ({
@@ -1028,6 +1041,7 @@
                   ...item,
                 }));
                 fileListRef.value.setList(fileList);
+                filePagination.value.total = listRes.data?.total || 0;
               }
               // 杩斿洖鏂版枃浠朵俊鎭�
               resolve({
@@ -1055,6 +1069,26 @@
       input.click();
     });
   };
+  // 鍒嗛〉鏌ヨ鏂囦欢鍒楄〃
+  const paginationSearch = async (page, size) => {
+    filePagination.value.current = page;
+    filePagination.value.size = size;
+    const listRes = await fileListPage({
+      safeHiddenId: currentFileRow.value.id,
+      current: filePagination.value.current,
+      size: filePagination.value.size,
+    });
+    if (listRes.code === 200) {
+      const fileList = (listRes.data?.records || []).map(item => ({
+        name: item.name,
+        url: item.url,
+        id: item.id,
+        ...item,
+      }));
+      fileListRef.value.setList(fileList);
+      filePagination.value.total = listRes.data?.total || 0;
+    }
+  };
   // 鍒犻櫎闄勪欢
   const handleFileDelete = async row => {
     try {
@@ -1065,6 +1099,8 @@
         if (currentFileRow.value && fileListRef.value) {
           const listRes = await fileListPage({
             safeHiddenId: currentFileRow.value.id,
+            current: filePagination.value.current,
+            size: filePagination.value.size,
           });
           if (listRes.code === 200) {
             const fileList = (listRes.data?.records || []).map(item => ({
@@ -1074,6 +1110,7 @@
               ...item,
             }));
             fileListRef.value.setList(fileList);
+            filePagination.value.total = listRes.data?.total || 0;
           }
         }
         return true; // 杩斿洖 true 琛ㄧず鍒犻櫎鎴愬姛锛岀粍浠朵細鏇存柊鍒楄〃
@@ -1285,4 +1322,12 @@
       page-break-after: avoid;
     }
   }
+  .classtitle {
+    font-size: 16px;
+    font-weight: 600;
+    color: #303133;
+    border-left: 4px solid #409eff;
+    padding-left: 12px;
+    margin-bottom: 12px;
+  }
 </style>

--
Gitblit v1.9.3