From e07ce319eaf156cbff58f07ac58ff1908ccd5a2c Mon Sep 17 00:00:00 2001 From: puriphatt Date: Tue, 30 Jul 2024 04:04:51 +0000 Subject: [PATCH] fix(03): select province input --- .../FormEmployeeHealthCheck.vue | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/components/03_customer-management/FormEmployeeHealthCheck.vue b/src/components/03_customer-management/FormEmployeeHealthCheck.vue index c42f0dbe..dc29ce47 100644 --- a/src/components/03_customer-management/FormEmployeeHealthCheck.vue +++ b/src/components/03_customer-management/FormEmployeeHealthCheck.vue @@ -9,6 +9,7 @@ import useAddressStore, { import { EmployeeCheckupCreate } from 'src/stores/employee/types'; import { useI18n } from 'vue-i18n'; import { selectFilterOptionRefMod } from 'src/stores/utils'; +import { QSelect } from 'quasar'; const { locale } = useI18n(); const adrressStore = useAddressStore(); @@ -53,6 +54,12 @@ async function fetchProvince() { const result = await adrressStore.fetchProvince(); if (result) addrOptions.provinceOps = result; + + provinceFilter = selectFilterOptionRefMod( + ref(addrOptions.provinceOps), + provinceOptions, + 'name', + ); } function addData() { @@ -87,12 +94,11 @@ onMounted(async () => { tab.value = 'tab0'; }); -// const provinceOps = ref[]>([]); -// const provinceFilter = selectFilterOptionRefMod( -// addrOptions.provinceOps, -// provinceOps, -// 'label', -// ); +const provinceOptions = ref[]>([]); +let provinceFilter: ( + value: string, + update: (callbackFn: () => void, afterFn?: (ref: QSelect) => void) => void, +) => void; const checkupTypeOptions = ref[]>([]); const checkupTypeFilter = selectFilterOptionRefMod( @@ -207,7 +213,7 @@ const insuranceCompanyFilter = selectFilterOptionRefMod( :readonly="readonly" :options="checkupTypeOptions" :hide-dropdown-icon="readonly" - :id="`${prefixId}-select-province`" + :id="`${prefixId}-select-checkup-type`" :label="$t('formDialogInputCheckupType')" @filter="checkupTypeFilter" > @@ -239,7 +245,8 @@ const insuranceCompanyFilter = selectFilterOptionRefMod( :label="$t('province')" :hide-dropdown-icon="readonly" :id="`${prefixId}-select-province`" - :options="addrOptions.provinceOps" + :options="provinceOptions" + @filter="provinceFilter" >