diff --git a/src/pages/05_quotation/MainPage.vue b/src/pages/05_quotation/MainPage.vue index f554c6aa..b8f3590f 100644 --- a/src/pages/05_quotation/MainPage.vue +++ b/src/pages/05_quotation/MainPage.vue @@ -6,7 +6,7 @@ import { storeToRefs } from 'pinia'; // NOTE: Import stores import { useQuotationStore } from 'src/stores/quotations'; -import { isRoleInclude } from 'stores/utils'; +import useUtilsStore, { isRoleInclude } from 'stores/utils'; import useFlowStore from 'src/stores/flow'; import useMyBranch from 'stores/my-branch'; import { useQuotationForm } from './form'; @@ -25,6 +25,7 @@ import CreateButton from 'src/components/AddButton.vue'; import ItemCard from 'src/components/ItemCard.vue'; import DialogForm from 'components/DialogForm.vue'; import SideMenu from 'components/SideMenu.vue'; +import NoData from 'src/components/NoData.vue'; import { dialogCreateCustomerItem } from 'src/pages/03_customer-management/constant'; @@ -44,6 +45,7 @@ const quotationFormStore = useQuotationForm(); const customerFormStore = useCustomerForm(); const flowStore = useFlowStore(); const userBranch = useMyBranch(); +const utilsStore = useUtilsStore(); const { currentFormData: quotationFormData, @@ -68,6 +70,7 @@ const pageState = reactive({ inputSearch: '', fieldSelected: [], gridView: true, + total: 0, currentTab: 'all', addModal: false, @@ -218,6 +221,17 @@ const { } = storeToRefs(quotationStore); onMounted(async () => { + utilsStore.currentTitle.title = 'quotation.title'; + utilsStore.currentTitle.path = [ + { + text: 'quotation.caption', + i18n: true, + handler: () => { + pageState.currentTab = 'all'; + }, + }, + ]; + { const ret = await quotationStore.getQuotationStats(); if (ret) { @@ -234,6 +248,7 @@ onMounted(async () => { if (ret) { quotationData.value = ret.result; quotationPageMax.value = Math.ceil(ret.total / quotationPageSize.value); + pageState.total = ret.total; } } @@ -315,7 +330,19 @@ async function storeDataLocal(id: string) { color: hsl(var(--info-bg)); " > - {{ '0' }} + {{ + pageState.currentTab === 'all' + ? pageState.total + : pageState.currentTab === 'fullAmountCash' + ? quotationStats.full + : pageState.currentTab === 'installmentsCash' + ? quotationStats.split + : pageState.currentTab === 'fullAmountBill' + ? quotationStats.billFull + : pageState.currentTab === 'installmentsBill' + ? quotationStats.billSplit + : 0 + }} + + {{ $t('general.recordsPage', { - resultcurrentPage: 0, - total: 0, + resultcurrentPage: quotationData.length, + total: pageState.total, }) }}