index.ts 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import request from '@/config/axios'
  2. // 故障上报 VO
  3. export interface IotFailureReportVO {
  4. id: number // 主键id
  5. failureCode: string // 故障编码
  6. failureName: string
  7. typeDesc?: string // 其他故障描述
  8. deviceId: number // 设备id
  9. status: string // 状态
  10. ifStop: boolean // 是否停机
  11. failureTime: Date // 故障时间
  12. failureInfluence: string // 故障影响
  13. failureSystem: string // 故障系统
  14. description: string // 故障描述
  15. pic: string // 图片
  16. ifDeal: boolean // 是否解决
  17. needHelp: boolean // 是否需要协助
  18. solution: string // 解决办法
  19. remark: string // 备注
  20. }
  21. // 故障上报 API
  22. export const IotFailureReportApi = {
  23. // 提交审核
  24. submitForApproval: async (id: number) => {
  25. return await request.put({ url: `/rq/iot-failure-report/submitForApproval?id=${id}` })
  26. },
  27. // 查询故障上报分页
  28. getIotFailureReportPage: async (params: any) => {
  29. return await request.get({ url: `/rq/iot-failure-report/page`, params })
  30. },
  31. // 查询故障上报详情
  32. getIotFailureReport: async (id: number) => {
  33. return await request.get({ url: `/rq/iot-failure-report/get?id=` + id })
  34. },
  35. getApproval: async () => {
  36. return await request.get({ url: `/rq/iot-failure-report/get/approval` })
  37. },
  38. // 新增故障上报
  39. createIotFailureReport: async (data: IotFailureReportVO) => {
  40. return await request.post({ url: `/rq/iot-failure-report/create`, data })
  41. },
  42. // 修改故障上报
  43. updateIotFailureReport: async (data: IotFailureReportVO) => {
  44. return await request.put({ url: `/rq/iot-failure-report/update`, data })
  45. },
  46. // 删除故障上报
  47. deleteIotFailureReport: async (id: number) => {
  48. return await request.delete({ url: `/rq/iot-failure-report/delete?id=` + id })
  49. },
  50. // 导出故障上报 Excel
  51. exportIotFailureReport: async (params) => {
  52. return await request.download({ url: `/rq/iot-failure-report/export-excel`, params })
  53. },
  54. updateIotMaintainProcess: async (
  55. processId: any,
  56. id: any,
  57. type: any,
  58. assigneeUserId: any,
  59. trans: any
  60. ) => {
  61. return await request.put({
  62. url:
  63. `/rq/iot-failure-report/process-info?processId=` +
  64. processId +
  65. `&id=` +
  66. id +
  67. `&type=` +
  68. type +
  69. `&assigneeUserId=` +
  70. assigneeUserId +
  71. `&trans=` +
  72. trans
  73. })
  74. }
  75. }