This commit is contained in:
Warunee Tamkoo 2024-07-08 21:51:56 +07:00
parent afe7fbf3dd
commit 7004be79f4

View file

@ -263,7 +263,7 @@ const visibleColumnsHistory = ref<String[]>([
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="[