แก้กรอกวันที่ในทะเบียนประวัติ

This commit is contained in:
Warunee Tamkoo 2024-02-09 15:09:00 +07:00
parent 4c43a053eb
commit 5a27893af8
3 changed files with 76 additions and 35 deletions

View file

@ -33,13 +33,13 @@ const informaData = ref<any>({
prefixId: null,
firstname: null,
lastname: null,
birthDate: null,
birthDate: "",
genderId: null,
bloodId: null,
nationality: "ไทย",
ethnicity: "ไทย",
statusId: null,
religionId: 'ceaec498-71b4-4f82-b5a2-7d6ec988b753',
religionId: "ceaec498-71b4-4f82-b5a2-7d6ec988b753",
tel: null,
employeeType: null,
employeeClass: null,
@ -173,23 +173,23 @@ const calRetire = async (birth: Date) => {
birthDate: dateToISO(birth),
};
if (dateToISO(dateBefore.value) != dateToISO(birth)) {
showLoader();
// showLoader();
await http
.post(config.API.profileCalRetire, body)
.then((res: any) => {
const data = res.data.result;
informaData.value.age = data.age;
informaData.value.birthDate = birth;
// informaData.value.birthDate = birth;
changeRetireText(data.retireDate);
dateBefore.value = birth;
})
.catch((e: any) => {
messageError($q, e);
informaData.value.birthDate = null;
informaData.value.age = "";
})
// .catch((e: any) => {
// messageError($q, e);
// informaData.value.birthDate = null;
// informaData.value.age = "";
// })
.finally(() => {
hideLoader();
// hideLoader();
});
}
};
@ -321,6 +321,7 @@ const fetchPerson = async () => {
});
};
</script>
<template>
<q-dialog v-model="modal">
<q-card style="min-width: 60vw">
@ -403,7 +404,23 @@ const fetchPerson = async () => {
</div>
<div class="row col-12 q-col-gutter-x-sm q-mb-xs">
<div class="col-xs-6 col-sm-2 col-md-2">
<datepicker
<!-- เปลยนเปนเลอกปฏ -->
<q-input
v-model="informaData.birthDate"
:rules="[(val: string) => !!val || `${'กรุณาเลือก วัน/เดือน/ปี เกิด'}`]"
:label="`${'วัน/เดือน/ปี เกิด'}`"
type="date"
hide-bottom-space
outlined
dense
lazy-rules
@update:model-value="
(val:any) => {
calRetire(new Date(val));
}
"
/>
<!-- <datepicker
v-model="informaData.birthDate"
:locale="'th'"
autoApply
@ -418,8 +435,7 @@ const fetchPerson = async () => {
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
<template #trigger><q-input
for="#birthDate"
hide-bottom-space
outlined
@ -441,9 +457,9 @@ const fetchPerson = async () => {
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</q-input> -->
<!-- </template>
</datepicker> -->
</div>
<div class="col-xs-6 col-sm-2 col-md-2">
<q-input