feat(platform): link quality issues to mileage evidence
This commit is contained in:
@@ -264,12 +264,14 @@ async function copyQualityShareURL() {
|
||||
export function Quality({
|
||||
onOpenVehicle,
|
||||
onOpenHistory,
|
||||
onOpenMileage,
|
||||
onHealthLoaded,
|
||||
onFiltersChange,
|
||||
initialFilters = {}
|
||||
}: {
|
||||
onOpenVehicle: (vin: string, protocol?: string) => void;
|
||||
onOpenHistory?: (filters: Record<string, string>) => void;
|
||||
onOpenMileage?: (filters: Record<string, string>) => void;
|
||||
onHealthLoaded?: (health: OpsHealth) => void;
|
||||
onFiltersChange?: (filters: Record<string, string>) => void;
|
||||
initialFilters?: Record<string, string>;
|
||||
@@ -363,6 +365,17 @@ export function Quality({
|
||||
...(dateTo ? { dateTo } : {})
|
||||
});
|
||||
};
|
||||
const openIssueMileage = (row: QualityIssueRow) => {
|
||||
const lookup = qualityIssueVehicleLookup(row);
|
||||
const dateFrom = issueEvidenceDate(row.lastSeen);
|
||||
const dateTo = nextDate(dateFrom);
|
||||
onOpenMileage?.({
|
||||
keyword: lookup.key,
|
||||
protocol: row.protocol,
|
||||
...(dateFrom ? { dateFrom } : {}),
|
||||
...(dateTo ? { dateTo } : {})
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="vp-page">
|
||||
@@ -606,6 +619,7 @@ export function Quality({
|
||||
<Button size="small" icon={<IconCopy />} onClick={() => copyText(row.phone, '手机号')}>手机号</Button>
|
||||
<Button size="small" icon={<IconCopy />} onClick={() => copyText(row.sourceEndpoint, '来源')}>来源</Button>
|
||||
<Button size="small" disabled={!lookup.key || !onOpenHistory} onClick={() => openIssueHistory(row)}>核对历史</Button>
|
||||
<Button size="small" disabled={!lookup.key || !onOpenMileage} onClick={() => openIssueMileage(row)}>核对里程</Button>
|
||||
<Button size="small" disabled={!lookup.key} onClick={() => onOpenVehicle(lookup.key, row.protocol)}>
|
||||
{lookup.label}
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user