Преглед на файлове

feat: 施工安全作业管理列表

sunqijun преди 3 месеца
родител
ревизия
9adf325b71

+ 26 - 1
src/api/production-safety/responsibility-implementation/index.ts

@@ -704,4 +704,29 @@ export function safetyHazardInventoryUpdatePlan(params) {
     method: 'put',
     params
   });
-}
+}
+
+
+/**
+ * 分页查询施工安全数据(施工侧)
+ * @param params - 查询参数
+ * @returns Promise<void>
+ */
+export function constructionSafetyQueryPageConstruction(params) {
+  return http.request({
+    url: `/constructionSafety/queryPageConstruction`,
+    method: 'post',
+    params
+  });
+}
+/**
+ * 根据 ID 删除施工安全记录
+ * @param id - 施工安全记录 ID
+ * @returns Promise<void>
+ */
+export function constructionSafetyDeleteConstructionById(id) {
+  return http.request({
+    url: `/constructionSafety/deleteConstructionById/${id}`,
+    method: 'delete',
+  });
+}

+ 78 - 1
src/router/routers/production-safety-router/risk-identification-and-control.ts

@@ -181,7 +181,84 @@
             hidden: false,
             noCache: false,
           }
-        }],
+        },
+      
+        // 施工作业安全管理
+        {
+          id: 93008,
+          parentId: 90014,
+          name: 'constructionSafetyManage',
+          path: 'construction-safety-manage',
+          component: '/production-safety/risk-identification-and-control/construction-safety-manage/list',
+          meta: {
+            title: '施工作业安全管理',
+            icon: 'OverviewIcon',
+            isRoot: false,
+            hidden: false,
+            noCache: false,
+          }
+        },
+        {
+          id: 93009,
+          parentId: 90014,
+          name: 'constructionSafetyManageView',
+          path: 'construction-safety-manage-view',
+          component: '/production-safety/risk-identification-and-control/construction-safety-manage/view',
+          meta: {
+            title: '查看施工作业安全',
+            activeMenu: '/work-safety/risk-identification-and-control/construction-safety-manage',
+            icon: 'OverviewIcon',
+            isRoot: false,
+            hidden: false,
+            noCache: false,
+          }
+        },
+        {
+          id: 93010,
+          parentId: 90014,
+          name: 'constructionSafetyManageAdd',
+          path: 'construction-safety-manage-add',
+          component: '/production-safety/risk-identification-and-control/construction-safety-manage/add',
+          meta: {
+            title: '新增施工作业安全',
+            activeMenu: '/work-safety/risk-identification-and-control/construction-safety-manage',
+            icon: 'OverviewIcon',
+            isRoot: false,
+            hidden: false,
+            noCache: false,
+          }
+        },
+        {
+          id: 93011,
+          parentId: 90014,
+          name: 'constructionSafetyManageEdit',
+          path: 'construction-safety-manage-edit',
+          component: '/production-safety/risk-identification-and-control/construction-safety-manage/edit',
+          meta: {
+            title: '编辑施工作业安全',
+            activeMenu: '/work-safety/risk-identification-and-control/construction-safety-manage',
+            icon: 'OverviewIcon',
+            isRoot: false,
+            hidden: false,
+            noCache: false,
+          }
+        },
+        {
+          id: 93012,
+          parentId: 90014,
+          name: 'constructionSafetyManageMonitor',
+          path: 'construction-safety-manage-monitor',
+          component: '/production-safety/risk-identification-and-control/construction-safety-manage/monitor',
+          meta: {
+            title: '视频监控',
+            activeMenu: '/work-safety/risk-identification-and-control/construction-safety-manage',
+            icon: 'OverviewIcon',
+            isRoot: false,
+            hidden: false,
+            noCache: false,
+          }
+        },
+      ],
     }];
      
      export default riskIdentificationAndControlRoutes; 

+ 1 - 0
src/views/production-safety/risk-identification-and-control/construction-safety-manage/add.vue

@@ -0,0 +1 @@
+<template> xxx </template>

+ 1 - 0
src/views/production-safety/risk-identification-and-control/construction-safety-manage/edit.vue

