feat(platform): add mileage definition delivery strip
This commit is contained in:
@@ -1446,6 +1446,66 @@ export function Mileage({
|
||||
onClick: exportMileage
|
||||
}
|
||||
];
|
||||
const mileageDefinitionMetrics = [
|
||||
{
|
||||
label: '区间总值',
|
||||
value: `${formatKm(summary.totalMileageKm)} km`,
|
||||
detail: `来自汇总口径,覆盖 ${summary.vehicleCount.toLocaleString()} 辆车。`,
|
||||
color: 'blue' as const,
|
||||
onClick: copyStatisticsSummary
|
||||
},
|
||||
{
|
||||
label: '明细合计',
|
||||
value: `${formatKm(pageMileageTotal)} km`,
|
||||
detail: `${rows.length.toLocaleString()} / ${summary.recordCount.toLocaleString()} 条明细,覆盖 ${formatPercent(pageCoverageRate)}。`,
|
||||
color: hasFullMileagePage ? 'green' as const : 'orange' as const,
|
||||
onClick: copyPublishAudit
|
||||
},
|
||||
{
|
||||
label: '闭合差值',
|
||||
value: closureDeltaKm == null ? '需全量' : `${formatKm(Math.abs(closureDeltaKm))} km`,
|
||||
detail: closureDeltaKm == null ? '当前为分页抽样,交付前需要拉齐全量明细。' : closureActionText,
|
||||
color: closureStatusColor,
|
||||
onClick: copyPublishAudit
|
||||
},
|
||||
{
|
||||
label: '异常记录',
|
||||
value: `${anomalyRows.length.toLocaleString()} 条`,
|
||||
detail: anomalyRows[0] ? `${anomalyRows[0].plate || anomalyRows[0].vin} / ${anomalyRows[0].date} 优先复核。` : '当前页没有异常日里程。',
|
||||
color: anomalyRows.length > 0 ? 'orange' as const : 'green' as const,
|
||||
onClick: () => anomalyRows[0] ? copyMileageEvidence(anomalyRows[0]) : copyMileageDecision()
|
||||
}
|
||||
];
|
||||
const mileageDefinitionActions = [
|
||||
{
|
||||
label: '复制口径',
|
||||
action: '决策说明',
|
||||
color: 'blue' as const,
|
||||
disabled: false,
|
||||
onClick: copyMileageDecision
|
||||
},
|
||||
{
|
||||
label: '复制交付',
|
||||
action: '交付包',
|
||||
color: mileageDeliveryColor,
|
||||
disabled: false,
|
||||
onClick: copyMileageDeliveryPackage
|
||||
},
|
||||
{
|
||||
label: '轨迹复核',
|
||||
action: '轨迹',
|
||||
color: currentVehicleKeyword ? 'blue' as const : 'grey' as const,
|
||||
disabled: !currentVehicleKeyword || !onOpenHistory,
|
||||
onClick: () => onOpenHistory?.({ keyword: currentVehicleKeyword, protocol: currentProtocol, dateFrom: filters.dateFrom ?? '', dateTo: filters.dateTo ?? '' })
|
||||
},
|
||||
{
|
||||
label: '导出明细',
|
||||
action: 'CSV',
|
||||
color: rows.length > 0 ? 'blue' as const : 'grey' as const,
|
||||
disabled: rows.length === 0,
|
||||
onClick: exportMileage
|
||||
}
|
||||
];
|
||||
const mileageServiceTasks = [
|
||||
{
|
||||
title: '发布判断',
|
||||
@@ -1655,6 +1715,51 @@ export function Mileage({
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
<section className="vp-mileage-definition-strip" aria-label="客户里程口径交付条">
|
||||
<div className="vp-mileage-definition-copy">
|
||||
<Space wrap>
|
||||
<Tag color="blue">客户里程口径交付条</Tag>
|
||||
<Tag color={closureStatusColor}>{closureStatus}</Tag>
|
||||
<Tag color={publishAuditColor}>{publishAuditConclusion}</Tag>
|
||||
</Space>
|
||||
<Typography.Title heading={5} style={{ margin: 0 }}>
|
||||
日里程按当天首末总里程差值计算;区间总值必须等于每日里程之和,异常日进入轨迹和历史明细复核。
|
||||
</Typography.Title>
|
||||
<Typography.Text type="secondary">
|
||||
这是客户、BI 和运营三方共用口径:同一车辆、同一时间窗、同一统计证据,导出前先看闭合差值和异常记录。
|
||||
</Typography.Text>
|
||||
</div>
|
||||
<div className="vp-mileage-definition-metrics">
|
||||
{mileageDefinitionMetrics.map((item) => (
|
||||
<button
|
||||
key={item.label}
|
||||
type="button"
|
||||
className="vp-mileage-definition-metric"
|
||||
onClick={item.onClick}
|
||||
aria-label={`客户里程口径交付 ${item.label} ${item.value}`}
|
||||
>
|
||||
<Tag color={item.color}>{item.label}</Tag>
|
||||
<strong>{item.value}</strong>
|
||||
<span>{item.detail}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<div className="vp-mileage-definition-actions">
|
||||
{mileageDefinitionActions.map((item) => (
|
||||
<button
|
||||
key={item.label}
|
||||
type="button"
|
||||
className="vp-mileage-definition-action"
|
||||
disabled={item.disabled}
|
||||
onClick={item.onClick}
|
||||
aria-label={`客户里程口径动作 ${item.label} ${item.action}`}
|
||||
>
|
||||
<Tag color={item.color}>{item.label}</Tag>
|
||||
<span>{item.action}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
<section className="vp-mileage-customer-workbench" aria-label="客户里程统计工作台">
|
||||
<div className="vp-mileage-customer-workbench-main">
|
||||
<Space wrap>
|
||||
|
||||
Reference in New Issue
Block a user