Sfoglia il codice sorgente

fix: 隐患台账补充部门,隐患筛选,修改参数

xiaweibo 1 mese fa
parent
commit
9c17997d20

+ 3 - 3
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/hiddenTroubleAccountManagement/components/hiddenTroubleAccountManagementDetail.vue

@@ -9,10 +9,10 @@
   <main class="safety-platform-container__main">
     
     <el-form label-width="150px" :model="ruleFormData" :rules="isViewMode ? undefined : formRules" ref="basicFormRef">
-      <el-form-item label="隐患问题类别:" prop="typeId">
+      <el-form-item label="隐患类别:" prop="typeId">
         <el-select
           v-model="ruleFormData.typeId"
-          placeholder="请选择隐患问题类别"
+          placeholder="请选择隐患类别"
           clearable
           filterable
           :disabled="isViewMode"
@@ -502,7 +502,7 @@ const attachmentsFileList = ref([]) as any
     const walk = (items: DeptTree[]) => {
       items.forEach((n) => {
         if (n.id != null) list.push({ id: n.id, deptName: n.deptName });
-        if (n.children?.length) walk(n.children);
+        // if (n.children?.length) walk(n.children);
       });
     };
     walk(nodes);

+ 31 - 10
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/hiddenTroubleAccountManagement/configs/tables.ts

@@ -15,6 +15,12 @@ export const HIDDEN_DANGER_TABLE_COLUMNS: TableColumnProps[] = [
     align: 'center',
     width: '80px',
   },
+  {
+    label: '隐患类别',
+    prop: 'typeName',
+    align: 'left',
+    minWidth: '150px',
+  },
   {
     label: '隐患问题',
     prop: 'dangerProblem',
@@ -38,25 +44,33 @@ export const HIDDEN_DANGER_TABLE_COLUMNS: TableColumnProps[] = [
     prop: 'taskSource',
     align: 'left',
     minWidth: '120px',
+  },
+    {
+    label: '整改部门',
+    prop: 'rectificationDepartmentNames',
+    align: 'left',
+    minWidth: '200px',
+    slot: 'rectificationDepartmentNames',
   },
   {
-    label: '整改要求',
-    prop: 'rectificationRequirement',
+    label: '整改负责人',
+    prop: 'rectificationResponsiblePerson',
     align: 'left',
     minWidth: '200px',
+    slot: 'rectificationResponsiblePerson',
   },
   {
-    label: '隐患问题类别',
-    prop: 'typeName',
+    label: '是否举一反三',
+    prop: 'isDrawLessonsPush',
     align: 'left',
-    minWidth: '150px',
+    minWidth: '200px',
+    slot: 'isDrawLessonsPush',
   },
   {
-    label: '当前流程节点',
-    // prop: 'currentNode',
-    slot: 'currentNode',
-    align: 'center',
-    minWidth: '150px',
+    label: '整改要求',
+    prop: 'rectificationRequirement',
+    align: 'left',
+    minWidth: '200px',
   },
   {
     label: '状态',
@@ -65,6 +79,13 @@ export const HIDDEN_DANGER_TABLE_COLUMNS: TableColumnProps[] = [
     align: 'center',
     minWidth: '100px',
   },
+  {
+    label: '当前流程节点',
+    // prop: 'currentNode',
+    slot: 'currentNode',
+    align: 'center',
+    minWidth: '150px',
+  },
   {
     label: '操作',
     prop: 'action',

+ 81 - 2
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/hiddenTroubleAccountManagement/hiddenTroubleAccountManagement.vue

@@ -50,6 +50,36 @@
                   clearable
                 />
               </div>
+              <div class="select-box--item">
+                <span>部门名称:</span>
+                <el-cascader
+                  v-model="tableQuery.queryParam.rectificationDepartmentId"
+                  style="width: 170px"
+                  ref="cascaderRef"
+                  :options="firstLevelDepts"
+                  :props="cascaderProp"
+                  :show-all-levels="false"
+                  placeholder="部门名称"
+                  filterable
+                  @change="handleChangeDept"
+                />
+              </div>
+              <div class="select-box--item">
+                <span>隐患类别:</span>
+                <el-select
+                  v-model="tableQuery.queryParam.typeId"
+                  placeholder="请选择隐患类别"
+                  clearable
+                  filterable
+                >
+                  <el-option
+                    v-for="option in hiddenRiskCategoriesList || []"
+                    :key="option.id"
+                    :label="option.categoryName"
+                    :value="option.id"
+                  />
+                </el-select>
+              </div>
             </section>
             <section class="search-btn">
               <el-button type="primary" @click="handleSearch">查询</el-button>
@@ -69,6 +99,15 @@
             @update:pageSize="handleSizeChange"
             @update:pageNumber="handleCurrentChange"
           >
+            <template #rectificationDepartmentNames="scope">
+              <span>{{ scope.row.rectificationDepartmentNames || '-' }}</span>
+            </template>
+            <template #rectificationResponsiblePerson="scope">
+              <span>{{ scope.row.rectificationResponsiblePerson || '-' }}</span>
+            </template>
+            <template #isDrawLessonsPush="scope">
+              <span>{{ scope.row.isDrawLessonsPush === 1 ? '是' : '否' }}</span>
+            </template>
             <template #currentNode="scope">
               <span>{{ scope.row.currentNode  }}</span>
             </template>
@@ -248,10 +287,13 @@
   import BatchImport from '@/components/batch-import/BatchImport.vue';
   import { useGlobSetting } from '@/hooks/setting';
   import urlJoin from 'url-join';
+  import { formatDeptTree } from '@/views/disaster/utils/formatDeptTree';
   import { useUserInfoHook } from '@/hooks/useUserInfoHook'
+  import { queryDangerTypePage } from '@/api/production-safety';
   const { id } = useUserInfoHook();
-
+  const cascaderRef = ref();
   const router = useRouter();
+  const hiddenRiskCategoriesList = ref();
 
   // 表格
   const basicTableRef = ref<InstanceType<typeof BasicTable>>();
@@ -267,9 +309,20 @@
       keyword: '',
       status: undefined,
       taskSource: '',
+      rectificationDepartmentId: undefined,
+      typeId: undefined,
     },
   });
 