@@ -0,0 +1 @@
+<template> xxx </template>

+ 249 - 0
src/views/production-safety/risk-identification-and-control/construction-safety-manage/list.vue

@@ -0,0 +1,249 @@
+<template>
+  <div class="safety-platform-container">
+    <header class="safety-platform-container__header">
+      <div class="breadcrumb-title"> 施工作业安全管理 </div>
+    </header>
+    <main class="safety-platform-container__main">
+      <div class="search-form">
+        <el-form :inline="true">
+          <el-form-item label="项目名称">
+            <el-input v-model="queryParams.queryParam.projectName" placeholder="搜索项目名称" style="width: 170px" />
+          </el-form-item>
+          <el-form-item label="状态">
+            <el-select v-model="queryParams.queryParam.status" clearable placeholder="状态" style="width: 170px">
+              <el-option value="" label="全部" />
+              <el-option :value="1" label="待提交" />
+              <el-option :value="2" label="待审批" />
+              <el-option :value="3" label="已完成" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="部门名称">
+            <el-cascader
+              v-model="queryParams.queryParam.departmentId"
+              style="width: 170px"
+              ref="cascaderRef"
+              :options="firstLevelDepts"
+              :props="cascaderProp"
+              :show-all-levels="false"
+              placeholder="部门名称"
+              filterable
+              @change="handleChangeDept"
+            />
+          </el-form-item>
+          <el-form-item label="施工地点">
+            <el-input
+              v-model="queryParams.queryParam.constructionLocation"
+              placeholder="输入施工地点"
+              style="width: 170px"
+            />
+          </el-form-item>
+        </el-form>
+
+        <div>
+          <el-button type="primary" @click="$router.push({ name: 'hazardManageAdd' })">添加 </el-button>
+          <el-button type="primary" @click="queryTableList">查询</el-button>
+          <el-button @click="handleRestParams">重置</el-button>
+        </div>
+      </div>
+
+      <div class="table-content">
+        <el-table :data="tableData.data">
+          <el-table-column type="index" label="序号" width="80" />
+          <el-table-column label="项目名称" prop="projectName" width="180" />
+          <el-table-column label="申请单号" prop="code" width="180" />
+          <el-table-column label="施工地点(区域)" prop="constructionLocation" width="180" />
+          <el-table-column label="工程施工内容简要描述 " prop="constructionContent" width="230" />
+          <el-table-column label="施工单位名称" prop="constructionUnit" width="180" />
+          <el-table-column label="施工项目负责人" prop="projectManagerName" width="180" />
+          <el-table-column label="施工现场安全负责人" prop="siteSafetyManagerName" width="240" />
+          <el-table-column label="当前流程节点" prop="nodeDescription" width="80" />
+          <el-table-column label="状态" props="statusName" width="100" />
+          <el-table-column fixed="right" min-width="240" label="操作">
+            <template #default="scope">
+              <el-button
+                type="primary"
+                link
+                @click="$router.push({ name: 'hazardManageEdit', query: { id: scope.row.id } })"
+                >编辑</el-button
+              >
+
+              <el-button type="primary" link @click="handleConfirmDeleteRow(scope)">删除</el-button>
+              <el-button
+                type="primary"
+                link
+                @click="$router.push({ name: 'hazardManageView', query: { id: scope.row.id } })"
+                >查看</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <div class="pagination-container" v-if="tableData.total > 0">
+        <el-pagination
+          background
+          :current-page="queryParams.pageNumber"
+          :page-size="queryParams.pageSize"
+          :total="tableData.total"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+        />
+      </div>
+    </main>
+  </div>
+</template>
+<script lang="ts" setup>
+  import { onMounted, reactive, ref } from 'vue';
+  import { ElMessage } from 'element-plus';
+  import { useRouter } from 'vue-router';
+  import {
+    constructionSafetyQueryPageConstruction,
+    constructionSafetyDeleteConstructionById,
+  } from '@/api/production-safety/responsibility-implementation';
+  import { omit } from 'lodash-es';
+  import { useUserInfoHook } from '@/hooks/useUserInfoHook';
+  import { unformatAttachment } from '@/components/UploadFiles/utils';
+  import { downloadFile } from '@/views/disaster/utils';
+  import { formatDeptTree } from '@/views/disaster/utils/formatDeptTree';
+  import { getAllDepartments } from '@/api/auth/dept';
+
+  const router = useRouter();
+  const { id } = useUserInfoHook();
+  const firstLevelDepts = ref<any[]>([]);
+  const cascaderProp = {
+    expandTrigger: 'click',
+    checkStrictly: true,
+    // emitPath: false,
+    value: 'id',
+    label: 'deptName',
+  };
+  const queryParams = reactive<any>({
+    pageNumber: 1,
+    pageSize: 10,
+    queryParam: {
+      status: '',
+      projectName: '',
+      constructionLocation: '',
+      department: '',
+      departmentId: [],
+    },
+  });
+  const cascaderRef = ref();
+
+  const tableData = reactive({
+    data: [],
+    total: 0,
+  });
+
+  const handleSizeChange = (value) => {};
+
+  const handleCurrentChange = (value) => {
+    queryParams.pageNumber = value;
+    queryTableList();
+  };
+
+  const getDeptData = () => {
+    getAllDepartments().then((res) => {
+      firstLevelDepts.value = formatDeptTree(res);
+    });
+  };
+  const handleChangeDept = () => {
+    const deptInfo = cascaderRef.value?.getCheckedNodes();
+    if (deptInfo?.[0]) {
+      queryParams.queryParam.department = deptInfo[0].label;
+      queryParams.queryParam.departmentId = deptInfo[0].pathValues;
+    }
+  };
+
+  const handleConfirmDeleteRow = (scope) => {
+    constructionSafetyDeleteConstructionById(scope.row.id).then(() => {
+      ElMessage.success('删除成功!');
+      queryTableList();
+    });
+  };
+
+  const queryTableList = () => {
+    constructionSafetyQueryPageConstruction({
+      ...queryParams,
+      queryParam: {
+        ...omit(queryParams.queryParam, 'responsibleDepartmentId'),
+      },
+    }).then((res) => {
+      tableData.data = res.records;
+      tableData.total = res.totalRow;
+    });
+  };
+  const handleRestParams = () => {
+    Object.assign(queryParams, {
+      pageNumber: 1,
+      pageSize: 10,
+      queryParam: {
+        ...queryParams.queryParam,
+        status: '',
+        projectName: '',
+        constructionLocation: '',
+        department: '',
+        departmentId: [],
+      },
+    });
+    queryTableList();
+  };
+
+  onMounted(async () => {
+    await getDeptData();
+    queryTableList();
+  });
+</script>
+
+<style lang="scss" scoped>
+  @use '@/styles/page-details-layout.scss' as *;
+  @use '@/styles/page-main-layout.scss' as *;
+  @use '@/styles/basic-table-action.scss' as *;
+
+  :deep(.el-tabs__header) {
+    margin: 0;
+  }
+  :deep(.el-tabs__item) {
+    font-size: 14px !important;
+  }
+  :deep(.flexContent) {
+    display: flex;
+  }
+  :deep(.breadcrumb .title) {
+    margin-left: 0;
+  }
+
+  :deep(.el-form) {
+    flex: 1;
+    display: flex;
+    row-gap: 15px;
+    flex-wrap: wrap;
+  }
+  :deep(.el-form-item) {
+    margin-bottom: 0;
+  }
+  :deep(main) {
+    display: flex;
+    flex-direction: column;
+  }
+  .search-form {
+    min-width: 800px;
+    display: flex;
+
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 20px;
+  }
+
+  .button-content {
+    margin-bottom: 20px;
+  }
+  .table-content {
+    flex: 1;
+    overflow: hidden;
+    overflow-y: auto;
+  }
+  .page-content {
+    display: flex;
+    justify-content: flex-end;
+  }
+</style>

+ 1 - 0
src/views/production-safety/risk-identification-and-control/construction-safety-manage/monitor.vue

@@ -0,0 +1 @@
+<template>monitor</template>

+ 1 - 0
src/views/production-safety/risk-identification-and-control/construction-safety-manage/view.vue

@@ -0,0 +1 @@
+<template> xxx </template>