fix Leave reason

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-12-10 18:09:23 +07:00
parent a3d008024e
commit 698d03ce00
12 changed files with 64 additions and 16 deletions

View file

@ -122,11 +122,12 @@ function onValidate() {
}
}
const isLeave = ref<boolean>(true);
const reasonLeave = ref<string>("");
/**
* check าลาไดไหม จาก api
* @param formData
*/
const isLeave = ref<boolean>(true);
async function fetchCheck() {
await http
.post(config.API.leaveCheck(), {
@ -138,6 +139,9 @@ async function fetchCheck() {
const data = res.data.result;
isLeave.value = data.isLeave;
formDataBirth.leaveTotal = data.totalDate;
reasonLeave.value = data.reason
? data.reason
: "จำนวนวันลาเกินที่กำหนด";
})
.catch((e: any) => {
messageError($q, e);
@ -321,7 +325,7 @@ onMounted(() => {
>
<template v-slot:hint>
<span style="color: red">
{{ !isLeave ? "จำนวนวันลาเกินที่กำหนด" : "" }}
{{ !isLeave ? reasonLeave : "" }}
</span>
</template>
</q-input>