xiaweibo 2 місяців тому
батько
коміт
30b03a0aec

+ 21 - 21
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/oneByOneManagement/components/OneByOneNotifyTarget.vue

@@ -159,13 +159,13 @@
   const { tableConfig, pagination } = useTableConfig(DRAW_LESSONS_TABLE_COLUMNS_TOW, TABLE_OPTIONS, true);
   const basicTableRef = ref<InstanceType<typeof BasicTable>>();
   const rawTableData = ref<any[]>([]);
-  const detailData = ref<{
-    problem?: string;
-    creatorName?: string;
-    createdAt?: string;
-  } | null>(null);
+  const detailData = ref({
+    problem: route.query.problem as string,
+    creatorName: route.query.creatorName as string,
+    createdAt: route.query.createdAt as string,
+  });
 
-  const activeTab = ref<string>('ALL');
+  const activeTab = ref<string>(route.query.statusId as string);
   const searchStatus = ref<string>('');
   const searchDeptName = ref<string>('');
   const searchDateRange = ref<string[] | null>(null);
@@ -231,7 +231,7 @@
           obligationDeptName: searchDeptName.value,
           planStartDate: searchDateRange.value?.[0],
           planEndDate: searchDateRange.value?.[1],
-          statusId: searchStatus.value ? Number(searchStatus.value) : undefined,
+          statusId: activeTab.value ? Number(activeTab.value) : undefined,
           problem: searchKeyword.value,
         },
       };
@@ -241,27 +241,27 @@
       if (id.value) {
         const current = list;
         rawTableData.value = current;
-        if (current.length) {
-          const row = current[0] as { problem?: string; creatorName?: string; createdAt?: string };
-          detailData.value = {
-            problem: row.problem,
-            creatorName: row.creatorName,
-            createdAt: row.createdAt,
-          };
-        } else {
-          detailData.value = null;
-        }
+        // if (current.length) {
+        //   const row = current[0] as { problem?: string; creatorName?: string; createdAt?: string };
+        //   detailData.value = {
+        //     problem: row.problem,
+        //     creatorName: row.creatorName,
+        //     createdAt: row.createdAt,
+        //   };
+        // } else {
+        //   detailData.value = null;
+        // }
       } else {
         rawTableData.value = list;
         const first = list[0] as { problem?: string; creatorName?: string; createdAt?: string } | undefined;
-        detailData.value = first
-          ? { problem: first.problem, creatorName: first.creatorName, createdAt: first.createdAt }
-          : null;
+        // detailData.value = first
+        //   ? { problem: first.problem, creatorName: first.creatorName, createdAt: first.createdAt }
+        //   : null;
       }
     } catch (e) {
       console.error('获取举一反三列表失败:', e);
       rawTableData.value = [];
-      detailData.value = null;
+      // detailData.value = null;
     } finally {
       tableConfig.loading = false;
     }

+ 19 - 6
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/oneByOneManagement/oneByOneManagement.vue

@@ -106,7 +106,7 @@
                 <!-- 待审核 statusId=4 -->
                 <template v-else-if="scope.row.statusId === 4">
                   <ActionButton text="通知对象" @click="handleNotifyTarget(scope.row)" />
-                  <ActionButton text="审核" @click="handleAudit(scope.row.id)" />
+                  <ActionButton text="审核" @click="handleAudit(scope.row)" />
                   <ActionButton
                     text="作废"
                     :popconfirm="{ title: '确定要作废该记录?' }"
@@ -180,7 +180,7 @@
         <el-button type="primary" @click="handleIssueSubmit">保存</el-button>
       </template>
     </el-dialog>
-    <BatchImport
+    <!-- <BatchImport
       v-if="batchImportVisible"
       :visible="batchImportVisible"
       :import-api-url="importApiUrl"
@@ -189,7 +189,7 @@
       :show-template="false"
       @close="batchImportVisible = false"
       @update="handleUpdate"
-    />
+    /> -->
   </div>
 </template>
 
@@ -279,6 +279,8 @@
           feedbackCount: item.feedbackCount ?? 0,
           feedbackRatio: item.feedbackRatio,
           associationOtTimeLimit: item.associationOtTimeLimit,
+          creatorName: item.creatorName,
+          createdAt: item.createdAt,
         }));
         pagination.total = (res as any).totalRow ?? (res as any).total ?? 0;
       }
@@ -361,12 +363,23 @@
   };
 
   /** 审核:跳转审核详情页 */
-  const handleAudit = (id: number) => {
+  const handleAudit = (row: { id: number; statusId: number }) => {
+    // router.push({
+    //   name: 'oneByOneManagementItem',
+    //   query: {
+    //     id: String(id),
+    //     operate: 'one-by-one-audit-detail',
+    //   },
+    // });
     router.push({
       name: 'oneByOneManagementItem',
       query: {
-        id: String(id),
-        operate: 'one-by-one-audit-detail',
+        id: String(row.id),
+        statusId: row.statusId,
+        problem: row.problem,
+        creatorName: row.creatorName,
+        createdAt: row.createdAt,
+        operate: 'one-by-one-notify-target',
       },
     });
   };