xiaweibo il y a 3 mois
Parent
commit
6a0e45e91c
12 fichiers modifiés avec 187 ajouts et 97 suppressions
  1. 2 0
      src/api/hiddenDanger/index.ts
  2. 8 8
      src/api/production-safety-system/index.ts
  3. 36 18
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/areaCheckPlanManagement.vue
  4. 38 32
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/components/areaCheckPlanManagementDetail.vue
  5. 16 21
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/components/areaCheckPlanRecordDetail.vue
  6. 6 5
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/configs/form.ts
  7. 5 5
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/configs/status.ts
  8. 2 2
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/configs/tables.ts
  9. 2 2
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/configs/types.ts
  10. 0 2
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagementDept/components/areaCheckPlanManagementDeptDetail.vue
  11. 23 0
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/hiddenTroubleAccountManagement/components/hiddenTroubleAccountManagementDetail.vue
  12. 49 2
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/hiddenTroubleAccountManagement/hiddenTroubleAccountManagement.vue

+ 2 - 0
src/api/hiddenDanger/index.ts

@@ -279,6 +279,8 @@ export interface HiddenDangerDeductPointsRequest {
   deductionScore: number;
   deductionReason?: string;
   remark?: string;
+  /** 扣分部门,多个用逗号分隔 */
+  department_ids?: string;
 }
 
 export function deductHiddenDangerPoints(data: HiddenDangerDeductPointsRequest) {

+ 8 - 8
src/api/production-safety-system/index.ts

@@ -797,8 +797,8 @@ interface AreaCheckPlanManageApiRecord {
   hospitalLeaderExecGroupCode?: string; // 院领导执行人所属分组code
   hospitalLeaderPersonName?: string; // 院领导责任人名称
   hospitalLeaderPersonCode?: string; // 院领导责任人code
-  checklistCategoryName?: string; // 检查单所属类别名称/检查单模版类别
-  checklistCategoryCode?: string; // 检查单模板类别code
+  categoryName?: string; // 检查单模版类别名称
+  categoryCode?: string; // 检查单模版类别 code
   checklistTemplateName?: string; // 检查单模版名称
   checkKeyContent?: string; // 检查重点内容
   needOverallDesc?: number | string; // 是否需要整体检查情况描述:0=否 1=是
@@ -850,8 +850,8 @@ export interface AreaCheckPlanRecord {
   hospitalLeaderResponsiblePerson?: string;
   hospitalLeaderPersonCode?: string;
   checkKeyContent?: string;
-  checklistCategoryName?: string;
-  checklistCategoryCode?: string;
+  categoryName?: string;
+  categoryCode?: string;
   checklistTemplateName?: string;
   needOverallDesc?: boolean;
   needInspectedSign?: boolean;
@@ -899,8 +899,8 @@ export function mapAreaCheckPlanApiRecordToUi(api: AreaCheckPlanManageApiRecord
     hospitalLeaderResponsiblePerson: api.hospitalLeaderPersonName ?? api.hospitalLeaderPerson,
     hospitalLeaderExecGroupCode: api.hospitalLeaderExecGroupCode,
     hospitalLeaderPersonCode: api.hospitalLeaderPersonCode,
-    checklistCategoryName: api.checklistCategoryName,
-    checklistCategoryCode: api.checklistCategoryCode,
+    categoryName: api.categoryName,
+    categoryCode: api.categoryCode,
     checklistTemplateName: api.checklistTemplateName,
     checkKeyContent: api.checkKeyContent,
     needOverallDesc: toBool(api.needOverallDesc),
@@ -949,8 +949,8 @@ function uiRecordToApi(ui: AreaCheckPlanRecord & { id?: number }): AreaCheckPlan
     hospitalLeaderExecGroupCode: code.hospitalLeaderExecGroupCode as string | undefined,
     hospitalLeaderPersonName: ui.hospitalLeaderResponsiblePerson,
     hospitalLeaderPersonCode: code.hospitalLeaderPersonCode as string | undefined,
-    checklistCategoryName: ui.checklistCategoryName,
-    checklistCategoryCode: code.checklistCategoryCode as string | undefined,
+    categoryName: ui.categoryName,
+    categoryCode: code.categoryCode as string | undefined,
     checklistTemplateName: ui.checklistTemplateName,
     checkKeyContent: ui.checkKeyContent,
     needOverallDesc: toNum(ui.needOverallDesc),

+ 36 - 18
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/areaCheckPlanManagement.vue

@@ -93,7 +93,7 @@
             </template>
             <template #action="scope">
               <div class="action-container--div" style="justify-content: left">
-                <!-- 未开始(0):编辑、删除、查看、下发 -->
+                <!-- 未下发(0):编辑、删除、查看、下发 -->
                 <template v-if="Number(scope.row.status) === 0">
                   <ActionButton text="编辑" @click="handleEdit(scope.row.id)" />
                   <ActionButton
@@ -117,7 +117,7 @@
                 <template v-else-if="Number(scope.row.status) === 2">
                   <ActionButton text="查看" @click="handleView(scope.row.id)" />
                 </template>
-                <!-- 已终止(3):删除、查看 -->
+                <!-- 已作废(3):删除、查看 -->
                 <template v-else-if="Number(scope.row.status) === 3">
                   <ActionButton
                     text="删除"
@@ -291,6 +291,10 @@
     queryAreaCheckPlanManageDetail,
     mapAreaCheckPlanApiRecordToUi,
   } from '@/api/production-safety-system';
+  import { getAllDepartments } from '@/api/auth/dept';
+  import type { DeptTree } from '@/types/dept/type';
+  import { queryUserGroupPage } from '@/api/system/person-group';
+  import type { PersonGroupListItem } from '@/types/person-group/type';
 
   const router = useRouter();
 
@@ -331,8 +335,8 @@
     needOverallDesc: [{ required: true, message: '请选择是否需要整体检查情况描述', trigger: 'change' }],
     needInspectedSign: [{ required: true, message: '请选择是否需要被检查人签字', trigger: 'change' }],
   };
-  // 下发弹窗:示例部门树与分组(不调用接口
-  const issueDeptTree = ref<any[]>([]);
+  // 下发弹窗:责任部门/安全应急部门/院领导部门复用新增区域检查计划的主责部门下拉(getAllDepartments
+  const issueDeptTree = ref<DeptTree[]>([]);
   const cascaderDeptProp = {
     checkStrictly: true,
     expandTrigger: 'hover' as const,
@@ -344,24 +348,38 @@
     ...cascaderDeptProp,
     multiple: true,
   };
-  const userGroupOptions = ref<Array<{ id: number; name: string }>>([]);
+  // 责任部门人员分组/安全应急部人员分组/院领导人员分组复用 queryUserGroupPage 查询用户分组接口
+  const userGroupOptions = ref<PersonGroupListItem[]>([]);
 
-  const initIssueMockData = () => {
-    issueDeptTree.value = [
-      { id: 1, deptName: '试验验证中心' },
-      { id: 2, deptName: '质量管理部' },
-      { id: 3, deptName: '安全应急部' },
-      { id: 4, deptName: '院领导' },
-    ];
-    userGroupOptions.value = [
-      { id: 1, name: '自查小分队分组' },
-      { id: 2, name: '安全应急部小分队分组' },
-      { id: 3, name: '领导小分队执行组' },
-    ];
+  /** 下发弹窗打开时加载部门树(与新增区域检查计划主责部门一致) */
+  const loadIssueDeptTree = async () => {
+    try {
+      const res = await getAllDepartments();
+      issueDeptTree.value = res?.[0]?.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 = () => {
-    initIssueMockData();
+    loadIssueDeptTree();
+    loadUserGroupOptions();
   };
 
   const resetIssueForm = () => {

+ 38 - 32
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/components/areaCheckPlanManagementDetail.vue

@@ -5,8 +5,8 @@
       <div class="view-summary__title">一级危险点:{{ viewDetail.checkVenue || '-' }}</div>
       <div class="view-summary__meta">
         <span>检查类别:{{ viewDetail.venueCategoryName || '-' }}</span>
-        <span>创建人:{{ viewDetail.createdBy || '李小红' }}</span>
-        <span>创建时间:{{ viewDetail.createdAt || '2026-01-06 12:20:30' }}</span>
+        <span>创建人:{{ viewDetail.createdBy || '-' }}</span>
+        <span>创建时间:{{ viewDetail.createdAt || '-' }}</span>
       </div>
     </section>
 
@@ -89,7 +89,7 @@
         <div class="row">
           <div class="col">
             <div class="label">检查单所属类别名称:</div>
-            <div class="value">{{ viewDetail.checklistCategoryName || '-' }}</div>
+            <div class="value">{{ viewDetail.categoryName || '-' }}</div>
           </div>
           <div class="col">
             <div class="label">检查单模版名称:</div>
@@ -127,7 +127,7 @@
           </div>
           <div class="col">
             <div class="label">业务工作:</div>
-            <div class="value">{{ viewDetail.businessWork || '动火作业' }}</div>
+            <div class="value">{{ viewDetail.businessWork || '-' }}</div>
           </div>
         </div>
       </div>
@@ -313,7 +313,6 @@
     AREA_CHECK_PLAN_FORM_DATA as AREA_CHECK_PLAN_FORM_DATA_IMPORT,
     AREA_CHECK_PLAN_FORM_RULES as AREA_CHECK_PLAN_FORM_RULES_IMPORT,
     CHECK_FREQUENCY_OPTIONS as CHECK_FREQUENCY_OPTIONS_IMPORT,
-    CHECKLIST_CATEGORY_OPTIONS as CHECKLIST_CATEGORY_OPTIONS_IMPORT,
   } from '../configs/form';
   import type { AreaCheckPlanRecord } from '../configs/types';
   import { AREA_CHECK_PLAN_STATUS_LABEL } from '../configs/status';
@@ -331,6 +330,7 @@
     queryCheckListTemplateNameList,
     type ChecklistTemplate,
   } from '@/api/production-safety-system';
+  import { queryDictTypeDetail } from '@/api/dict';
 
   const router = useRouter();
   const route = useRoute();
@@ -345,9 +345,6 @@
   const AREA_CHECK_PLAN_FORM_DATA = AREA_CHECK_PLAN_FORM_DATA_IMPORT ?? {};
   const AREA_CHECK_PLAN_FORM_RULES = AREA_CHECK_PLAN_FORM_RULES_IMPORT ?? {};
   const CHECK_FREQUENCY_OPTIONS = CHECK_FREQUENCY_OPTIONS_IMPORT ?? [];
-  const CHECKLIST_CATEGORY_OPTIONS = Array.isArray(CHECKLIST_CATEGORY_OPTIONS_IMPORT)
-    ? CHECKLIST_CATEGORY_OPTIONS_IMPORT
-    : [];
 
   const { ruleFormData, formRules, ruleFormConfig, cloneRuleFormData, beforeRouteLeave } = useFormConfigHook(
     AREA_CHECK_PLAN_FORM_CONFIG,
@@ -404,7 +401,21 @@
     setDeptNameFromCascader(hospitalLeaderDeptCascaderRef.value, 'hospitalLeaderDeptName');
   };
 
-  // 检查单模版类别:使用 form 静态选项,不请求接口
+  // 检查单模版类别:使用 admin/dict/queryDictTypeDetail 接口
+  const checklistCategoryOptions = ref<Array<{ label: string; value: string }>>([]);
+  const loadChecklistCategoryOptions = async () => {
+    try {
+      const res = await queryDictTypeDetail('checklist_template');
+      const list = res?.sysDictDataList ?? [];
+      checklistCategoryOptions.value = list.map((item) => ({
+        label: item.itemValue,
+        value: item.itemCode,
+      }));
+    } catch (e) {
+      console.error('获取检查单模版类别字典失败:', e);
+      checklistCategoryOptions.value = [];
+    }
+  };
   // 检查单模版名称:来自接口,可按类别筛选
   const checklistTemplateOptions = ref<Array<{ label: string; value: string }>>([]);
   const allChecklistTemplates = ref<ChecklistTemplate[]>([]);
@@ -429,7 +440,7 @@
       const res = await queryCheckListTemplateNameList();
       const list = ((res as { data?: ChecklistTemplate[] })?.data ?? (res as ChecklistTemplate[] | undefined)) || [];
       allChecklistTemplates.value = list;
-      const currentCategoryName = ruleFormData.checklistCategoryName as string | undefined;
+      const currentCategoryName = ruleFormData.categoryName as string | undefined;
       updateChecklistTemplateOptionsByCategory(currentCategoryName);
     } catch (e) {
       console.error('获取检查单模版名称列表失败:', e);
@@ -450,17 +461,19 @@
   const computedFormConfig = computed(() => {
     const base = isViewMode.value ? viewFormConfig.value : cloneDeep(AREA_CHECK_PLAN_FORM_CONFIG);
     return base.map((item) => {
-      if (item.prop === 'checklistCategoryName') {
+      if (item.prop === 'categoryCode') {
+        const opts = checklistCategoryOptions.value;
         return {
           ...item,
-          selectOptions: CHECKLIST_CATEGORY_OPTIONS,
+          selectOptions: opts,
           componentProps: {
             ...(item.componentProps || {}),
             onChange: (val: string) => {
-              ruleFormData.checklistCategoryName = val;
-              (ruleFormData as Record<string, unknown>).checklistCategoryCode = val;
+              const opt = opts.find((o) => o.value === val);
+              ruleFormData.categoryName = opt?.label ?? '';
+              (ruleFormData as Record<string, unknown>).categoryCode = val;
               ruleFormData.checklistTemplateName = '';
-              updateChecklistTemplateOptionsByCategory(val);
+              updateChecklistTemplateOptionsByCategory(opt?.label);
             },
           },
         };
@@ -480,7 +493,7 @@
 
   const basicFormRef = ref<InstanceType<typeof BasicForm>>();
 
-  // 查看页:详情数据(含列表假数据中的完整字段)
+  // 查看页:详情数据
   const viewDetailData = ref<Record<string, unknown>>({});
   const viewDetail = computed(() => {
     const d = viewDetailData.value;
@@ -503,29 +516,21 @@
       hospitalLeaderCheckFrequency: d?.hospitalLeaderCheckFrequency ?? ruleFormData.hospitalLeaderCheckFrequency ?? '-',
       hospitalLeaderExecutorGroupName: d?.hospitalLeaderExecutorGroupName ?? '-',
       hospitalLeaderResponsiblePerson: d?.hospitalLeaderResponsiblePerson ?? '-',
-      checklistCategoryName: d?.checklistCategoryName ?? ruleFormData.checklistCategoryName ?? '-',
+      categoryName: d?.categoryName ?? ruleFormData.categoryName ?? '-',
       checklistTemplateName: d?.checklistTemplateName ?? ruleFormData.checklistTemplateName ?? '-',
       needOverallDesc: d?.needOverallDesc ?? ruleFormData.needOverallDesc,
       needInspectedSign: d?.needInspectedSign ?? ruleFormData.needInspectedSign,
       planStartTime: d?.planStartTime ?? ruleFormData.planStartTime ?? '-',
       planEndTime: d?.planEndTime ?? ruleFormData.planEndTime ?? '-',
-      createdBy: d?.createdBy ?? '李小红',
-      createdAt: d?.createdAt ?? '2026-01-06 12:20:30',
-      businessWork: d?.businessWork ?? '动火作业',
+      createdBy: d?.createdBy ?? '-',
+      createdAt: d?.createdAt ?? '-',
+      businessWork: d?.businessWork ?? '-',
     };
   });
 
   const inspectionContentList = computed(() => {
     const content = (viewDetailData.value?.checkKeyContent ?? ruleFormData.checkKeyContent) as string;
-    if (!content || typeof content !== 'string') {
-      return [
-        '工作场所布局是否合理,通道是否畅通;',
-        '各种机械、电力、电气等设备的安装和使用是否符合安全技术要求;',
-        '安全防护装置是否齐全、灵敏、有效;',
-        '易燃易爆、有限空间和高处作业等作业场所是否符合安全条件;',
-        '有较大危险因素和职业危害因素的科研试验场所和有关;',
-      ];
-    }
+    if (!content || typeof content !== 'string') return [];
     return content.split(/[;;]/).map((s) => s.trim()).filter(Boolean);
   });
 
@@ -685,11 +690,11 @@
       ruleFormData.hospitalLeaderDeptName = detail.hospitalLeaderDeptName ?? '';
       ruleFormData.hospitalLeaderDeptId = findDeptIdByName(deptTree.value, ruleFormData.hospitalLeaderDeptName as string) ?? null;
       ruleFormData.hospitalLeaderCheckFrequency = detail.hospitalLeaderCheckFrequency ?? '';
-      (ruleFormData as Record<string, unknown>).checklistCategoryCode = detail.checklistCategoryCode ?? '';
-      ruleFormData.checklistCategoryName = detail.checklistCategoryName ?? '';
+      (ruleFormData as Record<string, unknown>).categoryCode = detail.categoryCode ?? '';
+      ruleFormData.categoryName = detail.categoryName ?? '';
       ruleFormData.checklistTemplateName = detail.checklistTemplateName ?? '';
       ruleFormData.checkKeyContent = detail.checkKeyContent ?? '';
-      updateChecklistTemplateOptionsByCategory(ruleFormData.checklistCategoryName as string | undefined);
+      updateChecklistTemplateOptionsByCategory(ruleFormData.categoryName as string | undefined);
       cloneRuleFormData();
       if (isViewMode.value) {
         loadRecordList();
@@ -720,6 +725,7 @@
     cloneRuleFormData();
     beforeRouteLeave();
     await getDeptTreeData();
+    await loadChecklistCategoryOptions();
     await loadChecklistTemplateOptions();
     if (isEditMode.value || isViewMode.value) {
       getDetail();

+ 16 - 21
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/components/areaCheckPlanRecordDetail.vue

@@ -64,12 +64,12 @@
   const recordId = computed(() => Number(route.query.recordId));
 
   const formData = ref({
-    inspectedUnit: String(route.query.inspectedUnit || ''),
-    inspector: String(route.query.inspector || ''),
-    checkTime: String(route.query.checkTime || ''),
-    checkPlace: String(route.query.checkPlace || ''),
-    overallDesc: String(route.query.overallDesc || ''),
-    signFile: String(route.query.signFile || ''),
+    inspectedUnit: '',
+    inspector: '',
+    checkTime: '',
+    checkPlace: '',
+    overallDesc: '',
+    signFile: '',
   });
 
   /** 将签字文件(逗号分隔URL或文件名)转换为 UploadFiles 使用的 FileItem 列表,复用新增安全考核上传附件文档字段样式 */
@@ -102,21 +102,16 @@
 
   const loadRecordDetail = async () => {
     if (!recordId.value) {
-      if (!formData.value.inspector && !formData.value.checkTime) {
-        formData.value = {
-          inspectedUnit: '某被检查单位',
-          inspector: '孙菲',
-          checkTime: '2025-03-28 10:00:00',
-          checkPlace: '18号楼',
-          overallDesc: '学习宣传贯彻习近平新时代中国特色社会主义思想和党的二十大精神等相关内容。',
-          signFile: '领导签字文件.pdf',
-        };
-        checkItems.value = [
-          { checkContent: '工作场所布局是否合理,通道是否畅通', checkStandard: '通道无阻塞', checkResult: '合格', checkProblem: '无' },
-          { checkContent: '各种机械、电力、电气等设备的安装和使用是否符合安全技术要求', checkStandard: '设备有完好防护装置', checkResult: '不合格', checkProblem: '部分电气设备绝缘老化' },
-          { checkContent: '易燃易爆、有限空间和高处作业等作业场所是否符合安全条件', checkStandard: '作业票证齐全', checkResult: '合格', checkProblem: '无' },
-        ];
-      }
+      // 新增检查日志:全部为空数据
+      formData.value = {
+        inspectedUnit: '',
+        inspector: '',
+        checkTime: '',
+        checkPlace: '',
+        overallDesc: '',
+        signFile: '',
+      };
+      checkItems.value = [];
       return;
     }
     try {

+ 6 - 5
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/configs/form.ts

@@ -83,16 +83,16 @@ export const AREA_CHECK_PLAN_FORM_CONFIG: FormConfig[] = [
     slot: 'hospitalLeaderCheckFrequency',
   },
   {
-    prop: 'checklistCategoryName',
+    prop: 'categoryCode',
     label: '检查单模版类别:',
     component: 'ElSelect',
     componentProps: {
-      placeholder: '选择检查单模版类别名称,单选',
+      placeholder: '选择检查单模版类别,单选',
       filterable: true,
       clearable: true,
       style: { width: '100%' },
     },
-    selectOptions: [], // 使用 CHECKLIST_CATEGORY_OPTIONS,由详情页注入
+    selectOptions: [], // 由详情页 queryDictTypeDetail 注入,value=itemCode, label=itemValue
   },
   {
     prop: 'checklistTemplateName',
@@ -133,7 +133,8 @@ export const AREA_CHECK_PLAN_FORM_DATA: Record<string, unknown> = {
   hospitalLeaderDeptId: null as number | null,
   hospitalLeaderDeptName: '',
   hospitalLeaderCheckFrequency: '',
-  checklistCategoryName: '',
+  categoryName: '',
+  categoryCode: '',
   checklistTemplateName: '',
   checkKeyContent: '',
 };
@@ -147,7 +148,7 @@ export const AREA_CHECK_PLAN_FORM_RULES = {
   safetyEmergencyDeptName: [{ required: true, message: '请选择安全应急部门', trigger: 'change' }],
   hospitalLeaderDeptName: [{ required: true, message: '请选择院领导部门', trigger: 'change' }],
   hospitalLeaderCheckFrequency: [{ required: true, message: '请选择院领导检查频次', trigger: 'change' }],
-  checklistCategoryName: [{ required: true, message: '请选择检查单模版类别', trigger: 'change' }],
+  categoryCode: [{ required: true, message: '请选择检查单模版类别', trigger: 'change' }],
   checklistTemplateName: [{ required: true, message: '请选择检查单模版名称', trigger: 'change' }],
   checkKeyContent: [{ required: true, message: '请输入检查重点内容', trigger: 'blur' }],
 };

+ 5 - 5
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/configs/status.ts

@@ -1,15 +1,15 @@
-// 区域检查计划状态配置:0=未开始 1=进行中 2=已完成 3=已终止(与接口文档对齐)
+// 区域检查计划状态配置(管理员与部门一致):0=未下发 1=进行中 2=已完成 3=已作废
 export const AREA_CHECK_PLAN_STATUS_OPTIONS = [
   { label: '全部', value: '' as const },
-  { label: '未开始', value: 0 },
+  { label: '未下发', value: 0 },
   { label: '进行中', value: 1 },
   { label: '已完成', value: 2 },
-  { label: '已终止', value: 3 },
+  { label: '已作废', value: 3 },
 ];
 
 export const AREA_CHECK_PLAN_STATUS_LABEL: Record<string, string> = {
-  '0': '未开始',
+  '0': '未下发',
   '1': '进行中',
   '2': '已完成',
-  '3': '已终止',
+  '3': '已作废',
 };

+ 2 - 2
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/configs/tables.ts

@@ -138,7 +138,7 @@ export const AREA_CHECK_PLAN_TABLE_COLUMNS: TableColumnProps[] = [
   },
   {
     label: '检查单所属类别名称',
-    prop: 'checklistCategoryName',
+    prop: 'categoryName',
     align: 'left',
     minWidth: '150px',
     showOverflowTooltip: true,
@@ -181,7 +181,7 @@ export const AREA_CHECK_PLAN_TABLE_COLUMNS: TableColumnProps[] = [
     prop: 'action',
     slot: 'action',
     fixed: 'right',
-    width: '180px',
+    width: '250px',
     align: 'left',
   },
 ];

+ 2 - 2
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/configs/types.ts

@@ -29,8 +29,8 @@ export interface AreaCheckPlanRecord {
   hospitalLeaderResponsiblePerson?: string;
   hospitalLeaderPersonCode?: string;
   checkKeyContent?: string;
-  checklistCategoryName?: string;
-  checklistCategoryCode?: string;
+  categoryName?: string;
+  categoryCode?: string;
   checklistTemplateName?: string;
   needOverallDesc?: boolean;
   needInspectedSign?: boolean;

+ 0 - 2
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagementDept/components/areaCheckPlanManagementDeptDetail.vue

@@ -361,8 +361,6 @@
       query: {
         operate: 'area-check-plan-record-add',
         planId: currentId.value,
-        planName: viewDetail.value.planName,
-        checkVenue: viewDetail.value.checkVenue,
       },
     });
   };

+ 23 - 0
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/hiddenTroubleAccountManagement/components/hiddenTroubleAccountManagementDetail.vue

@@ -179,6 +179,25 @@
             style="width: 100%"
           />
         </el-form-item>
+        <el-form-item label="扣分部门">
+          <el-select
+            v-model="deductDeptIdsArray"
+            placeholder="请选择扣分部门,可多选(复用复查人员所属部门)"
+            clearable
+            filterable
+            multiple
+            collapse-tags
+            collapse-tags-tooltip
+            style="width: 100%"
+          >
+            <el-option
+              v-for="d in deptOptions"
+              :key="d.id"
+              :label="d.deptName"
+              :value="d.id"
+            />
+          </el-select>
+        </el-form-item>
       </el-form>
       <template #footer>
         <el-button @click="showDeductDialog = false">取消</el-button>
@@ -557,6 +576,7 @@
   // ---------- 扣分 ----------
   const showDeductDialog = ref(false);
   const deductFormRef = ref<FormInstance>();
+  const deductDeptIdsArray = ref<number[]>([]);
   const deductForm = ref<HiddenDangerDeductPointsRequest>({
     dangerId: 0,
     deductionScore: 0,
@@ -569,6 +589,7 @@
   };
 
   function resetDeductForm() {
+    deductDeptIdsArray.value = [];
     deductForm.value = {
       dangerId: currentId.value || 0,
       deductionScore: 0,
@@ -590,6 +611,8 @@
     }
     try {
       deductForm.value.dangerId = currentId.value;
+      deductForm.value.department_ids =
+        deductDeptIdsArray.value.length > 0 ? deductDeptIdsArray.value.join(',') : undefined;
       await deductHiddenDangerPoints(deductForm.value);
       ElMessage.success('扣分记录成功');
       showDeductDialog.value = false;

+ 49 - 2
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/hiddenTroubleAccountManagement/hiddenTroubleAccountManagement.vue

@@ -174,7 +174,7 @@
     </el-dialog>
 
     <!-- 扣分弹窗 -->
-    <el-dialog v-model="showDeductDialog" title="扣分记录" width="400px" destroy-on-close>
+    <el-dialog v-model="showDeductDialog" title="扣分记录" width="400px" destroy-on-close @open="onDeductDialogOpen">
       <el-form ref="deductFormRef" :model="deductForm" :rules="deductRules" label-width="100px">
         <el-form-item label="扣分值" prop="deductionScore">
           <el-input-number
@@ -186,6 +186,25 @@
             style="width: 100%"
           />
         </el-form-item>
+        <el-form-item label="扣分部门">
+          <el-select
+            v-model="deductDeptIdsArray"
+            placeholder="请选择扣分部门,可多选(复用复查人员所属部门)"
+            clearable
+            filterable
+            multiple
+            collapse-tags
+            collapse-tags-tooltip
+            style="width: 100%"
+          >
+            <el-option
+              v-for="d in deductDeptOptions"
+              :key="d.id"
+              :label="d.deptName"
+              :value="d.id"
+            />
+          </el-select>
+        </el-form-item>
       </el-form>
       <template #footer>
         <el-button @click="showDeductDialog = false">取消</el-button>
@@ -477,9 +496,23 @@
     });
   };
 
-  /** 扣分弹窗 */
+  /** 扣分弹窗(扣分部门复用复查人员所属部门数据源) */
+  function flattenDeptTreeForDeduct(nodes: DeptTree[] | undefined): Array<{ id: number; deptName: string }> {
+    if (!nodes?.length) return [];
+    const list: Array<{ id: number; deptName: string }> = [];
+    const walk = (items: DeptTree[]) => {
+      items.forEach((n) => {
+        if (n.id != null) list.push({ id: n.id, deptName: n.deptName });
+        if (n.children?.length) walk(n.children);
+      });
+    };
+    walk(nodes);
+    return list;
+  }
   const showDeductDialog = ref(false);
   const deductDangerId = ref<number>(0);
+  const deductDeptOptions = ref<Array<{ id: number; deptName: string }>>([]);
+  const deductDeptIdsArray = ref<number[]>([]);
   const deductForm = ref<HiddenDangerDeductPointsRequest>({
     dangerId: 0,
     deductionScore: 0,
@@ -491,8 +524,20 @@
       { type: 'number', min: 0, max: 9999, message: '扣分值须为0-9999的整数', trigger: 'blur' },
     ],
   };
+  const onDeductDialogOpen = async () => {
+    try {
+      const deptRes = await getAllDepartments();
+      const fullTree = (deptRes as DeptTree[]) ?? [];
+      const tree = Array.isArray(fullTree) && fullTree[0]?.children ? fullTree[0].children : [];
+      deductDeptOptions.value = flattenDeptTreeForDeduct(tree);
+    } catch (e) {
+      console.error('获取部门列表失败:', e);
+      deductDeptOptions.value = [];
+    }
+  };
   const handleOpenDeduct = (id: number) => {
     deductDangerId.value = id;
+    deductDeptIdsArray.value = [];
     deductForm.value = {
       dangerId: id,
       deductionScore: 0,
@@ -508,6 +553,8 @@
     }
     try {
       deductForm.value.dangerId = deductDangerId.value;
+      deductForm.value.department_ids =
+        deductDeptIdsArray.value.length > 0 ? deductDeptIdsArray.value.join(',') : undefined;
       await deductHiddenDangerPoints(deductForm.value);
       ElMessage.success('扣分记录成功');
       showDeductDialog.value = false;