special-equipment.ts 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. import { http } from '@/utils/http/axios';
  2. import type { QueryPageRequest, QueryPageResponse } from '@/types/basic-query';
  3. /**
  4. * 特种设备设施管理 - 实体与接口
  5. * 基础路径: /api/specialEquipment
  6. */
  7. /** 分页查询条件 */
  8. export interface SpecialEquipmentQueryParam {
  9. deviceName?: string; // 设备名称(模糊)
  10. useUnit?: string; // 使用单位(模糊)
  11. categoryId?: number; // 设备类别ID
  12. typeId?: number; // 设备种类ID
  13. isUseDepartment?: number; // 是否使用部门 1-是,0-否
  14. responsibilityDeptId?: number; // 责任部门ID
  15. deviceStatus?: number; // 设备状态 1-在用,2-停用,3-报废
  16. }
  17. /** 特种设备设施实体(列表 + 详情统一类型) */
  18. export interface SpecialEquipment {
  19. id?: number; // 设备主键ID
  20. deviceId?: string; // 设备ID,企业内部唯一标识编号
  21. deviceName?: string; // 设备名称
  22. useUnit?: string; // 使用单位名称
  23. categoryId?: number; // 设备类别ID
  24. categoryName?: string; // 设备类别名称
  25. typeId?: number; // 设备种类ID
  26. typeName?: string; // 设备种类名称
  27. registerCode?: string; // 注册代码
  28. deviceCode?: string; // 设备编码
  29. useDepartment?: string | number; // 使用部门名称
  30. responsiblePerson?: string; // 设备责任人姓名
  31. factoryNo?: string; // 出厂编号
  32. startUseDate?: string; // 启用日期 yyyy-MM-dd
  33. useYears?: number; // 使用年限(年)
  34. inspectionTime?: string; // 检测时间 yyyy-MM-dd
  35. assetId?: string; // 设备固资ID
  36. licenseNo?: string; // 使用证号
  37. safeLocation?: string; // 安全地点
  38. responsibilityDeptId?: number; // 责任部门ID
  39. responsibilityDeptName?: string; // 责任部门名称
  40. jobNo?: string; // 责任人工号
  41. productionDate?: string; // 生产日期 yyyy-MM-dd
  42. inspectionCycle?: number; // 检测周期(天)
  43. deviceStatus?: number; // 设备状态 1-在用,2-停用,3-报废
  44. deviceStatusName?: string; // 设备状态名称
  45. isUseDepartment?: number; // 是否使用部门 1-是,0-否
  46. isUseDepartmentName?: string; // 是否使用部门名称
  47. nextInspectionDate?: string; // 下次检测时间 yyyy-MM-dd
  48. remark?: string; // 备注
  49. attachments?: {
  50. file_name: string;
  51. url: string;
  52. }[]; // 附件列表
  53. [key: string]: any;
  54. useDepartmentPath?: any; // 使用部门路径(部门ID列表)
  55. }
  56. /** 分页查询特种设备设施列表 */
  57. export function querySpecialEquipmentPage(
  58. query: QueryPageRequest<SpecialEquipmentQueryParam>,
  59. ) {
  60. return http.request<QueryPageResponse<SpecialEquipment>>({
  61. url: '/specialEquipment/queryPage',
  62. method: 'post',
  63. data: query,
  64. });
  65. }
  66. /** 查询特种设备设施详情 */
  67. export function querySpecialEquipmentDetail(id: number) {
  68. return http.request<SpecialEquipment>({
  69. url: '/specialEquipment/queryDetail',
  70. method: 'get',
  71. params: { id },
  72. });
  73. }
  74. /** 新增特种设备设施 */
  75. export function saveSpecialEquipment(data: SpecialEquipment) {
  76. return http.request({
  77. url: '/specialEquipment/save',
  78. method: 'post',
  79. data,
  80. });
  81. }
  82. /** 编辑特种设备设施 */
  83. export function updateSpecialEquipment(data: SpecialEquipment) {
  84. return http.request({
  85. url: '/specialEquipment/update',
  86. method: 'put',
  87. data,
  88. });
  89. }
  90. /** 删除特种设备设施 */
  91. export function deleteSpecialEquipment(id: number) {
  92. return http.request({
  93. url: `/specialEquipment/delete?id=${id}`,
  94. method: 'delete',
  95. });
  96. }
  97. /**
  98. * 导出特种设备设施
  99. */
  100. export function exportSpecialEquipment(query: SpecialEquipmentQueryParam) {
  101. return http.request({
  102. url: '/specialEquipment/exportInventory',
  103. method: 'post',
  104. data: query,
  105. // params: classifyName ? { classifyName } : undefined,
  106. responseType: 'blob',
  107. }, {
  108. isTransformResponse: false,
  109. });
  110. }