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>
@@ -401,7 +408,9 @@
        executionDate: "",
      };
    } else {
      form.value = row;
      // 关键:编辑时不要直接引用表格行对象,避免取消/重置时把列表数据一起清空
      // 使用深拷贝断开引用关系
      form.value = JSON.parse(JSON.stringify(row || {}));
    }
    dialogFormVisible.value = true;
  };
@@ -446,6 +455,7 @@
  // 关闭弹框
  const closeDia = () => {
    proxy.resetForm("formRef");
    form.value = {};
    dialogFormVisible.value = false;
  };
  // 关闭产品弹框
@@ -510,12 +520,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 +619,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 +630,7 @@
                  ...item,
                }));
                fileListRef.value.setList(fileList);
                filePagination.value.total = listRes.data?.total || 0;
              }
              // 返回新文件信息
              resolve({
@@ -635,6 +658,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 +688,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 +699,7 @@
              ...item,
            }));
            fileListRef.value.setList(fileList);
            filePagination.value.total = listRes.data?.total || 0;
          }
        }
        return true; // 返回 true 表示删除成功,组件会更新列表
@@ -681,9 +727,9 @@
    background-color: #fef0f0 !important;
  }
  :deep(.warning-row td) {
    // color: #cf1322 !important;
  }
  /* :deep(.warning-row td) {
    color: #cf1322 !important;
  } */
  .actions {
    display: flex;