| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- import { http } from '@/utils/http/axios';
- import type { QueryPageRequest, QueryPageResponse } from '@/types/basic-query';
- /**
- * 查询物品信息返回对象
- */
- export interface BusinessCertification {
- id: number;
- stuffName: string; // 物品名称
- injuryTime: string; // 入库日期
- stuffQty: number; // 物品数量
- surplusQty: number; // 物品结余数量
- remark: string; // 备注
- createdUserName: string; // 经办人
- status: boolean; // 状态(1-启用/0-禁用)
- createdAt: string; // 创建时间
- updatedAt: string; // 更新时间
- isDeleted: number; // 0-未删除,大于0(时间戳)-已删除
- statusName: 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
- applicantName: string; // 申请人姓名
- applicantCode: string; // 申请人工号
- injuryReason: string; // 受伤原因
- departmentCode: string; // 部门编码
- templateId?: any; // 审批模板ID
- departmentName?: string; // 部门名称
- }
- /**
- * 查询物品信息请求参数
- */
- export interface BusinessQueryParam {
- stuffName?: string; // 物品名称
- status?: boolean; // 状态
- ids?: string[]; // 选择数据的ID
- }
- /** 审批流程参数 */
- export interface ApprovalProcessParam {
- id: string;
- approvalDescription: string;
- templateId?: number;
- approvalInfoList: {
- approvalOrder: number;
- approverIdList: number[];
- }[];
- }
- /** 审核参数(兼容旧调用:映射到 SaveApprovalReq) */
- export interface AuditPurchaseApplyParam {
- id: number;
- /** 1-审核通过,-1-审核不通过 → 映射 approvalStatus 2/3 */
- status: number;
- rejectReason?: string; // 同 returnReason
- approvalOrder?: number;
- templateId?: string;
- code?: string;
- }
- /** 提交审批 - 通过/退回 SaveApprovalReq */
- export interface SaveApprovalReq {
- id: number;
- approvalOrder?: number;
- /** 审批状态: 1-待审批,2-已审批,3-退回 */
- approvalStatus: number;
- /** 退回原因 */
- returnReason?: string;
- templateId?: string;
- }
- /**
- * 保存物品信息请求参数
- */
- export interface SaveInventoryRequest {
- applicantCode: string; // 申请人工号
- applicantName: string; // 申请人姓名
- injuryTime: string; // 入库日期 (ISO 格式)
- 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
- }
- /**
- * 更新工伤认定请求参数
- */
- 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
- }
- /**
- * 查询物品库存管理列表
- */
- export function queryInventoryManage(query: QueryPageRequest<BusinessQueryParam>) {
- return http.request<QueryPageResponse<BusinessCertification>>({
- url: '/inventory/queryInventoryManage',
- method: 'post',
- data: query,
- });
- }
- /**
- * 保存业务信息
- */
- export function saveBusinessInformation(data: SaveInventoryRequest) {
- return http.request({
- url: '/WorkInjuryApply/saveWorkInjuryApply',
- method: 'post',
- data,
- });
- }
- /**
- * 更新物品信息请求参数
- */
- export interface UpdateInventoryRequest extends SaveInventoryRequest {
- id: number; // 物品ID
- }
- /**
- * 更新物品库存(编辑)
- */
- export function updateInventory(data: UpdateInventoryRequest) {
- return http.request({
- url: '/inventory/updateInventory',
- method: 'put',
- data,
- });
- }
- /**
- * 删除物品库存
- */
- export function deleteInventory(id: number) {
- return http.request({
- url: `/inventory/deleteInventory?id=${id}`,
- method: 'delete',
- // data: { id },
- });
- }
- /**
- * 查询物品库存详情
- */
- export function queryInventoryDetail(id: number) {
- return http.request<BusinessCertification>({
- url: `/inventory/queryInventoryDetail?id=${id}`,
- method: 'get',
- });
- }
- /**
- * 导入物品库存
- * 注意:导入功能使用 BatchImport 组件,直接通过 URL 上传文件
- */
- /**
- * 导出物品库存请求参数
- */
- export interface ExportInventoryRequest {
- stuffName?: string; // 物品名称
- status?: boolean; // 状态
- ids?: string[]; // 选择数据的ID
- }
- /**
- * 导出物品库存
- */
- export function exportInventory(query: ExportInventoryRequest) {
- return http.request({
- url: '/inventory/exportInventory',
- method: 'post',
- data: query,
- responseType: 'blob',
- }, {
- isTransformResponse: false,
- });
- }
- /** 提交审批流程 */
- export const submitApprovalProcess = (data: ApprovalProcessParam) => {
- return http.request({
- url: '/WorkInjuryApply/submit',
- method: 'post',
- data,
- });
- };
- /** 审核劳防用品采购申请(通过/退回)- 兼容旧接口,内部调 saveApproval */
- export function auditPurchaseApply(data: AuditPurchaseApplyParam) {
- return saveApproval({
- id: data.id,
- approvalStatus: data.status === 2 ? 2 : 3, // 3审核不通过 4已完成
- returnReason: data.rejectReason,
- approvalOrder: data.approvalOrder,
- templateId: data.templateId,
- code: data.code,
- });
- }
- /** 提交审批(通过/退回) */
- export function saveApproval(data: SaveApprovalReq) {
- return http.request({
- url: '/WorkInjuryApply/saveApproval',
- 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,
- }
- });
- }
|