From e260fd0a8474fe4fe4550baaec2a643121ed778a Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期一, 02 二月 2026 11:41:35 +0800
Subject: [PATCH] 事故上报分页

---
 src/views/safeProduction/safeQualifications/index.vue |   47 +++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/src/views/safeProduction/safeQualifications/index.vue b/src/views/safeProduction/safeQualifications/index.vue
index 8bf320b..e61a39c 100644
--- a/src/views/safeProduction/safeQualifications/index.vue
+++ b/src/views/safeProduction/safeQualifications/index.vue
@@ -82,7 +82,11 @@
                          show-overflow-tooltip />
         <el-table-column label="瑙勭▼璧勮川绫诲瀷"
                          prop="type"
-                         show-overflow-tooltip />
+                         show-overflow-tooltip>
+          <template #default="scope">
+            {{ type_qualification.find(item => item.value === scope.row.type)?.label || '-' }}
+          </template>
+        </el-table-column>
         <el-table-column label="鐗堟湰鍙�"
                          prop="version"
                          width="180"
@@ -203,8 +207,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>
@@ -510,12 +517,22 @@
   const fileListRef = ref(null);
   const fileListDialogVisible = ref(false);
   const currentFileRow = ref(null);
+  const filePagination = ref({
+    current: 1,
+    size: 10,
+    total: 0,
+  });
   const downLoadFile = row => {
     currentFileRow.value = row;
-    fileListPage({ safeCertificationId: row.id }).then(res => {
+    fileListPage({
+      safeCertificationId: row.id,
+      current: filePagination.value.current,
+      size: filePagination.value.size,
+    }).then(res => {
       if (fileListRef.value) {
         fileListRef.value.open(res.data.records);
       }
+      filePagination.value.total = res.data.total || 0;
     });
   };
   const currentFactoryName = ref("");
@@ -599,6 +616,8 @@
               // 閲嶆柊鍔犺浇鏂囦欢鍒楄〃
               const listRes = await fileListPage({
                 safeCertificationId: currentFileRow.value.id,
+                current: filePagination.value.current,
+                size: filePagination.value.size,
               });
               if (listRes.code === 200 && fileListRef.value) {
                 const fileList = (listRes.data?.records || []).map(item => ({
@@ -608,6 +627,7 @@
                   ...item,
                 }));
                 fileListRef.value.setList(fileList);
+                filePagination.value.total = listRes.data?.total || 0;
               }
               // 杩斿洖鏂版枃浠朵俊鎭�
               resolve({
@@ -635,6 +655,26 @@
       input.click();
     });
   };
+  const paginationSearch = async (page, size) => {
+    filePagination.value.current = page;
+    filePagination.value.size = size;
+    const listRes = await fileListPage({
+      safeCertificationId: 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 {
@@ -645,6 +685,8 @@
         if (currentFileRow.value && fileListRef.value) {
           const listRes = await fileListPage({
             safeCertificationId: currentFileRow.value.id,
+            current: filePagination.value.current,
+            size: filePagination.value.size,
           });
           if (listRes.code === 200) {
             const fileList = (listRes.data?.records || []).map(item => ({
@@ -654,6 +696,7 @@
               ...item,
             }));
             fileListRef.value.setList(fileList);
+            filePagination.value.total = listRes.data?.total || 0;
           }
         }
         return true; // 杩斿洖 true 琛ㄧず鍒犻櫎鎴愬姛锛岀粍浠朵細鏇存柊鍒楄〃

--
Gitblit v1.9.3