diff --git a/apps/web-antd/src/views/system/salesperson-dashboard/api/index.ts b/apps/web-antd/src/views/system/salesperson-dashboard/api/index.ts index 1c3e7d58..5c8a5cad 100644 --- a/apps/web-antd/src/views/system/salesperson-dashboard/api/index.ts +++ b/apps/web-antd/src/views/system/salesperson-dashboard/api/index.ts @@ -9,7 +9,8 @@ export type DashboardPeriod = | 'last30days' | 'this_year' | 'last365days' - | 'last_year'; + | 'last_year' + | 'custom'; export type SalespersonDashboardTrendItem = { label: string; @@ -36,6 +37,24 @@ export type SalespersonDashboardRankingItem = { amount?: string; }; +export type SalespersonDashboardStoreAmountItem = { + store_id: number; + name: string; + type: number; + type_label: string; + amount: string; + promoter_nick_name: string; +}; + +export type SalespersonDashboardInactiveStoreItem = { + store_id: number; + name: string; + type: number; + type_label: string; + input_at: number; + promoter_nick_name: string; +}; + export type SalespersonDashboardResult = { period: DashboardPeriod; start_at: number; @@ -58,8 +77,16 @@ export type SalespersonDashboardResult = { region_stats: SalespersonDashboardRegionItem[]; input_ranking: SalespersonDashboardRankingItem[]; amount_ranking: SalespersonDashboardRankingItem[]; + store_amount_ranking: SalespersonDashboardStoreAmountItem[]; + inactive_store_warnings: SalespersonDashboardInactiveStoreItem[]; }; -export async function getSalespersonDashboardApi(params: { period: DashboardPeriod }) { +export type SalespersonDashboardParams = { + period: DashboardPeriod; + start_at?: number; + end_at?: number; +}; + +export async function getSalespersonDashboardApi(params: SalespersonDashboardParams) { return requestClient.get(`${prefix}dashboard`, { params }); } diff --git a/apps/web-antd/src/views/system/salesperson-dashboard/components/InactiveStoreWarningList.vue b/apps/web-antd/src/views/system/salesperson-dashboard/components/InactiveStoreWarningList.vue new file mode 100644 index 00000000..fb6acc09 --- /dev/null +++ b/apps/web-antd/src/views/system/salesperson-dashboard/components/InactiveStoreWarningList.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/apps/web-antd/src/views/system/salesperson-dashboard/components/RegionDistributionChart.vue b/apps/web-antd/src/views/system/salesperson-dashboard/components/RegionDistributionChart.vue index d0ae9c2a..5d0faebc 100644 --- a/apps/web-antd/src/views/system/salesperson-dashboard/components/RegionDistributionChart.vue +++ b/apps/web-antd/src/views/system/salesperson-dashboard/components/RegionDistributionChart.vue @@ -60,12 +60,8 @@ async function renderChart() { watch( () => props.data, () => renderChart(), - { deep: true, flush: 'post' }, + { deep: true, immediate: true, flush: 'post' }, ); - -watch(showChart, (visible) => { - if (visible) renderChart(); -});