detail.uts 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /**
  2. * 工作台详情接口
  3. */
  4. import { request } from '../../utils/request'
  5. import type { acceptOrderInfo, acceptOrderInfo2 } from '../../types/order'
  6. /**
  7. * 根据 ID 获取维保工单详情
  8. * @param id 工单 ID
  9. */
  10. export const getOrderInfoById = (id: string): Promise<any> => {
  11. return request({
  12. url: `/mobile/order/${id}`,
  13. method: 'GET'
  14. })
  15. }
  16. /**
  17. * 根据 ID 获取维修工单详情
  18. * @param id 工单 ID
  19. */
  20. export const getRepairOrderInfoById = (id: string): Promise<any> => {
  21. return request({
  22. url: `/mobile/order/repairOrder/${id}`,
  23. method: 'GET'
  24. })
  25. }
  26. // 接单(支持一次性选择处理人员和检修人员)
  27. export const acceptOrder = (gxtWorkOrder: acceptOrderInfo2 | null): Promise<any> => {
  28. const plainObject = gxtWorkOrder != null ? JSON.parse(JSON.stringify(gxtWorkOrder)) : null;
  29. const data: UTSJSONObject | null = plainObject as UTSJSONObject;
  30. return request({
  31. url: `/mobile/order/accept`,
  32. method: 'PUT',
  33. data: data
  34. })
  35. }
  36. // 挂起
  37. export const suspendOrder = (gxtWorkOrder: acceptOrderInfo | null): Promise<any> => {
  38. const plainObject = gxtWorkOrder != null ? JSON.parse(JSON.stringify(gxtWorkOrder)) : null;
  39. const data: UTSJSONObject | null = plainObject as UTSJSONObject;
  40. return request({
  41. url: `/mobile/order/suspend`,
  42. method: 'PUT',
  43. data: data
  44. })
  45. }
  46. // 审批
  47. export const approveOrder = (gxtWorkOrder: acceptOrderInfo2 | null): Promise<any> => {
  48. const plainObject = gxtWorkOrder != null ? JSON.parse(JSON.stringify(gxtWorkOrder)) : null;
  49. const data: UTSJSONObject | null = plainObject as UTSJSONObject;
  50. return request({
  51. url: `/mobile/order/approve`,
  52. method: 'PUT',
  53. data: data
  54. })
  55. }
  56. //
  57. export const resumeOrder = (gxtWorkOrder: acceptOrderInfo | null): Promise<any> => {
  58. const plainObject = gxtWorkOrder != null ? JSON.parse(JSON.stringify(gxtWorkOrder)) : null;
  59. const data: UTSJSONObject | null = plainObject as UTSJSONObject;
  60. return request({
  61. url: `/mobile/order/resume`,
  62. method: 'PUT',
  63. data: data
  64. })
  65. }
  66. export const returnRepairOrder = (gxtWorkOrder: UTSJSONObject | null): Promise<any> => {
  67. // const plainObject = gxtWorkOrder != null ? JSON.parse(JSON.stringify(gxtWorkOrder)) : null;
  68. // const data: UTSJSONObject | null = plainObject as UTSJSONObject;
  69. return request({
  70. url: `/mobile/order/returnRepairOrder`,
  71. method: 'PUT',
  72. data: gxtWorkOrder
  73. })
  74. }
  75. export const resetAndStart = (gxtWorkOrder: UTSJSONObject | null): Promise<any> => {
  76. // const plainObject = gxtWorkOrder != null ? JSON.parse(JSON.stringify(gxtWorkOrder)) : null;
  77. // const data: UTSJSONObject | null = plainObject as UTSJSONObject;
  78. return request({
  79. url: `/mobile/order/resetAndStart`,
  80. method: 'PUT',
  81. data: gxtWorkOrder
  82. })
  83. }
  84. // 维保工单结单
  85. export const finishOrder = (gxtWorkOrder: UTSJSONObject | null): Promise<any> => {
  86. return request({
  87. url: `/mobile/order/finish`,
  88. method: 'PUT',
  89. data: gxtWorkOrder
  90. })
  91. }
  92. // 维修工单结单
  93. export const repairFinishOrder = (gxtWorkOrder: UTSJSONObject | null): Promise<any> => {
  94. return request({
  95. url: `/mobile/order/repairFinish`,
  96. method: 'PUT',
  97. data: gxtWorkOrder
  98. })
  99. }
  100. // 维保工单停机
  101. export const shutdownOrder = (gxtWorkOrder: UTSJSONObject | null): Promise<any> => {
  102. return request({
  103. url: `/mobile/order/shutdown`,
  104. method: 'PUT',
  105. data: gxtWorkOrder
  106. })
  107. }