diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue index 9af581c33..6ca2aaab9 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue @@ -263,7 +263,7 @@ const visibleColumnsHistory = ref([ async function getData() { showLoader(); - await http + http .get(config.API.registryNewByProfileId(profileId.value, empType.value)) .then(async (res) => { informaData.value = await res.data.result; @@ -271,7 +271,10 @@ async function getData() { id.value = informaData.value.id; if (informaData.value.birthDate) { + console.log("birthDate===>", informaData.value.birthDate); + age.value = calculateAge(informaData.value.birthDate); + console.log("age===>", age.value); } } }) @@ -312,6 +315,8 @@ async function editData() { function onClickOpenDialog() { if (!informaData.value) return; modal.value = true; + console.log("onClickOpenDialog birthDate===>", informaData.value.birthDate); + id.value = informaData.value.id; age.value = calculateAge(informaData.value.birthDate); formData.citizenId = informaData.value.citizenId; @@ -378,6 +383,8 @@ function changeCardID(citizenId: string | number | null) { watch( () => formData.birthDate, (v) => { + console.log("v===>", v); + if (v) { age.value = calculateAge(v); } @@ -385,12 +392,12 @@ watch( ); onMounted(async () => { - if (store.Ops.prefixOps && store.Ops.prefixOps.length === 0) { + await getData(); + + if (store.Ops && store.Ops.prefixOps && store.Ops.prefixOps.length === 0) { fetchPerson(); } - await getData(); - // store.Ops.prefixOps.length === 0 || // store.Ops.genderOps.length === 0 || // store.Ops.bloodOps.length === 0 || @@ -622,9 +629,7 @@ onMounted(async () => { hide-bottom-space class="inputgreen" :model-value=" - formData.birthDate != null - ? date2Thai(formData.birthDate) - : null + formData.birthDate ? date2Thai(formData.birthDate) : null " :label="dataLabel.birthDate" :rules="[