index.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import request from '@/config/axios'
  2. // PMS 设备BOM物料关联 VO
  3. export interface IotDeviceMaterialVO {
  4. id: number // 主键
  5. deviceCategoryId: number // 所属设备分类
  6. deviceId: number // 所属设备
  7. name: string // 设备BOM节点名称
  8. bomNodeId: number // 设备BOM节点id
  9. code: string // 设备BOM节点编码
  10. materialId: number // 物料id
  11. quantity: number // 数量
  12. status: number // 状态 0启用 1停用
  13. remark: string // 备注
  14. }
  15. // PMS 设备BOM物料关联 API
  16. export const IotDeviceMaterialApi = {
  17. // 查询PMS 设备BOM物料关联分页
  18. getIotDeviceMaterialPage: async (params: any) => {
  19. return await request.get({ url: `/pms/iot-device-material/page`, params })
  20. },
  21. // 查询PMS 设备BOM物料关联详情
  22. getIotDeviceMaterial: async (id: number) => {
  23. return await request.get({ url: `/pms/iot-device-material/get?id=` + id })
  24. },
  25. // 新增PMS 设备BOM物料关联
  26. createIotDeviceMaterial: async (data: IotDeviceMaterialVO) => {
  27. return await request.post({ url: `/pms/iot-device-material/create`, data })
  28. },
  29. // 修改PMS 设备BOM物料关联
  30. updateIotDeviceMaterial: async (data: IotDeviceMaterialVO) => {
  31. return await request.put({ url: `/pms/iot-device-material/update`, data })
  32. },
  33. // 删除PMS 设备BOM物料关联
  34. deleteIotDeviceMaterial: async (id: number) => {
  35. return await request.delete({ url: `/pms/iot-device-material/delete?id=` + id })
  36. },
  37. // 导出PMS 设备BOM物料关联 Excel
  38. exportIotDeviceMaterial: async (params) => {
  39. return await request.download({ url: `/pms/iot-device-material/export-excel`, params })
  40. },
  41. deleteDeviceMaterial: async (bomNodeId: number, code: string) => {
  42. return await request.delete({ url: '/pms/iot-device-material/deleteDeviceMaterial?bomNodeId=' + bomNodeId + '&code=' + code })
  43. }
  44. }