Просмотр исходного кода

Merge branch 'feat/production-safety' of http://192.168.6.110/product-group-fe/sfy-safety-group/sfy-safety into feat/production-safety

sunqijun 2 месяцев назад
Родитель
Сommit
c468bb4c8b

+ 56 - 1
src/api/inventory/index.ts

@@ -1,4 +1,4 @@
-  import { http } from '@/utils/http/axios';
+import { http } from '@/utils/http/axios';
 import type { QueryPageRequest, QueryPageResponse } from '@/types/basic-query';
 
 /**
@@ -30,6 +30,7 @@ export interface BusinessCertification {
   injuryReason: string; // 受伤原因
   departmentCode: string; // 部门编码
   templateId?: any; // 审批模板ID
+  departmentName?: string; // 部门名称
 }
 
 /**
@@ -92,6 +93,29 @@ export interface SaveInventoryRequest {
   trusteeIdCardUrl: string; // 被委托人员身份证正反面URL
 }
 
+/**
+ * 更新工伤认定请求参数
+ */
+export interface UpdateWorkInjuryApplyRequest {
+  id: number; // 工伤认定ID
+  applicantName: string; // 申请人姓名
+  applicantCode: string; // 申请人工号
+  injuryTime: string; // 受伤时间 (ISO 格式)
+  status: boolean; // 状态(1-启用/0-禁用)
+  injuryReason: string; // 受伤原因
+  accidentCertUrl: string; // 事故报告URL
+  powerAttorneyUrl: string; // 授权委托书URL
+  addressConfirmUrl: string; // 地址确认URL
+  applicationFormUrl: string; // 申请表URL
+  idCardUrl: string; // 身份证正反面URL
+  laborContractUrl: string; // 劳动合同URL
+  initialMedicalCertUrl: string; // 初次医疗证明URL
+  trusteeIdCardUrl: string; // 被委托人员身份证正反面URL
+  departmentName: string; // 部门名称
+  departmentCode: string | number[]; // 部门编码
+  templateId: number; // 审批模板ID
+}
+
 /**
  * 查询物品库存管理列表
  */
@@ -209,4 +233,35 @@ export function saveApproval(data: SaveApprovalReq) {
     method: 'post',
     data,
   });
+}
+
+/**
+ * 查询工伤认定详情
+ */
+export function queryWorkInjuryApplyDetail(id: number) {
+  return http.request<BusinessCertification>({
+    url: `/WorkInjuryApply/queryWorkInjuryApplyDetail?id=${id}`,
+    method: 'post',
+  });
+}
+
+/** 编辑工伤认定(保存/提交,带审批信息) */
+export function updateWorkInjuryApply(data: UpdateWorkInjuryApplyRequest) {
+  return http.request({
+    url: '/WorkInjuryApply/updateWorkInjuryApply',
+    method: 'put',
+    data,
+  });
+}
+
+/** 审核工伤认确定 */
+export function auditWorkInjuryConfirm(id: number, confirmedSealed: string) {
+   return http.request<BusinessCertification>({
+    url: `/WorkInjuryApply/confirmedSealed`,
+    method: 'post',
+    data:{
+      id,
+      confirmedSealed,
+    }
+  });
 }

+ 13 - 0
src/api/production-safety/business-registration-application.ts

@@ -19,6 +19,7 @@ export interface InventoryItem {
   approvalOrder: number; // 审批订单
   templateId: string; // 模板ID
   injuryCategoryCode: string; // 工伤类别编码
+  rejectReason: string; // 拒绝原因
 }
 
 /**
@@ -41,6 +42,18 @@ export function queryWorkInjuryApplyList(query: QueryPageRequest<InventoryQueryP
   });
 }
 
+/**
+ * 查询物品库存管理列表admin
+ */
+export function queryWorkInjuryApplyListAdmin(query: QueryPageRequest<InventoryQueryParam>) {
+  return http.request<QueryPageResponse<InventoryItem>>({
+    url: '/WorkInjuryApply/queryWorkInjuryApplyListAdmin',
+    method: 'post',
+    data: query,
+  });
+}
+
+
 /**
  * 保存工商认定信息请求参数
  */

+ 30 - 0
src/router/routers/production-safety-router/risk-identification-and-control.ts

@@ -608,6 +608,36 @@ const riskIdentificationAndControlRoutes: RouteComponent[] = [{
         noCache: false,
       }
     },
+    //劳防用品采购申请admin
+    {
+      id: 93034,
+      parentId: 90014,
+      name: 'laborProductsPurchaseApplyManageAdmin',
+      path: 'labor-products-purchase-apply-manage-admin',
+      component: '/production-safety/risk-identification-and-control/labor-products-purchase-apply-manage/listAdmin',
+      meta: {
+        title: '劳防用品采购申请(管理员)',
+        icon: 'OverviewIcon',
+        isRoot: false,
+        hidden: false,
+        noCache: false,
+      }
+    },
+    //工伤认定申请
+    {
+      id: 93035,
+      parentId: 90014,
+      name: 'workInjuryApplyManageAdmin',
+      path: 'work-injury-apply-manage-admin',
+      component: '/production-safety/risk-identification-and-control/work-injury-apply-manage/listAdmin',
+      meta: {
+        title: '工伤认定申请(管理员)',
+        icon: 'OverviewIcon',
+        isRoot: false,
+        hidden: false,
+        noCache: false,
+      }
+    },
   ],
 }];
 

