feat(platform): add customer mileage question flow
This commit is contained in:
@@ -1227,6 +1227,48 @@ export function Mileage({
|
||||
onClick: copyOnlineOperationsReport
|
||||
}
|
||||
];
|
||||
const mileageCustomerQuestions = [
|
||||
{
|
||||
question: '这段时间总共跑了多少?',
|
||||
answer: `${formatKm(summary.totalMileageKm)} km / ${summary.vehicleCount.toLocaleString()} 辆车`,
|
||||
action: '复制摘要',
|
||||
color: 'blue' as const,
|
||||
disabled: false,
|
||||
onClick: copyStatisticsSummary
|
||||
},
|
||||
{
|
||||
question: '这份里程能给客户或 BI 吗?',
|
||||
answer: `${mileageDeliveryState} / ${publishAuditConclusion}`,
|
||||
action: mileageDeliveryState === '可交付' ? '复制交付包' : '发布审计',
|
||||
color: mileageDeliveryColor,
|
||||
disabled: false,
|
||||
onClick: mileageDeliveryState === '可交付' ? copyMileageDeliveryPackage : copyPublishAudit
|
||||
},
|
||||
{
|
||||
question: '哪天或哪辆车有异常?',
|
||||
answer: anomalyRows[0] ? `${anomalyRows[0].plate || anomalyRows[0].vin} / ${anomalyRows[0].date}` : '当前明细无异常',
|
||||
action: anomalyRows[0] ? '异常证据' : '复制决策',
|
||||
color: anomalyRows.length > 0 ? 'orange' as const : 'green' as const,
|
||||
disabled: false,
|
||||
onClick: () => anomalyRows[0] ? copyMileageEvidence(anomalyRows[0]) : copyMileageDecision()
|
||||
},
|
||||
{
|
||||
question: '这段路能回放轨迹吗?',
|
||||
answer: currentVehicleKeyword ? mileageRangeText : '请先选择车辆',
|
||||
action: '轨迹复核',
|
||||
color: currentVehicleKeyword ? 'blue' as const : 'grey' as const,
|
||||
disabled: !currentVehicleKeyword || !onOpenHistory,
|
||||
onClick: () => onOpenHistory?.({ keyword: currentVehicleKeyword, protocol: currentProtocol, dateFrom: filters.dateFrom ?? '', dateTo: filters.dateTo ?? '' })
|
||||
},
|
||||
{
|
||||
question: '明细数据能导出吗?',
|
||||
answer: `${rows.length.toLocaleString()} 条当前页 / 覆盖 ${formatPercent(pageCoverageRate)}`,
|
||||
action: '导出明细',
|
||||
color: rows.length > 0 ? 'blue' as const : 'grey' as const,
|
||||
disabled: rows.length === 0,
|
||||
onClick: exportMileage
|
||||
}
|
||||
];
|
||||
|
||||
useEffect(() => {
|
||||
const nextFilters = mergeInitialFilters(initialVin, initialProtocol, initialFilters);
|
||||
@@ -1289,6 +1331,24 @@ export function Mileage({
|
||||
))}
|
||||
</div>
|
||||
</Card>
|
||||
<Card bordered title="客户里程问题" style={{ marginTop: 16 }}>
|
||||
<div className="vp-mileage-question-grid">
|
||||
{mileageCustomerQuestions.map((item) => (
|
||||
<button
|
||||
key={item.question}
|
||||
type="button"
|
||||
className="vp-mileage-question-item"
|
||||
disabled={item.disabled}
|
||||
onClick={item.onClick}
|
||||
aria-label={`客户里程问题 ${item.question} ${item.action}`}
|
||||
>
|
||||
<strong>{item.question}</strong>
|
||||
<span>{item.answer}</span>
|
||||
<Tag color={item.color}>{item.action}</Tag>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</Card>
|
||||
<Card bordered title="里程报告建议" style={{ marginTop: 16 }}>
|
||||
<div className="vp-mileage-next-actions">
|
||||
<div className="vp-mileage-next-summary">
|
||||
|
||||
Reference in New Issue
Block a user