แก้แสดงข้อความกรณียื่นลาซ้ำ

This commit is contained in:
Warunee Tamkoo 2024-01-19 13:40:51 +07:00
parent 19e8059cd8
commit 141c3a92f8
2 changed files with 14 additions and 3 deletions

View file

@ -268,6 +268,7 @@ function onConfirm(id: string) {
await http await http
.put(config.API.leaveUserSendId(personalId.value), { reason: "" }) .put(config.API.leaveUserSendId(personalId.value), { reason: "" })
.then(() => { .then(() => {
router.push("/leave");
success($q, "ยื่นใบลาสำเร็จ"); success($q, "ยื่นใบลาสำเร็จ");
}) })
.catch((e: any) => { .catch((e: any) => {
@ -275,7 +276,6 @@ function onConfirm(id: string) {
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
router.push("/leave");
// fetchDataDetail(personalId.value); // fetchDataDetail(personalId.value);
}); });
}, },

View file

@ -411,7 +411,7 @@ export const useCounterMixin = defineStore("mixin", () => {
component: CustomComponent, component: CustomComponent,
componentProps: { componentProps: {
title: `ข้อความแจ้งเตือน`, title: `ข้อความแจ้งเตือน`,
message: `ขออภัยไม่สามารถลาได้เนื่องจากจำนวนวันลาของคุณเกินสิทธิ์ที่กำหนด`, message: `ไม่สามารถขอลาในช่วงเวลาเดียวกันได้ เนื่องจากมีการขอลาในช่วงเวลาดังกล่าวแล้ว`,
icon: "warning", icon: "warning",
color: "red", color: "red",
onlycancel: true, onlycancel: true,
@ -432,7 +432,18 @@ export const useCounterMixin = defineStore("mixin", () => {
onlycancel: true, onlycancel: true,
}, },
}); });
} else { } else if (e.response.data.result) {
q.dialog({
component: CustomComponent,
componentProps: {
title: `ข้อความแจ้งเตือน`,
message: `${e.response.data.result}`,
icon: "warning",
color: "red",
onlycancel: true,
},
});
} else if (e.response.data.message) {
q.dialog({ q.dialog({
component: CustomComponent, component: CustomComponent,
componentProps: { componentProps: {