feat(finance): 统一履约事实并改造人工账单分类
This commit is contained in:
@@ -219,35 +219,41 @@ export function resolveOrderPlatformBadge(row: { platform?: string; provider?: s
|
||||
}
|
||||
|
||||
export function resolveOrderFulfillmentMode(row: {
|
||||
provider?: string
|
||||
platform?: string
|
||||
fulfillmentType?: 'auto_claim' | 'worker_dispatch' | 'voucher_only' | 'manual'
|
||||
workOrderCount?: number
|
||||
canClaimH5?: boolean
|
||||
taskCount?: number
|
||||
fulfillmentMode?:
|
||||
| 'work_order'
|
||||
| 'affiliate_dash'
|
||||
| 'legacy_platform'
|
||||
| 'manual'
|
||||
| 'pending'
|
||||
| 'mixed'
|
||||
}): { label: string; color: string } {
|
||||
const provider = String(row.provider || '').toLowerCase()
|
||||
switch (row.fulfillmentMode) {
|
||||
case 'affiliate_dash':
|
||||
return { label: '⚡ 自动发货', color: 'blue' }
|
||||
case 'work_order':
|
||||
return { label: '👥 接单平台', color: 'purple' }
|
||||
case 'legacy_platform':
|
||||
return { label: '🗄 历史平台', color: 'default' }
|
||||
case 'manual':
|
||||
return { label: '🙋 人工履约', color: 'orange' }
|
||||
case 'mixed':
|
||||
return { label: '🔀 混合履约', color: 'geekblue' }
|
||||
default:
|
||||
return { label: '⏳ 待判定', color: 'default' }
|
||||
}
|
||||
}
|
||||
|
||||
if (row.canClaimH5 || row.fulfillmentType === 'auto_claim' || provider === 'douyin_mashida') {
|
||||
return { label: '⚡ 自动直发', color: 'blue' }
|
||||
export function resolveVoucherStateLabel(state?: string) {
|
||||
switch (state) {
|
||||
case 'unused':
|
||||
return '核销码未用'
|
||||
case 'consumed':
|
||||
return '核销码已核销'
|
||||
case 'destroyed':
|
||||
return '核销码已销毁'
|
||||
case 'mixed':
|
||||
return '核销码混合状态'
|
||||
default:
|
||||
return ''
|
||||
}
|
||||
|
||||
if (row.fulfillmentType === 'worker_dispatch' || Number(row.workOrderCount || 0) > 0) {
|
||||
return { label: '👥 打手履约', color: 'purple' }
|
||||
}
|
||||
|
||||
if (
|
||||
provider === 'kuaishou_industry' ||
|
||||
provider === '91kaquan' ||
|
||||
provider === 'open_91' ||
|
||||
row.fulfillmentType === 'voucher_only'
|
||||
) {
|
||||
return { label: '🎫 电子凭证', color: 'gold' }
|
||||
}
|
||||
|
||||
if (provider === 'pdd') {
|
||||
return { label: '📦 拼多多发货', color: 'red' }
|
||||
}
|
||||
|
||||
return { label: '手动交付', color: 'default' }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user