detail.uts 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. }