Browse Source

Merge branch 'cc-dev' into 'dev'

修复灾害处置查看bug 需要整合代码

See merge request product-group-fe/sfy-safety-group/sfy-safety!85
陈昶 10 months ago
parent
commit
1af15b4ec4

+ 23 - 0
src/views/disaster/disaster-control/PageViewDisposalRectification.vue

@@ -92,6 +92,7 @@
     if (!lossRecordList.value.length) return;
     lossRecordListInfo.value = lossRecordList.value.find((item) => item.fixTaskId === activeTaskId.value);
     getFixUserList(lossRecordListInfo.value?.fixPrincipals);
+    getFixRecordUser();
   };
   const handleActiveReportRecordId = (reportRecordId: number) => {
     activeReportRecordId.value = reportRecordId;
@@ -133,6 +134,7 @@
       activeTaskId.value = lossRecordList.value[0].fixTaskId;
       lossRecordListInfo.value = lossRecordList.value.find((item) => item.fixTaskId === activeTaskId.value);
       getFixUserList(lossRecordListInfo.value?.fixPrincipals);
+      getFixRecordUser();
     }
   };
   const rectificationResponsibleUserList = ref<PersonGroupItem[]>([]);
@@ -146,6 +148,26 @@
     const res = await queryUserInfoByIds(ids);
     rectificationResponsibleUserList.value = res;
   };
+  const getFixRecordUser = () => {
+    const fixRecordList = lossRecordListInfo.value?.fixRecordList;
+    if (fixRecordList?.length) {
+      const updatedList = Promise.all(
+        fixRecordList.map(async (item) => {
+          if (!item.createdBy) return item;
+          const res = await queryUserInfoByIds([item.createdBy]);
+          return {
+            ...item,
+            createdByName: `${res[0].realname}(${res[0].staffNo})`,
+          };
+        }),
+      );
+      updatedList.then((result) => {
+        if (lossRecordListInfo.value) {
+          lossRecordListInfo.value.fixRecordList = result;
+        }
+      });
+    }
+  };
   onMounted(async () => {
     await getDisasterLossDetailList({
       handleTaskId,
@@ -162,6 +184,7 @@
     }
     lossRecordListInfo.value = lossRecordList.value.find((item) => item.fixTaskId === activeTaskId.value);
     getFixUserList(lossRecordListInfo.value?.fixPrincipals);
+    getFixRecordUser();
   });
 </script>
 

+ 23 - 0
src/views/disaster/disaster-control/src/components/ViewDisposalControlItem.vue

@@ -72,6 +72,7 @@
       activeTaskId.value = lossRecordList.value[0].fixTaskId;
       lossRecordListInfo.value = lossRecordList.value.find((item) => item.fixTaskId === activeTaskId.value);
       getFixUserList(lossRecordListInfo.value?.fixPrincipals);
+      getFixRecordUser();
     }
   };
   const handleActiveTask = (fixTaskId: number) => {
@@ -79,6 +80,7 @@
     if (!lossRecordList.value.length) return;
     lossRecordListInfo.value = lossRecordList.value.find((item) => item.fixTaskId === activeTaskId.value);
     getFixUserList(lossRecordListInfo.value?.fixPrincipals);
+    getFixRecordUser();
   };
   const reportTaskList = ref<ReportTaskListDetail[]>([]);
   const lossRecordList = ref<LossRecordListDetail[]>([]);
@@ -91,6 +93,26 @@
     const res = await queryUserInfoByIds(ids);
     rectificationResponsibleUserList.value = res;
   };
+  const getFixRecordUser = () => {
+    const fixRecordList = lossRecordListInfo.value?.fixRecordList;
+    if (fixRecordList?.length) {
+      const updatedList = Promise.all(
+        fixRecordList.map(async (item) => {
+          if (!item.createdBy) return item;
+          const res = await queryUserInfoByIds([item.createdBy]);
+          return {
+            ...item,
+            createdByName: `${res[0].realname}(${res[0].staffNo})`,
+          };
+        }),
+      );
+      updatedList.then((result) => {
+        if (lossRecordListInfo.value) {
+          lossRecordListInfo.value.fixRecordList = result;
+        }
+      });
+    }
+  };
   const getLossRecordListInfo = () => {
     if (!lossRecordListInfo.value) return;
     return {
@@ -109,6 +131,7 @@
     activeTaskId.value = lossRecordList.value[0].fixTaskId;
     lossRecordListInfo.value = lossRecordList.value.find((item) => item.fixTaskId === activeTaskId.value);
     getFixUserList(lossRecordListInfo.value?.fixPrincipals);
+    getFixRecordUser();
   });
   defineExpose({
     getLossRecordListInfo,

+ 30 - 1
src/views/disaster/disaster-control/src/components/ViewDisposalControlTaskItem.vue

@@ -65,6 +65,13 @@
       activeId.value = null;
     } else {
       activeId.value = itemId;
+      reportTaskListInfo.value = reportTaskList.value.find((item) => item.reportDeptId === activeId.value);
+      if (!reportTaskListInfo.value) return;
+      lossRecordList.value = reportTaskListInfo.value?.lossRecordList;
+      activeTaskId.value = lossRecordList.value[0].fixTaskId;
+      lossRecordListInfo.value = lossRecordList.value.find((item) => item.fixTaskId === activeTaskId.value);
+      getFixUserList(lossRecordListInfo.value?.fixPrincipals);
+      getFixRecordUser();
     }
   };
   const handleActiveTask = (fixTaskId: number) => {
@@ -72,6 +79,7 @@
     if (!lossRecordList.value.length) return;
     lossRecordListInfo.value = lossRecordList.value.find((item) => item.fixTaskId === activeTaskId.value);
     getFixUserList(lossRecordListInfo.value?.fixPrincipals);
+    getFixRecordUser();
   };
   const reportTaskList = ref<ReportTaskListDetail[]>([]);
   const lossRecordList = ref<LossRecordListDetail[]>([]);
