From 8023de14378a1e9c4f337420c9c21b772a00ded5 Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Tue, 4 Mar 2025 13:39:48 +0700 Subject: [PATCH 1/8] feat: add title --- src/pages/15_dash-board/MainPage.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pages/15_dash-board/MainPage.vue b/src/pages/15_dash-board/MainPage.vue index 081ecf2e..bd02a8aa 100644 --- a/src/pages/15_dash-board/MainPage.vue +++ b/src/pages/15_dash-board/MainPage.vue @@ -1,11 +1,20 @@ From 5ec7012119b961a7e0d75e03d4d33715554fa2e7 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Wed, 5 Mar 2025 14:11:06 +0700 Subject: [PATCH 2/8] feat: add dashboard localization for English and Thai --- src/i18n/eng.ts | 33 ++++++++++++++++++++++++++++++++- src/i18n/tha.ts | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/src/i18n/eng.ts b/src/i18n/eng.ts index 51e53bf9..aa6cedb5 100644 --- a/src/i18n/eng.ts +++ b/src/i18n/eng.ts @@ -1336,7 +1336,6 @@ export default { Succeed: 'Completed', }, }, - report: { report: { title: 'Report', @@ -1373,4 +1372,36 @@ export default { }, }, }, + dashboard: { + title: 'Dashboard', + newComer: 'New Interested Party', + openQuotation: 'Open Quotation', + paidSales: 'Paid Sales', + pendingSales: 'Pending Sales', + + receipt: { + title: 'Tax Invoice Summary', + caption: 'By Total Amount', + total: 'Total Amount', + paid: 'Partially & Fully Paid', + pending: 'Pending Payment', + cancel: 'Cancelled', + }, + opportunity: { + title: 'Sales Opportunity Screening', + caption: 'By Sales Opportunity Status', + }, + quotation: { + title: 'Quotations & Sales Orders', + caption: 'By Document Status', + waitCustomer: 'Waiting for Customer', + inProgress: 'In Progress', + complete: 'Complete', + cancel: 'Cancel', + }, + sales: { + title: 'Top 5 Highest Sales', + caption: 'Based on Tax Invoices', + }, + }, }; diff --git a/src/i18n/tha.ts b/src/i18n/tha.ts index 7d7b561f..8d165a65 100644 --- a/src/i18n/tha.ts +++ b/src/i18n/tha.ts @@ -1351,4 +1351,36 @@ export default { count: 'จำนวนที่ขาย', }, }, + dashboard: { + title: 'Dashboard', + newComer: 'ผู้สนใจใหม่', + openQuotation: 'ใบเสนอราคาที่เปิดอยู่', + paidSales: 'ยอดขายที่ชำระแล้ว', + pendingSales: 'ยอดขายที่รอชำระ', + + receipt: { + title: 'สรุปยอดใบกำกับภาษี', + caption: 'ตามจำนวนเงินรวม', + total: 'ยอดรวมทั้งหมด', + paid: 'ชำระไม่ครบและชำระครบ', + pending: 'รอชำระ', + cancel: 'ยกเลิก', + }, + opportunity: { + title: 'การคัดกรองโอกาสทางการขาย', + caption: 'ตามสถานะโอกาสทางการขาย', + }, + quotation: { + title: 'ใบเสนอราคาและใบสั่งขาย', + caption: 'ตามสถานะเอกสาร', + waitCustomer: 'รอลูกค้าตอบรับ', + inProgress: 'กำลังดำเนินการ', + complete: 'เสร็จสิ้น', + cancel: 'ยกเลิก', + }, + sales: { + title: '5 อันดับยอดขายสูงสุด', + caption: 'ตามใบกำกับภาษี', + }, + }, }; From f168b43b1afdf0e711afa52ac06b0f07815e933c Mon Sep 17 00:00:00 2001 From: puriphatt Date: Wed, 5 Mar 2025 14:11:16 +0700 Subject: [PATCH 3/8] feat: add new chart components for opportunity, quotation status, receipt, and sales --- .../15_dash-board/chart/ChartOpportunity.vue | 58 ++++++++ .../chart/ChartQuotationStatus.vue | 107 ++++++++++++++ .../15_dash-board/chart/ChartReceipt.vue | 131 ++++++++++++++++++ src/pages/15_dash-board/chart/ChartSales.vue | 75 ++++++++++ 4 files changed, 371 insertions(+) create mode 100644 src/pages/15_dash-board/chart/ChartOpportunity.vue create mode 100644 src/pages/15_dash-board/chart/ChartQuotationStatus.vue create mode 100644 src/pages/15_dash-board/chart/ChartReceipt.vue create mode 100644 src/pages/15_dash-board/chart/ChartSales.vue diff --git a/src/pages/15_dash-board/chart/ChartOpportunity.vue b/src/pages/15_dash-board/chart/ChartOpportunity.vue new file mode 100644 index 00000000..23900231 --- /dev/null +++ b/src/pages/15_dash-board/chart/ChartOpportunity.vue @@ -0,0 +1,58 @@ + + diff --git a/src/pages/15_dash-board/chart/ChartQuotationStatus.vue b/src/pages/15_dash-board/chart/ChartQuotationStatus.vue new file mode 100644 index 00000000..8792c6dd --- /dev/null +++ b/src/pages/15_dash-board/chart/ChartQuotationStatus.vue @@ -0,0 +1,107 @@ + + diff --git a/src/pages/15_dash-board/chart/ChartReceipt.vue b/src/pages/15_dash-board/chart/ChartReceipt.vue new file mode 100644 index 00000000..b48db65a --- /dev/null +++ b/src/pages/15_dash-board/chart/ChartReceipt.vue @@ -0,0 +1,131 @@ + + diff --git a/src/pages/15_dash-board/chart/ChartSales.vue b/src/pages/15_dash-board/chart/ChartSales.vue new file mode 100644 index 00000000..2cafbef2 --- /dev/null +++ b/src/pages/15_dash-board/chart/ChartSales.vue @@ -0,0 +1,75 @@ + + From 1c9874a9e792c4418b0de178297f1ceafa69356f Mon Sep 17 00:00:00 2001 From: puriphatt Date: Wed, 5 Mar 2025 14:11:20 +0700 Subject: [PATCH 4/8] feat: enhance dashboard with new chart components and role/year selection --- src/pages/15_dash-board/MainPage.vue | 137 ++++++++++++++++++++++++++- 1 file changed, 133 insertions(+), 4 deletions(-) diff --git a/src/pages/15_dash-board/MainPage.vue b/src/pages/15_dash-board/MainPage.vue index bd02a8aa..0a82c3a7 100644 --- a/src/pages/15_dash-board/MainPage.vue +++ b/src/pages/15_dash-board/MainPage.vue @@ -1,20 +1,149 @@ - + From 9a196b7077b886caf66000da47b03c18b4162dc0 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Wed, 5 Mar 2025 16:00:14 +0700 Subject: [PATCH 5/8] feat: integrate quotation statistics into dashboard and adjust layout for responsiveness --- src/pages/15_dash-board/MainPage.vue | 34 ++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/src/pages/15_dash-board/MainPage.vue b/src/pages/15_dash-board/MainPage.vue index 0a82c3a7..58ca2bd4 100644 --- a/src/pages/15_dash-board/MainPage.vue +++ b/src/pages/15_dash-board/MainPage.vue @@ -12,9 +12,13 @@ import ChartSales from './chart/ChartSales.vue'; // NOTE: Stores & Type import { useNavigator } from 'src/stores/navigator'; +import { useQuotationStore } from 'src/stores/quotations'; +import { storeToRefs } from 'pinia'; // NOTE: Variable const navigatorStore = useNavigator(); +const quotationStore = useQuotationStore(); +const { stats: quotationStats } = storeToRefs(quotationStore); const state = reactive({ role: 'admin', @@ -36,6 +40,12 @@ const option = reactive({ onMounted(async () => { navigatorStore.current.title = 'dashboard.title'; navigatorStore.current.path = [{ text: '' }]; + + const ret = await quotationStore.getQuotationStats(); + if (ret) { + quotationStats.value = Object.assign(quotationStats.value, ret); + console.log(quotationStats.value); + } });