business-registration-application.ts 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. import { http } from '@/utils/http/axios';
  2. import type { QueryPageRequest, QueryPageResponse } from '@/types/basic-query';
  3. /**
  4. * 查询工商认定信息返回对象
  5. */
  6. export interface InventoryItem {
  7. id: number;
  8. applyNo: string; // 申请单号
  9. applicantCode: string; // 工号
  10. applicantName: string; // 姓名
  11. departmentName: string; // 所属部门
  12. injuryReason: string; // 受伤原因
  13. injuryTime: string; // 受伤时间
  14. injuryCategoryName: string; // 工伤类别
  15. remark: string; // 备注
  16. status: boolean; // 状态
  17. approvalTemplateId: string; // 审批模板ID
  18. approvalOrder: number; // 审批订单
  19. templateId: string; // 模板ID
  20. injuryCategoryCode: string; // 工伤类别编码
  21. rejectReason: string; // 拒绝原因
  22. }
  23. /**
  24. * 查询工商认定信息请求参数
  25. */
  26. export interface InventoryQueryParam {
  27. queryKey?: string; // 物品名称
  28. status?: boolean; // 状态
  29. ids?: string[]; // 选择数据的ID
  30. }
  31. /**
  32. * 查询物品库存管理列表
  33. */
  34. export function queryWorkInjuryApplyList(query: QueryPageRequest<InventoryQueryParam>) {
  35. return http.request<QueryPageResponse<InventoryItem>>({
  36. url: '/WorkInjuryApply/queryWorkInjuryApplyList',
  37. method: 'post',
  38. data: query,
  39. });
  40. }
  41. /**
  42. * 查询物品库存管理列表admin
  43. */
  44. export function queryWorkInjuryApplyListAdmin(query: QueryPageRequest<InventoryQueryParam>) {
  45. return http.request<QueryPageResponse<InventoryItem>>({
  46. url: '/WorkInjuryApply/queryWorkInjuryApplyListAdmin',
  47. method: 'post',
  48. data: query,
  49. });
  50. }
  51. /**
  52. * 保存工商认定信息请求参数
  53. */
  54. export interface SaveInventoryRequest {
  55. queryKey: string; // 物品名称
  56. inStoreTime: string; // 入库日期 (ISO 格式)
  57. stuffQty: number; // 物品数量
  58. remark: string; // 备注
  59. }
  60. /**
  61. * 保存物品库存(新增)
  62. */
  63. export function saveInventory(data: SaveInventoryRequest) {
  64. return http.request({
  65. url: '/inventory/saveInventory',
  66. method: 'post',
  67. data,
  68. });
  69. }
  70. /**
  71. * 更新工商认定信息请求参数
  72. */
  73. export interface UpdateInventoryRequest extends SaveInventoryRequest {
  74. id: number; // 物品ID
  75. }
  76. /**
  77. * 更新物品库存(编辑)
  78. */
  79. export function updateInventory(data: UpdateInventoryRequest) {
  80. return http.request({
  81. url: '/inventory/updateInventory',
  82. method: 'put',
  83. data,
  84. });
  85. }
  86. /**
  87. * 删除物品库存
  88. */
  89. export function deleteInventory(id: number) {
  90. return http.request({
  91. url: `/inventory/deleteInventory?id=${id}`,
  92. method: 'delete',
  93. // data: { id },
  94. });
  95. }
  96. /**
  97. * 查询物品库存详情
  98. */
  99. export function queryInventoryDetail(id: number) {
  100. return http.request<InventoryItem>({
  101. url: `/inventory/queryInventoryDetail?id=${id}`,
  102. method: 'get',
  103. });
  104. }
  105. /**
  106. * 导入物品库存
  107. * 注意:导入功能使用 BatchImport 组件,直接通过 URL 上传文件
  108. */
  109. /**
  110. * 导出物品库存请求参数
  111. */
  112. export interface ExportInventoryRequest {
  113. queryKey?: string; // 物品名称
  114. status?: boolean; // 状态
  115. ids?: string[]; // 选择数据的ID
  116. }
  117. /**
  118. * 导出物品库存
  119. */
  120. export function exportInventory(query: ExportInventoryRequest) {
  121. return http.request({
  122. url: '/inventory/exportInventory',
  123. method: 'post',
  124. data: query,
  125. responseType: 'blob',
  126. }, {
  127. isTransformResponse: false,
  128. });
  129. }