+  const firstLevelDepts = ref<any[]>([]);
+  const cascaderProp = {
+    expandTrigger: 'hover',
+    checkStrictly: true,
+    // emitPath: false,
+    value: 'id',
+    label: 'deptName',
+  };
+
   const handleSizeChange = (value: number) => {
     pagination.pageSize = value;
     tableQuery.pageSize = value;
@@ -302,6 +355,9 @@
           statusId: item.statusId,
           reviewPersonId: item.reviewPersonId,
           rectificationResponsibleIds: Number(item.rectificationResponsibleIds),
+          rectificationDepartmentNames: item.rectificationDepartmentNames,
+          rectificationResponsiblePerson: item.rectificationResponsiblePerson,
+          isDrawLessonsPush: item.isDrawLessonsPush,
         }));
         pagination.total = (res as any).totalRow ?? (res as any).total ?? 0;
       } else {
@@ -588,8 +644,31 @@
     });
   };
 
-  onMounted(() => {
+  const getDeptData = () => {
+    getAllDepartments().then((res) => {
+      firstLevelDepts.value = formatDeptTree(res);
+    });
+  };
+
+  const handleChangeDept = () => {
+    const deptInfo = cascaderRef.value?.getCheckedNodes();
+    if (deptInfo?.[0]) {
+      tableQuery.queryParam.rectificationDepartmentId = deptInfo[0].value;
+    }
+  };
+
+  onMounted(async () => {
     getTableData();
+    getDeptData();
+    await queryDangerTypePage({
+      pageNumber: 1,
+      pageSize: 9999,
+      queryParam: {
+        status: 1
+      }
+    }).then(res => {
+      hiddenRiskCategoriesList.value = res?.records || [];
+    });
   });
 </script>
 

+ 1 - 1
src/views/production-safety/productionSafetySystem/safetySystemConstructionWorkPlanManagement/components/safetySystemConstructionWorkPlanManagementDetail.vue

@@ -284,7 +284,7 @@
     const res = await handleValidate();
     if (!res) return;
     try {
-      if (isViewMode && form.fileUrl) {
+      if (isViewMode.value && form.fileUrl) {
         // 处理附件格式
         form.fileUrl = JSON.parse(form.fileUrl)[0].url;
       }