diff --git a/src/App.tsx b/src/App.tsx index 21b9e38..55ded30 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -346,17 +346,17 @@ export default function App() { 总计 - {SUMMARY.totalAssets} - {SUMMARY.inventory.total} + {processedData.reduce((s, t) => s + t.totalAssets, 0)} + {processedData.reduce((s, t) => s + t.totalInventory, 0)} {['嘉兴', '广东', '北京', '新疆', '其他'].map((reg) => { - const val = processedData.reduce((sum, t) => sum + (t.inventoryRegions?.[reg] || 0), 0); + const val = processedData.reduce((s, t) => s + (t.inventoryRegions?.[reg] || 0), 0); return {val || ''}; })} - {SUMMARY.pendingDelivery || ''} - {SUMMARY.operating.total} - {SUMMARY.weeklyDelivered || ''} - {SUMMARY.weeklyReturned || ''} - {SUMMARY.weeklyReplaced || ''} + {processedData.reduce((s, t) => s + t.pending, 0) || ''} + {processedData.reduce((s, t) => s + t.totalOperating, 0)} + {processedData.reduce((s, t) => s + t.weeklyDelivered, 0) || ''} + {processedData.reduce((s, t) => s + t.weeklyReturned, 0) || ''} + {processedData.reduce((s, t) => s + t.weeklyReplaced, 0) || ''} diff --git a/src/server/routes/vehicles.ts b/src/server/routes/vehicles.ts index 034a78f..f0cd88e 100644 --- a/src/server/routes/vehicles.ts +++ b/src/server/routes/vehicles.ts @@ -320,9 +320,9 @@ function getStats(list: Vehicle[], weeklyIds?: WeeklyTruckIds) { const strIds = list.map((v) => String(v.id)); return { total: list.length, - inventory: list.filter((v) => v.status === 'Inventory').length, + inventory: list.filter((v) => v.status === 'Inventory' || v.status === 'Abnormal').length, inventoryRegions: getRegionCounts( - list.filter((v) => v.status === 'Inventory'), + list.filter((v) => v.status === 'Inventory' || v.status === 'Abnormal'), REGIONS, ), pending: list.filter((v) => v.status === 'Pending').length,