From 0eb4485af445d0415c1a06afbf2f4aff4a113a56 Mon Sep 17 00:00:00 2001 From: kkfluous Date: Sat, 28 Mar 2026 22:49:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BA=93=E5=AD=98=E6=89=B9=E6=AC=A1?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E8=BD=A6=E5=9E=8B=E5=90=8D=E7=A7=B0=E3=80=81?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E5=BE=85=E4=BA=A4=E8=BD=A6=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E5=A7=8B=E7=BB=88=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 库存统计:移除批次筛选(原显示contractNo),batch字段改为model - 区域Tab:待交车和库存数量即使为0也显示数字,移除|| ''和if守卫 - 桌面端和移动端的pendingCount/inventory全部始终显示 Co-Authored-By: Claude Opus 4.6 (1M context) --- src/App.tsx | 17 +++++------------ src/server/routes/vehicles.ts | 7 +++---- 2 files changed, 8 insertions(+), 16 deletions(-) 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);