Show aftersales stats and recent orders on dashboard

- Adds a second row of cards (total / pending / closed / rejected)
- New "最近售后工单" table linking to detail pages
- DashboardStats type extended; dashboardApi maps backend overview

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Frudrax Cheng
2026-05-26 11:04:25 +08:00
parent eab66bc3e9
commit f61004ba12
3 changed files with 156 additions and 4 deletions
+5
View File
@@ -212,6 +212,10 @@ export const dashboardApi = {
totalEmployeeSerials: data.overview?.totalEmployeeSerials || 0,
activeSerials: data.overview?.activeSerials || 0,
inactiveSerials: data.overview?.inactiveSerials || 0,
totalAftersales: data.overview?.totalAftersales || 0,
pendingConfirmation: data.overview?.pendingConfirmation || 0,
closedAftersales: data.overview?.closedAftersales || 0,
rejectedAftersales: data.overview?.rejectedAftersales || 0,
monthlyData: data.monthlyStats || [],
recentCompanies: data.recentCompanies?.map((c: any) => ({
id: c.companyName,
@@ -227,6 +231,7 @@ export const dashboardApi = {
createdAt: s.createdAt,
type: s.type,
})) || [],
recentAftersales: data.recentAftersales || [],
};
}
throw new Error('获取统计数据失败');