order.go 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. package order
  2. import "zhiyuan/pkg/param/common"
  3. // 订单维修类型
  4. type TType struct {
  5. ID int `json:"id"`
  6. Name string `json:"name"`
  7. Parent int `json:"parent"`
  8. }
  9. type TState struct {
  10. ID int `json:"id"`
  11. Name string `json:"name"`
  12. SupervisorName string `json:"supervisor_name"`
  13. CustomerName string `json:"customer_name"`
  14. Color string `json:"color"`
  15. }
  16. var State = struct {
  17. Revoked TState
  18. Unfinished TState
  19. Created TState
  20. Checked TState
  21. Allotted TState
  22. SupConfirmed TState
  23. Repairing TState
  24. Suspending TState
  25. Repaired TState
  26. Confirmed TState
  27. Completed TState
  28. ForceCompleted TState
  29. }{
  30. Revoked: TState{-1, "已撤销", "已撤销", "已撤销", "gray-300"},
  31. Unfinished: TState{-2, "未完成", "未完成", "未完成", "gray-200"},
  32. Created: TState{10, "待审核", "待审核", "待审核", "gray-500"},
  33. Checked: TState{20, "待分配", "待分配", "待分配", "yellow-500"},
  34. Allotted: TState{30, "待维修", "待确认", "待维修", "blue-500"},
  35. SupConfirmed: TState{40, "已接单", "处理中", "已接单", "indigo-500"},
  36. Repairing: TState{50, "维修中", "处理中", "维修中", "indigo-500"},
  37. Suspending: TState{51, "维修待定", "维修待定", "维修待定", "red-500"},
  38. Repaired: TState{60, "已维修", "维修已提交", "已维修", "purple-500"},
  39. Confirmed: TState{70, "已确认", "客户已确认", "已确认", "green-500"},
  40. Completed: TState{90, "正常完结", "正常完结", "已完结", "red-500"},
  41. ForceCompleted: TState{100, "强制完结", "强制完结", "维修中", "indigo-500"},
  42. }
  43. var Allow = struct {
  44. Delete []int
  45. Check []int
  46. Revoke []int
  47. Allot []int
  48. ReAllot []int
  49. SupConfirm []int
  50. Repairing []int
  51. Suspend []int
  52. Feedback []int
  53. Confirm []int
  54. Repaired []int
  55. Complete []int
  56. ForceComplete []int
  57. }{
  58. Delete: []int{State.Created.ID},
  59. Check: []int{State.Created.ID},
  60. Revoke: []int{State.Created.ID, State.Checked.ID},
  61. Allot: []int{State.Suspending.ID, State.Checked.ID},
  62. ReAllot: []int{State.Suspending.ID, State.Allotted.ID},
  63. SupConfirm: []int{State.Allotted.ID},
  64. Repairing: []int{State.SupConfirmed.ID},
  65. Feedback: []int{State.Repairing.ID, State.Confirmed.ID},
  66. Confirm: []int{State.Repairing.ID},
  67. Repaired: []int{State.Confirmed.ID},
  68. Suspend: []int{State.Repairing.ID, State.Repaired.ID, State.Confirmed.ID},
  69. Complete: []int{State.Repaired.ID},
  70. ForceComplete: []int{State.Allotted.ID, State.Repairing.ID},
  71. }
  72. var Params = struct {
  73. Type []TType `json:"order_type"`
  74. State []TState `json:"order_state"`
  75. RepairState []common.Base `json:"repair_state"`
  76. IssueDirector []common.Base `json:"issue_director"`
  77. }{
  78. Type: []TType{
  79. {100, "工程问题", 0},
  80. {101, "水电", 100},
  81. {102, "泥工", 100},
  82. {103, "木工", 100},
  83. {104, "油漆工", 100},
  84. {200, "材料问题", 0},
  85. {201, "瓷砖", 200},
  86. {202, "地板", 200},
  87. {203, "洁具", 200},
  88. {204, "门类", 200},
  89. {205, "柜子类", 200},
  90. {206, "电器类", 200},
  91. {207, "吊顶类", 200},
  92. },
  93. State: []TState{
  94. State.Revoked,
  95. State.Unfinished,
  96. State.Created,
  97. State.Checked,
  98. State.Allotted,
  99. State.SupConfirmed,
  100. State.Repairing,
  101. State.Suspending,
  102. State.Repaired,
  103. State.Confirmed,
  104. State.Completed,
  105. State.ForceCompleted,
  106. },
  107. RepairState: []common.Base{
  108. common.Base{1, "已解决"},
  109. common.Base{-1, "处理中"},
  110. },
  111. IssueDirector: []common.Base{
  112. common.Base{1, "材料商"},
  113. common.Base{2, "开发商"},
  114. common.Base{3, "设计师"},
  115. common.Base{4, "项目经理"},
  116. common.Base{5, "业主原因"},
  117. },
  118. }
  119. func GetIssueDirectorMap() map[int]string {
  120. issueMap := make(map[int]string)
  121. for _, v := range Params.IssueDirector {
  122. issueMap[v.ID] = v.Name
  123. }
  124. return issueMap
  125. }