|
@@ -6,17 +6,17 @@
|
|
|
<main class="safety-platform-container__main">
|
|
<main class="safety-platform-container__main">
|
|
|
<div class="search-table-container">
|
|
<div class="search-table-container">
|
|
|
<header>
|
|
<header>
|
|
|
- <div style="position: relative">
|
|
|
|
|
|
|
+ <!-- <div style="position: relative">
|
|
|
<el-button plain class="search-table-container--button" @click="handleImport"> 导入 </el-button>
|
|
<el-button plain class="search-table-container--button" @click="handleImport"> 导入 </el-button>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div> -->
|
|
|
|
|
|
|
|
<div class="act-search">
|
|
<div class="act-search">
|
|
|
<section class="select-box">
|
|
<section class="select-box">
|
|
|
<div class="select-box--item">
|
|
<div class="select-box--item">
|
|
|
<span>检查场所/检查人员:</span>
|
|
<span>检查场所/检查人员:</span>
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="tableQuery.queryParam.keyword"
|
|
|
|
|
- placeholder="搜索检查场所或计划名称"
|
|
|
|
|
|
|
+ v-model="tableQuery.queryParam.searchKey"
|
|
|
|
|
+ placeholder="搜索检查场所或检查人员"
|
|
|
class="act-search-input"
|
|
class="act-search-input"
|
|
|
style="min-width: 200px;"
|
|
style="min-width: 200px;"
|
|
|
clearable
|
|
clearable
|
|
@@ -70,20 +70,31 @@
|
|
|
scope.row.status === 0 ? '-' : scope.row.needOverallDesc === true ? '是' : scope.row.needOverallDesc === false ? '否' : '-'
|
|
scope.row.status === 0 ? '-' : scope.row.needOverallDesc === true ? '是' : scope.row.needOverallDesc === false ? '否' : '-'
|
|
|
}}</span>
|
|
}}</span>
|
|
|
</template>
|
|
</template>
|
|
|
- <template #primaryResponsibleDeptName="scope">
|
|
|
|
|
- <!-- 如果有下发按钮就展示原来的字段primaryResponsibleDeptName,没有下发按钮就展示responsibleDeptName -->
|
|
|
|
|
- {{ Number(scope.row.status) === 0 ? scope.row.primaryResponsibleDeptName: scope.row.responsibleDeptName}}
|
|
|
|
|
|
|
+ <template #sign="scope">
|
|
|
|
|
+ <div class="file-list">
|
|
|
|
|
+ <div class="file-item" v-for="item in scope.row.checkedPersonSign" :key="item.fileId">
|
|
|
|
|
+ <span class="file-item--name">{{ item.fileName }}</span>
|
|
|
|
|
+ <div class="file-item--footer">
|
|
|
|
|
+ <el-button link type="primary" @click="previewOnline(item.fileUrl, item.fileType)"
|
|
|
|
|
+ >预览</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button link type="primary" @click.stop="downloadFile(item.fileUrl, item.fileName)"
|
|
|
|
|
+ >下载</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
<template #needSigneeSign="scope">
|
|
<template #needSigneeSign="scope">
|
|
|
<span>{{
|
|
<span>{{
|
|
|
scope.row.status === 0 ? '-' : scope.row.needSigneeSign === true ? '是' : scope.row.needSigneeSign === false ? '否' : '-'
|
|
scope.row.status === 0 ? '-' : scope.row.needSigneeSign === true ? '是' : scope.row.needSigneeSign === false ? '否' : '-'
|
|
|
}}</span>
|
|
}}</span>
|
|
|
</template>
|
|
</template>
|
|
|
- <template #planStartTime="scope">
|
|
|
|
|
- <span>{{ scope.row.planStartTime ?? '-' }}</span>
|
|
|
|
|
|
|
+ <template #startDate="scope">
|
|
|
|
|
+ <span>{{ scope.row.startDate ?? '-' }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
- <template #planEndTime="scope">
|
|
|
|
|
- <span>{{ scope.row.planEndTime ?? '-' }}</span>
|
|
|
|
|
|
|
+ <template #endDate="scope">
|
|
|
|
|
+ <span>{{ scope.row.endDate ?? '-' }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
<template #action="scope">
|
|
<template #action="scope">
|
|
|
<div class="action-container--div" style="justify-content: left">
|
|
<div class="action-container--div" style="justify-content: left">
|
|
@@ -117,11 +128,7 @@
|
|
|
import type { QueryPageRequest } from '@/types/basic-query';
|
|
import type { QueryPageRequest } from '@/types/basic-query';
|
|
|
import type { AreaCheckPlanQuery, AreaCheckPlanRecord } from './configs/types';
|
|
import type { AreaCheckPlanQuery, AreaCheckPlanRecord } from './configs/types';
|
|
|
import {
|
|
import {
|
|
|
- queryAreaCheckPlanManagePage,
|
|
|
|
|
- deleteAreaCheckPlanManage,
|
|
|
|
|
- sendAreaCheckPlanToDep,
|
|
|
|
|
- cancelAreaCheckPlanManage,
|
|
|
|
|
- queryAreaCheckPlanManageDetail,
|
|
|
|
|
|
|
+ queryAreaCheckPlanDetailPage,
|
|
|
mapAreaCheckPlanApiRecordToUi,
|
|
mapAreaCheckPlanApiRecordToUi,
|
|
|
exportAreaCheckPlanAdministration,
|
|
exportAreaCheckPlanAdministration,
|
|
|
} from '@/api/production-safety-system';
|
|
} from '@/api/production-safety-system';
|
|
@@ -133,6 +140,7 @@
|
|
|
import { useGlobSetting } from '@/hooks/setting';
|
|
import { useGlobSetting } from '@/hooks/setting';
|
|
|
import urlJoin from 'url-join';
|
|
import urlJoin from 'url-join';
|
|
|
import { downloadByData } from '@/utils/file/download';
|
|
import { downloadByData } from '@/utils/file/download';
|
|
|
|
|
+ import { downloadFile } from '@/views/disaster/utils';
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
@@ -143,184 +151,31 @@
|
|
|
// 场所所属类别选项(示例数据,本页面不调用接口)
|
|
// 场所所属类别选项(示例数据,本页面不调用接口)
|
|
|
const venueCategoryOptions = ref<Array<{ label: string; value: string }>>([]);
|
|
const venueCategoryOptions = ref<Array<{ label: string; value: string }>>([]);
|
|
|
|
|
|
|
|
- // 下发弹窗
|
|
|
|
|
- const showIssueDialog = ref(false);
|
|
|
|
|
- const currentIssuePlanId = ref<number | null>(null);
|
|
|
|
|
- const issueFormRef = ref();
|
|
|
|
|
- const issueResponsibleDeptCascaderRef = ref();
|
|
|
|
|
- const issueForm = reactive({
|
|
|
|
|
- responsibleDeptIds: [] as number[],
|
|
|
|
|
- responsibleDeptPersonnelGroupCode: undefined as string | undefined,
|
|
|
|
|
- safetyEmergencyDeptId: undefined as number | undefined,
|
|
|
|
|
- safetyEmergencyGroupId: undefined as number | undefined,
|
|
|
|
|
- hospitalLeaderDeptId: undefined as number | undefined,
|
|
|
|
|
- hospitalLeaderGroupId: undefined as number | undefined,
|
|
|
|
|
- planStartTime: '',
|
|
|
|
|
- planEndTime: '',
|
|
|
|
|
- needOverallDesc: false,
|
|
|
|
|
- needSigneeSign: false,
|
|
|
|
|
- });
|
|
|
|
|
- const issueRules = {
|
|
|
|
|
- responsibleDeptIds: [{ required: true, message: '请选择责任部门', trigger: 'change', type: 'array', min: 1 }],
|
|
|
|
|
- responsibleDeptPersonnelGroupCode: [{ required: true, message: '请选择责任部门人员分组', trigger: 'change' }],
|
|
|
|
|
- safetyEmergencyDeptId: [{ required: true, message: '请选择安全应急部门', trigger: 'change' }],
|
|
|
|
|
- safetyEmergencyGroupId: [{ required: true, message: '请选择安全应急部人员分组', trigger: 'change' }],
|
|
|
|
|
- hospitalLeaderDeptId: [{ required: true, message: '请选择院领导部门', trigger: 'change' }],
|
|
|
|
|
- hospitalLeaderGroupId: [{ required: true, message: '请选择院领导人员分组', trigger: 'change' }],
|
|
|
|
|
- planStartTime: [{ required: true, message: '请选择计划开始日期', trigger: 'change' }],
|
|
|
|
|
- planEndTime: [{ required: true, message: '请选择计划结束时间', trigger: 'change' }],
|
|
|
|
|
- needOverallDesc: [{ required: true, message: '请选择是否需要整体检查情况描述', trigger: 'change' }],
|
|
|
|
|
- needSigneeSign: [{ required: true, message: '请选择是否需要被检查人签字', trigger: 'change' }],
|
|
|
|
|
- };
|
|
|
|
|
- // 下发弹窗:责任部门/安全应急部门/院领导部门复用新增区域检查计划的主责部门下拉(getAllDepartments)
|
|
|
|
|
- const issueDeptTree = ref<DeptTree[]>([]);
|
|
|
|
|
- const issueDeptTreeTow = ref<DeptTree[]>([]);
|
|
|
|
|
- const cascaderDeptProp = {
|
|
|
|
|
- checkStrictly: true,
|
|
|
|
|
- expandTrigger: 'hover' as const,
|
|
|
|
|
- value: 'id',
|
|
|
|
|
- label: 'deptName',
|
|
|
|
|
- emitPath: false,
|
|
|
|
|
- };
|
|
|
|
|
- const cascaderDeptPropMultiple = {
|
|
|
|
|
- ...cascaderDeptProp,
|
|
|
|
|
- multiple: true,
|
|
|
|
|
- };
|
|
|
|
|
- // 责任部门人员分组/安全应急部人员分组/院领导人员分组复用 queryUserGroupPage 查询用户分组接口
|
|
|
|
|
- const userGroupOptions = ref<PersonGroupListItem[]>([]);
|
|
|
|
|
-
|
|
|
|
|
- /** 下发弹窗打开时加载部门树(与新增区域检查计划主责部门一致) */
|
|
|
|
|
- const loadIssueDeptTree = async () => {
|
|
|
|
|
- try {
|
|
|
|
|
- const res = await getAllDepartments();
|
|
|
|
|
- issueDeptTree.value = res?.[0]?.children ?? [];
|
|
|
|
|
- issueDeptTreeTow.value = res?.[0]?.children.map(item => ({
|
|
|
|
|
- ...item,
|
|
|
|
|
- children: []
|
|
|
|
|
- }));
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- console.error('获取部门树失败:', e);
|
|
|
|
|
- issueDeptTree.value = [];
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- /** 下发弹窗打开时加载用户分组列表 */
|
|
|
|
|
- const loadUserGroupOptions = async () => {
|
|
|
|
|
- try {
|
|
|
|
|
- const res = await queryUserGroupPage({
|
|
|
|
|
- pageNumber: 1,
|
|
|
|
|
- pageSize: 9999,
|
|
|
|
|
- queryParam: '',
|
|
|
|
|
- });
|
|
|
|
|
- userGroupOptions.value = res?.records ?? [];
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- console.error('获取用户分组列表失败:', e);
|
|
|
|
|
- userGroupOptions.value = [];
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
|
|
|
|
|
- const onIssueDialogOpen = async () => {
|
|
|
|
|
- await Promise.all([loadIssueDeptTree(), loadUserGroupOptions()]);
|
|
|
|
|
|
|
|
|
|
- if (!currentIssuePlanId.value) return;
|
|
|
|
|
|
|
|
|
|
- try {
|
|
|
|
|
- const raw = await queryAreaCheckPlanManageDetail(currentIssuePlanId.value);
|
|
|
|
|
- const detail = mapAreaCheckPlanApiRecordToUi(raw);
|
|
|
|
|
-
|
|
|
|
|
- const responsibleDeptIdsByCode = parseNumberList(
|
|
|
|
|
- detail.primaryResponsibleDeptCode ?? (detail as Record<string, unknown>).responsibleDeptCode,
|
|
|
|
|
- );
|
|
|
|
|
-
|
|
|
|
|
- issueForm.responsibleDeptIds = responsibleDeptIdsByCode.length
|
|
|
|
|
- ? responsibleDeptIdsByCode
|
|
|
|
|
- : (detail.primaryResponsibleDeptName || '')
|
|
|
|
|
- .split(',')
|
|
|
|
|
- .map((name) => findDeptIdByName(issueDeptTree.value, name.trim()))
|
|
|
|
|
- .filter((id): id is number => id != null);
|
|
|
|
|
-
|
|
|
|
|
- const safetyEmergencyDeptIdByCode = parseNumber(detail.safetyEmergencyDeptCode);
|
|
|
|
|
- issueForm.safetyEmergencyDeptId =
|
|
|
|
|
- safetyEmergencyDeptIdByCode ?? findDeptIdByName(issueDeptTree.value, detail.safetyEmergencyDeptName);
|
|
|
|
|
-
|
|
|
|
|
- const hospitalLeaderDeptIdByCode = parseNumber(detail.hospitalLeaderDeptCode);
|
|
|
|
|
- issueForm.hospitalLeaderDeptId =
|
|
|
|
|
- hospitalLeaderDeptIdByCode ?? findDeptIdByName(issueDeptTree.value, detail.hospitalLeaderDeptName);
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- console.error('加载下发默认数据失败:', e);
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
|
|
|
|
|
- const findDeptNameById = (nodes: DeptTree[] | undefined, id: number | undefined): string | undefined => {
|
|
|
|
|
- if (!nodes?.length || id == null) return undefined;
|
|
|
|
|
- for (const n of nodes) {
|
|
|
|
|
- if (n.id === id) return n.deptName;
|
|
|
|
|
- const found = findDeptNameById(n.children, id);
|
|
|
|
|
- if (found) return found;
|
|
|
|
|
|
|
+ const previewOnline = (url: string | undefined, type) => {
|
|
|
|
|
+ if (url) {
|
|
|
|
|
+ previewOnlineRef.value?.open(url, type);
|
|
|
}
|
|
}
|
|
|
- return undefined;
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const findDeptIdByName = (nodes: DeptTree[] | undefined, name: string | undefined): number | undefined => {
|
|
|
|
|
- if (!nodes?.length || !name) return undefined;
|
|
|
|
|
- for (const n of nodes) {
|
|
|
|
|
- if (n.deptName === name) return n.id ?? undefined;
|
|
|
|
|
- const found = findDeptIdByName(n.children, name);
|
|
|
|
|
- if (found != null) return found;
|
|
|
|
|
- }
|
|
|
|
|
- return undefined;
|
|
|
|
|
- };
|
|
|
|
|
|
|
|
|
|
- const parseNumber = (val: unknown): number | undefined => {
|
|
|
|
|
- if (val == null || val === '') return undefined;
|
|
|
|
|
- const n = Number(val);
|
|
|
|
|
- return Number.isFinite(n) ? n : undefined;
|
|
|
|
|
- };
|
|
|
|
|
|
|
|
|
|
- const parseNumberList = (val: unknown): number[] => {
|
|
|
|
|
- if (val == null || val === '') return [];
|
|
|
|
|
- return String(val)
|
|
|
|
|
- .split(',')
|
|
|
|
|
- .map((s) => parseNumber(s.trim()))
|
|
|
|
|
- .filter((n): n is number => n != null);
|
|
|
|
|
- };
|
|
|
|
|
|
|
|
|
|
- const findDeptNamesByIds = (nodes: DeptTree[] | undefined, ids: number[] | undefined): string[] => {
|
|
|
|
|
- const list = (ids ?? []).filter((v) => v != null);
|
|
|
|
|
- if (!list.length) return [];
|
|
|
|
|
- return list
|
|
|
|
|
- .map((id) => findDeptNameById(nodes, id))
|
|
|
|
|
- .filter((name): name is string => !!name && String(name).trim().length > 0);
|
|
|
|
|
- };
|
|
|
|
|
|
|
|
|
|
- const findGroupNameById = (id: number | undefined): string | undefined => {
|
|
|
|
|
- if (id == null) return undefined;
|
|
|
|
|
- return userGroupOptions.value.find((g) => g.id === id)?.name;
|
|
|
|
|
- };
|
|
|
|
|
|
|
|
|
|
- const resetIssueForm = () => {
|
|
|
|
|
- issueForm.responsibleDeptIds = [];
|
|
|
|
|
- issueForm.responsibleDeptPersonnelGroupCode = undefined;
|
|
|
|
|
- issueForm.safetyEmergencyDeptId = undefined;
|
|
|
|
|
- issueForm.safetyEmergencyGroupId = undefined;
|
|
|
|
|
- issueForm.hospitalLeaderDeptId = undefined;
|
|
|
|
|
- issueForm.hospitalLeaderGroupId = undefined;
|
|
|
|
|
- issueForm.planStartTime = '';
|
|
|
|
|
- issueForm.planEndTime = '';
|
|
|
|
|
- issueForm.needOverallDesc = false;
|
|
|
|
|
- issueForm.needSigneeSign = false;
|
|
|
|
|
- issueFormRef.value?.resetFields?.();
|
|
|
|
|
- };
|
|
|
|
|
|
|
|
|
|
const tableQuery = reactive<QueryPageRequest<AreaCheckPlanQuery>>({
|
|
const tableQuery = reactive<QueryPageRequest<AreaCheckPlanQuery>>({
|
|
|
pageNumber: pagination.pageNumber,
|
|
pageNumber: pagination.pageNumber,
|
|
|
pageSize: pagination.pageSize,
|
|
pageSize: pagination.pageSize,
|
|
|
queryParam: {
|
|
queryParam: {
|
|
|
- keyword: '',
|
|
|
|
|
|
|
+ searchKey: '',
|
|
|
status: '' as AreaCheckPlanQuery['status'],
|
|
status: '' as AreaCheckPlanQuery['status'],
|
|
|
venueCategory: '',
|
|
venueCategory: '',
|
|
|
- planStartTime: '',
|
|
|
|
|
- planEndTime: '',
|
|
|
|
|
|
|
+ startDate: '',
|
|
|
|
|
+ endDate: '',
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -339,7 +194,7 @@
|
|
|
async function getTableData() {
|
|
async function getTableData() {
|
|
|
tableConfig.loading = true;
|
|
tableConfig.loading = true;
|
|
|
try {
|
|
try {
|
|
|
- const res = await queryAreaCheckPlanManagePage({
|
|
|
|
|
|
|
+ const res = await queryAreaCheckPlanDetailPage({
|
|
|
pageNumber: tableQuery.pageNumber,
|
|
pageNumber: tableQuery.pageNumber,
|
|
|
pageSize: tableQuery.pageSize,
|
|
pageSize: tableQuery.pageSize,
|
|
|
queryParam: tableQuery.queryParam,
|
|
queryParam: tableQuery.queryParam,
|
|
@@ -359,11 +214,11 @@
|
|
|
|
|
|
|
|
const handleSearch = () => {
|
|
const handleSearch = () => {
|
|
|
if (dateRange.value && dateRange.value.length === 2) {
|
|
if (dateRange.value && dateRange.value.length === 2) {
|
|
|
- tableQuery.queryParam.planStartTime = dateRange.value[0];
|
|
|
|
|
- tableQuery.queryParam.planEndTime = dateRange.value[1];
|
|
|
|
|
|
|
+ tableQuery.queryParam.startDate = dateRange.value[0];
|
|
|
|
|
+ tableQuery.queryParam.endDate = dateRange.value[1];
|
|
|
} else {
|
|
} else {
|
|
|
- tableQuery.queryParam.planStartTime = '';
|
|
|
|
|
- tableQuery.queryParam.planEndTime = '';
|
|
|
|
|
|
|
+ tableQuery.queryParam.startDate = '';
|
|
|
|
|
+ tableQuery.queryParam.endDate = '';
|
|
|
}
|
|
}
|
|
|
pagination.pageNumber = 1;
|
|
pagination.pageNumber = 1;
|
|
|
tableQuery.pageNumber = 1;
|
|
tableQuery.pageNumber = 1;
|
|
@@ -371,122 +226,24 @@
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleReset = () => {
|
|
const handleReset = () => {
|
|
|
- tableQuery.queryParam.keyword = '';
|
|
|
|
|
|
|
+ tableQuery.queryParam.searchKey = '';
|
|
|
tableQuery.queryParam.status = '';
|
|
tableQuery.queryParam.status = '';
|
|
|
tableQuery.queryParam.venueCategory = '';
|
|
tableQuery.queryParam.venueCategory = '';
|
|
|
- tableQuery.queryParam.planStartTime = '';
|
|
|
|
|
- tableQuery.queryParam.planEndTime = '';
|
|
|
|
|
|
|
+ tableQuery.queryParam.startDate = '';
|
|
|
|
|
+ tableQuery.queryParam.endDate = '';
|
|
|
dateRange.value = null;
|
|
dateRange.value = null;
|
|
|
handleSearch();
|
|
handleSearch();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- const handleEdit = (id: number) => {
|
|
|
|
|
- router.push({
|
|
|
|
|
- name: 'areaCheckPlanManagementItem',
|
|
|
|
|
- query: { id, operate: 'area-check-plan-edit' },
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
const handleView = (id: number) => {
|
|
const handleView = (id: number) => {
|
|
|
router.push({
|
|
router.push({
|
|
|
- name: 'areaCheckPlanManagementItem',
|
|
|
|
|
|
|
+ name: 'areaCheckPlanTaskItem',
|
|
|
query: { id, operate: 'area-check-plan-view' },
|
|
query: { id, operate: 'area-check-plan-view' },
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const handleDelete = async (id: number) => {
|
|
|
|
|
- try {
|
|
|
|
|
- await deleteAreaCheckPlanManage(id);
|
|
|
|
|
- ElMessage.success('删除成功');
|
|
|
|
|
- getTableData();
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- console.error('删除失败:', e);
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- const handleIssue = (id: number) => {
|
|
|
|
|
- currentIssuePlanId.value = id;
|
|
|
|
|
- resetIssueForm();
|
|
|
|
|
- showIssueDialog.value = true;
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- const handleIssueSave = async () => {
|
|
|
|
|
- if (!issueFormRef.value || !currentIssuePlanId.value) return;
|
|
|
|
|
- const valid = await issueFormRef.value.validate().catch(() => false);
|
|
|
|
|
- if (!valid) return;
|
|
|
|
|
- if (
|
|
|
|
|
- issueForm.planStartTime &&
|
|
|
|
|
- issueForm.planEndTime &&
|
|
|
|
|
- new Date(issueForm.planStartTime) > new Date(issueForm.planEndTime)
|
|
|
|
|
- ) {
|
|
|
|
|
- ElMessage.error('计划开始日期不能大于计划结束日期');
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- try {
|
|
|
|
|
- // 仅提交:弹窗页面字段 + id(下拉同时提交 name + value)
|
|
|
|
|
- const responsibleDeptIds = (issueForm.responsibleDeptIds ?? []).filter((v) => v != null);
|
|
|
|
|
- const responsibleDeptNames = findDeptNamesByIds(issueDeptTree.value, responsibleDeptIds);
|
|
|
|
|
- const responsibleDeptName = responsibleDeptNames.length ? responsibleDeptNames.join(',') : undefined;
|
|
|
|
|
- const responsibleDeptCode = responsibleDeptIds.length ? responsibleDeptIds.join(',') : undefined;
|
|
|
|
|
-
|
|
|
|
|
- const responsibleDeptPersonnelGroupName = (() => {
|
|
|
|
|
- const code = issueForm.responsibleDeptPersonnelGroupCode;
|
|
|
|
|
- if (code == null || code === '') return undefined;
|
|
|
|
|
- const byId = userGroupOptions.value.find((g) => String(g.id) === code);
|
|
|
|
|
- return byId?.name ?? undefined;
|
|
|
|
|
- })();
|
|
|
|
|
-
|
|
|
|
|
- const safetyEmergencyDeptName = findDeptNameById(issueDeptTree.value, issueForm.safetyEmergencyDeptId);
|
|
|
|
|
- const hospitalLeaderDeptName = findDeptNameById(issueDeptTree.value, issueForm.hospitalLeaderDeptId);
|
|
|
|
|
-
|
|
|
|
|
- const payload = {
|
|
|
|
|
- id: currentIssuePlanId.value,
|
|
|
|
|
- responsibleDeptName,
|
|
|
|
|
- responsibleDeptCode,
|
|
|
|
|
- responsibleDeptPersonnelGroupName,
|
|
|
|
|
- responsibleDeptPersonnelGroupCode: issueForm.responsibleDeptPersonnelGroupCode,
|
|
|
|
|
-
|
|
|
|
|
- // 安全应急部门
|
|
|
|
|
- safetyEmergencyDeptName,
|
|
|
|
|
- SafetyEmergencyDeptCode: issueForm.safetyEmergencyDeptId,
|
|
|
|
|
- safetyEmergencyExecutorGroupName: findGroupNameById(issueForm.safetyEmergencyGroupId),
|
|
|
|
|
- safetyEmergencyExecGroupCode:
|
|
|
|
|
- issueForm.safetyEmergencyGroupId != null ? String(issueForm.safetyEmergencyGroupId) : undefined,
|
|
|
|
|
-
|
|
|
|
|
- // 院领导部门
|
|
|
|
|
- hospitalLeaderDeptName,
|
|
|
|
|
- hospitalLeaderDeptCode: issueForm.hospitalLeaderDeptId,
|
|
|
|
|
- hospitalLeaderExecutorGroupName: findGroupNameById(issueForm.hospitalLeaderGroupId),
|
|
|
|
|
- hospitalLeaderExecGroupCode:
|
|
|
|
|
- issueForm.hospitalLeaderGroupId != null ? String(issueForm.hospitalLeaderGroupId) : undefined,
|
|
|
|
|
-
|
|
|
|
|
- // 计划时间与开关项
|
|
|
|
|
- planStartTime: issueForm.planStartTime,
|
|
|
|
|
- planEndTime: issueForm.planEndTime,
|
|
|
|
|
- needOverallDesc: issueForm.needOverallDesc,
|
|
|
|
|
- needSigneeSign: issueForm.needSigneeSign,
|
|
|
|
|
- } as AreaCheckPlanRecord & { id: number } & Record<string, unknown>;
|
|
|
|
|
-
|
|
|
|
|
- await sendAreaCheckPlanToDep(payload);
|
|
|
|
|
- ElMessage.success('下发成功');
|
|
|
|
|
- showIssueDialog.value = false;
|
|
|
|
|
- getTableData();
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- ElMessage.error(e.message);
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- const handleCancel = async (id: number) => {
|
|
|
|
|
- try {
|
|
|
|
|
- await cancelAreaCheckPlanManage(id);
|
|
|
|
|
- ElMessage.success('作废成功');
|
|
|
|
|
- getTableData();
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- console.error('作废失败:', e);
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -494,12 +251,12 @@
|
|
|
try {
|
|
try {
|
|
|
const response = await exportAreaCheckPlanAdministration(tableQuery.queryParam);
|
|
const response = await exportAreaCheckPlanAdministration(tableQuery.queryParam);
|
|
|
if (response) {
|
|
if (response) {
|
|
|
- const fileName = `区域检查计划管理_${new Date().toISOString().split('T')[0]}.xlsx`;
|
|
|
|
|
|
|
+ const fileName = `区域检查计划任务_${new Date().toISOString().split('T')[0]}.xlsx`;
|
|
|
downloadByData(response, fileName);
|
|
downloadByData(response, fileName);
|
|
|
ElMessage.success('导出成功');
|
|
ElMessage.success('导出成功');
|
|
|
}
|
|
}
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
- console.error('导出院级文件失败:', e);
|
|
|
|
|
|
|
+ console.error('导出文件失败:', e);
|
|
|
ElMessage.error('导出失败,请重试');
|
|
ElMessage.error('导出失败,请重试');
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|