|
@@ -29,7 +29,7 @@
|
|
|
<div class="row">
|
|
<div class="row">
|
|
|
<div class="col">
|
|
<div class="col">
|
|
|
<div class="label">主责部门:</div>
|
|
<div class="label">主责部门:</div>
|
|
|
- <div class="value">{{ viewDetail.mainDeptName || '-' }}</div>
|
|
|
|
|
|
|
+ <div class="value">{{ viewDetail.primary_responsible_dept_name || viewDetail.mainDeptName || '-' }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="col">
|
|
<div class="col">
|
|
|
<div class="label">自查频率:</div>
|
|
<div class="label">自查频率:</div>
|
|
@@ -164,6 +164,18 @@
|
|
|
@update:pageSize="handleRecordSizeChange"
|
|
@update:pageSize="handleRecordSizeChange"
|
|
|
@update:pageNumber="handleRecordPageChange"
|
|
@update:pageNumber="handleRecordPageChange"
|
|
|
>
|
|
>
|
|
|
|
|
+ <template #unqualifiedItemNum="scope">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="Number(scope.row.unqualifiedItemNum) > 0"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ link
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ @click="openUnqualifiedDialog(scope.row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ scope.row.unqualifiedItemNum }}
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <span v-else>{{ scope.row.unqualifiedItemNum ?? 0 }}</span>
|
|
|
|
|
+ </template>
|
|
|
<template #sign="scope">
|
|
<template #sign="scope">
|
|
|
<template v-if="parseSignFiles(scope.row.checkedPersonSign || scope.row.signFile).length">
|
|
<template v-if="parseSignFiles(scope.row.checkedPersonSign || scope.row.signFile).length">
|
|
|
<div
|
|
<div
|
|
@@ -208,7 +220,7 @@
|
|
|
<template #mainDept>
|
|
<template #mainDept>
|
|
|
<el-cascader
|
|
<el-cascader
|
|
|
ref="mainDeptCascaderRef"
|
|
ref="mainDeptCascaderRef"
|
|
|
- v-model="ruleFormData.mainDeptId"
|
|
|
|
|
|
|
+ v-model="ruleFormData.primary_responsible_dept_id"
|
|
|
:options="deptTree"
|
|
:options="deptTree"
|
|
|
:props="cascaderDeptProp"
|
|
:props="cascaderDeptProp"
|
|
|
:show-all-levels="false"
|
|
:show-all-levels="false"
|
|
@@ -292,6 +304,111 @@
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</footer>
|
|
</footer>
|
|
|
<PreviewOnline ref="previewOnlineRef" />
|
|
<PreviewOnline ref="previewOnlineRef" />
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 检查不合格数据弹窗(管理员) -->
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ v-model="showUnqualifiedDialog"
|
|
|
|
|
+ title="检查不合格数据"
|
|
|
|
|
+ width="800px"
|
|
|
|
|
+ destroy-on-close
|
|
|
|
|
+ >
|
|
|
|
|
+ <BasicTable
|
|
|
|
|
+ :tableData="unqualifiedList"
|
|
|
|
|
+ :tableConfig="unqualifiedTableConfig"
|
|
|
|
|
+ @update:pageSize="handleUnqualifiedSizeChange"
|
|
|
|
|
+ @update:pageNumber="handleUnqualifiedPageChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #action="scope">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="Number(scope.row.isSand) === 0"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ link
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ @click="handleSandToHiddenDanger(scope.row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ 下入账
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <span v-else-if="Number(scope.row.isSand) === 1" style="color: #999999">已入账</span>
|
|
|
|
|
+ <span v-else>-</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </BasicTable>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 检查记录入账隐患台账确认弹窗 -->
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ v-model="showSandConfirmDialog"
|
|
|
|
|
+ title="检查记录入账隐患台账"
|
|
|
|
|
+ width="900px"
|
|
|
|
|
+ destroy-on-close
|
|
|
|
|
+ >
|
|
|
|
|
+ <BasicForm
|
|
|
|
|
+ ref="sandHiddenDangerFormRef"
|
|
|
|
|
+ :formData="sandHiddenDangerFormData"
|
|
|
|
|
+ :formRules="sandHiddenDangerFormRules"
|
|
|
|
|
+ :formConfig="sandHiddenDangerFormConfig"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #reviewDepartmentId>
|
|
|
|
|
+ <el-cascader
|
|
|
|
|
+ v-model="sandHiddenDangerFormData.reviewDepartmentId"
|
|
|
|
|
+ :options="deptTree"
|
|
|
|
|
+ :props="cascaderDeptProp"
|
|
|
|
|
+ :show-all-levels="false"
|
|
|
|
|
+ placeholder="请选择复查人员所属部门"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ clearable
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #reviewPerson>
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="sandHiddenDangerFormData.reviewPersonId"
|
|
|
|
|
+ placeholder="请选择复查人员"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ filterable
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="u in reviewUserList"
|
|
|
|
|
+ :key="u.id"
|
|
|
|
|
+ :label="u.realname || u.username"
|
|
|
|
|
+ :value="u.id"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #isDrawLessonsPush>
|
|
|
|
|
+ <el-radio-group v-model="sandHiddenDangerFormData.isDrawLessonsPush">
|
|
|
|
|
+ <el-radio :value="0">否</el-radio>
|
|
|
|
|
+ <el-radio :value="1">是</el-radio>
|
|
|
|
|
+ </el-radio-group>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #drawLessonsDepartmentIds>
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="drawLessonsDeptIdsArray"
|
|
|
|
|
+ placeholder="请选择举一反三责任部门,可多选"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ filterable
|
|
|
|
|
+ multiple
|
|
|
|
|
+ collapse-tags
|
|
|
|
|
+ collapse-tags-tooltip
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ @change="() => { sandHiddenDangerFormData.drawLessonsDepartmentIds = drawLessonsDeptIdsArray.join(','); }"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="d in deptOptions"
|
|
|
|
|
+ :key="d.id"
|
|
|
|
|
+ :label="d.deptName"
|
|
|
|
|
+ :value="d.id"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </BasicForm>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <el-button @click="showSandConfirmDialog = false">取消</el-button>
|
|
|
|
|
+ <el-button type="primary" :loading="sandConfirmLoading" @click="confirmSandToHiddenDanger">
|
|
|
|
|
+ 提交
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
@@ -328,9 +445,18 @@
|
|
|
queryAreaCheckRecord,
|
|
queryAreaCheckRecord,
|
|
|
mapAreaCheckPlanApiRecordToUi,
|
|
mapAreaCheckPlanApiRecordToUi,
|
|
|
queryCheckListTemplateNameList,
|
|
queryCheckListTemplateNameList,
|
|
|
|
|
+ queryUnqualifiedItemNumPage,
|
|
|
|
|
+ sandAreaCheckRecordToProductionHiddenDanger,
|
|
|
type ChecklistTemplate,
|
|
type ChecklistTemplate,
|
|
|
|
|
+ type UnqualifiedItemNumRecord,
|
|
|
|
|
+ type SandAreaCheckRecordToHiddenDangerReq,
|
|
|
} from '@/api/production-safety-system';
|
|
} from '@/api/production-safety-system';
|
|
|
import { queryDictTypeDetail } from '@/api/dict';
|
|
import { queryDictTypeDetail } from '@/api/dict';
|
|
|
|
|
+ import {
|
|
|
|
|
+ HIDDEN_DANGER_FORM_CONFIG,
|
|
|
|
|
+ HIDDEN_DANGER_FORM_DATA,
|
|
|
|
|
+ HIDDEN_DANGER_FORM_RULES,
|
|
|
|
|
+ } from '@/views/production-safety/hiddenTroubleInvestigationAndGovernance/hiddenTroubleAccountManagement/configs/form';
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
@@ -386,13 +512,20 @@
|
|
|
return undefined;
|
|
return undefined;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const setDeptNameFromCascader = (refVal: any, nameKey: 'mainDeptName' | 'safetyEmergencyDeptName' | 'hospitalLeaderDeptName') => {
|
|
|
|
|
|
|
+ const setDeptNameFromCascader = (refVal: any, nameKey: 'primary_responsible_dept_name' | 'safetyEmergencyDeptName' | 'hospitalLeaderDeptName') => {
|
|
|
const nodes = refVal?.getCheckedNodes?.();
|
|
const nodes = refVal?.getCheckedNodes?.();
|
|
|
- ruleFormData[nameKey] = nodes?.[0]?.label ?? '';
|
|
|
|
|
|
|
+ const label = nodes?.[0]?.label ?? '';
|
|
|
|
|
+ const value = nodes?.[0]?.value;
|
|
|
|
|
+ if (nameKey === 'primary_responsible_dept_name') {
|
|
|
|
|
+ ruleFormData.primary_responsible_dept_name = label;
|
|
|
|
|
+ (ruleFormData as Record<string, unknown>).primary_responsible_dept_code = value != null ? String(value) : '';
|
|
|
|
|
+ } else {
|
|
|
|
|
+ (ruleFormData as Record<string, unknown>)[nameKey] = label;
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const onMainDeptChange = () => {
|
|
const onMainDeptChange = () => {
|
|
|
- setDeptNameFromCascader(mainDeptCascaderRef.value, 'mainDeptName');
|
|
|
|
|
|
|
+ setDeptNameFromCascader(mainDeptCascaderRef.value, 'primary_responsible_dept_name');
|
|
|
};
|
|
};
|
|
|
const onSafetyEmergencyDeptChange = () => {
|
|
const onSafetyEmergencyDeptChange = () => {
|
|
|
setDeptNameFromCascader(safetyEmergencyDeptCascaderRef.value, 'safetyEmergencyDeptName');
|
|
setDeptNameFromCascader(safetyEmergencyDeptCascaderRef.value, 'safetyEmergencyDeptName');
|
|
@@ -504,6 +637,7 @@
|
|
|
planName: d?.planName ?? ruleFormData.planName ?? '-',
|
|
planName: d?.planName ?? ruleFormData.planName ?? '-',
|
|
|
venueCategoryName: d?.venueCategoryName ?? ruleFormData.venueCategoryName ?? '-',
|
|
venueCategoryName: d?.venueCategoryName ?? ruleFormData.venueCategoryName ?? '-',
|
|
|
checkVenue: d?.checkVenue ?? ruleFormData.checkVenue ?? '-',
|
|
checkVenue: d?.checkVenue ?? ruleFormData.checkVenue ?? '-',
|
|
|
|
|
+ primary_responsible_dept_name: d?.primary_responsible_dept_name ?? d?.mainDeptName ?? (ruleFormData as Record<string, unknown>).primary_responsible_dept_name ?? ruleFormData.mainDeptName ?? '-',
|
|
|
mainDeptName: d?.mainDeptName ?? ruleFormData.mainDeptName ?? '-',
|
|
mainDeptName: d?.mainDeptName ?? ruleFormData.mainDeptName ?? '-',
|
|
|
selfCheckFrequency: d?.selfCheckFrequency ?? ruleFormData.selfCheckFrequency ?? '-',
|
|
selfCheckFrequency: d?.selfCheckFrequency ?? ruleFormData.selfCheckFrequency ?? '-',
|
|
|
mainDeptExecutorGroupName: d?.mainDeptExecutorGroupName ?? '-',
|
|
mainDeptExecutorGroupName: d?.mainDeptExecutorGroupName ?? '-',
|
|
@@ -542,7 +676,7 @@
|
|
|
{ label: '检查场所', prop: 'checkPlace', minWidth: '120px' },
|
|
{ label: '检查场所', prop: 'checkPlace', minWidth: '120px' },
|
|
|
{ label: '检查项总数', prop: 'checkItemTotal', align: 'center', width: '100px' },
|
|
{ label: '检查项总数', prop: 'checkItemTotal', align: 'center', width: '100px' },
|
|
|
{ label: '合格项数', prop: 'qualifiedItemNum', align: 'center', width: '90px' },
|
|
{ label: '合格项数', prop: 'qualifiedItemNum', align: 'center', width: '90px' },
|
|
|
- { label: '不合格项数', prop: 'unqualifiedItemNum', align: 'center', width: '100px' },
|
|
|
|
|
|
|
+ { label: '不合格项数', prop: 'unqualifiedItemNum', slot: 'unqualifiedItemNum', align: 'center', width: '100px' },
|
|
|
{ label: '整体检查情况描述', prop: 'overallCheckDesc', minWidth: '180px', showOverflowTooltip: true },
|
|
{ label: '整体检查情况描述', prop: 'overallCheckDesc', minWidth: '180px', showOverflowTooltip: true },
|
|
|
{ label: '被检查人签字', slot: 'sign', align: 'center', width: '140px' },
|
|
{ label: '被检查人签字', slot: 'sign', align: 'center', width: '140px' },
|
|
|
{ label: '操作', slot: 'action', align: 'center', width: '160px', fixed: 'right' },
|
|
{ label: '操作', slot: 'action', align: 'center', width: '160px', fixed: 'right' },
|
|
@@ -565,6 +699,44 @@
|
|
|
|
|
|
|
|
const paginatedRecordList = computed(() => inspectionRecordList.value);
|
|
const paginatedRecordList = computed(() => inspectionRecordList.value);
|
|
|
|
|
|
|
|
|
|
+ // 检查不合格数据弹窗
|
|
|
|
|
+ const showUnqualifiedDialog = ref(false);
|
|
|
|
|
+ const currentRecordIdForUnqualified = ref<number | null>(null);
|
|
|
|
|
+ const currentRowForUnqualified = ref<Record<string, unknown> | null>(null);
|
|
|
|
|
+ const unqualifiedList = ref<UnqualifiedItemNumRecord[]>([]);
|
|
|
|
|
+ const UNQUALIFIED_TABLE_COLUMNS: TableColumnProps[] = [
|
|
|
|
|
+ { label: '编号', type: 'index', align: 'center', width: '60px' },
|
|
|
|
|
+ { label: '检查场所', prop: 'checkPlace', minWidth: '200px' },
|
|
|
|
|
+ { label: '发现问题', prop: 'checkProblem', minWidth: '220px' },
|
|
|
|
|
+ { label: '检查时间', prop: 'checkTime', minWidth: '180px' },
|
|
|
|
|
+ { label: '操作', slot: 'action', align: 'center', width: '100px' },
|
|
|
|
|
+ ];
|
|
|
|
|
+ const UNQUALIFIED_TABLE_OPTIONS = {
|
|
|
|
|
+ emptyText: '暂无不合格数据',
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ maxHeight: '400px',
|
|
|
|
|
+ stripe: true,
|
|
|
|
|
+ };
|
|
|
|
|
+ const { tableConfig: unqualifiedTableConfig, pagination: unqualifiedPagination } = useTableConfig(
|
|
|
|
|
+ UNQUALIFIED_TABLE_COLUMNS,
|
|
|
|
|
+ UNQUALIFIED_TABLE_OPTIONS,
|
|
|
|
|
+ true,
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ // 入账确认弹窗数据(复用隐患台账新增表单字段与样式)
|
|
|
|
|
+ const showSandConfirmDialog = ref(false);
|
|
|
|
|
+ const sandConfirmLoading = ref(false);
|
|
|
|
|
+ const sandHiddenDangerFormRef = ref<InstanceType<typeof BasicForm>>();
|
|
|
|
|
+ const {
|
|
|
|
|
+ ruleFormData: sandHiddenDangerFormData,
|
|
|
|
|
+ formRules: sandHiddenDangerFormRules,
|
|
|
|
|
+ ruleFormConfig: sandHiddenDangerFormConfig,
|
|
|
|
|
+ } = useFormConfigHook(
|
|
|
|
|
+ HIDDEN_DANGER_FORM_CONFIG,
|
|
|
|
|
+ HIDDEN_DANGER_FORM_DATA as Record<string, unknown>,
|
|
|
|
|
+ HIDDEN_DANGER_FORM_RULES,
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
const handleRecordSizeChange = (value: number) => {
|
|
const handleRecordSizeChange = (value: number) => {
|
|
|
recordPagination.pageSize = value;
|
|
recordPagination.pageSize = value;
|
|
|
recordPagination.pageNumber = 1;
|
|
recordPagination.pageNumber = 1;
|
|
@@ -575,6 +747,52 @@
|
|
|
loadRecordList();
|
|
loadRecordList();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ const loadUnqualifiedList = async () => {
|
|
|
|
|
+ if (!currentRecordIdForUnqualified.value) return;
|
|
|
|
|
+ unqualifiedTableConfig.loading = true;
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await queryUnqualifiedItemNumPage({
|
|
|
|
|
+ pageNumber: unqualifiedPagination.pageNumber,
|
|
|
|
|
+ pageSize: unqualifiedPagination.pageSize,
|
|
|
|
|
+ queryParam: {
|
|
|
|
|
+ id: currentRecordIdForUnqualified.value,
|
|
|
|
|
+ checkPlace: String(currentRowForUnqualified.value?.checkPlace ?? ''),
|
|
|
|
|
+ checkProblem: String(currentRowForUnqualified.value?.checkProblem ?? ''),
|
|
|
|
|
+ checkTime: String(currentRowForUnqualified.value?.checkTime ?? ''),
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ const raw = (res as { data?: { records?: UnqualifiedItemNumRecord[]; totalRow?: number } })?.data ?? res;
|
|
|
|
|
+ unqualifiedList.value = raw?.records ?? [];
|
|
|
|
|
+ unqualifiedPagination.total = raw?.totalRow ?? 0;
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('查询不合格数据失败:', e);
|
|
|
|
|
+ unqualifiedList.value = [];
|
|
|
|
|
+ unqualifiedPagination.total = 0;
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ unqualifiedTableConfig.loading = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleUnqualifiedSizeChange = (value: number) => {
|
|
|
|
|
+ unqualifiedPagination.pageSize = value;
|
|
|
|
|
+ unqualifiedPagination.pageNumber = 1;
|
|
|
|
|
+ loadUnqualifiedList();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleUnqualifiedPageChange = (value: number) => {
|
|
|
|
|
+ unqualifiedPagination.pageNumber = value;
|
|
|
|
|
+ loadUnqualifiedList();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const openUnqualifiedDialog = (row: { id?: number } & Record<string, unknown>) => {
|
|
|
|
|
+ if (!row.id) return;
|
|
|
|
|
+ currentRecordIdForUnqualified.value = Number(row.id);
|
|
|
|
|
+ currentRowForUnqualified.value = row;
|
|
|
|
|
+ unqualifiedPagination.pageNumber = 1;
|
|
|
|
|
+ showUnqualifiedDialog.value = true;
|
|
|
|
|
+ loadUnqualifiedList();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
const loadRecordList = async () => {
|
|
const loadRecordList = async () => {
|
|
|
if (!currentId.value) return;
|
|
if (!currentId.value) return;
|
|
|
recordTableConfig.loading = true;
|
|
recordTableConfig.loading = true;
|
|
@@ -616,6 +834,62 @@
|
|
|
ElMessage.success('导出功能开发中');
|
|
ElMessage.success('导出功能开发中');
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ const handleSandToHiddenDanger = (row: { id?: number } & Record<string, unknown>) => {
|
|
|
|
|
+ if (!row.id) return;
|
|
|
|
|
+ currentRecordIdForUnqualified.value = Number(row.id);
|
|
|
|
|
+ // 每次打开入账弹窗都使用一份全新的隐患台账初始数据,不带入检查记录旧数据
|
|
|
|
|
+ Object.assign(sandHiddenDangerFormData, HIDDEN_DANGER_FORM_DATA);
|
|
|
|
|
+ showSandConfirmDialog.value = true;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const validateSandHiddenDangerForm = async () => {
|
|
|
|
|
+ if (!sandHiddenDangerFormRef.value) return false;
|
|
|
|
|
+ return await sandHiddenDangerFormRef.value.validateForm();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const confirmSandToHiddenDanger = async () => {
|
|
|
|
|
+ if (!currentRecordIdForUnqualified.value) return;
|
|
|
|
|
+ const valid = await validateSandHiddenDangerForm();
|
|
|
|
|
+ if (!valid) return;
|
|
|
|
|
+ sandConfirmLoading.value = true;
|
|
|
|
|
+ try {
|
|
|
|
|
+ const d = sandHiddenDangerFormData;
|
|
|
|
|
+ const payload: SandAreaCheckRecordToHiddenDangerReq = {
|
|
|
|
|
+ areaCheckRecordId: currentRecordIdForUnqualified.value,
|
|
|
|
|
+ sourceType: 4,
|
|
|
|
|
+ sourceRefId: currentRecordIdForUnqualified.value,
|
|
|
|
|
+ dangerProblem: d.dangerProblem || '',
|
|
|
|
|
+ typeId: d.typeId,
|
|
|
|
|
+ reasonId: d.reasonId,
|
|
|
|
|
+ taskSource: d.taskSource || '',
|
|
|
|
|
+ rectificationRequirement: d.rectificationRequirement || '',
|
|
|
|
|
+ rectificationDeadline: d.rectificationDeadline || '',
|
|
|
|
|
+ rectificationDepartmentIds: d.rectificationDepartmentIds || '',
|
|
|
|
|
+ rectificationResponsiblePerson: d.rectificationResponsiblePerson || '',
|
|
|
|
|
+ reviewDepartmentId: d.reviewDepartmentId,
|
|
|
|
|
+ reviewPersonId: d.reviewPersonId,
|
|
|
|
|
+ reviewPersonName: d.reviewPersonName || '',
|
|
|
|
|
+ isDrawLessonsPush: d.isDrawLessonsPush ?? 0,
|
|
|
|
|
+ drawLessonsContent: d.drawLessonsContent || '',
|
|
|
|
|
+ drawLessonsDepartmentIds: d.drawLessonsDepartmentIds || '',
|
|
|
|
|
+ drawLessonsDeadline: d.drawLessonsDeadline || '',
|
|
|
|
|
+ attachments: d.attachments || '',
|
|
|
|
|
+ };
|
|
|
|
|
+ await sandAreaCheckRecordToProductionHiddenDanger(payload);
|
|
|
|
|
+ ElMessage.success('下入账成功');
|
|
|
|
|
+ // 关闭入账表单弹窗和“不合格数据”弹窗
|
|
|
|
|
+ showSandConfirmDialog.value = false;
|
|
|
|
|
+ showUnqualifiedDialog.value = false;
|
|
|
|
|
+ // 重新加载检查记录列表,刷新 isSand 状态和数量
|
|
|
|
|
+ await loadRecordList();
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('下入账失败:', e);
|
|
|
|
|
+ ElMessage.error('下入账失败,请稍后重试');
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ sandConfirmLoading.value = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
const previewOnlineRef = ref<InstanceType<typeof PreviewOnline>>();
|
|
const previewOnlineRef = ref<InstanceType<typeof PreviewOnline>>();
|
|
|
const previewOnline = (url: string | undefined, type: keyof typeof FILE_TYPE_ICON) => {
|
|
const previewOnline = (url: string | undefined, type: keyof typeof FILE_TYPE_ICON) => {
|
|
|
if (url) previewOnlineRef.value?.open(url, type);
|
|
if (url) previewOnlineRef.value?.open(url, type);
|
|
@@ -656,7 +930,7 @@
|
|
|
operate: 'area-check-plan-record-view',
|
|
operate: 'area-check-plan-record-view',
|
|
|
recordId: row.id,
|
|
recordId: row.id,
|
|
|
planId: currentId.value,
|
|
planId: currentId.value,
|
|
|
- inspectedUnit: String(row.checkedCompanyName ?? row.checkedCompany ?? viewDetail.value.mainDeptName ?? viewDetail.value.checkVenue ?? ''),
|
|
|
|
|
|
|
+ inspectedUnit: String(row.checkedCompanyName ?? row.checkedCompany ?? viewDetail.value.primary_responsible_dept_name ?? viewDetail.value.mainDeptName ?? viewDetail.value.checkVenue ?? ''),
|
|
|
inspector: String(row.checkPersonName ?? row.checkPerson ?? row.inspector ?? ''),
|
|
inspector: String(row.checkPersonName ?? row.checkPerson ?? row.inspector ?? ''),
|
|
|
checkTime: String(row.checkTime ?? row.inspectionTime ?? ''),
|
|
checkTime: String(row.checkTime ?? row.inspectionTime ?? ''),
|
|
|
checkPlace: String(row.checkAddress ?? row.checkPlace ?? row.venue ?? ''),
|
|
checkPlace: String(row.checkAddress ?? row.checkPlace ?? row.venue ?? ''),
|
|
@@ -681,8 +955,12 @@
|
|
|
ruleFormData.planName = detail.planName ?? '';
|
|
ruleFormData.planName = detail.planName ?? '';
|
|
|
ruleFormData.venueCategoryName = detail.venueCategoryName ?? '';
|
|
ruleFormData.venueCategoryName = detail.venueCategoryName ?? '';
|
|
|
ruleFormData.checkVenue = detail.checkVenue ?? '';
|
|
ruleFormData.checkVenue = detail.checkVenue ?? '';
|
|
|
- ruleFormData.mainDeptName = detail.mainDeptName ?? '';
|
|
|
|
|
- ruleFormData.mainDeptId = findDeptIdByName(deptTree.value, ruleFormData.mainDeptName as string) ?? null;
|
|
|
|
|
|
|
+ const mainDeptName = detail.primary_responsible_dept_name ?? detail.mainDeptName ?? '';
|
|
|
|
|
+ (ruleFormData as Record<string, unknown>).primary_responsible_dept_name = mainDeptName;
|
|
|
|
|
+ (ruleFormData as Record<string, unknown>).primary_responsible_dept_code = detail.primary_responsible_dept_code ?? detail.mainDeptCode ?? '';
|
|
|
|
|
+ const primaryCode = detail.primary_responsible_dept_code ?? detail.mainDeptCode;
|
|
|
|
|
+ const idFromCode = primaryCode != null && /^\d+$/.test(String(primaryCode)) ? Number(primaryCode) : undefined;
|
|
|
|
|
+ (ruleFormData as Record<string, unknown>).primary_responsible_dept_id = idFromCode ?? findDeptIdByName(deptTree.value, mainDeptName) ?? null;
|
|
|
ruleFormData.selfCheckFrequency = detail.selfCheckFrequency ?? '';
|
|
ruleFormData.selfCheckFrequency = detail.selfCheckFrequency ?? '';
|
|
|
ruleFormData.safetyEmergencyDeptName = detail.safetyEmergencyDeptName ?? '';
|
|
ruleFormData.safetyEmergencyDeptName = detail.safetyEmergencyDeptName ?? '';
|
|
|
ruleFormData.safetyEmergencyDeptId = findDeptIdByName(deptTree.value, ruleFormData.safetyEmergencyDeptName as string) ?? null;
|
|
ruleFormData.safetyEmergencyDeptId = findDeptIdByName(deptTree.value, ruleFormData.safetyEmergencyDeptName as string) ?? null;
|