|
|
@@ -54,14 +54,27 @@
|
|
|
<span>{{ getEmergencyEvent(scope.row.eventType) }}</span>
|
|
|
</template>
|
|
|
<template #status="scope">
|
|
|
- <span>{{ getEmergencyPlanStatusLabel(scope.row.status) }}</span>
|
|
|
+ <span
|
|
|
+ :class="
|
|
|
+ scope.row.status === EMERGENCY_PLAN_STATUS.APPROVAL_IN_PROGRESS ||
|
|
|
+ scope.row.status === EMERGENCY_PLAN_STATUS.RETURNED
|
|
|
+ ? 'highlight-text'
|
|
|
+ : ''
|
|
|
+ "
|
|
|
+ @click="handleViewApprovalProcess(scope.row)"
|
|
|
+ >{{ getEmergencyPlanStatusLabel(scope.row.status) }}</span
|
|
|
+ >
|
|
|
</template>
|
|
|
<template #action="scope">
|
|
|
<div class="action-container--div">
|
|
|
<ActionButton text="查看" @click="handleView(scope.row.id)" />
|
|
|
- <ActionButton v-if="planManagementPremissions" text="编辑" @click="handleEdit(scope.row.id)" />
|
|
|
<ActionButton
|
|
|
- v-if="planManagementPremissions"
|
|
|
+ v-if="planManagementPremissions && scope.row.status !== EMERGENCY_PLAN_STATUS.APPROVAL_IN_PROGRESS"
|
|
|
+ text="编辑"
|
|
|
+ @click="handleEdit(scope.row.id)"
|
|
|
+ />
|
|
|
+ <ActionButton
|
|
|
+ v-if="planManagementPremissions && scope.row.status !== EMERGENCY_PLAN_STATUS.APPROVAL_IN_PROGRESS"
|
|
|
text="删除"
|
|
|
:popconfirm="{ title: '确认删除' }"
|
|
|
@confirm="handleDelete(scope.row.id)"
|
|
|
@@ -72,6 +85,18 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <BasicDialog ref="basicDialogRef" title="审批流程" width="1000">
|
|
|
+ <template #form>
|
|
|
+ <BasicTable :tableData="approvalProcessData" :tableConfig="approvalProcessConfig">
|
|
|
+ <template #approvalType="scope">
|
|
|
+ <span>{{ APPROVAL_TYPE_MAP[scope.row.approvalType] }}</span>
|
|
|
+ </template>
|
|
|
+ <template #approvalStatus="scope">
|
|
|
+ <span>{{ APPROVAL_STATUS_MAP[scope.row.approvalStatus] }}</span>
|
|
|
+ </template>
|
|
|
+ </BasicTable>
|
|
|
+ </template>
|
|
|
+ </BasicDialog>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
@@ -81,22 +106,31 @@
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
import BasicSearch from '@/components/BasicSearch.vue';
|
|
|
import BasicTable from '@/components/BasicTable.vue';
|
|
|
+ import BasicDialog from '@/components/BasicDialog.vue';
|
|
|
import ActionButton from '@/components/ActionButton.vue';
|
|
|
import useTableConfig from '@/hooks/useTableConfigHook';
|
|
|
import { useEmergencyHook } from '../src/hoos';
|
|
|
import { useEmergencyPlanHook } from './src/hook';
|
|
|
import { useUserInfoHook } from '@/hooks/useUserInfoHook';
|
|
|
import type { QueryPageRequest } from '@/types/basic-query';
|
|
|
- import type { PlanEmergencyListQuery, PlanEmergencyListResponse } from '@/types/emergency-plan';
|
|
|
- import { getEmergencyPlanList, deleteEmergencyPlan } from '@/api/emergency-plan';
|
|
|
+ import type {
|
|
|
+ PlanEmergencyListQuery,
|
|
|
+ PlanEmergencyListResponse,
|
|
|
+ ApprovalProcessList,
|
|
|
+ ApprovalProcessResponse,
|
|
|
+ ProcessInfoListType,
|
|
|
+ } from '@/types/emergency-plan';
|
|
|
+ import { getEmergencyPlanList, deleteEmergencyPlan, queryApprovalProcess } from '@/api/emergency-plan';
|
|
|
import {
|
|
|
EMERGENCY_PLAN_MANAGEMENT_SEARCH_CONFIG,
|
|
|
EMERGENCY_PLAN_MANAGEMENT_TABLE_OPTIONS,
|
|
|
EMERGENCY_PLAN_MANAGEMENT_TABLE_COLUMNS,
|
|
|
TABLE_MAX_HEIGHT_DEFAULT,
|
|
|
TABLE_MAX_HEIGHT_PERMISSION,
|
|
|
+ APPROVAL_PROCESS_TABLE_COLUMNS,
|
|
|
} from './src/config';
|
|
|
import { EMERGENCY_PERMISSIONS } from '@/views/emergency/src/constant';
|
|
|
+ import { EMERGENCY_PLAN_STATUS, APPROVAL_TYPE_MAP,APPROVAL_STATUS_MAP } from './src/constant';
|
|
|
|
|
|
const router = useRouter();
|
|
|
const planManagementPremissions = ref<boolean>(false);
|
|
|
@@ -104,6 +138,7 @@
|
|
|
EMERGENCY_PLAN_MANAGEMENT_TABLE_COLUMNS,
|
|
|
EMERGENCY_PLAN_MANAGEMENT_TABLE_OPTIONS,
|
|
|
);
|
|
|
+ const { tableConfig: approvalProcessConfig } = useTableConfig(APPROVAL_PROCESS_TABLE_COLUMNS, {}, false);
|
|
|
const { emergencyEventDice, getEmergencyEventDict, getEmergencyEvent } = useEmergencyHook();
|
|
|
const { planTypeDice, getPlanTypeDict, getPlanType, getEmergencyPlanStatusLabel } = useEmergencyPlanHook();
|
|
|
const { permissions } = useUserInfoHook();
|
|
|
@@ -175,7 +210,7 @@
|
|
|
name: defaultName,
|
|
|
query: {
|
|
|
id,
|
|
|
- type: 'view'
|
|
|
+ type: 'view',
|
|
|
},
|
|
|
});
|
|
|
};
|
|
|
@@ -184,6 +219,33 @@
|
|
|
ElMessage.success('删除成功');
|
|
|
await getTableData();
|
|
|
};
|
|
|
+ const basicDialogRef = ref<InstanceType<typeof BasicDialog>>();
|
|
|
+ const approvalProcessData = ref<ApprovalProcessList[]>([]);
|
|
|
+ const handleViewApprovalProcess = async (row: PlanEmergencyListResponse) => {
|
|
|
+ if (row.status !== EMERGENCY_PLAN_STATUS.APPROVAL_IN_PROGRESS && row.status !== EMERGENCY_PLAN_STATUS.RETURNED)
|
|
|
+ return;
|
|
|
+
|
|
|
+ const res = await queryApprovalProcess(row.approvalTemplateId, row.id);
|
|
|
+
|
|
|
+ // 处理审批流程数据
|
|
|
+ approvalProcessData.value = [];
|
|
|
+ res.forEach((item: ApprovalProcessResponse) => {
|
|
|
+ if (item.processInfoList && item.processInfoList.length > 0) {
|
|
|
+ item.processInfoList.forEach((process: ProcessInfoListType) => {
|
|
|
+ approvalProcessData.value.push({
|
|
|
+ approvalOrder: item.approvalOrder,
|
|
|
+ nodeDescription: item.nodeDescription,
|
|
|
+ approvalType: process.approvalType,
|
|
|
+ approverName: process.approverName,
|
|
|
+ approvalContent: process.approvalContent,
|
|
|
+ approvalStatus: process.approvalStatus,
|
|
|
+ approvalTime: process.approvalTime,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ basicDialogRef.value?.openDialog();
|
|
|
+ };
|
|
|
|
|
|
onMounted(() => {
|
|
|
getPlanTypeDict();
|
|
|
@@ -200,4 +262,8 @@
|
|
|
@use '@/styles/page-details-layout.scss' as *;
|
|
|
@use '@/styles/page-main-layout.scss' as *;
|
|
|
@use '@/styles/basic-table-action.scss' as *;
|
|
|
+ .highlight-text {
|
|
|
+ cursor: pointer;
|
|
|
+ color: $primary-color;
|
|
|
+ }
|
|
|
</style>
|