123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- package order
- import "zhiyuan/pkg/param/common"
- // 订单维修类型
- type TType struct {
- ID int `json:"id"`
- Name string `json:"name"`
- Parent int `json:"parent"`
- }
- type TState struct {
- ID int `json:"id"`
- Name string `json:"name"`
- SupervisorName string `json:"supervisor_name"`
- CustomerName string `json:"customer_name"`
- Color string `json:"color"`
- }
- var State = struct {
- Revoked TState
- Unfinished TState
- Created TState
- Checked TState
- Allotted TState
- SupConfirmed TState
- Repairing TState
- Suspending TState
- Repaired TState
- Confirmed TState
- Completed TState
- ForceCompleted TState
- }{
- Revoked: TState{-1, "已撤销", "已撤销", "已撤销", "gray-300"},
- Unfinished: TState{-2, "未完成", "未完成", "未完成", "gray-200"},
- Created: TState{10, "待审核", "待审核", "待审核", "gray-500"},
- Checked: TState{20, "待分配", "待分配", "待分配", "yellow-500"},
- Allotted: TState{30, "待维修", "待确认", "待维修", "blue-500"},
- SupConfirmed: TState{40, "已接单", "处理中", "已接单", "indigo-500"},
- Repairing: TState{50, "维修中", "处理中", "维修中", "indigo-500"},
- Suspending: TState{51, "维修待定", "维修待定", "维修待定", "red-500"},
- Repaired: TState{60, "已维修", "维修已提交", "已维修", "purple-500"},
- Confirmed: TState{70, "已确认", "客户已确认", "已确认", "green-500"},
- Completed: TState{90, "正常完结", "正常完结", "已完结", "red-500"},
- ForceCompleted: TState{100, "强制完结", "强制完结", "维修中", "indigo-500"},
- }
- var Allow = struct {
- Delete []int
- Check []int
- Revoke []int
- Allot []int
- ReAllot []int
- SupConfirm []int
- Repairing []int
- Suspend []int
- Feedback []int
- Confirm []int
- Repaired []int
- Complete []int
- ForceComplete []int
- }{
- Delete: []int{State.Created.ID},
- Check: []int{State.Created.ID},
- Revoke: []int{State.Created.ID, State.Checked.ID},
- Allot: []int{State.Suspending.ID, State.Checked.ID},
- ReAllot: []int{State.Suspending.ID, State.Allotted.ID},
- SupConfirm: []int{State.Allotted.ID},
- Repairing: []int{State.SupConfirmed.ID},
- Feedback: []int{State.Repairing.ID, State.Confirmed.ID},
- Confirm: []int{State.Repairing.ID},
- Repaired: []int{State.Confirmed.ID},
- Suspend: []int{State.Repairing.ID, State.Repaired.ID, State.Confirmed.ID},
- Complete: []int{State.Repaired.ID},
- ForceComplete: []int{State.Allotted.ID, State.Repairing.ID},
- }
- var Params = struct {
- Type []TType `json:"order_type"`
- State []TState `json:"order_state"`
- RepairState []common.Base `json:"repair_state"`
- IssueDirector []common.Base `json:"issue_director"`
- }{
- Type: []TType{
- {100, "工程问题", 0},
- {101, "水电", 100},
- {102, "泥工", 100},
- {103, "木工", 100},
- {104, "油漆工", 100},
- {200, "材料问题", 0},
- {201, "瓷砖", 200},
- {202, "地板", 200},
- {203, "洁具", 200},
- {204, "门类", 200},
- {205, "柜子类", 200},
- {206, "电器类", 200},
- {207, "吊顶类", 200},
- },
- State: []TState{
- State.Revoked,
- State.Unfinished,
- State.Created,
- State.Checked,
- State.Allotted,
- State.SupConfirmed,
- State.Repairing,
- State.Suspending,
- State.Repaired,
- State.Confirmed,
- State.Completed,
- State.ForceCompleted,
- },
- RepairState: []common.Base{
- common.Base{1, "已解决"},
- common.Base{-1, "处理中"},
- },
- IssueDirector: []common.Base{
- common.Base{1, "材料商"},
- common.Base{2, "开发商"},
- common.Base{3, "设计师"},
- common.Base{4, "项目经理"},
- common.Base{5, "业主原因"},
- },
- }
- func GetIssueDirectorMap() map[int]string {
- issueMap := make(map[int]string)
- for _, v := range Params.IssueDirector {
- issueMap[v.ID] = v.Name
- }
- return issueMap
- }
|