|
|
@@ -1,13 +1,17 @@
|
|
|
<template>
|
|
|
<div class="safety-platform-container">
|
|
|
<header class="safety-platform-container__header">
|
|
|
- <div class="breadcrumb-title"> 施工作业安全管理 </div>
|
|
|
+ <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 label="申请单位名称">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.queryParam.applicationUnitName"
|
|
|
+ placeholder="申请单位名称"
|
|
|
+ style="width: 170px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="状态">
|
|
|
<el-select v-model="queryParams.queryParam.status" clearable placeholder="状态" style="width: 170px">
|
|
|
@@ -17,9 +21,12 @@
|
|
|
<el-option :value="3" label="已完成" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="部门名称">
|
|
|
+ <el-form-item label="申请人名称">
|
|
|
+ <el-input v-model="queryParams.queryParam.applicantName" placeholder="搜索申请人" style="width: 170px" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="申请部门">
|
|
|
<el-cascader
|
|
|
- v-model="queryParams.queryParam.departmentId"
|
|
|
+ v-model="queryParams.queryParam.applicationDepartmentId"
|
|
|
style="width: 170px"
|
|
|
ref="cascaderRef"
|
|
|
:options="firstLevelDepts"
|
|
|
@@ -30,17 +37,10 @@
|
|
|
@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="$router.push({ name: 'hazardApprovalManageAdd' })">添加 </el-button>
|
|
|
<el-button type="primary" @click="queryTableList">查询</el-button>
|
|
|
<el-button @click="handleRestParams">重置</el-button>
|
|
|
</div>
|
|
|
@@ -49,37 +49,46 @@
|
|
|
<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="180" />
|
|
|
- <el-table-column label="状态" props="statusName" width="100" />
|
|
|
+ <el-table-column label="申请单号" width="150" prop="code" />
|
|
|
+ <el-table-column label="申请单位" width="180" prop="applicationUnitName" />
|
|
|
+ <el-table-column label="申请人" width="180" prop="applicantName" />
|
|
|
+ <el-table-column label="申请部门" width="180" prop="applicationDepartment" />
|
|
|
+ <el-table-column label="申请人电话" width="180" prop="applicantPhone" />
|
|
|
+ <el-table-column label="作业类别" width="180" prop="hazardOperationType" />
|
|
|
+ <el-table-column label="申请状态" width="120" prop="statusName" />
|
|
|
+ <el-table-column label="申请时间" width="180" prop="createdAt" />
|
|
|
+ <el-table-column label="备注" width="180" prop="remark" />
|
|
|
+ <el-table-column label="当前节点名称" width="180" prop="nodeDescription" />
|
|
|
+
|
|
|
<el-table-column fixed="right" min-width="240" label="操作">
|
|
|
<template #default="scope">
|
|
|
+ <el-button v-if="scope.row.status === 1" type="primary" link @click="handleSendApproval(scope)"
|
|
|
+ >提交</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
link
|
|
|
- @click="$router.push({ name: 'constructionSafetyManageEdit', query: { id: scope.row.id } })"
|
|
|
+ @click="$router.push({ name: 'hazardApprovalManageEdit', query: { id: scope.row.id } })"
|
|
|
>编辑</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
link
|
|
|
- @click="$router.push({ name: 'constructionSafetyManageView', query: { id: scope.row.id } })"
|
|
|
+ @click="$router.push({ name: 'hazardApprovalManageView', query: { id: scope.row.id } })"
|
|
|
>查看</el-button
|
|
|
>
|
|
|
|
|
|
- <el-button type="primary" link @click="handleConfirmDeleteRow(scope)">删除</el-button>
|
|
|
+ <el-popconfirm title="确定要删除吗?" @confirm="handleConfirmDeleteRow(scope)">
|
|
|
+ <template #reference>
|
|
|
+ <el-button type="primary" link>删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
|
|
|
<el-button type="primary" link>审批</el-button>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
link
|
|
|
- @click="$router.push({ name: 'constructionSafetyManageMonitor', query: { id: scope.row.id } })"
|
|
|
+ @click="$router.push({ name: 'hazardApprovalManageMonitor', query: { id: scope.row.id } })"
|
|
|
>视频监控</el-button
|
|
|
>
|
|
|
</template>
|
|
|
@@ -98,25 +107,91 @@
|
|
|
</div>
|
|
|
</main>
|
|
|
</div>
|
|
|
+ <BasicDialog
|
|
|
+ v-if="approvalVisible"
|
|
|
+ v-model="approvalVisible"
|
|
|
+ ref="basicDialogRef"
|
|
|
+ title="提交审批"
|
|
|
+ @refresh="closeApprovalDialog"
|
|
|
+ >
|
|
|
+ <template #form>
|
|
|
+ <div class="form">
|
|
|
+ <el-form ref="approvalFormRef" :model="approvalForm">
|
|
|
+ <el-form-item label="审批描述:" label-position="top">
|
|
|
+ <el-input v-model="approvalForm.description" placeholder="请输入审批描述" type="textarea" />
|
|
|
+ </el-form-item>
|
|
|
+ <div class="form-item">
|
|
|
+ <span>审批流程:</span>
|
|
|
+ <template v-for="item in approvalNodeList" :key="item.id">
|
|
|
+ <el-form-item
|
|
|
+ :label="`第${item.approvalOrder}步:${item.nodeDescription}(${APPROVAL_TYPE_MAP[item.approvalType]})`"
|
|
|
+ label-position="top"
|
|
|
+ :prop="item.approverType !== APPROVER_TYPE.FIX ? `approvers.${item.id}` : ''"
|
|
|
+ :rules="{ required: true, message: '请选择审批人员', trigger: 'change' }"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-if="item.approverType === APPROVER_TYPE.FIX"
|
|
|
+ :model-value="item.approverInfoList.map((info) => info.approverName).join(',')"
|
|
|
+ disabled
|
|
|
+ />
|
|
|
+ <el-select
|
|
|
+ v-else
|
|
|
+ v-model="approvalForm.approvers[item.id]"
|
|
|
+ placeholder="请选择审批人员"
|
|
|
+ value-key="id"
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ collapse-tags
|
|
|
+ collapse-tags-tooltip
|
|
|
+ :max-collapse-tags="2"
|
|
|
+ :remote-method="remoteMethod"
|
|
|
+ :loading="loading"
|
|
|
+ multiple
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="option in userOptions"
|
|
|
+ :key="option.id"
|
|
|
+ :label="`${option.realname}(${option.username})${option.deptName}`"
|
|
|
+ :value="option.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #footer>
|
|
|
+ <el-button type="primary" @click="handleSubmitApproval">提交</el-button>
|
|
|
+ <el-button @click="approvalVisible = false">取消</el-button>
|
|
|
+ </template>
|
|
|
+ </BasicDialog>
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
import { onMounted, reactive, ref } from 'vue';
|
|
|
- import { ElMessage } from 'element-plus';
|
|
|
+ import { ElMessage, ElTableColumn } from 'element-plus';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
import {
|
|
|
- constructionSafetyQueryPageConstruction,
|
|
|
- constructionSafetyDeleteConstructionById,
|
|
|
+ constructionSafetyUpdateApply,
|
|
|
+ dangerWorkQueryPage,
|
|
|
+ dangerWorkDeleteDangerWork,
|
|
|
} from '@/api/production-safety/responsibility-implementation';
|
|
|
+ import BasicDialog from '@/components/BasicDialog.vue';
|
|
|
+ import { getApprovalNodeInstanceList } from '@/api/approval/approval';
|
|
|
+ import { submitReceiptRecordApprovalProcess } from '@/api/receiptRecord';
|
|
|
import { omit } from 'lodash-es';
|
|
|
import { useUserInfoHook } from '@/hooks/useUserInfoHook';
|
|
|
- import { unformatAttachment } from '@/components/UploadFiles/utils';
|
|
|
- import { downloadFile } from '@/views/disaster/utils';
|
|
|
+ import type { ApprovalNodeInstanceType } from '@/views/system/approval/types';
|
|
|
+
|
|
|
import { formatDeptTree } from '@/views/disaster/utils/formatDeptTree';
|
|
|
import { getAllDepartments } from '@/api/auth/dept';
|
|
|
+ import { APPROVAL_TYPE_MAP, APPROVER_TYPE } from '@/views/emergency/emergency-plan/src/constant';
|
|
|
+ import { useEmergencySuppliesHook } from '@/views/emergency/emergency-supplies/src/hook';
|
|
|
|
|
|
const router = useRouter();
|
|
|
const { id } = useUserInfoHook();
|
|
|
const firstLevelDepts = ref<any[]>([]);
|
|
|
+ const approvalVisible = ref(false);
|
|
|
const cascaderProp = {
|
|
|
expandTrigger: 'click',
|
|
|
checkStrictly: true,
|
|
|
@@ -129,10 +204,9 @@
|
|
|
pageSize: 10,
|
|
|
queryParam: {
|
|
|
status: '',
|
|
|
- projectName: '',
|
|
|
- constructionLocation: '',
|
|
|
- department: '',
|
|
|
- departmentId: [],
|
|
|
+ applicationUnitName: '',
|
|
|
+ applicantName: '',
|
|
|
+ applicationDepartmentId: [],
|
|
|
},
|
|
|
});
|
|
|
const cascaderRef = ref();
|
|
|
@@ -154,23 +228,17 @@
|
|
|
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 handleChangeDept = () => {};
|
|
|
|
|
|
const handleConfirmDeleteRow = (scope) => {
|
|
|
- constructionSafetyDeleteConstructionById(scope.row.id).then(() => {
|
|
|
+ dangerWorkDeleteDangerWork(scope.row.id).then(() => {
|
|
|
ElMessage.success('删除成功!');
|
|
|
queryTableList();
|
|
|
});
|
|
|
};
|
|
|
|
|
|
const queryTableList = () => {
|
|
|
- constructionSafetyQueryPageConstruction({
|
|
|
+ dangerWorkQueryPage({
|
|
|
...queryParams,
|
|
|
queryParam: {
|
|
|
...omit(queryParams.queryParam, 'responsibleDepartmentId'),
|
|
|
@@ -187,15 +255,81 @@
|
|
|
queryParam: {
|
|
|
...queryParams.queryParam,
|
|
|
status: '',
|
|
|
- projectName: '',
|
|
|
- constructionLocation: '',
|
|
|
- department: '',
|
|
|
- departmentId: [],
|
|
|
+ applicationUnitName: '',
|
|
|
+ applicantName: '',
|
|
|
+ applicationDepartmentId: [],
|
|
|
},
|
|
|
});
|
|
|
queryTableList();
|
|
|
};
|
|
|
|
|
|
+ const basicDialogRef = ref<InstanceType<typeof BasicDialog>>();
|
|
|
+ const approvalFormRef = ref();
|
|
|
+ const approvalForm = reactive({
|
|
|
+ description: '',
|
|
|
+ approvers: {} as Record<number, any[]>,
|
|
|
+ });
|
|
|
+
|
|
|
+ const approvalNodeList = ref<ApprovalNodeInstanceType[]>([]);
|
|
|
+ const receiptRecordId = ref<number>();
|
|
|
+
|
|
|
+ const { userOptions, loading, remoteMethod } = useEmergencySuppliesHook();
|
|
|
+
|
|
|
+ const getApprovalNode = async (id: number) => {
|
|
|
+ const res = await getApprovalNodeInstanceList(id);
|
|
|
+ approvalNodeList.value = res.approvalNodeInfoList || [];
|
|
|
+ };
|
|
|
+ const handleSendApproval = async (scope) => {
|
|
|
+ await getApprovalNode(scope.row.templateId);
|
|
|
+ approvalVisible.value = true;
|
|
|
+ receiptRecordId.value = scope.row.id;
|
|
|
+ };
|
|
|
+ const resetApprovalForm = () => {
|
|
|
+ approvalFormRef.value?.resetFields();
|
|
|
+ approvalForm.description = '';
|
|
|
+ };
|
|
|
+
|
|
|
+ const closeApprovalDialog = () => {
|
|
|
+ resetApprovalForm();
|
|
|
+ basicDialogRef.value?.closeDialog();
|
|
|
+ };
|
|
|
+
|
|
|
+ const handleSubmitApproval = () => {
|
|
|
+ approvalFormRef.value?.validate(async (valid: boolean) => {
|
|
|
+ if (!valid) return;
|
|
|
+ if (!receiptRecordId?.value) {
|
|
|
+ ElMessage.error('缺少施工作业记录ID,无法提交审批');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const approvalData: any = {
|
|
|
+ id: receiptRecordId.value,
|
|
|
+ approvalDescription: approvalForm.description,
|
|
|
+ approvalInfoList: approvalNodeList.value.map((node) => {
|
|
|
+ let approverIdList: number[] = [];
|
|
|
+ if (node.approverType === APPROVER_TYPE.FIX) {
|
|
|
+ approverIdList = node.approverInfoList.map((info) => info.approverId);
|
|
|
+ } else if (approvalForm.approvers[node.id]) {
|
|
|
+ approverIdList = approvalForm.approvers[node.id];
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ approvalOrder: node.approvalOrder,
|
|
|
+ approverIdList,
|
|
|
+ };
|
|
|
+ }),
|
|
|
+ };
|
|
|
+
|
|
|
+ try {
|
|
|
+ await constructionSafetyUpdateApply(approvalData);
|
|
|
+ ElMessage.success('提交成功');
|
|
|
+ approvalVisible.value = false;
|
|
|
+ queryTableList();
|
|
|
+ } catch (e) {
|
|
|
+ ElMessage.error('提交审批失败,请重试');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
onMounted(async () => {
|
|
|
await getDeptData();
|
|
|
queryTableList();
|
|
|
@@ -220,19 +354,6 @@
|
|
|
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;
|
|
|
@@ -240,6 +361,19 @@
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
margin-bottom: 20px;
|
|
|
+ :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;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.button-content {
|