diff --git a/src/components/02_personnel-management/FormAddress.vue b/src/components/02_personnel-management/FormAddress.vue index 9bbce4a1..04521b92 100644 --- a/src/components/02_personnel-management/FormAddress.vue +++ b/src/components/02_personnel-management/FormAddress.vue @@ -23,7 +23,6 @@ const provinceId = defineModel('provinceId'); const districtId = defineModel('districtId'); const subDistrictId = defineModel('subDistrictId'); const zipCode = defineModel('zipCode'); -const isOpen = defineModel('isOpen', { default: false }); const addrOptions = reactive<{ provinceOps: Province[]; @@ -66,9 +65,10 @@ async function selectSubDistrict(id: string) { onMounted(async () => { await fetchProvince(); + await fetchDistrict(); + await fetchSubDistrict(); }); -watch(isOpen, fetchDistrict); watch(provinceId, fetchDistrict); watch(districtId, fetchSubDistrict); @@ -149,11 +149,7 @@ watch(districtId, fetchSubDistrict); emit-value map-options id="select-sub-district" - :model-value=" - addrOptions.subDistrictOps.length === 1 - ? (subDistrictId = addrOptions.subDistrictOps[0].id) - : '' - " + v-model="subDistrictId" option-value="id" option-label="name" :label="$t('subDistrict')"