กลับไปใช้ปฏิทินก่อน

This commit is contained in:
Warunee Tamkoo 2024-02-09 17:17:25 +07:00
parent d5f0664894
commit 7aa4ae148b
4 changed files with 72 additions and 176 deletions

View file

@ -33,13 +33,13 @@ const informaData = ref<any>({
prefixId: null,
firstname: null,
lastname: null,
birthDate: "",
birthDate: null,
genderId: null,
bloodId: null,
nationality: "ไทย",
ethnicity: "ไทย",
nationality: null,
ethnicity: null,
statusId: null,
religionId: "ceaec498-71b4-4f82-b5a2-7d6ec988b753",
religionId: null,
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,7 +321,6 @@ const fetchPerson = async () => {
});
};
</script>
<template>
<q-dialog v-model="modal">
<q-card style="min-width: 60vw">
@ -404,23 +403,7 @@ 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">
<!-- เปลยนเปนเลอกปฏ -->
<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
<datepicker
v-model="informaData.birthDate"
:locale="'th'"
autoApply
@ -435,7 +418,8 @@ 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
@ -457,9 +441,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
@ -594,6 +578,12 @@ const fetchPerson = async () => {
:label="`${'เบอร์โทร'}`"
mask="##########"
/>
<!-- :rules="[
(val: string) => !!val || `${'กรุณากรอก เบอร์โทร'}`,
(val: string) =>
val.length >= 10 ||
`${'กรุณากรอกเบอร์โทรให้ครบ'}`,
]" -->
</div>
</div>
</div>