sunqijun недель назад: 3
Родитель
Сommit
d4cbfee0f2

+ 6 - 3
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagementDept/components/areaCheckPlanRecordDetailDept.vue

@@ -289,15 +289,18 @@
 })
 // 开始任务检查的检查明细列表
   const loadCheckItems = async () => {
-    if (!planId.value) {
+    if (!recordId.value) {
       // 没有计划ID时,不展示任何检查明细
       checkItems.value = [];
       return;
     }
     try {
-      const res = await fetchDeptAreaCheckRecord(planId.value);
+      const res = await fetchDeptAreaCheckRecord(recordId.value);
       const list = res.areaCheckRecords || [];
       checkItemData = res
+      if(checkType.value === 1){
+        formData.value.inspectedUnit = res.checkedCompanyName || ''
+      }
       if (Array.isArray(list) && list.length > 0) {
         checkItems.value = list;
       } else {
@@ -336,7 +339,7 @@
   };
   const viewDetailData = ref<Record<string, unknown>>({});
   const authority = ref(false)
-  const currentId = computed(() => Number(route.query.planId));
+  const currentId = computed(() => Number(route.query.recordId));
   const getDetail = async () => {
     if (!currentId.value) return;
     try {

+ 20 - 4
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanTaskDept/areaCheckPlanTaskDept.vue

@@ -81,15 +81,14 @@
             </template>
             <template #checkItemTotal="scope">
               <span>{{
-                scope.row.checkItemTotal ? scope.row.checkItemTotal+'项' : '-'
+                scope.row.checkItemTotal ?? 0
               }}</span>
             </template>
             <template #qualifiedItemNum="scope">
-              <span>{{ scope.row.qualifiedItemNum ? scope.row.qualifiedItemNum+'项' : '-' }}</span>
+              <span>{{ scope.row.qualifiedItemNum ?? 0 }}</span>
             </template>
             <template #unqualifiedItemNum="scope">
-              <span style="color:#1777ff;" v-if="scope.row.unqualifiedItemNum" @click="openUnqualifiedDialog(scope.row)">{{ scope.row.unqualifiedItemNum+'项'}}</span>
-              <span v-else>-</span>
+              <span style="color:#1777ff;cursor: pointer;"  @click="openUnqualifiedDialog(scope.row)">{{ scope.row.unqualifiedItemNum ?? 0 }}</span>
             </template>
             <template #action="scope">
               <div class="action-container--div" style="justify-content: left">
@@ -552,6 +551,7 @@
       { label: '室内外停车场', value: '室内外停车场' },
     ];
     getTableData();
+    loadDeptAndUserOptionsDept();
     onIssueDialogOpen();
   });
 
@@ -647,6 +647,22 @@
     walk(nodes);
     return list;
   }
+
+  const loadDeptAndUserOptionsDept = async () => {
+    try {
+      const [deptRes, userRes] = await Promise.all([
+        getAllDepartments(),
+        queryAvailableUserList({ pageNumber: 1, pageSize: 9999, queryParam: {} }),
+      ]);
+      const fullTree = (deptRes as DeptTree[]) ?? [];
+      deptTree.value = Array.isArray(fullTree) && fullTree[0]?.children ? fullTree[0].children : [];
+      reviewUserListDept.value = (userRes as any)?.records ?? [];
+    } catch (e) {
+      console.error('获取部门/用户列表失败:', e);
+      deptTree.value = [];
+      reviewUserListDept.value = [];
+    }
+  };
   const openUnqualifiedDialog = (row: { id?: number } & Record<string, unknown>) => {
     if (!row.id) return;
     currentRecordIdForUnqualified.value = Number(row.id);

+ 8 - 6
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanTaskDept/components/areaCheckPlanRecordDetail.vue

@@ -303,19 +303,21 @@
 })
 // 开始任务检查的检查明细列表
   const loadCheckItems = async () => {
-    if (!planId.value) {
+    if (!recordId.value) {
       // 没有计划ID时,不展示任何检查明细
       checkItems.value = [];
       return;
     }
     try {
-      const res = await fetchDeptAreaCheckRecord(planId.value);
+      const res = await fetchDeptAreaCheckRecord(recordId.value);
       const list = res.areaCheckRecords || [];
       checkItemData = res
+      if(checkType.value === 1){
+        formData.value.inspectedUnit = res.checkedCompanyName || ''
+      }
       if (Array.isArray(list) && list.length > 0) {
         checkItems.value = list;
       } else {
-        // 模板为空时,不展示任何检查明细
         checkItems.value = [];
       }
     } catch (e) {
@@ -329,10 +331,10 @@
     if (isAddMode.value) {
       const { planName, checkVenue } = route.query;
       formData.value = {
-        inspectedUnit: planName ? String(planName) : '',
+        inspectedUnit: '', // planName ? String(planName) : '',
         inspector: '',
         checkTime: '',
-        checkPlace: checkVenue ? String(checkVenue) : '',
+        checkPlace: '', //checkVenue ? String(checkVenue) : '',
         overallDesc: '',
         signFile: '',
       };
@@ -350,7 +352,7 @@
   };
 
   const authority = ref(false)
-  const currentId = computed(() => Number(route.query.planId));
+  const currentId = computed(() => Number(route.query.recordId));
   const getDetail = async () => {
     if (!currentId.value) return;
     try {