import { http } from '@/utils/http/axios'; import type { QueryPageRequest, QueryPageResponse } from '@/types/basic-query'; /** * 劳防用品管理 - 实体与接口 * 基础路径: /api/personalProtectiveEquipment */ /** 劳防用品实体 */ export interface PersonalProtectiveEquipment { id?: number; jobPost?: string; // 作业(岗位)分类 ppeCategory?: string; // 物品分类 ppeName?: string; // 物品名称 serviceMonths?: string; // 使用期限(月) status?: boolean; // 用品状态:true-启用,false-禁用 remark?: string; // 备注 isDeleted?: string | number; // 0-未删除,大于0(时间戳)-已删除 createdAt?: string; // 创建时间 updatedAt?: string; // 更新时间 } /** 分页查询请求体 - 查询条件 */ export interface QueryPersonalProtectiveEquipmentCommonPageReq { name?: string; // 标题 status?: boolean; // 状态:true-启用,false-禁用 applyDeptCode?: string; // 申请人部门CODE/申请部门编码 applyDeptName?: string; // 申请人部门名称 } /** 分页查询劳防用品列表 */ export function queryPersonalProtectiveEquipmentList( query: QueryPageRequest, ) { return http.request>({ url: '/personalProtectiveEquipment/queryPersonalProtectiveEquipmentList', method: 'post', data: query, }); } /** 新增劳防用品(id 不传) */ export function savePersonalProtectiveEquipment(data: PersonalProtectiveEquipment) { return http.request({ url: '/personalProtectiveEquipment/savePersonalProtectiveEquipment', method: 'post', data, }); } /** 编辑劳防用品(id 必传) */ export function updatePersonalProtectiveEquipment(data: PersonalProtectiveEquipment) { return http.request({ url: '/personalProtectiveEquipment/updatePersonalProtectiveEquipment', method: 'put', data, }); } /** 查询劳防用品详情(id 必传,RequestParam) */ export function queryPersonalProtectiveEquipmentDetail(id: number) { return http.request({ url: '/personalProtectiveEquipment/queryPersonalProtectiveEquipmentDetail', method: 'post', params: { id }, }); } /** 删除劳防用品(POST,传 id) */ export function deletePersonalProtectiveEquipment(id: number) { return http.request({ url: `/personalProtectiveEquipment/deletePersonalProtectiveEquipment?id=${id}`, method: 'delete', }); }