+ 2 - 3
src/views/production-safety/risk-identification-and-control/labor-products-purchase-apply-manage/components/detail.vue

@@ -1,8 +1,7 @@
 <template>
   <main class="safety-platform-container__main">
-
     <el-alert
-      v-if="rejectReason && approvalStatus === '3'"
+      v-if="rejectReason && (Number(approvalStatus) === 3)"
       type="error"
       :title="'不通过原因:' + rejectReason"
       show-icon
@@ -21,7 +20,7 @@
           v-model="form.approvalTemplateId"
           placeholder="审批流程"
           filterable
-          :disabled="isAuditMode"
+          :disabled="isViewMode || isAuditMode"
           popper-class="el-scrollbar--custom"
         >
           <el-option v-for="item in approvalList" :key="item.id" :label="item.templateName" :value="item.id" />

+ 4 - 1
src/views/production-safety/risk-identification-and-control/labor-products-purchase-apply-manage/list.vue

@@ -71,7 +71,6 @@
                 <!-- 待审核:查看、审核 -->
                 <template v-if="scope.row.status === 1 || scope.row.status === '1'">
                   <ActionButton text="查看" @click="handleView(scope.row.id!, scope.row)" />
-                  <ActionButton text="审核" @click="handleAudit(scope.row.id!, scope.row)" />
                 </template>
                 <!-- 审核通过:查看 -->
                 <template v-else-if="scope.row.status === 2 || scope.row.status === '2'">
@@ -215,6 +214,8 @@
           applicantName: row.applicantName ?? '',
           deptName: row.deptName ?? '',
           templateId: row.templateId ?? '',
+          rejectReason: row.rejectReason ?? '',
+          approvalStatus: row.status ?? '',
         }),
       },
     });
@@ -242,6 +243,8 @@
           applicantName: row.applicantName ?? '',
           deptName: row.deptName ?? '',
           templateId: row.templateId ?? '',
+          rejectReason: row.rejectReason ?? '',
+          approvalStatus: row.status ?? '',
         }),
       },
     });

+ 8 - 4
src/views/production-safety/risk-identification-and-control/labor-products-purchase-apply-manage/listAdmin.vue

@@ -6,11 +6,11 @@
     <main class="safety-platform-container__main">
       <div class="search-table-container">
         <header>
-          <div style="position: relative">
+          <!-- <div style="position: relative">
             <el-button type="primary" class="search-table-container--button" @click="handleCreate">
               添加
             </el-button>
-          </div>
+          </div> -->
 
           <div class="act-search">
             <section class="select-box">
@@ -79,12 +79,12 @@
                 </template>
                 <!-- 审核不通过:编辑、删除、查看 -->
                 <template v-else-if="scope.row.status === 3 || scope.row.status === '3'">
-                  <ActionButton text="编辑" @click="handleEdit(scope.row.id!, scope.row)" />
+                  <!-- <ActionButton text="编辑" @click="handleEdit(scope.row.id!, scope.row)" />
                   <ActionButton
                     text="删除"
                     :popconfirm="{ title: '确定要删除该申请吗?' }"
                     @confirm="handleDelete(scope.row.id!)"
-                  />
+                  /> -->
                   <ActionButton text="查看" @click="handleView(scope.row.id!, scope.row)" />
                 </template>
                 <template v-else>
@@ -214,6 +214,8 @@
           applicantName: row.applicantName ?? '',
           deptName: row.deptName ?? '',
           templateId: row.templateId ?? '',
+          rejectReason: row.rejectReason ?? '',
+          approvalStatus: row.status ?? '',
         }),
       },
     });
@@ -241,6 +243,8 @@
           applicantName: row.applicantName ?? '',
           deptName: row.deptName ?? '',
           templateId: row.templateId ?? '',
+          rejectReason: row.rejectReason ?? '',
+          approvalStatus: row.status ?? '',
         }),
       },
     });

+ 54 - 39
src/views/production-safety/risk-identification-and-control/work-injury-apply-manage/components/detail.vue

@@ -1,5 +1,13 @@
 <template>
   <main class="safety-platform-container__main">
+    <el-alert
+      v-if="rejectReason && (Number(approvalStatus) === 3)"
+      type="error"
+      :title="'不通过原因:' + rejectReason"
+      show-icon
+      class="detail-reject-alert"
+    />
+
     <BasicForm
       ref="basicFormRef"
       :formData="ruleFormData"
@@ -12,7 +20,7 @@
           v-model="ruleFormData.approvalTemplateId"
           placeholder="审批流程"
           filterable
