diff --git a/src/App.tsx b/src/App.tsx index 8ca133c..ee8714e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -957,13 +957,6 @@ export default function App() { {uniqueInventoryBrands.map(b => )} -
- - -
@@ -1911,7 +1904,7 @@ export default function App() { { e.stopPropagation(); setShowPlateNumbers({ batch: 'All', model: 'All', location: r.region, source: 'region', title: `区域运营统计 - ${r.region}` }); }}>{r.totalAssets} { e.stopPropagation(); setShowPlateNumbers({ batch: 'All', model: 'All', location: r.region, category: 'Operating', source: 'region', title: `区域运营统计 - ${r.region} - 正在运营` }); }}>{r.operatingCount} - { e.stopPropagation(); if (r.pendingCount) setShowPlateNumbers({ batch: 'All', model: 'All', location: r.region, category: 'Pending', source: 'region', title: `区域运营统计 - ${r.region} - 待交车` }); }}>{r.pendingCount || ''} + { e.stopPropagation(); setShowPlateNumbers({ batch: 'All', model: 'All', location: r.region, category: 'Pending', source: 'region', title: `区域运营统计 - ${r.region} - 待交车` }); }}>{r.pendingCount} {r.customers.slice(0, 2).join(', ')} {isExpanded && r.cities.map((city) => { @@ -1930,7 +1923,7 @@ export default function App() { { e.stopPropagation(); setShowPlateNumbers({ batch: 'All', model: 'All', location: city.city, source: 'region', title: `区域运营统计 - ${city.city}` }); }}>{city.totalAssets} { e.stopPropagation(); setShowPlateNumbers({ batch: 'All', model: 'All', location: city.city, category: 'Operating', source: 'region', title: `区域运营统计 - ${city.city} - 正在运营` }); }}>{city.operatingCount} - { e.stopPropagation(); if (city.pendingCount) setShowPlateNumbers({ batch: 'All', model: 'All', location: city.city, category: 'Pending', source: 'region', title: `区域运营统计 - ${city.city} - 待交车` }); }}>{city.pendingCount || ''} + { e.stopPropagation(); setShowPlateNumbers({ batch: 'All', model: 'All', location: city.city, category: 'Pending', source: 'region', title: `区域运营统计 - ${city.city} - 待交车` }); }}>{city.pendingCount} {city.customers.slice(0, 2).join(', ')} {isCityExpanded && city.typeBreakdown.map(tb => ( @@ -1941,7 +1934,7 @@ export default function App() { setShowPlateNumbers({ batch: 'All', model: 'All', location: city.city, vehicleType: tb.type, source: 'region', title: `区域运营统计 - ${city.city} - ${tb.type}` })}>{tb.total} setShowPlateNumbers({ batch: 'All', model: 'All', location: city.city, vehicleType: tb.type, category: 'Operating', source: 'region', title: `区域运营统计 - ${city.city} - ${tb.type} - 正在运营` })}>{tb.operating} - { if (tb.inventory) setShowPlateNumbers({ batch: 'All', model: 'All', location: city.city, vehicleType: tb.type, category: 'Inventory', source: 'region', title: `区域运营统计 - ${city.city} - ${tb.type} - 库存` }); }}>{tb.inventory || ''} + { setShowPlateNumbers({ batch: 'All', model: 'All', location: city.city, vehicleType: tb.type, category: 'Inventory', source: 'region', title: `区域运营统计 - ${city.city} - ${tb.type} - 库存` }); }}>{tb.inventory} {tb.customers.slice(0, 2).join(', ')} ))} @@ -1987,7 +1980,7 @@ export default function App() { onClick={() => setShowPlateNumbers({ batch: 'All', model: 'All', location: r.region, category: 'Pending', source: 'region', title: `区域运营统计 - ${r.region} - 待交车` })} >
待交车
-
{r.pendingCount || ''}
+
{r.pendingCount}
@@ -2005,7 +1998,7 @@ export default function App() { className="font-bold text-orange-600 cursor-pointer" onClick={() => setShowPlateNumbers({ batch: 'All', model: 'All', location: r.region, vehicleType: tb.type, category: 'Inventory', source: 'region', title: `区域运营统计 - ${r.region} - ${tb.type} - 库存` })} > - 待:{tb.inventory || ''} + 待:{tb.inventory}
diff --git a/src/server/routes/vehicles.ts b/src/server/routes/vehicles.ts index 5e5081f..b64b969 100644 --- a/src/server/routes/vehicles.ts +++ b/src/server/routes/vehicles.ts @@ -970,15 +970,14 @@ app.get('/inventory-stats', async (c) => { const city = resolveCity(v.city, v.province); const brand = v.brandLabel || '未知'; const model = v.model; - const batch = v.contractNo || 'N/A'; - const key = `${region}|${city}|${brand}|${typeName}|${model}|${batch}`; + const key = `${region}|${city}|${brand}|${typeName}|${model}`; groups.set(key, (groups.get(key) || 0) + 1); } const result = Array.from(groups.entries()) .map(([key, quantity]) => { - const [region, city, brand, type, model, batch] = key.split('|'); - return { region, city, brand, type, model, batch, quantity }; + const [region, city, brand, type, model] = key.split('|'); + return { region, city, brand, type, model, batch: model, quantity }; }) .sort((a, b) => b.quantity - a.quantity);