xiaweibo 3 månader sedan
förälder
incheckning
0855622f7e
25 ändrade filer med 3058 tillägg och 905 borttagningar
  1. 4 0
      src/api/hiddenDanger/index.ts
  2. 5 16
      src/api/pointDeduction/index.ts
  3. 127 4
      src/api/production-safety-system/index.ts
  4. 13 1
      src/api/production-safety/index.ts
  5. 473 144
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/areaCheckPlanManagement.vue
  6. 8 3
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/areaCheckPlanManagementItem.vue
  7. 804 168
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/components/areaCheckPlanManagementDetail.vue
  8. 156 0
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/components/areaCheckPlanRecordDetail.vue
  9. 116 54
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/configs/form.ts
  10. 15 0
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/configs/status.ts
  11. 142 17
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/configs/tables.ts
  12. 38 0
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/configs/types.ts
  13. 138 158
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagementDept/areaCheckPlanManagementDept.vue
  14. 17 8
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagementDept/areaCheckPlanManagementDeptItem.vue
  15. 584 210
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagementDept/components/areaCheckPlanManagementDeptDetail.vue
  16. 251 0
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagementDept/components/areaCheckPlanRecordDetailDept.vue
  17. 2 2
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/checkTemplateManagement/checkTemplateManagement.vue
  18. 30 11
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/checkTemplateManagement/components/checkTemplateManagementDetail.vue
  19. 78 7
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/employeeReportHiddenTroubleManagement/components/employeeReportHiddenTroubleManagementDetail.vue
  20. 18 0
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/hiddenTroubleAccountManagement/components/hiddenTroubleAccountManagementDetail.vue
  21. 2 2
      src/views/production-safety/hiddenTroubleInvestigationAndGovernance/hiddenTroubleReviewManagement/hiddenTroubleReviewManagement.vue
  22. 20 51
      src/views/production-safety/safetyAssessment/pointDeduction/components/PointDeductionDetail.vue
  23. 5 11
      src/views/production-safety/safetyAssessment/pointDeduction/configs/form.ts
  24. 2 2
      src/views/production-safety/safetyAssessment/pointDeduction/configs/tables.ts
  25. 10 36
      src/views/production-safety/safetyAssessment/pointDeduction/pointDeduction.vue

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

@@ -10,6 +10,8 @@ export interface HiddenDangerItem {
   sourceRefId?: number;
   dangerCode: string;
   dangerProblem: string;
+  /** 扣分原因名称(下拉显示,若无则用 dangerProblem) */
+  deductionReason?: string;
   typeId: number;
   typeName: string;
   reasonId: number;
@@ -50,6 +52,8 @@ export interface HiddenDangerItem {
   canReview?: boolean;
   canDeduct?: boolean;
   canView?: boolean;
+  /** 审查不通过原因(详情/整改页展示) */
+  reviewRejectReason?: string;
 }
 
 /**

+ 5 - 16
src/api/pointDeduction/index.ts

@@ -1,17 +1,6 @@
 import { http } from '@/utils/http/axios';
 import type { QueryPageRequest, QueryPageResponse } from '@/types/basic-query';
 
-/**
- * 扣分原因项
- */
-export interface DeductionReasonItem {
-  id: number;
-  pmdId: number;
-  serialNum: number;
-  deductionReason: string;
-  scoreVal: number;
-}
-
 /**
  * 月度扣分返回对象
  */
@@ -21,8 +10,8 @@ export interface PointDeductionItem {
   deductionDate: string; // 扣分日期 (YYYY-MM-DD)
   deductionScore: number; // 扣分值
   departmentName: string; // 部门名称
-  deductionReason?: string; // 扣分原因(已废弃,保留兼容
-  dedResonList?: DeductionReasonItem[]; // 扣分原因列表
+  hiddenDangerId?: number; // 隐患 id(与 deductionReason 平级
+  deductionReason?: string; // 扣分原因名称(与 hiddenDangerId 平级)
   status: boolean; // 状态 (true-启用, false-禁用)
   statusName: string; // 状态名称
 }
@@ -48,15 +37,15 @@ export function queryMonthlyDeduction(query: QueryPageRequest<PointDeductionQuer
 }
 
 /**
- * 保存月度扣分请求参数
+ * 保存月度扣分请求参数(deductionReason、hiddenDangerId 与其他字段平级)
  */
 export interface SaveMonthlyDeductionRequest {
   deductionTitle: string; // 扣分标题
   deductionDate: string; // 扣分日期 (YYYY-MM-DD)
   deductionScore: number; // 扣分值
   departmentName: string; // 部门名称
-  deductionReason?: string; // 扣分原因(已废弃,保留兼容)
-  dedResonList: DeductionReasonItem[]; // 扣分原因列表
+  hiddenDangerId?: number; // 隐患 id
+  deductionReason?: string; // 扣分原因名称
   status: boolean; // 状态 (true-启用, false-禁用)
   id?: number; // ID(编辑时需要)
 }

+ 127 - 4
src/api/production-safety-system/index.ts

@@ -674,9 +674,9 @@ export function queryChecklistTemplateList(query: ChecklistTemplatePageQuery) {
 }
 
 /** 二、删除检查单模版管理 */
-export function deleteChecklistTemplateList(id: number) {
+export function deleteChecklistTemplate(id: number) {
   return http.request({
-    url: `/checklistTemplate/deleteChecklistTemplateList?id=${id}`,
+    url: `/checklistTemplate/deleteChecklistTemplate?id=${id}`,
     method: 'delete',
   });
 }
@@ -699,9 +699,9 @@ export function updateChecklistTemplate(data: SaveChecklistTemplateReq) {
 }
 
 /** 五、新增检查单模版管理 */
-export function saveChecklistTemplateList(data: Omit<SaveChecklistTemplateReq, 'id'>) {
+export function saveChecklistTemplate(data: Omit<SaveChecklistTemplateReq, 'id'>) {
   return http.request({
-    url: '/checklistTemplate/saveChecklistTemplateList',
+    url: '/checklistTemplate/saveChecklistTemplate',
     method: 'post',
     data,
   });
@@ -730,3 +730,126 @@ export function importChecklistTemplateItem(file: File, id: string | number) {
   });
 }
 
+// ==================== 区域检查计划管理(管理员) areaCheckPlan ====================
+
+/** 区域检查计划状态:0-未下发 1-进行中 2-已完成 3-已作废 */
+export type AreaCheckPlanStatus = 0 | 1 | 2 | 3;
+
+export interface AreaCheckPlanRecord {
+  id?: number;
+  checkVenue?: string; // 检查场所
+  status?: AreaCheckPlanStatus; // 状态
+  venueCategoryName?: string; // 检查场所所属类别
+  planName?: string; // 区域检查计划名称
+  mainDeptName?: string; // 主责部门
+  selfCheckFrequency?: string; // 自查频次
+  mainDeptExecutorGroupName?: string; // 主责部门执行人所属分组名称
+  mainDeptResponsiblePerson?: string; // 主责部门责任人
+  safetyEmergencyDeptName?: string; // 安全应急部门名称
+  safetyEmergencyCheckFrequency?: string; // 安全应急部检查频次
+  safetyEmergencyExecutorGroupName?: string; // 安全应急部执行人所属分组名称
+  safetyEmergencyResponsiblePerson?: string; // 安全应急部责任人
+  hospitalLeaderDeptName?: string; // 院领导部门名称
+  hospitalLeaderCheckFrequency?: string; // 院领导检查频次
+  hospitalLeaderExecutorGroupName?: string; // 院领导执行人所属分组名称
+  hospitalLeaderResponsiblePerson?: string; // 院领导责任人
+  checkKeyContent?: string; // 检查重点内容
+  checklistCategoryName?: string; // 检查单所属类别名称
+  checklistTemplateName?: string; // 检查单模版名称
+  needOverallDesc?: boolean; // 是否需要整体检查情况描述
+  needInspectedSign?: boolean; // 是否需要被检查人签字
+  planStartTime?: string; // 计划开始时间
+  planEndTime?: string; // 计划结束时间
+  [key: string]: unknown;
+}
+
+export interface AreaCheckPlanQuery {
+  keyword?: string; // 检查场所/计划名称(模糊)
+  status?: AreaCheckPlanStatus | ''; // 状态:全部不传,0-未下发 1-进行中 2-已完成 3-已作废
+  venueCategory?: string; // 场所所属类别
+  planStartTime?: string; // 计划日期范围-开始 YYYY-MM-DD
+  planEndTime?: string; // 计划日期范围-结束 YYYY-MM-DD
+}
+
+export interface AreaCheckPlanPageQuery {
+  pageNumber: number;
+  pageSize: number;
+  queryParam?: AreaCheckPlanQuery;
+}
+
+/** 分页查询区域检查计划列表 */
+export function queryAreaCheckPlanPage(query: AreaCheckPlanPageQuery) {
+  return http.request<QueryPageResponse<AreaCheckPlanRecord>>({
+    url: '/admin/prod/areaCheckPlan/queryAreaCheckPlanPage',
+    method: 'post',
+    data: query,
+  });
+}
+
+/** 删除区域检查计划 */
+export function deleteAreaCheckPlan(id: number) {
+  return http.request({
+    url: `/admin/prod/areaCheckPlan/deleteAreaCheckPlan?id=${id}`,
+    method: 'delete',
+  });
+}
+
+/** 下发区域检查计划任务请求参数(弹窗表单) */
+export interface AreaCheckPlanIssueRequest {
+  planId: number; // 计划ID
+  responsibleDeptIds?: number[]; // 责任部门ID列表(多选)
+  mainDeptGroupId?: number; // 责任部门执行人所在分组ID,单选
+  safetyEmergencyDeptId?: number; // 安全应急部门ID
+  safetyEmergencyGroupId?: number; // 安全应急部执行人所在分组ID,单选
+  hospitalLeaderDeptId?: number; // 院领导部门ID
+  hospitalLeaderGroupId?: number; // 院领导部门执行人所在分组ID,单选
+  planStartTime?: string; // 计划开始日期 YYYY-MM-DD
+  planEndTime?: string; // 计划结束日期 YYYY-MM-DD
+  needOverallDesc?: boolean; // 是否需要整体检查情况描述
+  needInspectedSign?: boolean; // 是否需要被检查人签字
+}
+
+/** 下发区域检查计划(带任务配置弹窗提交) */
+export function issueAreaCheckPlan(data: AreaCheckPlanIssueRequest) {
+  return http.request({
+    url: '/admin/prod/areaCheckPlan/issueAreaCheckPlan',
+    method: 'post',
+    data,
+  });
+}
+
+/** 作废区域检查计划 */
+export function cancelAreaCheckPlan(id: number) {
+  return http.request({
+    url: '/admin/prod/areaCheckPlan/cancelAreaCheckPlan',
+    method: 'post',
+    params: { id },
+  });
+}
+
+/** 根据ID查询区域检查计划详情 */
+export function queryAreaCheckPlanById(id: number) {
+  return http.request<AreaCheckPlanRecord>({
+    url: `/admin/prod/areaCheckPlan/queryAreaCheckPlanById?id=${id}`,
+    method: 'get',
+  });
+}
+
+/** 新增区域检查计划 */
+export function saveAreaCheckPlan(data: AreaCheckPlanRecord) {
+  return http.request<number>({
+    url: '/admin/prod/areaCheckPlan/saveAreaCheckPlan',
+    method: 'post',
+    data,
+  });
+}
+
+/** 更新区域检查计划 */
+export function updateAreaCheckPlan(data: AreaCheckPlanRecord & { id: number }) {
+  return http.request({
+    url: '/admin/prod/areaCheckPlan/updateAreaCheckPlan',
+    method: 'put',
+    data,
+  });
+}
+

+ 13 - 1
src/api/production-safety/index.ts

@@ -142,6 +142,15 @@ export function queryEmployeeHazardReportPage(query: QueryPageRequest<QueryEmplo
   });
 }
 
