personal-protective-equipment.ts 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import { http } from '@/utils/http/axios';
  2. import type { QueryPageRequest, QueryPageResponse } from '@/types/basic-query';
  3. /**
  4. * 劳防用品管理 - 实体与接口
  5. * 基础路径: /api/personalProtectiveEquipment
  6. */
  7. /** 劳防用品实体 */
  8. export interface PersonalProtectiveEquipment {
  9. id?: number;
  10. jobPost?: string; // 作业(岗位)分类
  11. ppeCategory?: string; // 物品分类
  12. ppeName?: string; // 物品名称
  13. serviceMonths?: string; // 使用期限(月)
  14. status?: boolean; // 用品状态:true-启用,false-禁用
  15. remark?: string; // 备注
  16. isDeleted?: string | number; // 0-未删除,大于0(时间戳)-已删除
  17. createdAt?: string; // 创建时间
  18. updatedAt?: string; // 更新时间
  19. }
  20. /** 分页查询请求体 - 查询条件 */
  21. export interface QueryPersonalProtectiveEquipmentCommonPageReq {
  22. name?: string; // 标题
  23. status?: boolean; // 状态:true-启用,false-禁用
  24. applyDeptCode?: string; // 申请人部门CODE/申请部门编码
  25. applyDeptName?: string; // 申请人部门名称
  26. }
  27. /** 分页查询劳防用品列表 */
  28. export function queryPersonalProtectiveEquipmentList(
  29. query: QueryPageRequest<QueryPersonalProtectiveEquipmentCommonPageReq>,
  30. ) {
  31. return http.request<QueryPageResponse<PersonalProtectiveEquipment>>({
  32. url: '/personalProtectiveEquipment/queryPersonalProtectiveEquipmentList',
  33. method: 'post',
  34. data: query,
  35. });
  36. }
  37. /** 新增劳防用品(id 不传) */
  38. export function savePersonalProtectiveEquipment(data: PersonalProtectiveEquipment) {
  39. return http.request({
  40. url: '/personalProtectiveEquipment/savePersonalProtectiveEquipment',
  41. method: 'post',
  42. data,
  43. });
  44. }
  45. /** 编辑劳防用品(id 必传) */
  46. export function updatePersonalProtectiveEquipment(data: PersonalProtectiveEquipment) {
  47. return http.request({
  48. url: '/personalProtectiveEquipment/updatePersonalProtectiveEquipment',
  49. method: 'put',
  50. data,
  51. });
  52. }
  53. /** 查询劳防用品详情(id 必传,RequestParam) */
  54. export function queryPersonalProtectiveEquipmentDetail(id: number) {
  55. return http.request<PersonalProtectiveEquipment>({
  56. url: '/personalProtectiveEquipment/queryPersonalProtectiveEquipmentDetail',
  57. method: 'post',
  58. params: { id },
  59. });
  60. }
  61. /** 删除劳防用品(POST,传 id) */
  62. export function deletePersonalProtectiveEquipment(id: number) {
  63. return http.request({
  64. url: `/personalProtectiveEquipment/deletePersonalProtectiveEquipment?id=${id}`,
  65. method: 'delete',
  66. });
  67. }