@@ -84,6 +92,26 @@
     const res = await queryUserInfoByIds(ids);
     rectificationResponsibleUserList.value = res;
   };
+  const getFixRecordUser = () => {
+    const fixRecordList = lossRecordListInfo.value?.fixRecordList;
+    if (fixRecordList?.length) {
+      const updatedList = Promise.all(
+        fixRecordList.map(async (item) => {
+          if (!item.createdBy) return item;
+          const res = await queryUserInfoByIds([item.createdBy]);
+          return {
+            ...item,
+            createdByName: `${res[0].realname}(${res[0].staffNo})`,
+          };
+        }),
+      );
+      updatedList.then((result) => {
+        if (lossRecordListInfo.value) {
+          lossRecordListInfo.value.fixRecordList = result;
+        }
+      });
+    }
+  };
   const overviewLossRecordInfo = () => {
     return {
       needToReportDeptCount: disasterLossDetailList.value?.needToReportDeptCount,
@@ -111,10 +139,11 @@
     activeTaskId.value = lossRecordList.value[0].fixTaskId;
     lossRecordListInfo.value = lossRecordList.value.find((item) => item.fixTaskId === activeTaskId.value);
     getFixUserList(lossRecordListInfo.value?.fixPrincipals);
+    getFixRecordUser();
   });
 </script>
 
 <style lang="scss" scoped>
   @use '@/views/disaster/style/info-container.scss' as *;
   @use '../style/common.scss' as *;
-</style>
+</style>

+ 22 - 0
src/views/disaster/disaster-control/src/components/ViewLossReportItem.vue

@@ -75,6 +75,7 @@
     if (!lossRecordList.value.length) return;
     lossRecordListInfo.value = lossRecordList.value.find((item) => item.fixTaskId === activeTaskId.value);
     getFixUserList(lossRecordListInfo.value?.fixPrincipals);
+    getFixRecordUser();
   };
   const reportTaskList = ref<ReportTaskListDetail[]>([]);
   const lossRecordList = ref<LossRecordListDetail[]>([]);
@@ -87,6 +88,26 @@
     const res = await queryUserInfoByIds(ids);
     rectificationResponsibleUserList.value = res;
   };
+  const getFixRecordUser = () => {
+    const fixRecordList = lossRecordListInfo.value?.fixRecordList;
+    if (fixRecordList?.length) {
+      const updatedList = Promise.all(
+        fixRecordList.map(async (item) => {
+          if (!item.createdBy) return item;
+          const res = await queryUserInfoByIds([item.createdBy]);
+          return {
+            ...item,
+            createdByName: `${res[0].realname}(${res[0].staffNo})`,
+          };
+        }),
+      );
+      updatedList.then((result) => {
+        if (lossRecordListInfo.value) {
+          lossRecordListInfo.value.fixRecordList = result;
+        }
+      });
+    }
+  };
   const getLossRecordListInfo = () => {
     if (!lossRecordListInfo.value) return;
     return {
@@ -107,6 +128,7 @@
     }
     lossRecordListInfo.value = lossRecordList.value.find((item) => item.fixTaskId === activeTaskId.value);
     getFixUserList(lossRecordListInfo.value?.fixPrincipals);
+    getFixRecordUser();
   });
   defineExpose({
     getLossRecordListInfo,

+ 1 - 1
src/views/disaster/disaster-control/src/config/table.ts

@@ -172,7 +172,7 @@ export const RECTIFICATION_INFO_TABLE_COLUMNS: TableColumnProps[] = [
   {
     label: '整改人',
     prop: 'createdByName',
-    minWidth: '120px',
+    minWidth: '200px',
   },
   {
     label: '备注',