+// 分页查询员工上报隐患(管理员审核列表)
+export function queryEmployeeHazardReportPendingPage(query: QueryPageRequest<QueryEmployeeHazardReportReq>) {
+  return http.request<QueryPageResponse<EmployeeHazardReportDTO>>({
+    url: '/employeeHazardReport/queryEmployeeHazardReportPendingPage',
+    method: 'post',
+    data: query,
+  });
+}
+
 // 审核员工上报隐患
 export function approveEmployeeHazardReport(data: ApproveEmployeeHazardReportReq) {
   return http.request({
@@ -154,8 +163,11 @@ export function approveEmployeeHazardReport(data: ApproveEmployeeHazardReportReq
 // 入账员工上报隐患
 export function accountEmployeeHazardReport(hazardId: number) {
   return http.request({
-    url: `/employeeHazardReport/accountEmployeeHazardReport?hazardId=${hazardId}`,
+    url: `/employeeHazardReport/accountEmployeeHazardReport`,
     method: 'post',
+    data: {
+      hazardId,
+    },
   });
 }
 

+ 473 - 144
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/areaCheckPlanManagement.vue

@@ -1,7 +1,7 @@
 <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-table-container">
@@ -10,46 +10,62 @@
             <el-button type="primary" class="search-table-container--button" @click="handleCreate">
               添加
             </el-button>
-            <el-button plain class="search-table-container--button" @click="handleImport">
-              导入
-            </el-button>
-            <el-button plain class="search-table-container--button" @click="handleDownload">
-              导出
-            </el-button>
           </div>
 
           <div class="act-search">
             <section class="select-box">
               <div class="select-box--item">
-                <span>文件名称/编号:</span>
+                <span>检查场所/计划名称:</span>
                 <el-input
                   v-model="tableQuery.queryParam.keyword"
-                  placeholder="搜索文件名称或编号"
+                  placeholder="搜索检查场所或计划名称"
                   class="act-search-input"
+                  clearable
                 />
               </div>
               <div class="select-box--item">
-                <span>分类:</span>
+                <span>状态:</span>
                 <el-select
-                  v-model="tableQuery.queryParam.classifyName"
-                  placeholder="请选择分类"
+                  v-model="tableQuery.queryParam.status"
+                  placeholder="请选择状态"
                   clearable
                 >
-                  <el-option label="外部院级文件" value="外部院级文件" />
-                  <el-option label="内部院级文件" value="内部院级文件" />
+                  <el-option
+                    v-for="item in AREA_CHECK_PLAN_STATUS_OPTIONS"
+                    :key="String(item.value)"
+                    :label="item.label"
+                    :value="item.value"
+                  />
                 </el-select>
               </div>
               <div class="select-box--item">
-                <span>状态:</span>
+                <span>场所所属类别:</span>
                 <el-select
-                  v-model="tableQuery.queryParam.status"
-                  placeholder="请选择状态"
+                  v-model="tableQuery.queryParam.venueCategory"
+                  placeholder="请选择场所所属类别"
                   clearable
+                  filterable
                 >
-                  <el-option label="启用" :value="1" />
-                  <el-option label="禁用" :value="0" />
+                  <el-option
+                    v-for="item in venueCategoryOptions"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  />
                 </el-select>
               </div>
+              <div class="select-box--item">
+                <span>日期范围:</span>
+                <el-date-picker
+                  v-model="dateRange"
+                  type="daterange"
+                  range-separator="-"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                  value-format="YYYY-MM-DD"
+                  format="YYYY-MM-DD"
+                />
+              </div>
             </section>
             <section class="search-btn">
               <el-button type="primary" @click="handleSearch">查询</el-button>
@@ -67,37 +83,193 @@
             @update:pageNumber="handleCurrentChange"
           >
             <template #status="scope">
-              <span>
-                {{ scope.row.status === 1 ? '启用' : scope.row.status === 0 ? '禁用' : '-' }}
-              </span>
+              <span>{{ AREA_CHECK_PLAN_STATUS_LABEL[String(scope.row.status)] ?? '-' }}</span>
+            </template>
+            <template #needOverallDesc="scope">
+              <span>{{ scope.row.needOverallDesc === true ? '是' : scope.row.needOverallDesc === false ? '否' : '-' }}</span>
+            </template>
+            <template #needInspectedSign="scope">
+              <span>{{ scope.row.needInspectedSign === true ? '是' : scope.row.needInspectedSign === false ? '否' : '-' }}</span>
             </template>
             <template #action="scope">
               <div class="action-container--div" style="justify-content: left">
-                <ActionButton text="编辑" @click="handleEdit(scope.row.id)" />
-                <ActionButton
-                  text="删除"
-                  :popconfirm="{
-                    title: '确定要删除?',
-                  }"
-                  @confirm="handleDelete(scope.row.id)"
-                />
-                <ActionButton text="查看" @click="handleView(scope.row.id)" />
+                <!-- 未下发(0):编辑、删除、查看、下发 -->
+                <template v-if="Number(scope.row.status) === 0">
+                  <ActionButton text="编辑" @click="handleEdit(scope.row.id)" />
+                  <ActionButton
+                    text="删除"
+                    :popconfirm="{ title: '确定要删除?' }"
+                    @confirm="handleDelete(scope.row.id)"
+                  />
+                  <ActionButton text="查看" @click="handleView(scope.row.id)" />
+                  <ActionButton text="下发" @click="handleIssue(scope.row.id)" />
+                </template>
+                <!-- 进行中(1):查看、作废 -->
+                <template v-else-if="Number(scope.row.status) === 1">
+                  <ActionButton text="查看" @click="handleView(scope.row.id)" />
+                  <ActionButton
+                    text="作废"
+                    :popconfirm="{ title: '确定要作废该计划?' }"
+                    @confirm="handleCancel(scope.row.id)"
+                  />
+                </template>
+                <!-- 已完成(2):查看 -->
+                <template v-else-if="Number(scope.row.status) === 2">
+                  <ActionButton text="查看" @click="handleView(scope.row.id)" />
+                </template>
+                <!-- 已作废(3):删除、查看 -->
+                <template v-else-if="Number(scope.row.status) === 3">
+                  <ActionButton
+                    text="删除"
+                    :popconfirm="{ title: '确定要删除?' }"
+                    @confirm="handleDelete(scope.row.id)"
+                  />
+                  <ActionButton text="查看" @click="handleView(scope.row.id)" />
+                </template>
               </div>
             </template>
           </BasicTable>
         </div>
       </div>
     </main>
-    <BatchImport
-      v-if="batchImportVisible"
-      :visible="batchImportVisible"
-      :import-api-url="importApiUrl"
-      :template-url="templateUrl"
-      template-name="下载模板"
-      :show-template="false"
-      @close="batchImportVisible = false"
-      @update="handleUpdate"
-    />
+
+    <!-- 下发区域检查计划任务弹窗 -->
+    <el-dialog
+      v-model="showIssueDialog"
+      title="下发区域检查计划任务"
+      width="560px"
+      destroy-on-close
+      @open="onIssueDialogOpen"
+      @close="currentIssuePlanId = null"
+    >
+      <el-form ref="issueFormRef" :model="issueForm" :rules="issueRules" label-width="160px">
+        <el-form-item label="责任部门:" prop="responsibleDeptIds">
+          <el-cascader
+            ref="issueResponsibleDeptCascaderRef"
+            v-model="issueForm.responsibleDeptIds"
+            :options="issueDeptTree"
+            :props="cascaderDeptPropMultiple"
+            :show-all-levels="false"
+            placeholder="请选择责任部门名称,支持多选"
+            filterable
+            clearable
+            collapse-tags
+            collapse-tags-tooltip
+            style="width: 100%"
+          />
+        </el-form-item>
+        <el-form-item label="责任部门人员分组:" prop="mainDeptGroupId">
+          <el-select
+            v-model="issueForm.mainDeptGroupId"
+            placeholder="请选择责任部门执行人所在分组名称,单选"
+            filterable
+            clearable
+            style="width: 100%"
+          >
+            <el-option
+              v-for="item in userGroupOptions"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="安全应急部门:" prop="safetyEmergencyDeptId">
+          <el-cascader
+            v-model="issueForm.safetyEmergencyDeptId"
+            :options="issueDeptTree"
+            :props="cascaderDeptProp"
+            :show-all-levels="false"
+            placeholder="请选择安全应急部门"
+            filterable
+            clearable
+            style="width: 100%"
+          />
+        </el-form-item>
+        <el-form-item label="安全应急部人员分组:" prop="safetyEmergencyGroupId">
+          <el-select
+            v-model="issueForm.safetyEmergencyGroupId"
+            placeholder="请选择安全应急部执行人所在分组名称,单选"
+            filterable
+            clearable
+            style="width: 100%"
+          >
+            <el-option
+              v-for="item in userGroupOptions"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="院领导部门:" prop="hospitalLeaderDeptId">
+          <el-cascader
+            v-model="issueForm.hospitalLeaderDeptId"
+            :options="issueDeptTree"
+            :props="cascaderDeptProp"
+            :show-all-levels="false"
+            placeholder="请选择院领导部门"
+            filterable
+            clearable
+            style="width: 100%"
+          />
+        </el-form-item>
+        <el-form-item label="院领导人员分组:" prop="hospitalLeaderGroupId">
+          <el-select
+            v-model="issueForm.hospitalLeaderGroupId"
+            placeholder="请选择院领导部门执行人所在分组名称,单选"
+            filterable
+            clearable
+            style="width: 100%"
+          >
+            <el-option
+              v-for="item in userGroupOptions"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="计划开始日期:" prop="planStartTime">
+          <el-date-picker
+            v-model="issueForm.planStartTime"
+            type="date"
+            placeholder="选择计划开始日期"
+            value-format="YYYY-MM-DD"
+            format="YYYY-MM-DD"
+            style="width: 100%"
+            :disabled-date="(date: Date) => (issueForm.planEndTime ? date > new Date(issueForm.planEndTime) : false)"
+          />
+        </el-form-item>
+        <el-form-item label="计划结束时间:" prop="planEndTime">
+          <el-date-picker
+            v-model="issueForm.planEndTime"
+            type="date"
+            placeholder="选择计划结束日期"
+            value-format="YYYY-MM-DD"
+            format="YYYY-MM-DD"
+            style="width: 100%"
+            :disabled-date="(date: Date) => (issueForm.planStartTime ? date < new Date(issueForm.planStartTime) : false)"
+          />
+        </el-form-item>
+        <el-form-item label="是否需要整体检查情况描述:" prop="needOverallDesc">
+          <el-radio-group v-model="issueForm.needOverallDesc">
+            <el-radio :value="true">是</el-radio>
+            <el-radio :value="false">否</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="是否需要被检查人签字:" prop="needInspectedSign">
+          <el-radio-group v-model="issueForm.needInspectedSign">
+            <el-radio :value="true">是</el-radio>
+            <el-radio :value="false">否</el-radio>
+          </el-radio-group>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <el-button @click="showIssueDialog = false">取消</el-button>
+        <el-button type="primary" @click="handleIssueSave">保存</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -107,38 +279,107 @@
   import BasicTable from '@/components/BasicTable.vue';
   import useTableConfig from '@/hooks/useTableConfigHook';
   import ActionButton from '@/components/ActionButton.vue';
-  import { TABLE_OPTIONS, INVENTORY_TABLE_COLUMNS } from './configs/tables';
+  import { TABLE_OPTIONS, AREA_CHECK_PLAN_TABLE_COLUMNS, AREA_CHECK_PLAN_STATUS_OPTIONS, AREA_CHECK_PLAN_STATUS_LABEL } from './configs/tables';
   import { useRouter } from 'vue-router';
   import type { QueryPageRequest } from '@/types/basic-query';
-  import {
-    queryAcademyFilePage,
-    deleteAcademyFile,
-    exportAcademyFile,
-    type ProductionSafetyFileQuery,
-  } from '@/api/production-safety-system';
-  import { downloadByData } from '@/utils/file/download';
-  import BatchImport from '@/components/batch-import/BatchImport.vue';
-  import { useGlobSetting } from '@/hooks/setting';
-  import urlJoin from 'url-join';
+  import type { AreaCheckPlanQuery, AreaCheckPlanRecord } from './configs/types';
 
   const router = useRouter();
 
-  // 表格
   const basicTableRef = ref<InstanceType<typeof BasicTable>>();
+  const { tableConfig, pagination } = useTableConfig(AREA_CHECK_PLAN_TABLE_COLUMNS, TABLE_OPTIONS);
+  const allData = ref<AreaCheckPlanRecord[]>([]);
+  const tableData = ref<AreaCheckPlanRecord[]>([]);
+  const dateRange = ref<[string, string] | null>(null);
 
-  const { tableConfig, pagination } = useTableConfig(INVENTORY_TABLE_COLUMNS, TABLE_OPTIONS);
+  // 场所所属类别选项(示例数据,本页面不调用接口)
+  const venueCategoryOptions = ref<Array<{ label: string; value: string }>>([]);
 
-  const tableData = ref<any[]>([]);
+  // 下发弹窗
+  const showIssueDialog = ref(false);
+  const currentIssuePlanId = ref<number | null>(null);
+  const issueFormRef = ref();
+  const issueResponsibleDeptCascaderRef = ref();
+  const issueForm = reactive({
+    responsibleDeptIds: [] as number[],
+    mainDeptGroupId: undefined as number | 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,
+    needInspectedSign: false,
+  });
+  const issueRules = {
+    responsibleDeptIds: [{ required: true, message: '请选择责任部门', trigger: 'change', type: 'array', min: 1 }],
+    mainDeptGroupId: [{ 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' }],
+    needInspectedSign: [{ required: true, message: '请选择是否需要被检查人签字', trigger: 'change' }],
+  };
+  // 下发弹窗:示例部门树与分组(不调用接口)
+  const issueDeptTree = ref<any[]>([]);
+  const cascaderDeptProp = {
+    checkStrictly: true,
+    expandTrigger: 'hover' as const,
+    value: 'id',
+    label: 'deptName',
+    emitPath: false,
+  };
+  const cascaderDeptPropMultiple = {
+    ...cascaderDeptProp,
+    multiple: true,
+  };
+  const userGroupOptions = ref<Array<{ id: number; name: string }>>([]);
+
+  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 onIssueDialogOpen = () => {
+    initIssueMockData();
+  };
 
-  const tableQuery = reactive<QueryPageRequest<ProductionSafetyFileQuery>>({
+  const resetIssueForm = () => {
+    issueForm.responsibleDeptIds = [];
+    issueForm.mainDeptGroupId = undefined;
+    issueForm.safetyEmergencyDeptId = undefined;
+    issueForm.safetyEmergencyGroupId = undefined;
+    issueForm.hospitalLeaderDeptId = undefined;
+    issueForm.hospitalLeaderGroupId = undefined;
+    issueForm.planStartTime = '';
+    issueForm.planEndTime = '';
+    issueForm.needOverallDesc = false;
+    issueForm.needInspectedSign = false;
+    issueFormRef.value?.resetFields?.();
+  };
+
+  const tableQuery = reactive<QueryPageRequest<AreaCheckPlanQuery>>({
     pageNumber: pagination.pageNumber,
     pageSize: pagination.pageSize,
     queryParam: {
-      keyword: '', // 文件名称/编号(模糊查询)
-      status: 1, // 状态:1-启用,0-禁用
-      classifyName: '', // 分类名称:外部院级文件/内部院级文件
-      startDate: '', // 上传日期范围-开始日期
-      endDate: '', // 上传日期范围-结束日期
+      keyword: '',
+      status: '' as AreaCheckPlanQuery['status'],
+      venueCategory: '',
+      planStartTime: '',
+      planEndTime: '',
     },
   });
 
@@ -154,36 +395,129 @@
     getTableData();
   };
 
+  /** 主列表假数据(本页面不调用接口,全部使用示例数据) */
+  const MOCK_LIST: AreaCheckPlanRecord[] = [
+    {
+      id: 1,
+      checkVenue: '18号楼、油库、液氮罐',
+      status: 1,
+      venueCategoryName: '各级风险点',
+      planName: '2025年度生产安全检查计划',
+      mainDeptName: '试验验证中心、质量管理部',
+      selfCheckFrequency: '每日',
+      mainDeptExecutorGroupName: '自查小分队分组',
+      mainDeptResponsiblePerson: '孙菲、周萍',
+      safetyEmergencyDeptName: '安全应急部',
+      safetyEmergencyCheckFrequency: '每周',
+      safetyEmergencyExecutorGroupName: '安全应急部小分队分组',
+      safetyEmergencyResponsiblePerson: '李雪峰',
+      hospitalLeaderDeptName: '院领导',
+      hospitalLeaderCheckFrequency: '每季度',
+      hospitalLeaderExecutorGroupName: '领导小分队执行组',
+      hospitalLeaderResponsiblePerson: '孙菲亚',
+      checklistCategoryName: '安全管理检查单',
+      checklistTemplateName: '上飞院安全检查表',
+      needOverallDesc: true,
+      needInspectedSign: true,
+      planStartTime: '2019-03-28',
+      planEndTime: '2019-03-28',
+    },
+    {
+      id: 2,
+      checkVenue: '试验车间、配电间',
+      status: 0,
+      venueCategoryName: '关键业务活动',
+      planName: '2025年一季度专项检查计划',
+      mainDeptName: '生产保障部',
+      selfCheckFrequency: '每周',
+      mainDeptExecutorGroupName: '安全员分组',
+      mainDeptResponsiblePerson: '张三',
+      safetyEmergencyDeptName: '安全应急部',
+      safetyEmergencyCheckFrequency: '每月',
+      safetyEmergencyExecutorGroupName: '应急值班组',
+      safetyEmergencyResponsiblePerson: '李四',
+      hospitalLeaderDeptName: '院领导',
+      hospitalLeaderCheckFrequency: '每半年',
+      hospitalLeaderExecutorGroupName: '领导检查组',
+      hospitalLeaderResponsiblePerson: '王五',
+      checklistCategoryName: '关键业务活动专项检查单',
+      checklistTemplateName: '关键业务活动专项检查单',
+      needOverallDesc: false,
+      needInspectedSign: true,
+      planStartTime: '2025-01-01',
+      planEndTime: '2025-03-31',
+    },
+    {
+      id: 3,
+      checkVenue: '办公区、食堂',
+      status: 2,
+      venueCategoryName: '日常安全',
+      planName: '日常安全检查计划',
+      mainDeptName: '综合管理部',
+      selfCheckFrequency: '每日',
+      mainDeptExecutorGroupName: '日常检查组',
+      mainDeptResponsiblePerson: '赵六',
+      safetyEmergencyDeptName: '安全应急部',
+      safetyEmergencyCheckFrequency: '每周',
+      safetyEmergencyExecutorGroupName: '安全应急部小分队分组',
+      safetyEmergencyResponsiblePerson: '李雪峰',
+      hospitalLeaderDeptName: '院领导',
+      hospitalLeaderCheckFrequency: '每年',
+      hospitalLeaderExecutorGroupName: '领导小分队执行组',
+      hospitalLeaderResponsiblePerson: '孙菲亚',
+      checklistCategoryName: '日常安全检查单',
+      checklistTemplateName: '日常安全检查单',
+      needOverallDesc: true,
+      needInspectedSign: false,
+      planStartTime: '2025-01-06',
+      planEndTime: '2025-12-31',
+    },
+  ];
 
-  async function getTableData() {
+  function getTableData() {
     tableConfig.loading = true;
     try {
-      const res = await queryAcademyFilePage(tableQuery);
-      if (res) {
-        // 映射返回数据字段到表格字段
-        tableData.value = res.records.map((item) => ({
-          id: item.id,
-          fileName: item.fileName, // 文件名称
-          fileCode: item.fileCode, // 文件编号
-          classifyName: item.classifyName, // 分类名称
-          fileVersion: item.fileVersion, // 文件版本号
-          fileFormat: item.fileFormat, // 文件格式
-          releaseDate: item.releaseDate, // 发布日期
-          status: item.status, // 状态:1-启用,0-禁用
-          uploadTime: item.uploadTime || item.createdAt, // 上传时间
-        }));
-        pagination.total = res.total || 0;
+      let list = allData.value.slice();
+      const { keyword, status, venueCategory, planStartTime, planEndTime } = tableQuery.queryParam;
+
+      if (keyword && keyword.trim()) {
+        const kw = keyword.trim().toLowerCase();
+        list = list.filter(
+          (row) =>
+            (row.checkVenue || '').toLowerCase().includes(kw) ||
+            (row.planName || '').toLowerCase().includes(kw),
+        );
+      }
+      if (status !== '' && status !== undefined && status !== null) {
+        list = list.filter((row) => String(row.status) === String(status));
+      }
+      if (venueCategory && venueCategory.trim()) {
+        const vc = venueCategory.trim().toLowerCase();
+        list = list.filter((row) => (row.venueCategoryName || '').toLowerCase().includes(vc));
       }
-    } catch (e) {
-      console.error('获取院级文件列表失败:', e);
-      tableData.value = [];
-      pagination.total = 0;
+      if (planStartTime) {
+        list = list.filter((row) => !row.planStartTime || row.planStartTime >= planStartTime);
+      }
+      if (planEndTime) {
+        list = list.filter((row) => !row.planEndTime || row.planEndTime <= planEndTime);
+      }
+
+      pagination.total = list.length;
+      const start = (tableQuery.pageNumber - 1) * tableQuery.pageSize;
+      tableData.value = list.slice(start, start + tableQuery.pageSize);
     } finally {
       tableConfig.loading = false;
     }
   }
 
   const handleSearch = () => {
+    if (dateRange.value && dateRange.value.length === 2) {
+      tableQuery.queryParam.planStartTime = dateRange.value[0];
+      tableQuery.queryParam.planEndTime = dateRange.value[1];
+    } else {
+      tableQuery.queryParam.planStartTime = '';
+      tableQuery.queryParam.planEndTime = '';
+    }
     pagination.pageNumber = 1;
     tableQuery.pageNumber = 1;
     getTableData();
@@ -191,90 +525,85 @@
 
   const handleReset = () => {
     tableQuery.queryParam.keyword = '';
-    tableQuery.queryParam.status = undefined;
-    tableQuery.queryParam.classifyName = '';
-    tableQuery.queryParam.startDate = '';
-    tableQuery.queryParam.endDate = '';
+    tableQuery.queryParam.status = '';
+    tableQuery.queryParam.venueCategory = '';
+    tableQuery.queryParam.planStartTime = '';
+    tableQuery.queryParam.planEndTime = '';
+    dateRange.value = null;
     handleSearch();
   };
 
-  // 批量导入
-  const batchImportVisible = ref(false);
-  const { urlPrefix } = useGlobSetting();
-  const importApiUrl = ref(urlJoin(urlPrefix, '/productionSafety/academyFile/import'));
-  const templateUrl = ref('./skyeye-file-upload/sfysecurity/TEMPLATE/import-academy-file-template.xlsx');
-
-  const handleImport = () => {
-    batchImportVisible.value = true;
-  };
-
-  const handleUpdate = () => {
-    batchImportVisible.value = false;
-    getTableData();
-  };
-
-  const handleDownload = async () => {
-    try {
-      const exportParams: ProductionSafetyFileQuery = {
-        keyword: tableQuery.queryParam.keyword || undefined,
-        status: tableQuery.queryParam.status,
-        classifyName: tableQuery.queryParam.classifyName || undefined,
-        startDate: tableQuery.queryParam.startDate || undefined,
-        endDate: tableQuery.queryParam.endDate || undefined,
-      };
-      const response = await exportAcademyFile(exportParams);
-      if (response) {
-        const fileName = `院级文件管理_${new Date().toISOString().split('T')[0]}.xlsx`;
-        downloadByData(response, fileName);
-        ElMessage.success('导出成功');
-      }
-    } catch (e) {
-      console.error('导出院级文件失败:', e);
-      ElMessage.error('导出失败,请重试');
-    }
-  };
-
   const handleCreate = () => {
     router.push({
       name: 'areaCheckPlanManagementItem',
-      query: {
-        operate: 'area-check-plan-create',
-      },
+      query: { operate: 'area-check-plan-create' },
     });
   };
 
   const handleEdit = (id: number) => {
     router.push({
       name: 'areaCheckPlanManagementItem',
-      query: {
-        id,
-        operate: 'area-check-plan-edit',
-      },
+      query: { id, operate: 'area-check-plan-edit' },
     });
   };
 
-  const handleDelete = async (id: number) => {
-    try {
-      await deleteAcademyFile(id);
-      ElMessage.success('删除成功');
-      getTableData();
-    } catch (e) {
-      console.error('删除院级文件失败:', e);
-      ElMessage.error('删除失败,请重试');
-    }
-  };
-
   const handleView = (id: number) => {
     router.push({
       name: 'areaCheckPlanManagementItem',
-      query: {
-        id,
-        operate: 'area-check-plan-view',
-      },
+      query: { id, operate: 'area-check-plan-view' },
     });
   };
 
+  const handleDelete = async (id: number) => {
+    allData.value = allData.value.filter((item) => item.id !== id);
+    ElMessage.success('删除成功(本地示例数据,未调用接口)');
+    getTableData();
+  };
+
+  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;
+    }
+    const record = allData.value.find((item) => item.id === currentIssuePlanId.value);
+    if (record) {
+      record.status = 1; // 标记为进行中
+      record.planStartTime = issueForm.planStartTime || record.planStartTime;
+      record.planEndTime = issueForm.planEndTime || record.planEndTime;
+      record.needOverallDesc = issueForm.needOverallDesc;
+      record.needInspectedSign = issueForm.needInspectedSign;
+    }
+    ElMessage.success('下发成功(本地示例数据,未调用接口)');
+    showIssueDialog.value = false;
+    getTableData();
+  };
+
+  const handleCancel = async (id: number) => {
+    const record = allData.value.find((item) => item.id === id);
+    if (record) {
+      record.status = 3; // 已作废
+    }
+    ElMessage.success('作废成功(本地示例数据,未调用接口)');
+    getTableData();
+  };
+
   onMounted(() => {
+    // 初始化本地数据与筛选项
+    allData.value = [...MOCK_LIST];
+    venueCategoryOptions.value = [
+      { label: '各级风险点', value: '各级风险点' },
+      { label: '关键业务活动', value: '关键业务活动' },
+      { label: '日常安全', value: '日常安全' },
+    ];
     getTableData();
   });
 </script>
@@ -284,4 +613,4 @@
   @use '@/styles/page-main-layout.scss' as *;
   @use '@/styles/basic-table-action.scss' as *;
   @use '@/views/traffic/violation/style/act-search-table.scss' as *;
-</style>
+</style>

+ 8 - 3
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/areaCheckPlanManagementItem.vue

@@ -4,7 +4,8 @@
       <BreadcrumbBack />
       <span class="breadcrumb-title">{{ headerTitle }}</span>
     </header>
-    <AreaCheckPlanManagementDetail />
+    <AreaCheckPlanManagementDetail v-if="!isRecordDetail" />
+    <AreaCheckPlanRecordDetail v-else />
   </div>
 </template>
 
@@ -13,12 +14,16 @@
   import { useRoute } from 'vue-router';
   import BreadcrumbBack from '@/components/BreadcrumbBack.vue';
   import AreaCheckPlanManagementDetail from './components/areaCheckPlanManagementDetail.vue';
+  import AreaCheckPlanRecordDetail from './components/areaCheckPlanRecordDetail.vue';
 
   const route = useRoute();
-  const operate = route.query.operate as string;
+  const operate = computed(() => (route.query.operate as string) || '');
+
+  const isRecordDetail = computed(() => operate.value === 'area-check-plan-record-view');
 
   const headerTitle = computed(() => {
-    switch (operate) {
+    if (isRecordDetail.value) return '检查记录查看';
+    switch (operate.value) {
       case 'area-check-plan-create':
         return '新增区域检查计划';
       case 'area-check-plan-edit':

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 804 - 168
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/components/areaCheckPlanManagementDetail.vue


+ 156 - 0
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/components/areaCheckPlanRecordDetail.vue

@@ -0,0 +1,156 @@
+<template>
+  <div class="area-check-plan-record-detail">
+    <main class="safety-platform-container__main">
+      <el-form :model="formData" label-width="auto" class="check-record-form">
+        <el-form-item label="被检查单位:">
+          <el-input v-model="formData.inspectedUnit" disabled />
+        </el-form-item>
+        <el-form-item label="检查人员:">
+          <el-input v-model="formData.inspector" disabled />
+        </el-form-item>
+        <el-form-item label="检查时间:">
+          <el-input v-model="formData.checkTime" disabled />
+        </el-form-item>
+        <el-form-item label="检查地点:">
+          <el-input v-model="formData.checkPlace" disabled />
+        </el-form-item>
+        <el-form-item label="整体检查情况描述:">
+          <el-input
+            v-model="formData.overallDesc"
+            type="textarea"
+            :rows="5"
+            maxlength="300"
+            show-word-limit
+            disabled
+            placeholder="整体检查情况描述(限300字)"
+          />
+        </el-form-item>
+        <el-form-item label="被检查人签字文件:">
+          <div class="upload-files-disabled">
+            <UploadFiles
+              label="上传附件"
+              :file-list="signFileList"
+            />
+          </div>
+        </el-form-item>
+      </el-form>
+
+      <div class="check-items-section">
+        <div class="section-header">
+          <span class="section-title">检查明细</span>
+        </div>
+        <div class="check-items-table">
+          <el-table :data="checkItems" border>
+            <el-table-column type="index" label="编号" width="80" align="center" />
+            <el-table-column prop="checkContent" label="检查内容" min-width="180" />
+            <el-table-column prop="checkStandard" label="检查标准" min-width="180" />
+            <el-table-column prop="checkResult" label="检查结果" min-width="120" align="center" />
+            <el-table-column prop="checkProblem" label="检查发现问题" min-width="200" />
+          </el-table>
+        </div>
+      </div>
+    </main>
+  </div>
+</template>
+
+<script setup lang="ts">
+  import { computed, ref } from 'vue';
+  import { useRoute, useRouter } from 'vue-router';
+  import UploadFiles from '@/components/UploadFiles/UploadFiles.vue';
+  import type { FileItem } from '@/components/UploadFiles/types';
+
+  const router = useRouter();
+  const route = useRoute();
+
+  const formData = ref({
+    inspectedUnit: String(route.query.inspectedUnit || '某被检查单位'),
+    inspector: String(route.query.inspector || '孙菲'),
+    checkTime: String(route.query.checkTime || '2025-03-28 10:00:00'),
+    checkPlace: String(route.query.checkPlace || '18号楼'),
+    overallDesc: String(route.query.overallDesc || '学习宣传贯彻习近平新时代中国特色社会主义思想和党的二十大精神等相关内容。'),
+    signFile: String(route.query.signFile || '领导签字文件.pdf'),
+  });
+
+  /** 将签字文件(逗号分隔URL或文件名)转换为 UploadFiles 使用的 FileItem 列表,复用新增安全考核上传附件文档字段样式 */
+  function convertSignFileToFileItems(attachmentsStr: string): FileItem[] {
+    if (!attachmentsStr || !String(attachmentsStr).trim()) return [];
+    const urls = String(attachmentsStr)
+      .split(',')
+      .map((u) => u.trim())
+      .filter(Boolean);
+    return urls.map((url, index) => {
+      const parts = url.split('/');
+      const fileName = parts[parts.length - 1] || `附件${index + 1}`;
+      const ext = fileName.split('.').pop()?.toLowerCase() || '';
+      let fileType = 'pdf';
+      if (['doc', 'docx'].includes(ext)) fileType = 'word';
+      else if (['xls', 'xlsx'].includes(ext)) fileType = 'excel';
+      else if (['ppt', 'pptx'].includes(ext)) fileType = 'ppt';
+      return { fileId: index + 1, fileName, fileType, fileSize: '0', fileUrl: url };
+    });
+  }
+
+  const signFileList = computed<FileItem[]>(() => convertSignFileToFileItems(formData.value.signFile || ''));
+
+  const checkItems = ref<Array<{
+    checkContent: string;
+    checkStandard: string;
+    checkResult: string;
+    checkProblem: string;
+  }>>([
+    {
+      checkContent: '工作场所布局是否合理,通道是否畅通',
+      checkStandard: '通道无阻塞,安全出口标识清晰',
+      checkResult: '合格',
+      checkProblem: '无',
+    },
+    {
+      checkContent: '各种机械、电力、电气等设备的安装和使用是否符合安全技术要求',
+      checkStandard: '设备有完好防护装置,操作规程上墙',
+      checkResult: '不合格',
+      checkProblem: '部分电气设备绝缘老化,未及时更换',
+    },
+    {
+      checkContent: '易燃易爆、有限空间和高处作业等作业场所是否符合安全条件',
+      checkStandard: '作业票证齐全,应急预案到位',
+      checkResult: '合格',
+      checkProblem: '无',
+    },
+  ]);
+</script>
+
+<style scoped lang="scss">
+  @use '@/styles/page-details-layout.scss' as *;
+  @use '@/styles/page-main-layout.scss' as *;
+
+  .check-record-form {
+    max-width: 800px;
+  }
+
+  .check-items-section {
+    margin-top: 16px;
+
+    .section-header {
+      margin-bottom: 8px;
+      .section-title {
+        font-weight: 600;
+      }
+    }
+  }
+
+  .upload-files-disabled {
+    pointer-events: none;
+    opacity: 0.6;
+
+    :deep(.upload-button) {
+      cursor: not-allowed;
+      background-color: #f5f5f5;
+      color: #aaa;
+    }
+
+    :deep(.delete-button) {
+      display: none;
+    }
+  }
+</style>
+

+ 116 - 54
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagement/configs/form.ts

@@ -1,91 +1,153 @@
 import { FormConfig } from '@/types/basic-form';
 
-export const ACADEMY_FILE_FORM_CONFIG: FormConfig[] = [
+/** 检查频次选项:每日/每周/每月/每季度/每半年/每年 */
+export const CHECK_FREQUENCY_OPTIONS = [
+  { label: '每日', value: '每日' },
+  { label: '每周', value: '每周' },
+  { label: '每月', value: '每月' },
+  { label: '每季度', value: '每季度' },
+  { label: '每半年', value: '每半年' },
+  { label: '每年', value: '每年' },
+];
+
+/** 检查单模版类别选项(单选):1-安全管理检查单 2-关键业务活动专项检查单 3-日常安全检查单 */
+export const CHECKLIST_CATEGORY_OPTIONS = [
+  { label: '安全管理检查单', value: '安全管理检查单' },
+  { label: '关键业务活动专项检查单', value: '关键业务活动专项检查单' },
+  { label: '日常安全检查单', value: '日常安全检查单' },
+];
+
+/** 区域检查计划新增/编辑表单配置(与截图字段顺序一致) */
+export const AREA_CHECK_PLAN_FORM_CONFIG: FormConfig[] = [
   {
-    prop: 'fileName',
-    label: '文件名称:',
+    prop: 'planName',
+    label: '区域检查计划名称:',
     component: 'ElInput',
     componentProps: {
-      placeholder: '请输入文件名称',
+      placeholder: '输入区域检查计划名称',
     },
   },
   {
-    prop: 'classifyName',
-    label: '分类名称:',
-    component: 'ElSelect',
+    prop: 'venueCategoryName',
+    label: '检查类别:',
+    component: 'ElInput',
     componentProps: {
-      placeholder: '请选择分类名称',
+      placeholder: '输入检查类别',
     },
-    selectOptions: [
-      { label: '外部院级文件', value: '外部院级文件' },
-      { label: '内部院级文件', value: '内部院级文件' },
-    ],
   },
   {
-    prop: 'fileCode',
-    label: '文件编号:',
+    prop: 'checkVenue',
+    label: '检查场所:',
     component: 'ElInput',
     componentProps: {
-      placeholder: '请输入文件编号',
+      placeholder: '输入检查场所',
     },
   },
   {
-    prop: 'fileVersion',
-    label: '文件版本号:',
-    component: 'ElInput',
+    prop: 'mainDeptName',
+    label: '主责部门:',
+    slot: 'mainDept', // 与新增物品领取记录页的部门下拉一致(el-cascader + getAllDepartments)
+    componentProps: {
+      placeholder: '请选择部门',
+    },
+  },
+  {
+    prop: 'selfCheckFrequency',
+    label: '自查频次:',
+    slot: 'selfCheckFrequency',
+  },
+  {
+    prop: 'safetyEmergencyDeptName',
+    label: '安全应急部门:',
+    slot: 'safetyEmergencyDept', // 与新增物品领取记录页的部门下拉一致(el-cascader + getAllDepartments)
     componentProps: {
-      placeholder: '请输入文件版本号,如:V1.0',
+      placeholder: '请选择部门',
     },
   },
   {
-    prop: 'fileFormat',
-    label: '文件格式:',
-    slot: 'fileFormat',
+    prop: 'safetyEmergencyCheckFrequency',
+    label: '安全应急部检查频次:',
+    slot: 'safetyEmergencyCheckFrequency',
   },
   {
-    prop: 'releaseDate',
-    label: '发布日期:',
-    component: 'ElDatePicker',
+    prop: 'hospitalLeaderDeptName',
+    label: '院领导部门:',
+    slot: 'hospitalLeaderDept', // 与新增物品领取记录页的部门下拉一致(el-cascader + getAllDepartments)
     componentProps: {
-      type: 'date',
-      placeholder: '请选择发布日期',
-      valueFormat: 'YYYY-MM-DD',
+      placeholder: '请选择部门',
     },
   },
   {
-    prop: 'fileUrl',
-    label: '文件上传:',
-    slot: 'fileUrl',
+    prop: 'hospitalLeaderCheckFrequency',
+    label: '院领导检查频次:',
+    slot: 'hospitalLeaderCheckFrequency',
+  },
+  {
+    prop: 'checklistCategoryName',
+    label: '检查单模版类别:',
+    component: 'ElSelect',
+    componentProps: {
+      placeholder: '选择检查单模版类别名称,单选',
+      filterable: true,
+      clearable: true,
+      style: { width: '100%' },
+    },
+    selectOptions: [], // 使用 CHECKLIST_CATEGORY_OPTIONS,由详情页注入
   },
   {
-    prop: 'content',
-    label: '文档内容:',
-    slot: 'content',
+    prop: 'checklistTemplateName',
+    label: '检查单模版名称:',
+    component: 'ElSelect',
+    componentProps: {
+      placeholder: '选择检查单模版名称,单选',
+      filterable: true,
+      clearable: true,
+      style: { width: '100%' },
+    },
+    selectOptions: [], // 由页面根据类别请求模版列表后注入
   },
   {
-    prop: 'status',
-    label: '状态:',
-    slot: 'status',
+    prop: 'checkKeyContent',
+    label: '检查重点内容:',
+    component: 'ElInput',
+    componentProps: {
+      type: 'textarea',
+      rows: 4,
+      placeholder: '请输入检查重点内容',
+      maxlength: 300,
+      showWordLimit: true,
+    },
   },
 ];
 
-export const ACADEMY_FILE_FORM_DATA = {
-  fileName: '',
-  classifyName: '',
-  fileCode: '',
-  fileVersion: '',
-  fileFormat: '',
-  releaseDate: '',
-  fileUrl: '',
-  content: '',
-  status: 1, // 默认启用
+export const AREA_CHECK_PLAN_FORM_DATA: Record<string, unknown> = {
+  planName: '',
+  venueCategoryName: '',
+  checkVenue: '',
+  mainDeptId: null as number | null,
+  mainDeptName: '',
+  selfCheckFrequency: '',
+  safetyEmergencyDeptId: null as number | null,
+  safetyEmergencyDeptName: '',
+  safetyEmergencyCheckFrequency: '',
+  hospitalLeaderDeptId: null as number | null,
+  hospitalLeaderDeptName: '',
+  hospitalLeaderCheckFrequency: '',
+  checklistCategoryName: '',
+  checklistTemplateName: '',
+  checkKeyContent: '',
 };
 
-export const ACADEMY_FILE_FORM_RULES = {
-  fileName: [{ required: true, message: '请输入文件名称', trigger: 'blur' }],
-  classifyName: [{ required: true, message: '请选择分类名称', trigger: 'change' }],
-  fileCode: [{ required: true, message: '请输入文件编号', trigger: 'blur' }],
-  fileVersion: [{ required: true, message: '请输入文件版本号', trigger: 'blur' }],
-  fileFormat: [{ required: true, message: '请选择文件格式', trigger: 'change' }],
-  releaseDate: [{ required: true, message: '请选择发布日期', trigger: 'change' }],
+export const AREA_CHECK_PLAN_FORM_RULES = {
+  planName: [{ required: true, message: '请输入区域检查计划名称', trigger: 'blur' }],
+  venueCategoryName: [{ required: true, message: '请输入检查类别', trigger: 'blur' }],
+  checkVenue: [{ required: true, message: '请输入检查场所', trigger: 'blur' }],
+  mainDeptName: [{ required: true, message: '请选择主责部门', trigger: 'change' }],
+  selfCheckFrequency: [{ required: true, message: '请选择自查频次', trigger: 'change' }],
+  safetyEmergencyDeptName: [{ required: true, message: '请选择安全应急部门', trigger: 'change' }],
+  hospitalLeaderDeptName: [{ required: true, message: '请选择院领导部门', trigger: 'change' }],
+  hospitalLeaderCheckFrequency: [{ required: true, message: '请选择院领导检查频次', trigger: 'change' }],
+  checklistCategoryName: [{ required: true, message: '请选择检查单模版类别', trigger: 'change' }],
+  checklistTemplateName: [{ required: true, message: '请选择检查单模版名称', trigger: 'change' }],
+  checkKeyContent: [{ required: true, message: '请输入检查重点内容', trigger: 'blur' }],
 };

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

@@ -0,0 +1,15 @@
+// 区域检查计划状态配置:0-未下发 1-进行中 2-已完成 3-已作废
+export const AREA_CHECK_PLAN_STATUS_OPTIONS = [
+  { label: '全部', value: '' as const },
+  { label: '未下发', value: 0 },
+  { label: '进行中', value: 1 },
+  { label: '已完成', value: 2 },
+  { label: '已作废', value: 3 },
+];
+
+export const AREA_CHECK_PLAN_STATUS_LABEL: Record<string, string> = {
+  '0': '未下发',
+  '1': '进行中',
+  '2': '已完成',
+  '3': '已作废',
+};

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

@@ -1,13 +1,16 @@
 import type { TableColumnProps } from '@/types/basic-table';
+import { AREA_CHECK_PLAN_STATUS_OPTIONS, AREA_CHECK_PLAN_STATUS_LABEL } from './status';
+
+export { AREA_CHECK_PLAN_STATUS_OPTIONS, AREA_CHECK_PLAN_STATUS_LABEL };
 
-// 基础表格样式配置
 export const TABLE_OPTIONS = {
   emptyText: '暂无数据',
   loading: true,
   maxHeight: 'calc(70vh - 150px)',
 };
 
-export const INVENTORY_TABLE_COLUMNS: TableColumnProps[] = [
+// 表格样式与检查单模版管理列表一致(TABLE_OPTIONS、编号/操作列宽)
+export const AREA_CHECK_PLAN_TABLE_COLUMNS: TableColumnProps[] = [
   {
     label: '编号',
     type: 'index',
@@ -15,41 +18,163 @@ export const INVENTORY_TABLE_COLUMNS: TableColumnProps[] = [
     width: '80px',
   },
   {
-    label: '物品名称',
-    prop: 'itemName',
+    label: '检查场所',
+    prop: 'checkVenue',
     align: 'left',
     minWidth: '120px',
+    showOverflowTooltip: true,
   },
   {
-    label: '入库日期',
-    prop: 'warehouseDate',
+    label: '状态',
+    prop: 'status',
+    slot: 'status',
+    align: 'center',
+    minWidth: '90px',
+  },
+  {
+    label: '检查场所所属类别',
+    prop: 'venueCategoryName',
+    align: 'left',
+    minWidth: '140px',
+    showOverflowTooltip: true,
+  },
+  {
+    label: '区域检查计划名称',
+    prop: 'planName',
+    align: 'left',
+    minWidth: '160px',
+    showOverflowTooltip: true,
+  },
+  {
+    label: '主责部门',
+    prop: 'mainDeptName',
     align: 'left',
     minWidth: '120px',
+    showOverflowTooltip: true,
   },
   {
-    label: '物品数量',
-    prop: 'itemQuantity',
-    align: 'center',
+    label: '自查频次',
+    prop: 'selfCheckFrequency',
+    align: 'left',
+    minWidth: '100px',
+    showOverflowTooltip: true,
+  },
+  {
+    label: '主责部门执行人所属分组名称',
+    prop: 'mainDeptExecutorGroupName',
+    align: 'left',
+    minWidth: '180px',
+    showOverflowTooltip: true,
+  },
+  {
+    label: '主责部门责任人',
+    prop: 'mainDeptResponsiblePerson',
+    align: 'left',
     minWidth: '120px',
+    showOverflowTooltip: true,
+  },
+  {
+    label: '安全应急部门名称',
+    prop: 'safetyEmergencyDeptName',
+    align: 'left',
+    minWidth: '140px',
+    showOverflowTooltip: true,
+  },
+  {
+    label: '安全应急部检查频次',
+    prop: 'safetyEmergencyCheckFrequency',
+    align: 'left',
+    minWidth: '150px',
+    showOverflowTooltip: true,
+  },
+  {
+    label: '安全应急部执行人所属分组名称',
+    prop: 'safetyEmergencyExecutorGroupName',
+    align: 'left',
+    minWidth: '200px',
+    showOverflowTooltip: true,
+  },
+  {
+    label: '安全应急部责任人',
+    prop: 'safetyEmergencyResponsiblePerson',
+    align: 'left',
+    minWidth: '130px',
+    showOverflowTooltip: true,
+  },
+  {
+    label: '院领导部门名称',
+    prop: 'hospitalLeaderDeptName',
+    align: 'left',
+    minWidth: '130px',
+    showOverflowTooltip: true,
   },
   {
-    label: '经办人',
-    prop: 'handler',
+    label: '院领导检查频次',
+    prop: 'hospitalLeaderCheckFrequency',
+    align: 'left',
+    minWidth: '140px',
+    showOverflowTooltip: true,
+  },
+  {
+    label: '院领导执行人所属分组名称',
+    prop: 'hospitalLeaderExecutorGroupName',
+    align: 'left',
+    minWidth: '200px',
+    showOverflowTooltip: true,
+  },
+  {
+    label: '院领导责任人',
+    prop: 'hospitalLeaderResponsiblePerson',
     align: 'left',
     minWidth: '120px',
+    showOverflowTooltip: true,
   },
   {
-    label: '备注',
-    prop: 'remarks',
+    label: '检查重点内容',
+    prop: 'checkKeyContent',
     align: 'left',
     minWidth: '150px',
+    showOverflowTooltip: true,
   },
   {
-    label: '状态',
-    prop: 'status',
-    slot: 'status',
+    label: '检查单所属类别名称',
+    prop: 'checklistCategoryName',
+    align: 'left',
+    minWidth: '150px',
+    showOverflowTooltip: true,
+  },
+  {
+    label: '检查单模版名称',
+    prop: 'checklistTemplateName',
+    align: 'left',
+    minWidth: '140px',
+    showOverflowTooltip: true,
+  },
+  {
+    label: '是否需要整体检查情况描述',
+    prop: 'needOverallDesc',
+    slot: 'needOverallDesc',
     align: 'center',
-    minWidth: '100px',
+    minWidth: '180px',
+  },
+  {
+    label: '是否需要被检查人签字',
+    prop: 'needInspectedSign',
+    slot: 'needInspectedSign',
+    align: 'center',
+    minWidth: '160px',
+  },
+  {
+    label: '计划开始时间',
+    prop: 'planStartTime',
+    align: 'left',
+    minWidth: '120px',
+  },
+  {
+    label: '计划结束时间',
+    prop: 'planEndTime',
+    align: 'left',
+    minWidth: '120px',
   },
   {
     label: '操作',

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

@@ -0,0 +1,38 @@
+/** 区域检查计划状态:0-未下发 1-进行中 2-已完成 3-已作废 */
+export type AreaCheckPlanStatus = 0 | 1 | 2 | 3;
+
+export interface AreaCheckPlanRecord {
+  id?: number;
+  checkVenue?: string;
+  status?: AreaCheckPlanStatus;
+  venueCategoryName?: string;
+  planName?: string;
+  mainDeptName?: string;
+  selfCheckFrequency?: string;
+  mainDeptExecutorGroupName?: string;
+  mainDeptResponsiblePerson?: string;
+  safetyEmergencyDeptName?: string;
+  safetyEmergencyCheckFrequency?: string;
+  safetyEmergencyExecutorGroupName?: string;
+  safetyEmergencyResponsiblePerson?: string;
+  hospitalLeaderDeptName?: string;
+  hospitalLeaderCheckFrequency?: string;
+  hospitalLeaderExecutorGroupName?: string;
+  hospitalLeaderResponsiblePerson?: string;
+  checkKeyContent?: string;
+  checklistCategoryName?: string;
+  checklistTemplateName?: string;
+  needOverallDesc?: boolean;
+  needInspectedSign?: boolean;
+  planStartTime?: string;
+  planEndTime?: string;
+  [key: string]: unknown;
+}
+
+export interface AreaCheckPlanQuery {
+  keyword?: string;
+  status?: AreaCheckPlanStatus | '';
+  venueCategory?: string;
+  planStartTime?: string;
+  planEndTime?: string;
+}

+ 138 - 158
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagementDept/areaCheckPlanManagementDept.vue

@@ -1,55 +1,67 @@
 <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-table-container">
         <header>
-          <div style="position: relative">
-            <el-button type="primary" class="search-table-container--button" @click="handleCreate">
-              添加
-            </el-button>
-            <el-button plain class="search-table-container--button" @click="handleImport">
-              导入
-            </el-button>
-            <el-button plain class="search-table-container--button" @click="handleDownload">
-              导出
-            </el-button>
-          </div>
+          <div style="position: relative"></div>
 
           <div class="act-search">
             <section class="select-box">
               <div class="select-box--item">
-                <span>文件名称/编号:</span>
+                <span>检查场所/计划名称:</span>
                 <el-input
                   v-model="tableQuery.queryParam.keyword"
-                  placeholder="搜索文件名称或编号"
+                  placeholder="搜索检查场所或计划名称"
                   class="act-search-input"
+                  clearable
                 />
               </div>
               <div class="select-box--item">
-                <span>分类:</span>
+                <span>状态:</span>
                 <el-select
-                  v-model="tableQuery.queryParam.classifyName"
-                  placeholder="请选择分类"
+                  v-model="tableQuery.queryParam.status"
+                  placeholder="请选择状态"
                   clearable
                 >
-                  <el-option label="外部院级文件" value="外部院级文件" />
-                  <el-option label="内部院级文件" value="内部院级文件" />
+                  <el-option
+                    v-for="item in AREA_CHECK_PLAN_STATUS_OPTIONS"
+                    :key="String(item.value)"
+                    :label="item.label"
+                    :value="item.value"
+                  />
                 </el-select>
               </div>
               <div class="select-box--item">
-                <span>状态:</span>
+                <span>场所所属类别:</span>
                 <el-select
-                  v-model="tableQuery.queryParam.status"
-                  placeholder="请选择状态"
+                  v-model="tableQuery.queryParam.venueCategory"
+                  placeholder="请选择场所所属类别"
                   clearable
+                  filterable
                 >
-                  <el-option label="启用" :value="1" />
-                  <el-option label="禁用" :value="0" />
+                  <el-option
+                    v-for="item in venueCategoryOptions"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  />
                 </el-select>
               </div>
+              <div class="select-box--item">
+                <span>日期范围:</span>
+                <el-date-picker
+                  v-model="dateRange"
+                  type="daterange"
+                  range-separator="-"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                  value-format="YYYY-MM-DD"
+                  format="YYYY-MM-DD"
+                />
+              </div>
             </section>
             <section class="search-btn">
               <el-button type="primary" @click="handleSearch">查询</el-button>
@@ -67,20 +79,16 @@
             @update:pageNumber="handleCurrentChange"
           >
             <template #status="scope">
-              <span>
-                {{ scope.row.status === 1 ? '启用' : scope.row.status === 0 ? '禁用' : '-' }}
-              </span>
+              <span>{{ AREA_CHECK_PLAN_STATUS_LABEL[String(scope.row.status)] ?? '-' }}</span>
+            </template>
+            <template #needOverallDesc="scope">
+              <span>{{ scope.row.needOverallDesc === true ? '是' : scope.row.needOverallDesc === false ? '否' : '-' }}</span>
+            </template>
+            <template #needInspectedSign="scope">
+              <span>{{ scope.row.needInspectedSign === true ? '是' : scope.row.needInspectedSign === false ? '否' : '-' }}</span>
             </template>
             <template #action="scope">
               <div class="action-container--div" style="justify-content: left">
-                <ActionButton text="编辑" @click="handleEdit(scope.row.id)" />
-                <ActionButton
-                  text="删除"
-                  :popconfirm="{
-                    title: '确定要删除?',
-                  }"
-                  @confirm="handleDelete(scope.row.id)"
-                />
                 <ActionButton text="查看" @click="handleView(scope.row.id)" />
               </div>
             </template>
@@ -88,57 +96,44 @@
         </div>
       </div>
     </main>
-    <BatchImport
-      v-if="batchImportVisible"
-      :visible="batchImportVisible"
-      :import-api-url="importApiUrl"
-      :template-url="templateUrl"
-      template-name="下载模板"
-      :show-template="false"
-      @close="batchImportVisible = false"
-      @update="handleUpdate"
-    />
   </div>
 </template>
 
 <script setup lang="ts">
   import { onMounted, reactive, ref } from 'vue';
-  import { ElMessage } from 'element-plus';
   import BasicTable from '@/components/BasicTable.vue';
   import useTableConfig from '@/hooks/useTableConfigHook';
   import ActionButton from '@/components/ActionButton.vue';
-  import { TABLE_OPTIONS, INVENTORY_TABLE_COLUMNS } from './configs/tables';
+  import {
+    TABLE_OPTIONS,
+    AREA_CHECK_PLAN_TABLE_COLUMNS,
+    AREA_CHECK_PLAN_STATUS_OPTIONS,
+    AREA_CHECK_PLAN_STATUS_LABEL,
+  } from '../areaCheckPlanManagement/configs/tables';
   import { useRouter } from 'vue-router';
   import type { QueryPageRequest } from '@/types/basic-query';
-  import {
-    queryAcademyFilePage,
-    deleteAcademyFile,
-    exportAcademyFile,
-    type ProductionSafetyFileQuery,
-  } from '@/api/production-safety-system';
-  import { downloadByData } from '@/utils/file/download';
-  import BatchImport from '@/components/batch-import/BatchImport.vue';
-  import { useGlobSetting } from '@/hooks/setting';
-  import urlJoin from 'url-join';
+  import type { AreaCheckPlanQuery, AreaCheckPlanRecord } from '../areaCheckPlanManagement/configs/types';
 
   const router = useRouter();
 
-  // 表格
   const basicTableRef = ref<InstanceType<typeof BasicTable>>();
+  const { tableConfig, pagination } = useTableConfig(AREA_CHECK_PLAN_TABLE_COLUMNS, TABLE_OPTIONS);
+  const allData = ref<AreaCheckPlanRecord[]>([]);
+  const tableData = ref<AreaCheckPlanRecord[]>([]);
+  const dateRange = ref<[string, string] | null>(null);
 
-  const { tableConfig, pagination } = useTableConfig(INVENTORY_TABLE_COLUMNS, TABLE_OPTIONS);
+  // 场所所属类别选项(可从接口或字典获取,此处预留)
+  const venueCategoryOptions = ref<Array<{ label: string; value: string }>>([]);
 
-  const tableData = ref<any[]>([]);
-
-  const tableQuery = reactive<QueryPageRequest<ProductionSafetyFileQuery>>({
+  const tableQuery = reactive<QueryPageRequest<AreaCheckPlanQuery>>({
     pageNumber: pagination.pageNumber,
     pageSize: pagination.pageSize,
     queryParam: {
-      keyword: '', // 文件名称/编号(模糊查询)
-      status: 1, // 状态:1-启用,0-禁用
-      classifyName: '', // 分类名称:外部院级文件/内部院级文件
-      startDate: '', // 上传日期范围-开始日期
-      endDate: '', // 上传日期范围-结束日期
+      keyword: '',
+      status: '' as AreaCheckPlanQuery['status'],
+      venueCategory: '',
+      planStartTime: '',
+      planEndTime: '',
     },
   });
 
@@ -154,36 +149,79 @@
     getTableData();
   };
 
+  /** 主列表假数据(本页面不调用接口,全部使用示例数据) */
+  const MOCK_LIST: AreaCheckPlanRecord[] = [
+    {
+      id: 1,
+      checkVenue: '18号楼、油库、液氮罐',
+      status: 1,
+      venueCategoryName: '各级风险点',
+      planName: '2025年度生产安全检查计划',
+      mainDeptName: '试验验证中心、质量管理部',
+      selfCheckFrequency: '每日',
+      mainDeptExecutorGroupName: '自查小分队分组',
+      mainDeptResponsiblePerson: '孙菲、周萍',
+      safetyEmergencyDeptName: '安全应急部',
+      safetyEmergencyCheckFrequency: '每周',
+      safetyEmergencyExecutorGroupName: '安全应急部小分队分组',
+      safetyEmergencyResponsiblePerson: '李雪峰',
+      hospitalLeaderDeptName: '院领导',
+      hospitalLeaderCheckFrequency: '每季度',
+      hospitalLeaderExecutorGroupName: '领导小分队执行组',
+      hospitalLeaderResponsiblePerson: '孙菲亚',
+      checklistCategoryName: '安全管理检查单',
+      checklistTemplateName: '上飞院安全检查表',
+      needOverallDesc: true,
+      needInspectedSign: true,
+      planStartTime: '2019-03-28',
+      planEndTime: '2019-03-28',
+    },
+  ];
 
-  async function getTableData() {
+  function getTableData() {
     tableConfig.loading = true;
     try {
-      const res = await queryAcademyFilePage(tableQuery);
-      if (res) {
-        // 映射返回数据字段到表格字段
-        tableData.value = res.records.map((item) => ({
-          id: item.id,
-          fileName: item.fileName, // 文件名称
-          fileCode: item.fileCode, // 文件编号
-          classifyName: item.classifyName, // 分类名称
-          fileVersion: item.fileVersion, // 文件版本号
-          fileFormat: item.fileFormat, // 文件格式
-          releaseDate: item.releaseDate, // 发布日期
-          status: item.status, // 状态:1-启用,0-禁用
-          uploadTime: item.uploadTime || item.createdAt, // 上传时间
-        }));
-        pagination.total = res.total || 0;
+      let list = allData.value.slice();
+      const { keyword, status, venueCategory, planStartTime, planEndTime } = tableQuery.queryParam;
+
+      if (keyword && keyword.trim()) {
+        const kw = keyword.trim().toLowerCase();
+        list = list.filter(
+          (row) =>
+            (row.checkVenue || '').toLowerCase().includes(kw) ||
+            (row.planName || '').toLowerCase().includes(kw),
+        );
+      }
+      if (status !== '' && status !== undefined && status !== null) {
+        list = list.filter((row) => String(row.status) === String(status));
+      }
+      if (venueCategory && venueCategory.trim()) {
+        const vc = venueCategory.trim().toLowerCase();
+        list = list.filter((row) => (row.venueCategoryName || '').toLowerCase().includes(vc));
       }
-    } catch (e) {
-      console.error('获取院级文件列表失败:', e);
-      tableData.value = [];
-      pagination.total = 0;
+      if (planStartTime) {
+        list = list.filter((row) => !row.planStartTime || row.planStartTime >= planStartTime);
+      }
+      if (planEndTime) {
+        list = list.filter((row) => !row.planEndTime || row.planEndTime <= planEndTime);
+      }
+
+      pagination.total = list.length;
+      const start = (tableQuery.pageNumber - 1) * tableQuery.pageSize;
+      tableData.value = list.slice(start, start + tableQuery.pageSize);
     } finally {
       tableConfig.loading = false;
     }
   }
 
   const handleSearch = () => {
+    if (dateRange.value && dateRange.value.length === 2) {
+      tableQuery.queryParam.planStartTime = dateRange.value[0];
+      tableQuery.queryParam.planEndTime = dateRange.value[1];
+    } else {
+      tableQuery.queryParam.planStartTime = '';
+      tableQuery.queryParam.planEndTime = '';
+    }
     pagination.pageNumber = 1;
     tableQuery.pageNumber = 1;
     getTableData();
@@ -191,79 +229,14 @@
 
   const handleReset = () => {
     tableQuery.queryParam.keyword = '';
-    tableQuery.queryParam.status = undefined;
-    tableQuery.queryParam.classifyName = '';
-    tableQuery.queryParam.startDate = '';
-    tableQuery.queryParam.endDate = '';
+    tableQuery.queryParam.status = '';
+    tableQuery.queryParam.venueCategory = '';
+    tableQuery.queryParam.planStartTime = '';
+    tableQuery.queryParam.planEndTime = '';
+    dateRange.value = null;
     handleSearch();
   };
 
-  // 批量导入
-  const batchImportVisible = ref(false);
-  const { urlPrefix } = useGlobSetting();
-  const importApiUrl = ref(urlJoin(urlPrefix, '/productionSafety/academyFile/import'));
-  const templateUrl = ref('./skyeye-file-upload/sfysecurity/TEMPLATE/import-academy-file-template.xlsx');
-
-  const handleImport = () => {
-    batchImportVisible.value = true;
-  };
-
-  const handleUpdate = () => {
-    batchImportVisible.value = false;
-    getTableData();
-  };
-
-  const handleDownload = async () => {
-    try {
-      const exportParams: ProductionSafetyFileQuery = {
-        keyword: tableQuery.queryParam.keyword || undefined,
-        status: tableQuery.queryParam.status,
-        classifyName: tableQuery.queryParam.classifyName || undefined,
-        startDate: tableQuery.queryParam.startDate || undefined,
-        endDate: tableQuery.queryParam.endDate || undefined,
-      };
-      const response = await exportAcademyFile(exportParams);
-      if (response) {
-        const fileName = `院级文件管理_${new Date().toISOString().split('T')[0]}.xlsx`;
-        downloadByData(response, fileName);
-        ElMessage.success('导出成功');
-      }
-    } catch (e) {
-      console.error('导出院级文件失败:', e);
-      ElMessage.error('导出失败,请重试');
-    }
-  };
-
-  const handleCreate = () => {
-    router.push({
-      name: 'areaCheckPlanManagementDeptItem',
-      query: {
-        operate: 'area-check-plan-dept-create',
-      },
-    });
-  };
-
-  const handleEdit = (id: number) => {
-    router.push({
-      name: 'areaCheckPlanManagementDeptItem',
-      query: {
-        id,
-        operate: 'area-check-plan-dept-edit',
-      },
-    });
-  };
-
-  const handleDelete = async (id: number) => {
-    try {
-      await deleteAcademyFile(id);
-      ElMessage.success('删除成功');
-      getTableData();
-    } catch (e) {
-      console.error('删除院级文件失败:', e);
-      ElMessage.error('删除失败,请重试');
-    }
-  };
-
   const handleView = (id: number) => {
     router.push({
       name: 'areaCheckPlanManagementDeptItem',
@@ -275,6 +248,12 @@
   };
 
   onMounted(() => {
+    allData.value = [...MOCK_LIST];
+    venueCategoryOptions.value = [
+      { label: '各级风险点', value: '各级风险点' },
+      { label: '关键业务活动', value: '关键业务活动' },
+      { label: '日常安全', value: '日常安全' },
+    ];
     getTableData();
   });
 </script>
@@ -284,4 +263,5 @@
   @use '@/styles/page-main-layout.scss' as *;
   @use '@/styles/basic-table-action.scss' as *;
   @use '@/views/traffic/violation/style/act-search-table.scss' as *;
-</style>
+</style>
+

+ 17 - 8
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagementDept/areaCheckPlanManagementDeptItem.vue

@@ -4,7 +4,8 @@
       <BreadcrumbBack />
       <span class="breadcrumb-title">{{ headerTitle }}</span>
     </header>
-    <AreaCheckPlanManagementDeptDetail />
+    <AreaCheckPlanManagementDeptDetail v-if="operateType === 'view'" />
+    <AreaCheckPlanRecordDetailDept v-else />
   </div>
 </template>
 
@@ -13,17 +14,25 @@
   import { useRoute } from 'vue-router';
   import BreadcrumbBack from '@/components/BreadcrumbBack.vue';
   import AreaCheckPlanManagementDeptDetail from './components/areaCheckPlanManagementDeptDetail.vue';
+  import AreaCheckPlanRecordDetailDept from './components/areaCheckPlanRecordDetailDept.vue';
 
   const route = useRoute();
-  const operate = route.query.operate as string;
+  const operate = computed(() => (route.query.operate as string) || '');
+
+  const operateType = computed(() => {
+    if (operate.value === 'area-check-plan-record-view') return 'record-view';
+    if (operate.value === 'area-check-plan-record-add') return 'record-add';
+    if (operate.value === 'area-check-plan-dept-view') return 'view';
+    return 'view';
+  });
 
   const headerTitle = computed(() => {
-    switch (operate) {
-      case 'area-check-plan-dept-create':
-        return '新增区域检查计划';
-      case 'area-check-plan-dept-edit':
-        return '编辑区域检查计划';
-      case 'area-check-plan-dept-view':
+    switch (operateType.value) {
+      case 'record-view':
+        return '检查记录查看';
+      case 'record-add':
+        return '新增检查日志';
+      case 'view':
         return '查看区域检查计划';
       default:
         return '未知操作';

+ 584 - 210
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagementDept/components/areaCheckPlanManagementDeptDetail.vue

@@ -1,264 +1,638 @@
 <template>
-  <main class="safety-platform-container__main">
-    <BasicForm
-      ref="basicFormRef"
-      :formData="ruleFormData"
-      :formRules="isViewMode ? undefined : formRules"
-      :formConfig="computedFormConfig"
-    >
-      <template #fileFormat>
-        <el-radio-group v-model="ruleFormData.fileFormat" :disabled="isViewMode">
-          <el-radio value="PDF">PDF</el-radio>
-          <el-radio value="WORD">WORD</el-radio>
-        </el-radio-group>
-      </template>
-      <template #fileUrl>
-        <UploadFiles
-          v-if="!isViewMode"
-          label="上传文件"
-          :maxCount="1"
-          :fileList="uploadFileList"
-          @uploadSuccess="handleUploadSuccess"
-        />
-        <div v-else-if="ruleFormData.fileUrl" class="file-display">
-          <a :href="ruleFormData.fileUrl" target="_blank" class="file-link">{{ getFileName(ruleFormData.fileUrl) }}</a>
+  <!-- 区域检查计划管理(部门)查看:与管理员查看样式一致 -->
+  <main class="safety-platform-container__main area-check-plan-view">
+    <section class="view-section view-summary">
+      <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>
+      </div>
+    </section>
+
+    <section class="view-section audit-content">
+      <h4 class="section-title">
+        <el-icon class="section-title__icon"><Document /></el-icon>
+        <span>基本信息</span>
+      </h4>
+      <div class="detail-ct detail-ct--table">
+        <div class="row">
+          <div class="col">
+            <div class="label">区域计划名称:</div>
+            <div class="value">{{ viewDetail.planName || '-' }}</div>
+          </div>
+          <div class="col">
+            <div class="label">状态:</div>
+            <div class="value">{{ viewDetail.statusName || '进行中' }}</div>
+          </div>
+        </div>
+        <div class="row">
+          <div class="col">
+            <div class="label">主责部门:</div>
+            <div class="value">{{ viewDetail.mainDeptName || '-' }}</div>
+          </div>
+          <div class="col">
+            <div class="label">自查频率:</div>
+            <div class="value">{{ viewDetail.selfCheckFrequency || '-' }}</div>
+          </div>
+        </div>
+        <div class="row">
+          <div class="col">
+            <div class="label">主责部门执行人所属分组名称:</div>
+            <div class="value">{{ viewDetail.mainDeptExecutorGroupName || '-' }}</div>
+          </div>
+          <div class="col">
+            <div class="label">主责部门责任人:</div>
+            <div class="value">{{ viewDetail.mainDeptResponsiblePerson || '-' }}</div>
+          </div>
+        </div>
+        <div class="row">
+          <div class="col">
+            <div class="label">安全应急部部门名称:</div>
+            <div class="value">{{ viewDetail.safetyEmergencyDeptName || '-' }}</div>
+          </div>
+          <div class="col">
+            <div class="label">安全应急部检查频次:</div>
+            <div class="value">{{ viewDetail.safetyEmergencyCheckFrequency || '-' }}</div>
+          </div>
+        </div>
+        <div class="row">
+          <div class="col">
+            <div class="label">安全应急部执行人所属分组名称:</div>
+            <div class="value">{{ viewDetail.safetyEmergencyExecutorGroupName || '-' }}</div>
+          </div>
+          <div class="col">
+            <div class="label">安全应急部责任人:</div>
+            <div class="value">{{ viewDetail.safetyEmergencyResponsiblePerson || '-' }}</div>
+          </div>
+        </div>
+        <div class="row">
+          <div class="col">
+            <div class="label">院领导部门名称:</div>
+            <div class="value">{{ viewDetail.hospitalLeaderDeptName || '-' }}</div>
+          </div>
+          <div class="col">
+            <div class="label">院领导检查频次:</div>
+            <div class="value">{{ viewDetail.hospitalLeaderCheckFrequency || '-' }}</div>
+          </div>
+        </div>
+        <div class="row">
+          <div class="col">
+            <div class="label">院领导执行人所属分组名称:</div>
+            <div class="value">{{ viewDetail.hospitalLeaderExecutorGroupName || '-' }}</div>
+          </div>
+          <div class="col">
+            <div class="label">院领导责任人:</div>
+            <div class="value">{{ viewDetail.hospitalLeaderResponsiblePerson || '-' }}</div>
+          </div>
+        </div>
+        <div class="row">
+          <div class="col">
+            <div class="label">检查单所属类别名称:</div>
+            <div class="value">{{ viewDetail.checklistCategoryName || '-' }}</div>
+          </div>
+          <div class="col">
+            <div class="label">检查单模版名称:</div>
+            <div class="value">{{ viewDetail.checklistTemplateName || '-' }}</div>
+          </div>
         </div>
-        <span v-else class="no-file">暂无文件</span>
-      </template>
-      <template #content>
-        <div v-if="!isViewMode" class="editor-container">
-          <Toolbar style="border-bottom: 1px solid #dcdfe6" :editor="editorRef" />
-          <Editor
-            style="height: 400px; overflow-y: auto"
-            v-model="ruleFormData.content"
-            mode="default"
-            :defaultConfig="editorConfig"
-            @on-created="handleEditorCreated"
-            @on-change="handleEditorChange"
-          />
+        <div class="row">
+          <div class="col">
+            <div class="label">是否需要整体检查情况描述:</div>
+            <div class="value">{{ viewDetail.needOverallDesc === true ? '是' : viewDetail.needOverallDesc === false ? '否' : '-' }}</div>
+          </div>
+          <div class="col">
+            <div class="label">是否需要被检查人签字:</div>
+            <div class="value">{{ viewDetail.needInspectedSign === true ? '是' : viewDetail.needInspectedSign === false ? '否' : '-' }}</div>
+          </div>
         </div>
-        <div v-else class="content-display" v-html="ruleFormData.content || '暂无内容'"></div>
-      </template>
-      <template #status>
-        <el-radio-group v-model="ruleFormData.status" :disabled="isViewMode">
-          <el-radio :value="1">启用</el-radio>
-          <el-radio :value="0">禁用</el-radio>
-        </el-radio-group>
-      </template>
-    </BasicForm>
+        <div class="row">
+          <div class="col">
+            <div class="label">计划开始日期:</div>
+            <div class="value">{{ viewDetail.planStartTime || '-' }}</div>
+          </div>
+          <div class="col">
+            <div class="label">计划完成日期:</div>
+            <div class="value">{{ viewDetail.planEndTime || '-' }}</div>
+          </div>
+        </div>
+        <div class="row">
+          <div class="col">
+            <div class="label">检查内容:</div>
+            <div class="value value--list">
+              <ol class="inspection-content-list">
+                <li v-for="(item, i) in inspectionContentList" :key="i">{{ item }}</li>
+              </ol>
+            </div>
+          </div>
+          <div class="col">
+            <div class="label">业务工作:</div>
+            <div class="value">{{ viewDetail.businessWork || '动火作业' }}</div>
+          </div>
+        </div>
+      </div>
+    </section>
+
+    <section class="view-section">
+      <div class="view-section__title">
+        <span class="view-section__icon" />
+        检查记录
+      </div>
+      <div class="view-record-toolbar">
+        <el-input
+          v-model="recordSearchKeyword"
+          placeholder="检查场所类别/检查场所/检查人员"
+          clearable
+          style="width: 280px; margin-right: 12px"
+        />
+        <el-date-picker
+          v-model="recordDateRange"
+          type="daterange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          value-format="YYYY-MM-DD"
+          style="margin-right: 12px"
+        />
+        <el-button type="primary" @click="onRecordSearch">查询</el-button>
+        <el-button @click="onRecordExport">导出</el-button>
+        <el-button type="primary" @click="onAddRecord">新增检查日志</el-button>
+      </div>
+      <BasicTable
+        :tableData="paginatedRecordList"
+        :tableConfig="recordTableConfig"
+        class="view-record-table"
+        @update:pageSize="handleRecordSizeChange"
+        @update:pageNumber="handleRecordPageChange"
+      >
+        <template #sign="scope">
+          <template v-if="parseSignFiles(scope.row.signFile).length">
+            <div
+              class="file-container--div"
+              v-for="item in parseSignFiles(scope.row.signFile)"
+              :key="item.fileUrl || item.fileName"
+            >
+              <img
+                class="file-container--div__icon"
+                :src="FILE_TYPE_ICON[item.fileType as keyof typeof FILE_TYPE_ICON]"
+                @click="previewOnline(item.fileUrl, item.fileType as keyof typeof FILE_TYPE_ICON)"
+              />
+              <span
+                class="file-container--div__name"
+                @click="previewOnline(item.fileUrl, item.fileType as keyof typeof FILE_TYPE_ICON)"
+                >{{ item.fileName }}</span
+              >
+              <img
+                class="file-container--div__download"
+                :src="DownloadIcon"
+                @click="downloadFile(item.fileUrl, item.fileName)"
+              />
+            </div>
+          </template>
+          <span v-else>-</span>
+        </template>
+        <template #action="scope">
+          <el-button type="primary" link size="small" @click="onViewRecord(scope.row)">检查记录查看</el-button>
+        </template>
+      </BasicTable>
+    </section>
   </main>
-  <footer class="safety-platform-container__footer">
-    <el-button @click="router.back()">返回</el-button>
-    <el-button v-if="!isViewMode" type="primary" @click="handleSubmit">
-      {{ isCreateMode ? '提交' : '保存' }}
-    </el-button>
-  </footer>
+  <PreviewOnline ref="previewOnlineRef" />
 </template>
 
 <script setup lang="ts">
-  import { computed, onMounted, ref, shallowRef, onBeforeUnmount } from 'vue';
+  import { computed, onMounted, ref, watch } from 'vue';
   import { useRoute, useRouter } from 'vue-router';
   import { ElMessage } from 'element-plus';
-  import BasicForm from '@/components/BasicForm.vue';
-  import UploadFiles from '@/components/UploadFiles/UploadFiles.vue';
-  import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
-  import '@wangeditor/editor/dist/css/style.css';
-  import { useFormConfigHook } from '@/hooks/useFormConfigHook';
-  import { ACADEMY_FILE_FORM_CONFIG, ACADEMY_FILE_FORM_DATA, ACADEMY_FILE_FORM_RULES } from '../configs/form';
-  import {
-    queryAcademyFileById,
-    saveAcademyFile,
-    updateAcademyFile,
-    type ProductionSafetyFile,
-  } from '@/api/production-safety-system';
-  import type { FileItem } from '@/components/UploadFiles/types';
+  import { Document } from '@element-plus/icons-vue';
+  import BasicTable from '@/components/BasicTable.vue';
+  import { FILE_TYPE_ICON } from '@/components/UploadFiles/constants';
+  import DownloadIcon from '@/views/disaster/disaster-control/src/svg/download.svg';
+  import PreviewOnline from '@/views/disaster/components/PreviewOnline.vue';
+  import { downloadFile } from '@/views/disaster/utils';
+  import useTableConfig from '@/hooks/useTableConfigHook';
+  import type { TableColumnProps } from '@/types/basic-table';
+  import type { AreaCheckPlanRecord } from '../../areaCheckPlanManagement/configs/types';
+  import { AREA_CHECK_PLAN_STATUS_LABEL } from '../../areaCheckPlanManagement/configs/status';
 
   const router = useRouter();
   const route = useRoute();
 
-  const operate = computed(() => (route.query.operate as string) || 'area-check-plan-dept-create');
   const currentId = computed(() => Number(route.query.id));
 
-  const isCreateMode = computed(() => operate.value === 'area-check-plan-dept-create');
-  const isEditMode = computed(() => operate.value === 'area-check-plan-dept-edit');
-  const isViewMode = computed(() => operate.value === 'area-check-plan-dept-view');
+  const viewDetailData = ref<Record<string, unknown>>({});
+  const viewDetail = computed(() => {
+    const d = viewDetailData.value;
+    const status = d?.status as number | undefined;
+    return {
+      ...d,
+      statusName: status != null ? AREA_CHECK_PLAN_STATUS_LABEL[String(status)] ?? '-' : '-',
+      planName: d?.planName ?? '-',
+      venueCategoryName: d?.venueCategoryName ?? '-',
+      checkVenue: d?.checkVenue ?? '-',
+      mainDeptName: d?.mainDeptName ?? '-',
+      selfCheckFrequency: d?.selfCheckFrequency ?? '-',
+      mainDeptExecutorGroupName: d?.mainDeptExecutorGroupName ?? '-',
+      mainDeptResponsiblePerson: d?.mainDeptResponsiblePerson ?? '-',
+      safetyEmergencyDeptName: d?.safetyEmergencyDeptName ?? '-',
+      safetyEmergencyCheckFrequency: d?.safetyEmergencyCheckFrequency ?? '-',
+      safetyEmergencyExecutorGroupName: d?.safetyEmergencyExecutorGroupName ?? '-',
+      safetyEmergencyResponsiblePerson: d?.safetyEmergencyResponsiblePerson ?? '-',
+      hospitalLeaderDeptName: d?.hospitalLeaderDeptName ?? '-',
+      hospitalLeaderCheckFrequency: d?.hospitalLeaderCheckFrequency ?? '-',
+      hospitalLeaderExecutorGroupName: d?.hospitalLeaderExecutorGroupName ?? '-',
+      hospitalLeaderResponsiblePerson: d?.hospitalLeaderResponsiblePerson ?? '-',
+      checklistCategoryName: d?.checklistCategoryName ?? '-',
+      checklistTemplateName: d?.checklistTemplateName ?? '-',
+      needOverallDesc: d?.needOverallDesc,
+      needInspectedSign: d?.needInspectedSign,
+      planStartTime: d?.planStartTime ?? '-',
+      planEndTime: d?.planEndTime ?? '-',
+      createdBy: d?.createdBy ?? '李小红',
+      createdAt: d?.createdAt ?? '2026-01-06 12:20:30',
+      businessWork: d?.businessWork ?? '动火作业',
+    };
+  });
 
-  const { ruleFormData, formRules, ruleFormConfig, cloneRuleFormData, beforeRouteLeave } =
-    useFormConfigHook(ACADEMY_FILE_FORM_CONFIG, ACADEMY_FILE_FORM_DATA, ACADEMY_FILE_FORM_RULES);
+  const inspectionContentList = computed(() => {
+    const content = (viewDetailData.value?.checkKeyContent ?? '') as string;
+    if (!content || typeof content !== 'string') {
+      return [
+        '工作场所布局是否合理,通道是否畅通;',
+        '各种机械、电力、电气等设备的安装和使用是否符合安全技术要求;',
+        '安全防护装置是否齐全、灵敏、有效;',
+        '易燃易爆、有限空间和高处作业等作业场所是否符合安全条件;',
+        '有较大危险因素和职业危害因素的科研试验场所和有关;',
+      ];
+    }
+    return content.split(/[;;]/).map((s) => s.trim()).filter(Boolean);
+  });
 
-  // 查看模式下,所有字段设为只读
-  const viewFormConfig = ref(
-    ACADEMY_FILE_FORM_CONFIG.map((item) => ({
-      ...item,
-      componentProps: {
-        ...item.componentProps,
-        disabled: true,
-      },
-    })),
+  const RECORD_TABLE_COLUMNS: TableColumnProps[] = [
+    { label: '编号', type: 'index', align: 'center', width: '60px' },
+    { label: '检查时间', prop: 'inspectionTime', minWidth: '160px' },
+    { label: '检查人员', prop: 'inspector', minWidth: '100px' },
+    { label: '检查场所类别', prop: 'venueCategory', minWidth: '120px' },
+    { label: '检查场所', prop: 'venue', minWidth: '120px' },
+    { label: '检查项总数', prop: 'totalItems', align: 'center', width: '100px' },
+    { label: '合格项数', prop: 'qualifiedItems', align: 'center', width: '90px' },
+    { label: '不合格项数', prop: 'unqualifiedItems', align: 'center', width: '100px' },
+    { label: '整体检查情况描述', prop: 'overallDesc', minWidth: '180px', showOverflowTooltip: true },
+    { label: '被检查人签字', slot: 'sign', align: 'center', width: '140px' },
+    { label: '操作', slot: 'action', align: 'center', width: '160px', fixed: 'right' },
+  ];
+  const RECORD_TABLE_OPTIONS = {
+    emptyText: '暂无检查记录',
+    loading: false,
+    maxHeight: '400px',
+    stripe: true,
+  };
+  const { tableConfig: recordTableConfig, pagination: recordPagination } = useTableConfig(
+    RECORD_TABLE_COLUMNS,
+    RECORD_TABLE_OPTIONS,
+    true,
   );
 
-  const computedFormConfig = computed(() => {
-    if (isViewMode.value) {
-      return viewFormConfig.value;
-    }
-    return ruleFormConfig.value;
+  const recordSearchKeyword = ref('');
+  const recordDateRange = ref<[string, string] | null>(null);
+  const inspectionRecordList = ref([
+    {
+      id: 1,
+      inspectionTime: '2025-03-28 10:00:00',
+      inspector: '孙菲',
+      venueCategory: '各级风险点',
+      venue: '18号楼',
+      totalItems: '25项',
+      qualifiedItems: '20项',
+      unqualifiedItems: '5项',
+      overallDesc: '学习宣传贯彻习近平…',
+      signFile: '领导签字文件.pdf',
+    },
+  ]);
+
+  const paginatedRecordList = computed(() => {
+    const list = inspectionRecordList.value;
+    const start = (recordPagination.pageNumber - 1) * recordPagination.pageSize;
+    return list.slice(start, start + recordPagination.pageSize);
   });
 
-  const basicFormRef = ref<InstanceType<typeof BasicForm>>();
-  
-  // 富文本编辑器
-  const editorRef = shallowRef();
-  const editorConfig = {
-    placeholder: '请输入文档内容',
-    MENU_CONF: {},
-  };
+  watch(
+    () => inspectionRecordList.value.length,
+    (len) => {
+      recordPagination.total = len;
+    },
+    { immediate: true },
+  );
 
-  const handleEditorCreated = (editor: any) => {
-    editorRef.value = editor;
+  const handleRecordSizeChange = (value: number) => {
+    recordPagination.pageSize = value;
+    recordPagination.pageNumber = 1;
   };
-
-  const handleEditorChange = () => {
-    // 编辑器内容变化时的处理
+  const handleRecordPageChange = (value: number) => {
+    recordPagination.pageNumber = value;
   };
 
-  // 文件上传
-  const uploadFileList = ref<FileItem[]>([]);
+  const onRecordSearch = () => {
+    ElMessage.info('查询检查记录');
+  };
+  const onRecordExport = () => {
+    ElMessage.success('导出功能开发中');
+  };
 
-  const handleUploadSuccess = (files: FileItem[]) => {
-    uploadFileList.value = files;
-    if (files.length > 0 && files[0].file) {
-      // 这里需要实际上传文件到服务器,获取 fileUrl
-      // 暂时使用文件对象,实际应该调用上传接口
-      ruleFormData.fileUrl = files[0].file.name; // 临时处理,需要替换为实际上传后的URL
-    }
+  const onAddRecord = () => {
+    router.push({
+      name: 'areaCheckPlanManagementDeptItem',
+      query: {
+        operate: 'area-check-plan-record-add',
+        planId: currentId.value,
+        planName: viewDetail.value.planName,
+        checkVenue: viewDetail.value.checkVenue,
+      },
+    });
   };
 
-  const getFileName = (url: string) => {
-    if (!url) return '';
-    const parts = url.split('/');
-    return parts[parts.length - 1];
+  const previewOnlineRef = ref<InstanceType<typeof PreviewOnline>>();
+  const previewOnline = (url: string | undefined, type: keyof typeof FILE_TYPE_ICON) => {
+    if (url) previewOnlineRef.value?.open(url, type);
   };
 
-  const handleValidate = async () => {
-    if (!basicFormRef.value) return;
-    const res = await basicFormRef.value.validateForm();
-    return res;
+  const parseSignFiles = (signFile: string | undefined): Array<{ fileUrl: string; fileName: string; fileType: string }> => {
+    if (!signFile || !String(signFile).trim()) return [];
+    const parts = String(signFile)
+      .split(',')
+      .map((s) => s.trim())
+      .filter(Boolean);
+    return parts.map((part) => {
+      const urlParts = part.split('/');
+      const fileName = urlParts[urlParts.length - 1] || part || '未知文件';
+      const extension = fileName.split('.').pop()?.toLowerCase() || '';
+      let fileType = 'pdf';
+      if (extension === 'doc' || extension === 'docx') fileType = 'word';
+      else if (extension === 'xls' || extension === 'xlsx') fileType = 'excel';
+      else if (extension === 'ppt' || extension === 'pptx') fileType = 'ppt';
+      return { fileUrl: part, fileName, fileType };
+    });
   };
 
-  const getDetail = async () => {
-    if (!currentId.value) return;
-    try {
-      const res = await queryAcademyFileById(currentId.value);
-      if (res) {
-        // 映射接口字段到表单字段
-        ruleFormData.fileName = res.fileName || '';
-        ruleFormData.classifyName = res.classifyName || '';
-        ruleFormData.fileCode = res.fileCode || '';
-        ruleFormData.fileVersion = res.fileVersion || '';
-        ruleFormData.fileFormat = res.fileFormat || '';
-        ruleFormData.releaseDate = res.releaseDate || '';
-        ruleFormData.fileUrl = res.fileUrl || '';
-        ruleFormData.content = res.content || '';
-        ruleFormData.status = res.status ?? 1;
-        
-        // 如果有文件URL,转换为FileItem格式
-        if (res.fileUrl) {
-          uploadFileList.value = [
-            {
-              fileId: Date.now(),
-              fileName: getFileName(res.fileUrl),
-              fileType: res.fileFormat?.toLowerCase() === 'pdf' ? 'pdf' : 'word',
-              fileSize: '0KB',
-            },
-          ];
-        }
-      }
-      cloneRuleFormData();
-    } catch (e) {
-      console.error('获取院级文件详情失败:', e);
-      ElMessage.error('获取详情失败');
-    }
+  const onViewRecord = (row: { id?: number; inspector?: string; inspectionTime?: string; venue?: string; overallDesc?: string; signFile?: string }) => {
+    router.push({
+      name: 'areaCheckPlanManagementDeptItem',
+      query: {
+        operate: 'area-check-plan-record-view',
+        id: row.id,
+        inspectedUnit: viewDetail.value.mainDeptName || viewDetail.value.checkVenue || '',
+        inspector: row.inspector || '',
+        checkTime: row.inspectionTime || '',
+        checkPlace: row.venue || '',
+        overallDesc: row.overallDesc || '',
+        signFile: row.signFile || '',
+      },
+    });
   };
 
-  const handleSubmit = async () => {
-    const res = await handleValidate();
-    if (!res) return;
-    try {
-      const basePayload: ProductionSafetyFile = {
-        fileName: ruleFormData.fileName,
-        classifyName: ruleFormData.classifyName,
-        fileCode: ruleFormData.fileCode,
-        fileVersion: ruleFormData.fileVersion,
-        fileFormat: ruleFormData.fileFormat,
-        releaseDate: ruleFormData.releaseDate,
-        fileUrl: ruleFormData.fileUrl || undefined,
-        content: ruleFormData.content || undefined,
-        status: ruleFormData.status ?? 1,
-      };
-
-      if (isCreateMode.value) {
-        await saveAcademyFile(basePayload);
-        ElMessage.success('创建成功');
-      } else if (isEditMode.value && currentId.value) {
-        await updateAcademyFile({
-          id: currentId.value,
-          ...basePayload,
-        });
-        ElMessage.success('保存成功');
-      }
+  /** 详情 mock 数据(与列表 MOCK_LIST 对应) */
+  const MOCK_DETAIL_MAP: Record<number, AreaCheckPlanRecord> = {
+    1: {
+      id: 1,
+      planName: '2025年度生产安全检查计划',
+      status: 1,
+      checkVenue: '18号楼、油库、液氮罐',
+      venueCategoryName: '各级风险点',
+      mainDeptName: '试验验证中心、质量管理部',
+      selfCheckFrequency: '每日',
+      mainDeptExecutorGroupName: '自查小分队分组',
+      mainDeptResponsiblePerson: '孙菲、周萍',
+      safetyEmergencyDeptName: '安全应急部',
+      safetyEmergencyCheckFrequency: '每周',
+      safetyEmergencyExecutorGroupName: '安全应急部小分队分组',
+      safetyEmergencyResponsiblePerson: '李雪峰',
+      hospitalLeaderDeptName: '院领导',
+      hospitalLeaderCheckFrequency: '每季度',
+      hospitalLeaderExecutorGroupName: '领导小分队执行组',
+      hospitalLeaderResponsiblePerson: '孙菲亚',
+      checklistCategoryName: '安全管理检查单',
+      checklistTemplateName: '上飞院安全检查表',
+      needOverallDesc: true,
+      needInspectedSign: true,
+      planStartTime: '2019-03-28',
+      planEndTime: '2019-03-28',
+      createdBy: '李小红',
+      createdAt: '2026-01-06 12:20:30',
+      businessWork: '动火作业',
+      checkKeyContent: '工作场所布局是否合理,通道是否畅通;各种机械、电力、电气等设备的安装和使用是否符合安全技术要求;安全防护装置是否齐全、灵敏、有效;易燃易爆、有限空间和高处作业等作业场所是否符合安全条件',
+    },
+    2: {
+      id: 2,
+      planName: '2025年一季度专项检查计划',
+      status: 0,
+      checkVenue: '试验车间、配电间',
+      venueCategoryName: '关键业务活动',
+      mainDeptName: '生产保障部',
+      selfCheckFrequency: '每周',
+      mainDeptExecutorGroupName: '安全员分组',
+      mainDeptResponsiblePerson: '张三',
+      safetyEmergencyDeptName: '安全应急部',
+      safetyEmergencyCheckFrequency: '每月',
+      safetyEmergencyExecutorGroupName: '应急值班组',
+      safetyEmergencyResponsiblePerson: '李四',
+      hospitalLeaderDeptName: '院领导',
+      hospitalLeaderCheckFrequency: '每半年',
+      hospitalLeaderExecutorGroupName: '领导检查组',
+      hospitalLeaderResponsiblePerson: '王五',
+      checklistCategoryName: '关键业务活动专项检查单',
+      checklistTemplateName: '关键业务活动专项检查单',
+      needOverallDesc: false,
+      needInspectedSign: true,
+      planStartTime: '2025-01-01',
+      planEndTime: '2025-03-31',
+      createdBy: '李小红',
+      createdAt: '2026-01-06 12:20:30',
+      businessWork: '动火作业',
+      checkKeyContent: '设备安全;电气安全',
+    },
+  };
 
-      router.back();
-    } catch (e) {
-      console.error('保存院级文件失败:', e);
-      ElMessage.error('保存失败,请重试');
-    }
+  const getDetail = () => {
+    if (!currentId.value) return;
+    const res = MOCK_DETAIL_MAP[currentId.value] ?? {
+      id: currentId.value,
+      planName: '2025年度生产安全检查计划',
+      status: 1,
+      checkVenue: '18号楼、油库、液氮罐',
+      venueCategoryName: '各级风险点',
+      mainDeptName: '试验验证中心、质量管理部',
+      selfCheckFrequency: '每日',
+      mainDeptExecutorGroupName: '自查小分队分组',
+      mainDeptResponsiblePerson: '孙菲、周萍',
+      safetyEmergencyDeptName: '安全应急部',
+      safetyEmergencyCheckFrequency: '每周',
+      safetyEmergencyExecutorGroupName: '安全应急部小分队分组',
+      safetyEmergencyResponsiblePerson: '李雪峰',
+      hospitalLeaderDeptName: '院领导',
+      hospitalLeaderCheckFrequency: '每季度',
+      hospitalLeaderExecutorGroupName: '领导小分队执行组',
+      hospitalLeaderResponsiblePerson: '孙菲亚',
+      checklistCategoryName: '安全管理检查单',
+      checklistTemplateName: '上飞院安全检查表',
+      needOverallDesc: true,
+      needInspectedSign: true,
+      planStartTime: '2019-03-28',
+      planEndTime: '2019-03-28',
+      createdBy: '李小红',
+      createdAt: '2026-01-06 12:20:30',
+      businessWork: '动火作业',
+      checkKeyContent: '',
+    };
+    viewDetailData.value = { ...res };
   };
 
   onMounted(() => {
-    cloneRuleFormData();
-    beforeRouteLeave();
-    if (isEditMode.value || isViewMode.value) {
-      getDetail();
-    }
-  });
-
-  onBeforeUnmount(() => {
-    const editor = editorRef.value;
-    if (editor == null) return;
-    editor.destroy();
+    getDetail();
   });
 </script>
 
 <style scoped lang="scss">
   @use '@/styles/page-details-layout.scss' as *;
+  @use '@/styles/basic-table-file.scss' as *;
 
-  .editor-container {
-    width: 100%;
-    border: 1px solid #dcdfe6;
-    border-radius: 4px;
-    overflow: hidden;
+  .area-check-plan-view {
+    padding: 16px 24px;
+    display: flex;
+    flex-direction: column;
+    gap: 24px;
   }
 
-  .content-display {
-    min-height: 200px;
-    padding: 12px;
-    border: 1px solid #dcdfe6;
-    border-radius: 4px;
-    background-color: #f5f7fa;
+  .view-section {
+    .view-section__title {
+      font-weight: 600;
+      margin-bottom: 12px;
+      display: flex;
+      align-items: center;
+      gap: 6px;
+      &--small {
+        font-size: 13px;
+        margin-bottom: 8px;
+      }
+    }
+    .view-section__icon {
+      width: 4px;
+      height: 14px;
+      background: var(--el-color-primary);
+      border-radius: 2px;
+    }
   }
 
-  .file-display {
-    .file-link {
-      color: #409eff;
-      text-decoration: none;
-      &:hover {
-        text-decoration: underline;
+  .view-summary {
+    .view-summary__title {
+      font-weight: 600;
+      font-size: 15px;
+      margin-bottom: 4px;
+    }
+    .view-summary__venue {
+      margin-bottom: 8px;
+    }
+    .view-summary__meta {
+      font-size: 13px;
+      color: var(--el-text-color-secondary);
+      span + span {
+        margin-left: 16px;
+      }
+    }
+  }
+
+  .audit-content {
+    .section-title {
+      display: flex;
+      align-items: center;
+      gap: 8px;
+      margin: 20px 0 12px 0;
+      font-size: 16px;
+      font-weight: 600;
+      color: #333;
+
+      .section-title__icon {
+        font-size: 18px;
+        color: #333;
+      }
+    }
+
+    .section-title:first-child {
+      margin-top: 0;
+    }
+
+    .detail-ct {
+      font-size: 14px;
+      margin-bottom: 20px;
+
+      &--table {
+        border: 1px solid #dcdfe6;
+        .row {
+          display: flex;
+          border-bottom: 1px solid #dcdfe6;
+
+          &:last-child {
+            border-bottom: none;
+          }
+        }
+        .col {
+          display: flex;
+          flex: 1;
+          min-height: 40px;
+          align-items: stretch;
+
+          .label {
+            display: flex;
+            align-items: center;
+            justify-content: flex-end;
+            flex-shrink: 0;
+            width: 200px;
+            padding: 0 12px;
+            background-color: #f5f5f5;
+            border-right: 1px solid #dcdfe6;
+            color: #333;
+          }
+
+          .value {
+            flex: 1;
+            display: flex;
+            align-items: center;
+            padding: 10px 20px;
+            background-color: #fff;
+            border-right: 1px solid #dcdfe6;
+            color: #333;
+
+            &--list {
+              align-items: flex-start;
+              .inspection-content-list {
+                margin: 0;
+                padding-left: 20px;
+                line-height: 1.8;
+                color: #333;
+              }
+            }
+          }
+        }
+
+        .row .col:last-child .value {
+          border-right: none;
+        }
+
+        .row .col:nth-child(2) .label {
+          border-left: 1px solid #dcdfe6;
+        }
       }
     }
   }
 
-  .no-file {
-    color: rgba(0, 0, 0, 0.65);
+  .view-record-toolbar {
+    margin-bottom: 12px;
+    display: flex;
+    align-items: center;
+    flex-wrap: wrap;
+    gap: 8px;
   }
-</style>
 
+  .view-record-table {
+    margin-bottom: 16px;
+  }
+</style>

+ 251 - 0
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanManagementDept/components/areaCheckPlanRecordDetailDept.vue

@@ -0,0 +1,251 @@
+<template>
+  <main class="safety-platform-container__main">
+    <el-form ref="formRef" :model="formData" :rules="isAddMode ? formRules : undefined" label-width="180px" class="check-record-form">
+      <el-form-item label="被检查单位:" prop="inspectedUnit">
+        <el-input v-model="formData.inspectedUnit" :disabled="!isAddMode" placeholder="请输入被检查单位" clearable />
+      </el-form-item>
+      <el-form-item label="检查人员:" prop="inspector">
+        <el-input v-model="formData.inspector" :disabled="!isAddMode" placeholder="请输入检查人员" clearable />
+      </el-form-item>
+      <el-form-item label="检查时间:" prop="checkTime">
+        <el-date-picker
+          v-if="isAddMode"
+          v-model="formData.checkTime"
+          type="datetime"
+          placeholder="选择检查时间"
+          value-format="YYYY-MM-DD HH:mm:ss"
+          format="YYYY-MM-DD HH:mm:ss"
+          style="width: 100%"
+        />
+        <el-input v-else v-model="formData.checkTime" disabled />
+      </el-form-item>
+      <el-form-item label="检查地点:" prop="checkPlace">
+        <el-input v-model="formData.checkPlace" :disabled="!isAddMode" placeholder="请输入检查地点" clearable />
+      </el-form-item>
+      <el-form-item label="整体检查情况描述:" prop="overallDesc">
+        <el-input
+          v-model="formData.overallDesc"
+          type="textarea"
+          :rows="5"
+          maxlength="300"
+          show-word-limit
+          :disabled="!isAddMode"
+          :placeholder="isAddMode ? '请输入整体检查情况描述(限300字)' : '整体检查情况描述(限300字)'"
+        />
+      </el-form-item>
+      <el-form-item label="被检查人签字文件:" prop="signFile">
+        <div v-if="!isAddMode" class="upload-files-disabled">
+          <UploadFiles label="上传附件" :file-list="displayFileList" />
+        </div>
+        <UploadFiles
+          v-else
+          label="上传附件"
+          :file-list="displayFileList"
+          @uploadSuccess="handleUploadSuccess"
+        />
+      </el-form-item>
+    </el-form>
+
+    <div class="check-items-section">
+      <div class="section-header">
+        <span class="section-title">检查明细</span>
+      </div>
+      <el-table :data="checkItems" border class="check-items-table">
+        <el-table-column type="index" label="编号" width="80" align="center" />
+        <el-table-column prop="checkContent" label="检查内容" min-width="200" />
+        <el-table-column prop="checkStandard" label="检查标准" min-width="200" />
+        <el-table-column label="检查结果" width="160" align="center">
+          <template #default="{ row }">
+            <el-radio-group v-if="isAddMode" v-model="row.checkResult" size="small">
+              <el-radio value="合格">合格</el-radio>
+              <el-radio value="不合格">不合格</el-radio>
+            </el-radio-group>
+            <span v-else>{{ row.checkResult || '-' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="检查发现问题" min-width="200">
+          <template #default="{ row }">
+            <el-input v-if="isAddMode" v-model="row.checkProblem" placeholder="请输入检查发现问题" clearable />
+            <span v-else>{{ row.checkProblem || '-' }}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <footer v-if="isAddMode" class="safety-platform-container__footer">
+      <el-button @click="handleBack">返回</el-button>
+      <el-button type="primary" @click="handleSubmit">提交</el-button>
+    </footer>
+  </main>
+</template>
+
+<script setup lang="ts">
+  import { computed, onMounted, ref } from 'vue';
+  import { useRoute, useRouter } from 'vue-router';
+  import { ElMessage } from 'element-plus';
+  import UploadFiles from '@/components/UploadFiles/UploadFiles.vue';
+  import type { FileItem } from '@/components/UploadFiles/types';
+
+  const router = useRouter();
+  const route = useRoute();
+
+  const operate = computed(() => (route.query.operate as string) || '');
+  const isAddMode = computed(() => operate.value === 'area-check-plan-record-add');
+
+  const formRef = ref();
+  const formData = ref({
+    inspectedUnit: '',
+    inspector: '',
+    checkTime: '',
+    checkPlace: '',
+    overallDesc: '',
+    signFile: '',
+  });
+
+  const formRules = {
+    inspectedUnit: [{ required: true, message: '请输入被检查单位', trigger: 'blur' }],
+    inspector: [{ required: true, message: '请输入检查人员', trigger: 'blur' }],
+    checkTime: [{ required: true, message: '请选择检查时间', trigger: 'change' }],
+    checkPlace: [{ required: true, message: '请输入检查地点', trigger: 'blur' }],
+  };
+
+  const DEFAULT_VIEW_ITEMS = [
+    { checkContent: '工作场所布局是否合理,通道是否畅通', checkStandard: '通道无阻塞,安全出口标识清晰', checkResult: '合格', checkProblem: '无' },
+    { checkContent: '各种机械、电力、电气等设备的安装和使用是否符合安全技术要求', checkStandard: '设备有完好防护装置,操作规程上墙', checkResult: '不合格', checkProblem: '部分电气设备绝缘老化,未及时更换' },
+    { checkContent: '易燃易爆、有限空间和高处作业等作业场所是否符合安全条件', checkStandard: '作业票证齐全,应急预案到位', checkResult: '合格', checkProblem: '无' },
+  ];
+
+  interface CheckItem {
+    checkContent: string;
+    checkStandard: string;
+    checkResult: string;
+    checkProblem: string;
+  }
+
+  const checkItems = ref<CheckItem[]>([]);
+
+  function convertSignFileToFileItems(attachmentsStr: string): FileItem[] {
+    if (!attachmentsStr || !String(attachmentsStr).trim()) return [];
+    const urls = String(attachmentsStr)
+      .split(',')
+      .map((u) => u.trim())
+      .filter(Boolean);
+    return urls.map((url, index) => {
+      const parts = url.split('/');
+      const fileName = parts[parts.length - 1] || `附件${index + 1}`;
+      const ext = fileName.split('.').pop()?.toLowerCase() || '';
+      let fileType = 'pdf';
+      if (['doc', 'docx'].includes(ext)) fileType = 'word';
+      else if (['xls', 'xlsx'].includes(ext)) fileType = 'excel';
+      else if (['ppt', 'pptx'].includes(ext)) fileType = 'ppt';
+      return { fileId: index + 1, fileName, fileType, fileSize: '0', fileUrl: url };
+    });
+  }
+
+  const signFileList = ref<FileItem[]>([]);
+  const displayFileList = computed(() => {
+    if (isAddMode.value) return signFileList.value;
+    return convertSignFileToFileItems(formData.value.signFile || '');
+  });
+
+  const handleUploadSuccess = (files: FileItem[]) => {
+    signFileList.value = files;
+    formData.value.signFile = files.map((f) => f.fileName || f.fileUrl).filter(Boolean).join(',');
+  };
+
+  const handleBack = () => {
+    router.back();
+  };
+
+  const handleSubmit = async () => {
+    if (!formRef.value) return;
+    const valid = await formRef.value.validate().catch(() => false);
+    if (!valid) return;
+    ElMessage.success('提交成功');
+    router.back();
+  };
+
+  const initFormData = () => {
+    if (isAddMode.value) {
+      const { planName, checkVenue } = route.query;
+      formData.value = {
+        inspectedUnit: planName ? String(planName) : '',
+        inspector: '',
+        checkTime: '',
+        checkPlace: checkVenue ? String(checkVenue) : '',
+        overallDesc: '',
+        signFile: '',
+      };
+      signFileList.value = [];
+      checkItems.value = DEFAULT_VIEW_ITEMS.map((item) => ({
+        ...item,
+        checkResult: '',
+        checkProblem: '',
+      }));
+    } else {
+      formData.value = {
+        inspectedUnit: String(route.query.inspectedUnit || '某被检查单位'),
+        inspector: String(route.query.inspector || '孙菲'),
+        checkTime: String(route.query.checkTime || '2025-03-28 10:00:00'),
+        checkPlace: String(route.query.checkPlace || '18号楼'),
+        overallDesc: String(route.query.overallDesc || '学习宣传贯彻习近平新时代中国特色社会主义思想和党的二十大精神等相关内容。'),
+        signFile: String(route.query.signFile || '领导签字文件.pdf'),
+      };
+      checkItems.value = [...DEFAULT_VIEW_ITEMS];
+    }
+  };
+
+  onMounted(() => {
+    initFormData();
+  });
+</script>
+
+<style scoped lang="scss">
+  @use '@/styles/page-details-layout.scss' as *;
+  @use '@/styles/page-main-layout.scss' as *;
+
+  .check-record-form {
+    max-width: 900px;
+    margin-bottom: 24px;
+  }
+
+  .check-items-section {
+    margin-top: 16px;
+    margin-bottom: 24px;
+
+    .section-header {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      margin-bottom: 12px;
+
+      .section-title {
+        font-weight: 600;
+        font-size: 15px;
+      }
+    }
+  }
+
+  .check-items-table {
+    :deep(.el-textarea__inner) {
+      border: none;
+      box-shadow: none;
+      padding: 4px 0;
+    }
+  }
+
+  .upload-files-disabled {
+    pointer-events: none;
+    opacity: 0.6;
+
+    :deep(.upload-button) {
+      cursor: not-allowed;
+      background-color: #f5f5f5;
+      color: #aaa;
+    }
+
+    :deep(.delete-button) {
+      display: none;
+    }
+  }
+</style>

+ 2 - 2
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/checkTemplateManagement/checkTemplateManagement.vue

@@ -96,7 +96,7 @@
   import { useRouter } from 'vue-router';
   import {
     queryChecklistTemplateList,
-    deleteChecklistTemplateList,
+    deleteChecklistTemplate,
     type ChecklistTemplateQuery,
   } from '@/api/production-safety-system';
 
@@ -209,7 +209,7 @@
 
   const handleDelete = async (id: number) => {
     try {
-      await deleteChecklistTemplateList(id);
+      await deleteChecklistTemplate(id);
       ElMessage.success('删除成功');
       getTableData();
     } catch (e) {

+ 30 - 11
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/checkTemplateManagement/components/checkTemplateManagementDetail.vue

@@ -23,7 +23,7 @@
           @change="onCategoryChange"
         >
           <el-option
-            v-for="item in CHECK_TEMPLATE_CATEGORY_OPTIONS"
+            v-for="item in categoryOptions"
             :key="item.categoryCode"
             :label="item.label"
             :value="item.categoryCode"
@@ -128,18 +128,15 @@
   import { useRoute, useRouter } from 'vue-router';
   import { ElMessage } from 'element-plus';
   import type { FormInstance } from 'element-plus';
-  import {
-    CHECK_TEMPLATE_CATEGORY_OPTIONS,
-    CHECK_TEMPLATE_FORM_DATA,
-    CHECK_TEMPLATE_FORM_RULES,
-  } from '../configs/form';
+  import { CHECK_TEMPLATE_FORM_DATA, CHECK_TEMPLATE_FORM_RULES } from '../configs/form';
   import {
     queryChecklistTemplateDetail,
-    saveChecklistTemplateList,
+    saveChecklistTemplate,
     updateChecklistTemplate,
     importChecklistTemplateItem,
     type ChecklistTemplateItem,
   } from '@/api/production-safety-system';
+  import { queryDictTypeDetail } from '@/api/dict';
 
   const props = defineProps<{
     id?: number;
@@ -159,8 +156,29 @@
 
   const checkItems = ref<CheckItemRow[]>([]);
 
+  interface CategoryOption {
+    label: string;
+    categoryName: string;
+    categoryCode: string;
+  }
+
+  const categoryOptions = ref<CategoryOption[]>([]);
+
+  const loadCategoryOptions = async () => {
+    try {
+      const res = await queryDictTypeDetail('checklist_template');
+      categoryOptions.value = (res?.sysDictDataList || []).map((item) => ({
+        label: item.itemValue,
+        categoryName: item.itemValue,
+        categoryCode: item.itemCode,
+      }));
+    } catch (e) {
+      console.error('获取类别名称字典失败:', e);
+    }
+  };
+
   const onCategoryChange = (categoryCode: string) => {
-    const opt = CHECK_TEMPLATE_CATEGORY_OPTIONS.find((c) => c.categoryCode === categoryCode);
+    const opt = categoryOptions.value.find((c) => c.categoryCode === categoryCode);
     if (opt) ruleFormData.value.categoryName = opt.categoryName;
   };
 
@@ -296,7 +314,7 @@
         await updateChecklistTemplate({ id: props.id, ...payload });
         ElMessage.success('保存成功');
       } else {
-        await saveChecklistTemplateList(payload);
+        await saveChecklistTemplate(payload);
         ElMessage.success('创建成功');
       }
 
@@ -307,9 +325,10 @@
     }
   };
 
-  onMounted(() => {
+  onMounted(async () => {
+    await loadCategoryOptions();
     if (isEditMode.value || isViewMode.value) {
-      getDetail();
+      await getDetail();
     } else {
       checkItems.value = [createEmptyCheckItem()];
     }

+ 78 - 7
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/employeeReportHiddenTroubleManagement/components/employeeReportHiddenTroubleManagementDetail.vue

@@ -7,12 +7,17 @@
       :formConfig="formConfig"
     >
       <template #attachment>
-        <div v-if="attachmentList.length > 0">
+        <UploadFiles
+          v-if="isCreateOrEditMode"
+          label="上传附件"
+          :file-list="attachmentFileList"
+          @uploadSuccess="handleAttachmentUploadSuccess"
+        />
+        <div v-else-if="attachmentList.length > 0" class="attachment-view-list">
           <div
             v-for="(item, index) in attachmentList"
             :key="index"
             class="file-item"
-            style="display: flex; align-items: center; margin-bottom: 8px;"
           >
             <span>{{ item.file_name || item.fileName || `附件${index + 1}` }}</span>
             <el-button
@@ -26,7 +31,7 @@
             </el-button>
           </div>
         </div>
-        <span v-else>无附件</span>
+        <span v-else class="no-attachment">无附件</span>
       </template>
     </BasicForm>
     <!-- 审核弹窗 -->
@@ -71,6 +76,9 @@
   import { useRoute, useRouter } from 'vue-router';
   import { ElMessage } from 'element-plus';
   import BasicForm from '@/components/BasicForm.vue';
+  import UploadFiles from '@/components/UploadFiles/UploadFiles.vue';
+  import type { FileItem } from '@/components/UploadFiles/types';
+  import { formatAttachmentList } from '@/components/UploadFiles/utils';
   import { useFormConfigHook } from '@/hooks/useFormConfigHook';
   import { ACADEMY_FILE_FORM_CONFIG, ACADEMY_FILE_FORM_DATA, ACADEMY_FILE_FORM_RULES } from '../configs/form';
   import {
@@ -98,18 +106,76 @@
       operate.value === 'employee-report-hidden-trouble-approve' ||
       operate.value === 'hidden-trouble-review-approve',
   );
+  // 新增/编辑时表单可编辑,查看/审核时禁用
+  const isCreateOrEditMode = computed(
+    () =>
+      operate.value === 'employee-report-hidden-trouble-create' ||
+      operate.value === 'employee-report-hidden-trouble-edit' ||
+      operate.value === 'hidden-trouble-review-create' ||
+      operate.value === 'hidden-trouble-review-edit',
+  );
 
   const { ruleFormData, formRules, ruleFormConfig, cloneRuleFormData, beforeRouteLeave } =
     useFormConfigHook(ACADEMY_FILE_FORM_CONFIG, ACADEMY_FILE_FORM_DATA, ACADEMY_FILE_FORM_RULES);
 
-  const formConfig = computed(() => ruleFormConfig.value);
+  const formConfig = computed(() =>
+    isCreateOrEditMode.value
+      ? ruleFormConfig.value.map((item) => ({
+          ...item,
+          componentProps: item.componentProps
+            ? { ...item.componentProps, disabled: false }
+            : undefined,
+        }))
+      : ruleFormConfig.value,
+  );
 
   const basicFormRef = ref<InstanceType<typeof BasicForm>>();
   const previewOnlineRef = ref<InstanceType<typeof PreviewOnline>>();
 
-  // 附件列表
+  // 附件列表(查看/审核模式展示用)
   const attachmentList = ref<Array<{ file_name?: string; fileName?: string; url?: string; fileUrl?: string }>>([]);
 
+  /** 附件 JSON [{file_name, url}] 转 FileItem 列表,供 UploadFiles 使用(复用新增安全考核上传附件) */
+  function convertAttachmentJsonToFileItems(attachmentStr: string): FileItem[] {
+    if (!attachmentStr || !String(attachmentStr).trim()) return [];
+    try {
+      const arr = JSON.parse(attachmentStr);
+      if (!Array.isArray(arr)) return [];
+      return arr.map((item: any, index: number) => {
+        const fileName = item.file_name || item.fileName || `附件${index + 1}`;
+        const url = item.url || item.fileUrl || '';
+        const ext = (fileName || '').split('.').pop()?.toLowerCase() || '';
+        let fileType = 'pdf';
+        if (['doc', 'docx'].includes(ext)) fileType = 'word';
+        else if (['xls', 'xlsx'].includes(ext)) fileType = 'excel';
+        else if (['ppt', 'pptx'].includes(ext)) fileType = 'ppt';
+        return { fileId: index + 1, fileName, fileType, fileSize: '0', fileUrl: url };
+      });
+    } catch {
+      return [];
+    }
+  }
+
+  const attachmentFileList = computed(() => convertAttachmentJsonToFileItems(ruleFormData.attachment || ''));
+
+  async function handleAttachmentUploadSuccess(files: FileItem[]) {
+    if (!files?.length) {
+      ruleFormData.attachment = '';
+      return;
+    }
+    try {
+      const list = await formatAttachmentList(files);
+      const jsonArr = (list || []).map((r) => ({
+        file_name: r.fileName,
+        url: r.fileUrl || '',
+      })).filter((x) => x.url);
+      ruleFormData.attachment = JSON.stringify(jsonArr);
+    } catch (e) {
+      console.error('附件上传失败:', e);
+      ElMessage.error('附件上传失败,请重试');
+    }
+  }
+
   // 审核相关
   const approveDialogVisible = ref(false);
   const approveForm = ref<ApproveEmployeeHazardReportReq>({
@@ -132,8 +198,9 @@
         ruleFormData.reporterName = res.reporterName || '';
         ruleFormData.reporterJobNo = res.reporterJobNo || '';
         ruleFormData.reporterMobile = res.reporterMobile || '';
+        ruleFormData.attachment = res.attachment || '';
 
-        // 处理附件
+        // 处理附件(查看/审核模式展示用)
         if (res.attachment) {
           try {
             const attachmentData = typeof res.attachment === 'string' ? JSON.parse(res.attachment) : res.attachment;
@@ -210,10 +277,14 @@
 <style scoped lang="scss">
   @use '@/styles/page-details-layout.scss' as *;
 
-  .file-item {
+  .attachment-view-list .file-item {
     display: flex;
     align-items: center;
     margin-bottom: 8px;
   }
+
+  .no-attachment {
+    color: rgba($text-color, 0.45);
+  }
 </style>
 

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

@@ -1,5 +1,12 @@
 <template>
   <main class="safety-platform-container__main">
+    <el-alert
+      v-if="isRectifyMode && detailReviewRejectReason"
+      type="warning"
+      :title="'不通过原因:' + detailReviewRejectReason"
+      show-icon
+      class="detail-reject-alert"
+    />
     <BasicForm
       ref="basicFormRef"
       :formData="ruleFormData"
@@ -334,6 +341,8 @@
   }
 
   /** 状态:1待下发 2待整改 3待复查 4已完成 5待入账(用 statusId,兼容 statusOrder) */
+  /** 整改页:详情接口返回的审查不通过原因,供 el-alert 展示 */
+  const detailReviewRejectReason = ref('');
   const detailStatusOrder = ref<number>(0);
   const canRectify = computed(() => detailStatusOrder.value === 2);
   const canReview = computed(() => detailStatusOrder.value === 3);
@@ -367,6 +376,12 @@
         ruleFormData.rectificationCompletionStatus = d.rectificationCompletionStatus ?? '';
         ruleFormData.rectificationCompletionTime = d.rectificationCompletionTime ?? '';
         ruleFormData.attachments = d.attachments ?? '';
+        // 整改页:保存审查不通过原因供 el-alert 展示
+        if (isRectifyMode.value && d.reviewRejectReason != null && String(d.reviewRejectReason).trim()) {
+          detailReviewRejectReason.value = String(d.reviewRejectReason).trim();
+        } else {
+          detailReviewRejectReason.value = '';
+        }
       }
       if (isReviewMode.value) {
         ruleFormData.reviewComments = '';
@@ -599,4 +614,7 @@
 
 <style scoped lang="scss">
   @use '@/styles/page-details-layout.scss' as *;
+  .detail-reject-alert {
+    margin-bottom: 16px;
+  }
 </style>

+ 2 - 2
src/views/production-safety/hiddenTroubleInvestigationAndGovernance/hiddenTroubleReviewManagement/hiddenTroubleReviewManagement.vue

@@ -119,7 +119,7 @@
   import { useRouter } from 'vue-router';
   import type { QueryPageRequest } from '@/types/basic-query';
   import {
-    queryHiddenDangerPage,
+    queryEmployeeHazardReportPendingPage,
     exportHiddenDanger,
     accountEmployeeHazardReport,
     type QueryHiddenDangerReq,
@@ -179,7 +179,7 @@
   async function getTableData() {
     tableConfig.loading = true;
     try {
-      const res = await queryHiddenDangerPage(tableQuery);
+      const res = await queryEmployeeHazardReportPendingPage(tableQuery);
       if (res) {
         tableData.value = res.records || [];
         pagination.total = res.totalRow || 0;

+ 20 - 51
src/views/production-safety/safetyAssessment/pointDeduction/components/PointDeductionDetail.vue

@@ -12,23 +12,24 @@
           <el-radio label="DISABLE">禁用</el-radio>
         </el-radio-group>
       </template>
-      <template #dedResonList>
+      <template #deductionReason>
         <el-select
           v-if="!isViewMode"
-          v-model="deductionReasonValue"
+          v-model="ruleFormData.hiddenDangerId"
           placeholder="请选择扣分原因"
           filterable
           clearable
           style="width: 100%"
+          @change="onDeductionReasonChange"
         >
           <el-option
             v-for="item in hiddenDangerOptions"
             :key="item.id"
-            :label="item.dangerProblem"
-            :value="item.dangerProblem"
+            :label="item.deductionReason ?? item.dangerProblem"
+            :value="item.id"
           />
         </el-select>
-        <span v-else>{{ deductionReasonValue }}</span>
+        <span v-else>{{ ruleFormData.deductionReason || '-' }}</span>
       </template>
     </BasicForm>
   </main>
@@ -110,36 +111,21 @@
     }
   };
 
-  // 扣分原因下拉框与 dedResonList 双向绑定(单条)
-  const deductionReasonValue = computed({
-    get: () => {
-      const list = ruleFormData.dedResonList;
-      return (list && list[0] && list[0].deductionReason) || '';
-    },
-    set: (val) => {
-      if (val) {
-        const list = ruleFormData.dedResonList;
-        const prev = list && list[0];
-        ruleFormData.dedResonList = [
-          {
-            id: (prev && prev.id) || 0,
-            pmdId: (prev && prev.pmdId) || currentId.value || 0,
-            serialNum: 1,
-            deductionReason: val,
-            scoreVal: ruleFormData.deductionValue || 1,
-          },
-        ];
-      } else {
-        ruleFormData.dedResonList = [];
-      }
-    },
-  });
+  // 选择扣分原因时同步名称到 deductionReason
+  const onDeductionReasonChange = (hiddenDangerId: number | undefined) => {
+    if (hiddenDangerId == null) {
+      ruleFormData.deductionReason = '';
+      return;
+    }
+    const option = hiddenDangerOptions.value.find((item) => item.id === hiddenDangerId);
+    ruleFormData.deductionReason = option ? (option.deductionReason ?? option.dangerProblem) : '';
+  };
 
   const handleValidate = async () => {
     if (!basicFormRef.value) return;
     const res = await basicFormRef.value.validateForm();
     if (!res) return false;
-    if (!deductionReasonValue.value || !deductionReasonValue.value.trim()) {
+    if (ruleFormData.hiddenDangerId == null) {
       ElMessage.error('请选择扣分原因');
       return false;
     }
@@ -155,8 +141,9 @@
         ruleFormData.deductionDate = res.deductionDate;
         ruleFormData.deductionValue = res.deductionScore;
         ruleFormData.departmentName = res.departmentName;
+        ruleFormData.hiddenDangerId = res.hiddenDangerId;
+        ruleFormData.deductionReason = res.deductionReason ?? '';
         ruleFormData.status = res.status ? 'ENABLE' : 'DISABLE';
-        ruleFormData.dedResonList = res.dedResonList?.length ? [res.dedResonList[0]] : [];
       }
       cloneRuleFormData();
     } catch (e) {
@@ -168,33 +155,15 @@
   const handleSubmit = async () => {
     const res = await handleValidate();
     if (!res) return;
-    // 提交前同步扣分原因到 dedResonList(单条,分值为表单扣分值)
-    const dedResonList = deductionReasonValue.value
-      ? [
-          {
-            deductionReason: deductionReasonValue.value,
-            scoreVal: ruleFormData.deductionValue || 1,
-            serialNum: 1,
-            ...(ruleFormData.dedResonList?.[0]?.id
-              ? { id: ruleFormData.dedResonList[0].id, pmdId: ruleFormData.dedResonList[0].pmdId }
-              : {}),
-          },
-        ]
-      : [];
     try {
       const basePayload = {
         deductionTitle: ruleFormData.deductionTitle,
         deductionDate: ruleFormData.deductionDate,
         deductionScore: ruleFormData.deductionValue,
         departmentName: ruleFormData.departmentName,
+        hiddenDangerId: ruleFormData.hiddenDangerId,
+        deductionReason: ruleFormData.deductionReason,
         status: ruleFormData.status === 'ENABLE',
-        dedResonList: dedResonList.map((item) => {
-          if (!item.id) {
-            const { id, pmdId, ...rest } = item;
-            return rest;
-          }
-          return item;
-        }),
       };
 
       if (isCreateMode.value) {

+ 5 - 11
src/views/production-safety/safetyAssessment/pointDeduction/configs/form.ts

@@ -39,9 +39,9 @@ export const POINT_DEDUCTION_FORM_CONFIG: FormConfig[] = [
     },
   },
   {
-    prop: 'dedResonList',
+    prop: 'hiddenDangerId',
     label: '扣分原因:',
-    slot: 'dedResonList',
+    slot: 'deductionReason',
   },
   {
     prop: 'status',
@@ -50,20 +50,13 @@ export const POINT_DEDUCTION_FORM_CONFIG: FormConfig[] = [
   },
 ];
 
-export interface DeductionReasonItem {
-  id: number;
-  pmdId: number;
-  serialNum: number;
-  deductionReason: string;
-  scoreVal: number;
-}
-
 export const POINT_DEDUCTION_FORM_DATA = {
   deductionTitle: '',
   deductionDate: '',
   deductionValue: 1, // 最小值为1
   departmentName: '',
-  dedResonList: [] as DeductionReasonItem[],
+  hiddenDangerId: undefined as number | undefined,
+  deductionReason: '',
   status: 'ENABLE',
 };
 
@@ -76,5 +69,6 @@ export const POINT_DEDUCTION_FORM_RULES = {
     { type: 'number', max: 99999, message: '扣分值不能大于99999', trigger: 'blur' },
   ],
   departmentName: [{ required: true, message: '请输入部门名称', trigger: 'blur' }],
+  hiddenDangerId: [{ required: true, message: '请选择扣分原因', trigger: 'change' }],
   status: [{ required: true, message: '请选择状态', trigger: 'change' }],
 };

+ 2 - 2
src/views/production-safety/safetyAssessment/pointDeduction/configs/tables.ts

@@ -34,8 +34,8 @@ export const POINT_DEDUCTION_TABLE_COLUMNS: TableColumnProps[] = [
   },
   {
     label: '扣分原因',
-    prop: 'dedResonList', 
-    slot: 'dedResonList',
+    prop: 'deductionReason',
+    slot: 'deductionReason',
     align: 'left',
     minWidth: '300px',
   },

+ 10 - 36
src/views/production-safety/safetyAssessment/pointDeduction/pointDeduction.vue

@@ -60,27 +60,8 @@
                 {{ scope.row.statusName || (scope.row.status === true ? '启用' : scope.row.status === false ? '禁用' : '-') }}
               </span>
             </template>
-            <template #dedResonList="scope">
-              <div class="deduction-reason-list">
-                <template v-if="scope.row.deductionReason">
-                  <template
-                    v-for="(item, index) in (() => {
-                      const list = getDeductionReasonList(scope.row.deductionReason);
-                      return list.map((text, idx) => ({ text, index: idx, total: list.length }));
-                    })()"
-                    :key="index"
-                  >
-                    <div class="deduction-reason-item">
-                      <div class="reason-content">
-                        <span class="reason-text">{{ item.text }}</span>
-                      </div>
-                      <!-- 只有多条数据时才显示下划线,且不是最后一条 -->
-                      <div v-if="item.total > 1 && item.index < item.total - 1" class="reason-divider"></div>
-                    </div>
-                  </template>
-                </template>
-                <div v-else class="no-reason">-</div>
-              </div>
+            <template #deductionReason="scope">
+              <span>{{ scope.row.deductionReason || '-' }}</span>
             </template>
             <template #action="scope">
               <div class="action-container--div" style="justify-content: left">
@@ -130,13 +111,6 @@
 
   const router = useRouter();
 
-  // 处理扣分原因字符串,按换行符分割
-  const getDeductionReasonList = (deductionReason: string): string[] => {
-    if (!deductionReason) return [];
-    // 按 \r\n 或 \n 分割,并过滤空字符串
-    return deductionReason.split(/\r\n|\n/).filter((item) => item.trim() !== '');
-  };
-
   // 表格
   const basicTableRef = ref<InstanceType<typeof BasicTable>>();
 
@@ -173,14 +147,14 @@
         // 映射返回数据字段到表格字段
         tableData.value = res.records.map((item) => ({
           id: item.id,
-          deductionTitle: item.deductionTitle, // 扣分标题
-          deductionDate: item.deductionDate, // 扣分日期
-          deductionValue: item.deductionScore, // 扣分值(API 返回的是 deductionScore)
-          departmentName: item.departmentName, // 部门名称
-          deductionReason: item.deductionReason, // 扣分原因(兼容旧数据)
-          dedResonList: item.dedResonList || [], // 扣分原因列表
-          status: item.status, // 状态(boolean)
-          statusName: item.statusName, // 状态名称
+          deductionTitle: item.deductionTitle,
+          deductionDate: item.deductionDate,
+          deductionValue: item.deductionScore,
+          departmentName: item.departmentName,
+          deductionReason: item.deductionReason,
+          hiddenDangerId: item.hiddenDangerId,
+          status: item.status,
+          statusName: item.statusName,
         }));
         pagination.total = res.totalRow;
       }