81 lines
2.5 KiB
Plaintext
81 lines
2.5 KiB
Plaintext
export type ServiceOrderStatus =
|
|
'created' |
|
|
'paid' |
|
|
'assigned' |
|
|
'accepted' |
|
|
'rejected' |
|
|
'departed' |
|
|
'arrived' |
|
|
'in_service' |
|
|
'completed' |
|
|
'pending_acceptance' |
|
|
'accepted_by_user' |
|
|
'reviewed' |
|
|
'settled' |
|
|
'cancelled' |
|
|
'exception'
|
|
|
|
export const SERVICE_ORDER_STATUS_LIST: Array<ServiceOrderStatus> = [
|
|
'created',
|
|
'paid',
|
|
'assigned',
|
|
'accepted',
|
|
'rejected',
|
|
'departed',
|
|
'arrived',
|
|
'in_service',
|
|
'completed',
|
|
'pending_acceptance',
|
|
'accepted_by_user',
|
|
'reviewed',
|
|
'settled',
|
|
'cancelled',
|
|
'exception'
|
|
]
|
|
|
|
export type ServiceOrderTimelineItemType = {
|
|
id: string
|
|
orderId: string
|
|
fromStatus: string
|
|
toStatus: ServiceOrderStatus
|
|
operatorId: string
|
|
operatorRole: string
|
|
remark: string
|
|
createdAt: string
|
|
}
|
|
|
|
export function getServiceOrderStatusText(status: ServiceOrderStatus): string {
|
|
if (status == 'created') return '待处理'
|
|
if (status == 'paid') return '已支付'
|
|
if (status == 'assigned') return '已派单'
|
|
if (status == 'accepted') return '已接单'
|
|
if (status == 'rejected') return '已拒单'
|
|
if (status == 'departed') return '已出发'
|
|
if (status == 'arrived') return '已到达'
|
|
if (status == 'in_service') return '服务中'
|
|
if (status == 'completed') return '已完成'
|
|
if (status == 'pending_acceptance') return '待验收'
|
|
if (status == 'accepted_by_user') return '已验收'
|
|
if (status == 'reviewed') return '已评价'
|
|
if (status == 'settled') return '已结算'
|
|
if (status == 'cancelled') return '已取消'
|
|
return '异常'
|
|
}
|
|
|
|
export function normalizeServiceOrderStatus(status: string): ServiceOrderStatus {
|
|
if (status == 'created' || status == 'submitted') return 'created'
|
|
if (status == 'paid') return 'paid'
|
|
if (status == 'assigned' || status == 'pending_dispatch' || status == 'pending_assignment') return 'assigned'
|
|
if (status == 'accepted' || status == 'pending_accept') return 'accepted'
|
|
if (status == 'rejected') return 'rejected'
|
|
if (status == 'departed' || status == 'waiting_departure' || status == 'on_the_way') return 'departed'
|
|
if (status == 'arrived' || status == 'checked_in') return 'arrived'
|
|
if (status == 'in_service' || status == 'serving') return 'in_service'
|
|
if (status == 'completed') return 'completed'
|
|
if (status == 'pending_acceptance' || status == 'pending_confirm' || status == 'pending_submit') return 'pending_acceptance'
|
|
if (status == 'accepted_by_user') return 'accepted_by_user'
|
|
if (status == 'reviewed') return 'reviewed'
|
|
if (status == 'settled') return 'settled'
|
|
if (status == 'cancelled') return 'cancelled'
|
|
return 'exception'
|
|
} |