-          :disabled="!isCreateMode"
+          :disabled="isViewMode || isAuditMode"
           popper-class="el-scrollbar--custom"
         >
           <el-option v-for="item in approvalList" :key="item.id" :label="item.templateName" :value="item.id" />
@@ -21,13 +29,13 @@
       <template #reviewDepartmentId>
         <el-cascader
           v-model="ruleFormData.departmentCode"
-          ref="cascaderRef"
+          ref="cascaderRef" 
           :options="firstLevelDepts"
           :props="cascaderProp"
           :show-all-levels="false"
           placeholder="部门名称"
           filterable
-          :disabled="!isCreateMode"
+          :disabled="isViewMode || isAuditMode"
           @change="handleChangeDept"
         />
       </template>
@@ -35,8 +43,7 @@
         <UploadFiles
           label="上传事故报告"
           :file-list="accidentCertUrl"
-          :readonly="!isCreateMode"
-          :disabled="!isCreateMode"
+          :disabled="isViewMode || isAuditMode"
           @uploadSuccess="handleAccidentReportUploadSuccess"
           @preview="handlePreview"
         />
@@ -45,8 +52,7 @@
         <UploadFiles
           label="上传委托书"
           :file-list="powerAttorneyUrl"
-          :readonly="!isCreateMode"
-          :disabled="!isCreateMode"
+          :disabled="isViewMode || isAuditMode"
           @uploadSuccess="handlePowerOfAttorneyUploadSuccess"
           @preview="handlePreview"
         />
@@ -55,8 +61,7 @@
         <UploadFiles
           label="上传地址确认书"
           :file-list="addressConfirmUrl"
-          :readonly="!isCreateMode"
-          :disabled="!isCreateMode"
+          :disabled="isViewMode || isAuditMode"
           @uploadSuccess="handleAddressConfirmationUploadSuccess"
           @preview="handlePreview"
         />
@@ -65,8 +70,7 @@
         <UploadFiles
           label="上传申请表"
           :file-list="applicationFormUrl"
-          :readonly="!isCreateMode"
-          :disabled="!isCreateMode"
+          :disabled="isViewMode || isAuditMode"
           @uploadSuccess="handleApplicationFormUploadSuccess"
           @preview="handlePreview"
         />
@@ -75,8 +79,7 @@
         <UploadFiles
           label="上传身份证正反面"
           :file-list="idCardUrl"
-          :readonly="!isCreateMode"
-          :disabled="!isCreateMode"
+          :disabled="isViewMode || isAuditMode"
           @uploadSuccess="handleIdCardUploadSuccess"
           @preview="handlePreview"
         />
@@ -85,8 +88,7 @@
         <UploadFiles
           label="上传劳动合同"
           :file-list="laborContractUrl"
-          :readonly="!isCreateMode"
-          :disabled="!isCreateMode"
+          :disabled="isViewMode || isAuditMode"
           @uploadSuccess="handleLaborContractUploadSuccess"
           @preview="handlePreview"
         />
@@ -95,8 +97,7 @@
         <UploadFiles
           label="上传初次医疗证明"
           :file-list="initialMedicalCertUrl"
-          :readonly="!isCreateMode"
-          :disabled="!isCreateMode"
+          :disabled="isViewMode || isAuditMode"
           @uploadSuccess="handleInitialMedicalCertificateUploadSuccess"
           @preview="handlePreview"
         />
@@ -105,8 +106,7 @@
         <UploadFiles
           label="上传被委托人员身份证正反面"
           :file-list="trusteeIdCardUrl"
-          :readonly="!isCreateMode"
-          :disabled="!isCreateMode"
+          :disabled="isViewMode || isAuditMode"
           @uploadSuccess="handleAgentIdCardUploadSuccess"
           @preview="handlePreview"
         />
@@ -172,7 +172,7 @@
         <el-button @click="basicDialogRef.closeDialog">取消</el-button>
       </template>
     </BasicDialog>
-      <!-- 审核不通过原因 -->
+    <!-- 审核不通过原因 -->
     <el-dialog
       v-model="showRejectDialog"
       title="审核不通过"
@@ -225,7 +225,14 @@
   import BasicForm from '@/components/BasicForm.vue';
   import { useFormConfigHook } from '@/hooks/useFormConfigHook';
   import { INVENTORY_FORM_CONFIG, INVENTORY_FORM_DATA, INVENTORY_FORM_RULES } from '../configs/form';
-  import { queryInventoryDetail, saveBusinessInformation, updateInventory , submitApprovalProcess, auditPurchaseApply } from '@/api/inventory';
+  import { 
+    queryWorkInjuryApplyDetail, 
+    saveBusinessInformation, 
+    updateInventory , 
+    submitApprovalProcess, 
+    auditPurchaseApply,
+    updateWorkInjuryApply,
+   } from '@/api/inventory';
   import UploadFiles from '@/components/UploadFiles/UploadFiles.vue';
   import type { FileItem } from '@/components/UploadFiles/types';
   import { formatAttachmentList } from '@/components/UploadFiles/utils';
