| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- import { http } from '@/utils/http/axios';
- import type { QueryPageRequest, QueryPageResponse } from '@/types/basic-query';
- /**
- * 查询工商认定信息返回对象
- */
- export interface InventoryItem {
- id: number;
- applyNo: string; // 申请单号
- applicantCode: string; // 工号
- applicantName: string; // 姓名
- departmentName: string; // 所属部门
- injuryReason: string; // 受伤原因
- injuryTime: string; // 受伤时间
- injuryCategoryName: string; // 工伤类别
- remark: string; // 备注
- status: boolean; // 状态
- approvalTemplateId: string; // 审批模板ID
- approvalOrder: number; // 审批订单
- templateId: string; // 模板ID
- injuryCategoryCode: string; // 工伤类别编码
- rejectReason: string; // 拒绝原因
- }
- /**
- * 查询工商认定信息请求参数
- */
- export interface InventoryQueryParam {
- queryKey?: string; // 物品名称
- status?: boolean; // 状态
- ids?: string[]; // 选择数据的ID
- }
- /**
- * 查询物品库存管理列表
- */
- export function queryWorkInjuryApplyList(query: QueryPageRequest<InventoryQueryParam>) {
- return http.request<QueryPageResponse<InventoryItem>>({
- url: '/WorkInjuryApply/queryWorkInjuryApplyList',
- method: 'post',
- data: query,
- });
- }
- /**
- * 查询物品库存管理列表admin
- */
- export function queryWorkInjuryApplyListAdmin(query: QueryPageRequest<InventoryQueryParam>) {
- return http.request<QueryPageResponse<InventoryItem>>({
- url: '/WorkInjuryApply/queryWorkInjuryApplyListAdmin',
- method: 'post',
- data: query,
- });
- }
- /**
- * 保存工商认定信息请求参数
- */
- export interface SaveInventoryRequest {
- queryKey: string; // 物品名称
- inStoreTime: string; // 入库日期 (ISO 格式)
- stuffQty: number; // 物品数量
- remark: string; // 备注
- }
- /**
- * 保存物品库存(新增)
- */
- export function saveInventory(data: SaveInventoryRequest) {
- return http.request({
- url: '/inventory/saveInventory',
- 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<InventoryItem>({
- url: `/inventory/queryInventoryDetail?id=${id}`,
- method: 'get',
- });
- }
- /**
- * 导入物品库存
- * 注意:导入功能使用 BatchImport 组件,直接通过 URL 上传文件
- */
- /**
- * 导出物品库存请求参数
- */
- export interface ExportInventoryRequest {
- queryKey?: 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,
- });
- }
|