diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index afa01594..989c9a55 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -29,6 +29,8 @@ import FormBusiness from 'src/components/03_customer-management/FormBusiness.vue import DrawerInfo from 'src/components/DrawerInfo.vue'; import InfoForm from 'src/components/02_personnel-management/InfoForm.vue'; import CustomerInfoComponent from 'src/components/03_customer-management/CustomerInfoComponent.vue'; +import NoData from 'components/NoData.vue'; + import { CustomerCreate, CustomerStats, @@ -111,7 +113,7 @@ const formData = ref({ image: null, }); -const inputSearch = ref(''); +const inputSearch = ref(); const fieldSelectedCustomer = ref<{ label: string; value: string }>({ label: t('all'), value: 'all', @@ -250,6 +252,8 @@ const currentCustomerName = ref(''); const currentCustomerUrlImage = ref(null); const genderselector = ref(''); +const totalCustomer = ref(0); + const currentStatus = ref('All'); const inputFile = (() => { @@ -1024,7 +1028,11 @@ onMounted(async () => { pageSize: pageSizeCustomer.value, }); - if (resultStats) statsCustomerType.value = resultStats; + if (resultStats) { + totalCustomer.value = resultStats.CORP + resultStats.PERS; + + statsCustomerType.value = resultStats; + } if (resultList) listCustomer.value = resultList.result; @@ -1075,13 +1083,6 @@ watch(locale, () => { }; }); -watch(locale, () => { - fieldSelectedCustomer.value = { - label: `${fieldSelectedCustomer.value.label}`, - value: fieldSelectedCustomer.value?.value, - }; -}); - watch(currentPageCustomer, async () => { await fetchListCustomer(); }); @@ -1163,6 +1164,14 @@ watch(currentStatus, async () => { }); } }); + +watch(selectorLabel, async () => { + if (inputSearch.value) { + inputSearch.value = undefined; + resultSearch.value = undefined; + resultSearchEmployee.value = undefined; + } +});