@@ -264,9 +271,10 @@ import { template } from 'lodash-es';
   const isAuditMode = computed(() => operate.value === 'inventory-audit');
   const previewOnlineRef = ref<InstanceType<typeof PreviewOnline>>();
   const cascaderRef = ref();
-  const rejectReason = ref('');
+  const rejectReason = ref<string>(route.query.rejectReason as string || '');
   const approvalOrder = ref<string>(route.query.approvalOrder as string || '');
   const approvalTemplateId = ref<string>(route.query.approvalTemplateId as string || '');
+  const approvalStatus = ref<string>(route.query.approvalStatus as string || '');
   const auditType = ref(true);
 
   const basicDialogRef = ref();
@@ -316,24 +324,25 @@ import { template } from 'lodash-es';
   const getDetail = async () => {
     if (!currentId.value) return;
     try {
-      const res = await queryInventoryDetail(currentId.value);
+      const res = await queryWorkInjuryApplyDetail(currentId.value);
       if (res) {
         // 映射接口字段到表单字段
         ruleFormData.itemName = res.applicantName || ''; // 申请人姓名
-        ruleFormData.applicantCode = res.applicantCode || ''; // 工号
-        ruleFormData.warehouseDate = res.injuryTime ? res.injuryTime.split('T')[0] : ''; // 受伤时间
-        ruleFormData.status = res.status ? 'ENABLE' : 'DISABLE'; // 状态
-        ruleFormData.remarks = res.injuryReason || ''; // 受伤原因
-        ruleFormData.accidentCertUrl = res.accidentCertUrl || ''; // 事故报告
-        ruleFormData.powerAttorneyUrl = res.powerAttorneyUrl || ''; // 委托书
-        ruleFormData.addressConfirmUrl = res.addressConfirmUrl || ''; // 地址确认书
-        ruleFormData.applicationFormUrl = res.applicationFormUrl || ''; // 申请表
-        ruleFormData.idCardUrl = res.idCardUrl || ''; // 身份证正反面
-        ruleFormData.laborContractUrl = res.laborContractUrl || ''; // 劳动合同
-        ruleFormData.initialMedicalCertUrl = res.initialMedicalCertUrl || ''; // 初次医疗证明
-        ruleFormData.trusteeIdCardUrl = res.trusteeIdCardUrl || ''; // 被委托人员身份证正反面
-        ruleFormData.departmentCode = JSON.parse(res.departmentCode || '[]') || ''; // 部门编码
-        ruleFormData.approvalTemplateId = res.templateId || ''; // 审批模板ID
+      ruleFormData.applicantCode = res.applicantCode || ''; // 工号
+      ruleFormData.warehouseDate = res.injuryTime ? res.injuryTime.split('T')[0] : ''; // 受伤时间
+      ruleFormData.status = res.status ? 'ENABLE' : 'DISABLE'; // 状态
+      ruleFormData.remarks = res.injuryReason || ''; // 受伤原因
+      ruleFormData.accidentCertUrl = res.accidentCertUrl || ''; // 事故报告
+      ruleFormData.powerAttorneyUrl = res.powerAttorneyUrl || ''; // 委托书
+      ruleFormData.addressConfirmUrl = res.addressConfirmUrl || ''; // 地址确认书
+      ruleFormData.applicationFormUrl = res.applicationFormUrl || ''; // 申请表
+      ruleFormData.idCardUrl = res.idCardUrl || ''; // 身份证正反面
+      ruleFormData.laborContractUrl = res.laborContractUrl || ''; // 劳动合同
+      ruleFormData.initialMedicalCertUrl = res.initialMedicalCertUrl || ''; // 初次医疗证明
+      ruleFormData.trusteeIdCardUrl = res.trusteeIdCardUrl || ''; // 被委托人员身份证正反面
+      ruleFormData.departmentCode = JSON.parse(res.departmentCode || '[]') || ''; // 部门编码
+      ruleFormData.departmentName = res.departmentName || ''; // 添加这一行,设置部门名称
+      ruleFormData.approvalTemplateId = res.templateId || ''; // 审批模板ID
       }
       cloneRuleFormData();
     } catch (e) {
@@ -376,13 +385,16 @@ import { template } from 'lodash-es';
         basicDialogRef.value.openDialog();
         return;
       } else if (isEditMode.value && currentId.value) {
-        await updateInventory({
+        await updateWorkInjuryApply({
           id: currentId.value,
           ...basePayload,
         });
         ElMessage.success('保存成功');
+        await getApprovalNode(Number(ruleFormData.approvalTemplateId));
+        basicDialogRef.value.openDialog();
+        return;
       }
-
+      cloneRuleFormData();
       router.back();
     } catch (e) {
       console.error('保存物品库存失败:', e);
@@ -671,4 +683,7 @@ import { template } from 'lodash-es';
 
 <style scoped lang="scss">
   @use '@/styles/page-details-layout.scss' as *;
+  .detail-reject-alert{
+    margin-bottom: 20px;
+  }
 </style>

+ 2 - 0
src/views/production-safety/risk-identification-and-control/work-injury-apply-manage/configs/form.ts

@@ -117,4 +117,6 @@ export const INVENTORY_FORM_RULES = {
   applicantCode: [{ required: true, message: '请输入工号', trigger: 'blur' }],
   departmentCode: [{ required: true, message: '请选择所属部门', trigger: 'change' }],
   remarks: [{ required: true, message: '请输入受伤原因', trigger: 'blur' }],
+  departmentName: [{ required: true, message: '请选择所属部门', trigger: 'change' }],
+  approvalTemplateId: [{ required: true, message: '请选择审批流程', trigger: 'change' }],
 };

+ 83 - 6
src/views/production-safety/risk-identification-and-control/work-injury-apply-manage/list.vue

@@ -92,11 +92,11 @@
                 <!-- 申请加盖公章及材料申请 -->
                 <template v-else-if="scope.row.status === 2 || scope.row.status === '2'">
                   <ActionButton text="查看" @click="handleView(scope.row.id)" />
-                  <ActionButton text="确认" @click="handleAudit(scope.row.id,scope.row)" />
+                  <ActionButton text="确认" @click="confirmDialog = true;confirmId = scope.row.id;" />
                 </template>
                 <!-- 审核不通过:编辑、删除、查看 -->
                 <template v-else-if="scope.row.status === 3 || scope.row.status === '3'">
-                  <ActionButton text="编辑" @click="handleEdit(scope.row.id)" />
+                  <ActionButton text="编辑" @click="handleEdit(scope.row.id,scope.row)" />
                   <ActionButton
                     text="删除"
                     :popconfirm="{ title: '确定要删除该申请吗?' }"
@@ -113,6 +113,34 @@
           </BasicTable>
         </div>
       </div>
+      <!-- 确定弹窗 -->
+      <el-dialog
+        v-model="confirmDialog"
+        title="用户告知内容"
+        width="800px"
+        destroy-on-close
+        @close="confirmValue = '';confirmDialog = false"
+      >
+        <div class="editor-container">
+          <Toolbar 
+            style="border-bottom: 1px solid #dcdfe6" 
+            :editor="editorRef" 
+          />
+          <Editor
+            style="height: 400px; overflow-y: auto"
+            v-model="confirmValue"
+            mode="default"
+            :defaultConfig="editorConfig"
+            @on-created="handleEditorCreated"
+          />
+        </div>
+        <template #footer>
+          <el-button @click="confirmDialog = false">取消</el-button>
+          <el-button type="danger" :loading="auditSubmitting" @click="confirmRequest">
+            确定
+          </el-button>
+        </template>
+      </el-dialog>
     </main>
     <BatchImport
       v-if="batchImportVisible"
@@ -128,7 +156,7 @@
 </template>
 
 <script setup lang="ts">
-  import { onMounted, reactive, ref } from 'vue';
+  import { onMounted, reactive, ref ,shallowRef ,computed } from 'vue';
   import { ElMessage } from 'element-plus';
   import BasicTable from '@/components/BasicTable.vue';
   import useTableConfig from '@/hooks/useTableConfigHook';
@@ -136,7 +164,7 @@
   import { TABLE_OPTIONS, INVENTORY_TABLE_COLUMNS } from './configs/tables';
   import { useRouter } from 'vue-router';
   import type { QueryPageRequest } from '@/types/basic-query';
-  import { queryInventoryManage, deleteInventory, exportInventory } from '@/api/inventory';
+  import { queryInventoryManage, deleteInventory, exportInventory, auditWorkInjuryConfirm } from '@/api/inventory';
   import { downloadByData } from '@/utils/file/download';
   import BatchImport from '@/components/batch-import/BatchImport.vue';
   import { useGlobSetting } from '@/hooks/setting';
@@ -148,9 +176,21 @@
     type InventoryItem,
     type InventoryQueryParam,
   } from '@/api/production-safety/business-registration-application';
+  import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
+  import '@wangeditor/editor/dist/css/style.css';
 
   const router = useRouter();
-
+  const auditSubmitting = ref(false);
+  const confirmDialog = ref(false);
+  const confirmValue = ref('');
+  const confirmId = ref('');
+  // 富文本编辑器
+  const editorRef = shallowRef();
+  const editorConfig = computed(() => ({
+    placeholder: '请输入文档内容',
+    MENU_CONF: {},
+  }));
+  
   const firstLevelDepts = ref<any[]>([]);
   const cascaderProp = {
     expandTrigger: 'click',
@@ -213,6 +253,7 @@
           approvalOrder: item.approvalOrder, // 审批订单
           templateId: item.templateId, // 模板ID
           injuryCategoryCode: item.injuryCategoryCode, // 工伤类别编码
+          rejectReason: item.rejectReason, // 拒绝原因
         }));
         pagination.total = res.totalRow;
       }
