From 941dea1a08c2a3bf8b70db961cf188370bda2915 Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Thu, 7 Nov 2024 14:23:55 +0700 Subject: [PATCH] refactor: edit tab --- src/pages/05_quotation/MainPage.vue | 105 ++++++++++++++++++---------- 1 file changed, 67 insertions(+), 38 deletions(-) diff --git a/src/pages/05_quotation/MainPage.vue b/src/pages/05_quotation/MainPage.vue index 41285873..33c0618c 100644 --- a/src/pages/05_quotation/MainPage.vue +++ b/src/pages/05_quotation/MainPage.vue @@ -72,7 +72,7 @@ const pageState = reactive({ gridView: true, total: 0, - currentTab: 'all', + currentTab: 'Issued', addModal: false, quotationModal: false, employeeModal: false, @@ -227,7 +227,7 @@ onMounted(async () => { text: 'quotation.caption', i18n: true, handler: () => { - pageState.currentTab = 'all'; + pageState.currentTab = 'Issued'; }, }, ]; @@ -243,6 +243,8 @@ onMounted(async () => { const ret = await quotationStore.getQuotationList({ page: quotationPage.value, pageSize: quotationPageSize.value, + status: 'Issued', + urgentFirst: true, }); if (ret) { @@ -257,20 +259,24 @@ onMounted(async () => { async function fetchQuotationList() { { + console.log(pageState.currentTab); const ret = await quotationStore.getQuotationList({ page: quotationPage.value, pageSize: quotationPageSize.value, - payCondition: - pageState.currentTab !== 'all' + status: + pageState.currentTab !== 'Issued' ? ( { - fullAmountCash: 'Full', - installmentsCash: 'Split', - installmentsCustomCash: 'SplitCustom', + Accepted: 'Accepted', + Expired: 'Expired', + Invoice: 'PaymentInProcess', + PaymentSuccess: 'PaymentSuccess', + ProcessComplete: 'ProcessComplete', } as const )[pageState.currentTab] - : undefined, + : 'Issued', query: pageState.inputSearch, + urgentFirst: true, }); if (ret) { @@ -331,15 +337,19 @@ async function storeDataLocal(id: string) { " > {{ - pageState.currentTab === 'all' - ? pageState.total - : pageState.currentTab === 'fullAmountCash' - ? quotationStats.full - : pageState.currentTab === 'installmentsCash' - ? quotationStats.split - : pageState.currentTab === 'installmentsCustomCash' - ? quotationStats.splitCustom - : 0 + pageState.currentTab === 'Issued' + ? quotationStats.issued + : pageState.currentTab === 'Accepted' + ? quotationStats.accepted + : pageState.currentTab === 'Expired' + ? quotationStats.expired + : pageState.currentTab === 'Invoice' + ? quotationStats.paymentInProcess + : pageState.currentTab === 'PaymentSuccess' + ? quotationStats.paymentSuccess + : pageState.currentTab === 'ProcessComplete' + ? quotationStats.processComplete + : 0 }} - {{ $t(`quotation.type.${tab}`) }} + {{ $t(`quotation.status.${tab}`) }}