feat(platform): add customer report cadence

This commit is contained in:
lingniu
2026-07-05 17:05:06 +08:00
parent 8765ac002a
commit 8f9180f2ed
3 changed files with 150 additions and 0 deletions

View File

@@ -1044,6 +1044,44 @@ export function History({
onClick: () => copyScheduledHistoryReportPlan()
}
];
const customerReportCadenceItems = [
{
title: '每日运营复盘',
value: `${locations.total.toLocaleString()} 位置`,
detail: '每天交付位置历史、轨迹覆盖、里程统计和质量提示,便于运营早会复盘。',
action: '日报导出',
color: locations.total > 0 ? 'green' as const : 'orange' as const,
disabled: locations.items.length === 0,
onClick: () => exportLocations()
},
{
title: '每周客户对账',
value: '周报计划',
detail: '沉淀固定车辆范围、时间窗和交付物,按周给客户对账和复核。',
action: '周报计划',
color: 'blue' as const,
disabled: false,
onClick: () => copyScheduledHistoryReportPlan()
},
{
title: '临时问题解释',
value: deliveryState,
detail: '遇到定位、里程或断链质疑时,复制交付说明并附上证据链接。',
action: '复制说明',
color: deliveryStateColor,
disabled: false,
onClick: () => copyDeliveryPackage()
},
{
title: '字段模板复用',
value: selectedFieldCount > 0 ? `${selectedFieldCount.toLocaleString()} 字段` : '待配置',
detail: '复用字段裁剪模板,减少 CSV 体积并保证客户拿到稳定字段。',
action: '字段配置',
color: selectedFieldCount > 0 || rawFieldRows.length > 0 ? 'green' as const : 'orange' as const,
disabled: false,
onClick: () => openQueryTab('fields')
}
];
const customerHistoryQuestions = [
{
question: '这辆车这段时间在哪里?',
@@ -1532,6 +1570,40 @@ export function History({
</div>
</Card>
) : null}
{mode === 'query' ? (
<Card bordered title="客户报表交付节奏" style={{ marginTop: 16 }}>
<div className="vp-history-report-cadence">
<div className="vp-history-report-cadence-summary">
<Space wrap>
<Tag color="blue"></Tag>
<Tag color={deliveryStateColor}>{deliveryState}</Tag>
<Tag color={currentVehicleKeyword ? 'green' : 'grey'}>{currentVehicleKeyword ? '单车交付' : '批量交付'}</Tag>
</Space>
<Typography.Title heading={5} style={{ margin: 0 }}> FleetioSamsaraGeotab </Typography.Title>
<Typography.Text type="secondary">
</Typography.Text>
</div>
<div className="vp-history-report-cadence-grid">
{customerReportCadenceItems.map((item) => (
<button
key={item.title}
type="button"
className="vp-history-report-cadence-item"
disabled={item.disabled}
onClick={item.onClick}
aria-label={`客户报表交付节奏 ${item.title} ${item.action}`}
>
<Tag color={item.color}>{item.title}</Tag>
<strong>{item.value}</strong>
<span>{item.detail}</span>
<em>{item.action}</em>
</button>
))}
</div>
</div>
</Card>
) : null}
{mode === 'query' ? (
<Card bordered title="客户历史问题" style={{ marginTop: 16 }}>
<div className="vp-history-question-board">