fix: 库存批次改为车型名称、区域待交车数量始终显示
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

- 库存统计:移除批次筛选(原显示contractNo),batch字段改为model
- 区域Tab:待交车和库存数量即使为0也显示数字,移除|| ''和if守卫
- 桌面端和移动端的pendingCount/inventory全部始终显示

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
kkfluous
2026-03-28 22:49:57 +08:00
parent 24b66f68b5
commit 0eb4485af4
2 changed files with 8 additions and 16 deletions

View File

@@ -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);