@@ -281,11 +322,16 @@
     });
   };
 
-  const handleEdit = (id: number) => {
+  const handleEdit = (id: number,row: any) => {
     router.push({
       name: 'workInjuryApplyManageItem',
       query: {
         id,
+        rejectReason:row.rejectReason ?? '',
+        approvalTemplateId:row.templateId ?? '',
+        approvalOrder:row.approvalOrder ?? '',
+        approvalStatus:row.status ?? '',
+        injuryCategoryCode:row.injuryCategoryCode ?? '',
         operate: 'inventory-edit',
       },
     });
@@ -338,6 +384,30 @@
     // }
   };
 
+  const handleEditorCreated = (editor: any) => {
+    editorRef.value = editor;
+  };
+
+  const confirmRequest = async () => {
+    auditSubmitting.value = true;
+    try {
+      if (!confirmValue.value) {
+        ElMessage.error('请先填写用户告知内容!');
+        return;
+      }
+      await auditWorkInjuryConfirm(Number(confirmId.value), confirmValue.value);
+      ElMessage.success('操作成功');
+      confirmDialog.value = false;
+      confirmValue.value = '';
+      getTableData();
+    } catch (e) {
+      console.error('操作失败:', e);
+      ElMessage.error('操作失败,请重试');
+    } finally {
+      auditSubmitting.value = false;
+    }
+  };
+
   onMounted(() => {
     getTableData();
     getDeptData();
@@ -349,4 +419,11 @@
   @use '@/styles/page-main-layout.scss' as *;
   @use '@/styles/basic-table-action.scss' as *;
   @use '@/views/traffic/violation/style/act-search-table.scss' as *;
+  @use '@/styles/page-details-layout.scss' as *;
+  .editor-container {
+    width: 100%;
+    border: 1px solid #dcdfe6;
+    border-radius: 4px;
+    overflow: hidden;
+  }
 </style>

+ 430 - 0
src/views/production-safety/risk-identification-and-control/work-injury-apply-manage/listAdmin.vue

@@ -0,0 +1,430 @@
+<template>
+  <div class="safety-platform-container">
+    <header class="safety-platform-container__header">
+      <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 class="act-search">
+            <section class="select-box">
+              <div class="select-box--item">
+                <span>单号:</span>
+                <el-input
+                  v-model="tableQuery.queryParam.stuffName"
+                  placeholder="搜索申请单号/工号/姓名"
+                  class="act-search-input"
+                />
+              </div>
+              <div class="select-box--item">
+                <span>状态:</span>
+                <el-select
+                  v-model="tableQuery.queryParam.status"
+                  placeholder="请选择状态"
+                  clearable
+                >
+                  <el-option label="待审核" :value="1" />
+                  <el-option label="申请加盖公章及材料申请" :value="2" />
+                  <el-option label="审核不通过" :value="3" />
+                  <el-option label="已完成" :value="4" />
+                </el-select>
+              </div>
+              <div class="select-box--item">
+                <span>所属部门:</span>
+                 <el-cascader
+                  v-model="tableQuery.queryParam.applicationDepartmentId"
+                  style="width: 170px"
+                  ref="cascaderRef"
+                  :options="firstLevelDepts"
+                  :props="cascaderProp"
+                  :show-all-levels="false"
+                  placeholder="部门名称"
+                  filterable
+                  @change="handleChangeDept"
+                />
+              </div>
+            </section>
+            <section class="search-btn">
+              <el-button type="primary" @click="handleSearch">查询</el-button>
+              <el-button @click="handleReset">重置</el-button>
+            </section>
+          </div>
+        </header>
+
+        <div class="batch-table">
+          <BasicTable
+            ref="basicTableRef"
+            :tableData="tableData"
+            :tableConfig="tableConfig"
+            @update:pageSize="handleSizeChange"
+            @update:pageNumber="handleCurrentChange"
+          >
+            <template #status="scope">
+              <span>
+                {{ scope.row.status === 1 ? '待审核' : scope.row.status === 2 ? '申请加盖公章及材料申请' : scope.row.status === 3 ? '审核不通过' : scope.row.status === 4 ? '已完成' : '-' }}
+              </span>
+            </template>
+            <template #injuryCategoryCode="scope">
+              <span>
+                {{ scope.row.injuryCategoryCode === '1' ? '责任事故' : scope.row.injuryCategoryCode === '2' ? '非责任事故' :  scope.row.injuryCategoryCode == '3' ? "交通事故" : '-' }}
+              </span>
+            </template>
+            <template #action="scope">
+              <div class="action-container--div" style="justify-content: left">
+                
+                <!-- 待审核:查看、审核 -->
+                <template v-if="scope.row.status === 1 || scope.row.status === '1'">
+                  <ActionButton text="查看" @click="handleView(scope.row.id)" />
+                  <ActionButton text="审核" @click="handleAudit(scope.row.id,scope.row)" />
+                </template>
+                <!-- 申请加盖公章及材料申请 -->
+                <template v-else-if="scope.row.status === 2 || scope.row.status === '2'">
+                  <ActionButton text="查看" @click="handleView(scope.row.id)" />
+                  <ActionButton text="确认" @click="confirmDialog = true;confirmId = scope.row.id;" />
+                </template>
+                <!-- 审核不通过:编辑、删除、查看 -->
+                <template v-else-if="scope.row.status === 3 || scope.row.status === '3'">
+                  <ActionButton text="编辑" @click="handleEdit(scope.row.id,scope.row)" />
+                  <ActionButton
+                    text="删除"
+                    :popconfirm="{ title: '确定要删除该申请吗?' }"
+                    @confirm="handleDelete(scope.row.id)"
+                  />
+                  <ActionButton text="查看" @click="handleView(scope.row.id!)" />
+                </template>
+                <!-- 已完成:查看 -->
+                <template v-else-if="scope.row.status === 4 || scope.row.status === '4'">
+                  <ActionButton text="查看" @click="handleView(scope.row.id!)" />
+                </template>
+              </div>
+            </template>
+          </BasicTable>
+        </div>
+      </div>
+      <!-- 确定弹窗 -->
+      <el-dialog
+        v-model="confirmDialog"
+        title="用户告知内容"
+        width="800px"
+        destroy-on-close
+        @close="confirmValue = '';confirmDialog = false"
+      >
+        <div class="editor-container">
+          <Toolbar 
+            style="border-bottom: 1px solid #dcdfe6" 
+            :editor="editorRef" 
+          />
+          <Editor
+            style="height: 400px; overflow-y: auto"
+            v-model="confirmValue"
+            mode="default"
+            :defaultConfig="editorConfig"
+            @on-created="handleEditorCreated"
+          />
+        </div>
+        <template #footer>
+          <el-button @click="confirmDialog = false">取消</el-button>
+          <el-button type="danger" :loading="auditSubmitting" @click="confirmRequest">
+            确定
+          </el-button>
+        </template>
+      </el-dialog>
+    </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 ,shallowRef ,computed } 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 { useRouter } from 'vue-router';
+  import type { QueryPageRequest } from '@/types/basic-query';
+  import { queryInventoryManage, deleteInventory, exportInventory, auditWorkInjuryConfirm } from '@/api/inventory';
+  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 { formatDeptTree } from '@/views/disaster/utils/formatDeptTree';
+  import { getAllDepartments } from '@/api/auth/dept';
+  import {
+    queryWorkInjuryApplyList,
+    queryWorkInjuryApplyListAdmin,
+    type InventoryItem,
+    type InventoryQueryParam,
+  } from '@/api/production-safety/business-registration-application';
+  import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
+  import '@wangeditor/editor/dist/css/style.css';
+
+  const router = useRouter();
+  const auditSubmitting = ref(false);
+  const confirmDialog = ref(false);
+  const confirmValue = ref('');
+  const confirmId = ref('');
+  // 富文本编辑器
+  const editorRef = shallowRef();
+  const editorConfig = computed(() => ({
+    placeholder: '请输入文档内容',
+    MENU_CONF: {},
+  }));
+  
+  const firstLevelDepts = ref<any[]>([]);
+  const cascaderProp = {
+    expandTrigger: 'click',
+    checkStrictly: true,
+    // emitPath: false,
+    value: 'id',
+    label: 'deptName',
+  };
+  const cascaderRef = ref();
+
+  // 表格
+  const basicTableRef = ref<InstanceType<typeof BasicTable>>();
+
+  const { tableConfig, pagination } = useTableConfig(INVENTORY_TABLE_COLUMNS, TABLE_OPTIONS);
+
+  const tableData = ref<any[]>([]);
+
+  const tableQuery = reactive<QueryPageRequest<any>>({
+    pageNumber: pagination.pageNumber,
+    pageSize: pagination.pageSize,
+    queryParam: {
+      stuffName: '', // 物品名称
+      status: '', // 状态,默认启用
+      ids: [], // 选择数据的ID
+      applicationDepartmentId: '', // 所属部门ID
+    },
+  });
+
+  const handleSizeChange = (value: number) => {
+    pagination.pageSize = value;
+    tableQuery.pageSize = value;
+    getTableData();
+  };
+
+  const handleCurrentChange = (value: number) => {
+    pagination.pageNumber = value;
+    tableQuery.pageNumber = value;
+    getTableData();
+  };
+
+
+  async function getTableData() {
+    tableConfig.loading = true;
+    try {
+      const res = await queryWorkInjuryApplyListAdmin(tableQuery);
+      if (res) {
+        // 映射返回数据字段到表格字段
+        tableData.value = res.records.map((item) => ({
+          id: item.id,
+          applyNo: item.applyNo, // 申请单号
+          applicantCode: item.applicantCode, // 工号
+          applicantName: item.applicantName, // 姓名
+          departmentName: item.departmentName, // 所属部门
+          injuryReason: item.injuryReason, // 受伤原因
+          injuryTime: item.injuryTime, // 受伤时间
+          injuryCategoryName: item.injuryCategoryName, // 工伤类别
+          remark: item.remark, // 备注
+          status: item.status, // 状态
+          approvalTemplateId: item.approvalTemplateId, // 审批模板ID
+          approvalOrder: item.approvalOrder, // 审批订单
+          templateId: item.templateId, // 模板ID
+          injuryCategoryCode: item.injuryCategoryCode, // 工伤类别编码
+          rejectReason: item.rejectReason, // 拒绝原因
+        }));
+        pagination.total = res.totalRow;
+      }
+    } catch (e) {
+      console.error('获取物品库存列表失败:', e);
+      tableData.value = [];
+      pagination.total = 0;
+    } finally {
+      tableConfig.loading = false;
+    }
+  }
+
+  const handleSearch = () => {
+    pagination.pageNumber = 1;
+    tableQuery.pageNumber = 1;
+    getTableData();
+  };
+
+  const handleReset = () => {
+    tableQuery.queryParam.stuffName = '';
+    tableQuery.queryParam.status = true; // 重置为默认启用状态
+    tableQuery.queryParam.ids = [];
+    handleSearch();
+  };
+
+  // 批量导入
+  const batchImportVisible = ref(false);
+  const { urlPrefix } = useGlobSetting();
+  const importApiUrl = ref(urlJoin(urlPrefix, '/inventory/importInventory'));
+  const templateUrl = ref('./skyeye-file-upload/sfysecurity/TEMPLATE/import-inventory-template.xlsx');
+
+  const handleImport = () => {
+    batchImportVisible.value = true;
+  };
+
+  const handleUpdate = () => {
+    batchImportVisible.value = false;
+    getTableData();
+  };
+
+  const handleDownload = async () => {
+    try {
+      const exportParams = {
+        stuffName: tableQuery.queryParam.stuffName || undefined,
+        status: tableQuery.queryParam.status,
+        ids: tableQuery.queryParam.ids.length > 0 ? tableQuery.queryParam.ids : undefined,
+      };
+      const response = await exportInventory(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: 'workInjuryApplyManageItem',
+      query: {
+        operate: 'inventory-create',
+      },
+    });
+  };
+
+  const handleEdit = (id: number,row: any) => {
+    router.push({
+      name: 'workInjuryApplyManageItem',
+      query: {
+        id,
+        rejectReason:row.rejectReason ?? '',
+        approvalTemplateId:row.templateId ?? '',
+        approvalOrder:row.approvalOrder ?? '',
+        approvalStatus:row.status ?? '',
+        injuryCategoryCode:row.injuryCategoryCode ?? '',
+        operate: 'inventory-edit',
+      },
+    });
+  };
+
+  const handleAudit = (id: number,row: any) => {
+    router.push({
+      name: 'workInjuryApplyManageItem',
+      query: {
+        id,
+        approvalTemplateId:row.templateId ?? '',
+        approvalOrder:row.approvalOrder ?? '',
+        operate: 'inventory-audit',
+      },
+    });
+  }
+
+  const handleDelete = async (id: number) => {
+    try {
+      await deleteInventory(id);
+      ElMessage.success('删除成功');
+      getTableData();
+    } catch (e) {
+      console.error('删除物品库存失败:', e);
+      ElMessage.error('删除失败,请重试');
+    }
+  };
+
+  const handleView = (id: number) => {
+    router.push({
+      name: 'workInjuryApplyManageItem',
+      query: {
+        id,
+        operate: 'inventory-view',
+      },
+    });
+  };
+
+  const getDeptData = () => {
+    getAllDepartments().then((res) => {
+      firstLevelDepts.value = formatDeptTree(res);
+    });
+  };
+  
+  const handleChangeDept = () => {
+    // const deptInfo = cascaderRef.value?.getCheckedNodes();
+    // if (deptInfo?.[0]) {
+    //   tableQuery.queryParam.department = deptInfo[0].label;
+    //   tableQuery.queryParam.departmentId = deptInfo[0].pathValues;
+    // }
+  };
+
+  const handleEditorCreated = (editor: any) => {
+    editorRef.value = editor;
+  };
+
+  const confirmRequest = async () => {
+    auditSubmitting.value = true;
+    try {
+      if (!confirmValue.value) {
+        ElMessage.error('请先填写用户告知内容!');
+        return;
+      }
+      await auditWorkInjuryConfirm(Number(confirmId.value), confirmValue.value);
+      ElMessage.success('操作成功');
+      confirmDialog.value = false;
+      confirmValue.value = '';
+      getTableData();
+    } catch (e) {
+      console.error('操作失败:', e);
+      ElMessage.error('操作失败,请重试');
+    } finally {
+      auditSubmitting.value = false;
+    }
+  };
+
+  onMounted(() => {
+    getTableData();
+    getDeptData();
+  });
+</script>
+
+<style scoped lang="scss">
+  @use '@/styles/page-details-layout.scss' as *;
+  @use '@/styles/page-main-layout.scss' as *;
+  @use '@/styles/basic-table-action.scss' as *;
+  @use '@/views/traffic/violation/style/act-search-table.scss' as *;
+  @use '@/styles/page-details-layout.scss' as *;
+  .editor-container {
+    width: 100%;
+    border: 1px solid #dcdfe6;
+    border-radius: 4px;
+    overflow: hidden;
+  }
+</style>