From 714ab13b7d3ad5be0e2ec3af2eaa240c9d3f43f3 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 02 二月 2026 15:36:05 +0800
Subject: [PATCH] 进销存升级 1.生产报工带出来的原材料、过程、出厂检数据编辑时,规格型号回显还是有问题

---
 src/views/safeProduction/dangerInvestigation/index.vue |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 55 insertions(+), 3 deletions(-)

diff --git a/src/views/safeProduction/dangerInvestigation/index.vue b/src/views/safeProduction/dangerInvestigation/index.vue
index d585fc3..90093fa 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="scope.row.isRectify"
                        @click="openForm('edit2', scope.row)">鏁存敼</el-button>
             <el-button link
                        type="primary"
@@ -419,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>
@@ -655,6 +659,14 @@
         tableLoading.value = false;
         tableData.value = res.data.records;
         total.value = res.data.total;
+        tableData.value.forEach(item => {
+          // console.log(item.rectifyUserId, currentUserId.value, "=======");
+          if (Number(item.rectifyUserId) != Number(currentUserId.value)) {
+            item.isRectify = true;
+          } else {
+            item.isRectify = false;
+          }
+        });
         return res;
       })
       .catch(() => {
@@ -889,6 +901,9 @@
         proxy.$modal.msg("宸插彇娑�");
       });
   };
+  const isPeople = rectifyUserId => {
+    return Number(rectifyUserId) == Number(currentUserId.value);
+  };
 
   /**
    * 鍒ゆ柇鏄惁鍙互鍙戣揣
@@ -913,6 +928,11 @@
     const statusStr = shippingStatus ? String(shippingStatus).trim() : "";
     return statusStr === "寰呭彂璐�" || statusStr === "瀹℃牳鎷掔粷";
   };
+  const filePagination = ref({
+    current: 1,
+    size: 10,
+    total: 0,
+  });
 
   /**
    * 涓嬭浇鏂囦欢
@@ -924,9 +944,15 @@
   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;
       }
     });
   };
@@ -958,11 +984,11 @@
   };
 
   onMounted(() => {
+    getCurrentFactoryName();
     getList();
     userListNoPage().then(res => {
       userList.value = res.data;
     });
-    getCurrentFactoryName();
   });
   // 涓婁紶闄勪欢
   const handleUpload = async () => {
@@ -1012,6 +1038,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 => ({
@@ -1021,6 +1049,7 @@
                   ...item,
                 }));
                 fileListRef.value.setList(fileList);
+                filePagination.value.total = listRes.data?.total || 0;
               }
               // 杩斿洖鏂版枃浠朵俊鎭�
               resolve({
@@ -1048,6 +1077,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 {
@@ -1058,6 +1107,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 => ({
@@ -1067,6 +1118,7 @@
               ...item,
             }));
             fileListRef.value.setList(fileList);
+            filePagination.value.total = listRes.data?.total || 0;
           }
         }
         return true; // 杩斿洖 true 琛ㄧず鍒犻櫎鎴愬姛锛岀粍浠朵細鏇存柊鍒楄〃

--
Gitblit v1.9.3