แก้ bug ระบบลา
This commit is contained in:
parent
a13bfdffb2
commit
e7a1fe47e7
3 changed files with 26 additions and 16 deletions
|
|
@ -379,7 +379,7 @@ async function fetchDetailLeave(paramsId: string) {
|
|||
};
|
||||
|
||||
isLoadData.value = true;
|
||||
await fectOptionType();
|
||||
// await fetchOptionType();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -390,12 +390,11 @@ async function fetchDetailLeave(paramsId: string) {
|
|||
}
|
||||
|
||||
const leaveType = ref<LeaveType[]>();
|
||||
async function fectOptionType() {
|
||||
async function fetchOptionType() {
|
||||
await http
|
||||
.get(config.API.leaveType())
|
||||
.then((res) => {
|
||||
leaveType.value = res.data.result;
|
||||
checkLeaveType(formData.leaveTypeId, formData);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -645,9 +644,14 @@ async function fetchKeycloakPosition() {
|
|||
|
||||
onMounted(async () => {
|
||||
if (paramsId) {
|
||||
await fetchKeycloakPosition();
|
||||
await fetchDetailLeave(paramsId);
|
||||
await checkOfficer();
|
||||
await Promise.all([
|
||||
fetchOptionType(),
|
||||
fetchKeycloakPosition(),
|
||||
fetchDetailLeave(paramsId),
|
||||
checkOfficer(),
|
||||
]);
|
||||
|
||||
checkLeaveType(formData.leaveTypeId, formData);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -174,11 +174,13 @@ onMounted(async () => {
|
|||
if (paramsId) {
|
||||
showLoader();
|
||||
Promise.all([
|
||||
await fetchDetailDeleteLeave(paramsId),
|
||||
await fetchKeycloakPosition(),
|
||||
await fetchDetailLeave(paramsId),
|
||||
fetchOptionType(),
|
||||
fetchDetailDeleteLeave(paramsId),
|
||||
fetchKeycloakPosition(),
|
||||
fetchDetailLeave(paramsId),
|
||||
checkOfficer(),
|
||||
]).finally(() => {
|
||||
checkLeaveType(formData.leaveTypeId, formData.leaveSubTypeName);
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
|
@ -311,7 +313,7 @@ async function fetchDetailLeave(paramsId: string) {
|
|||
commanders: data.commanders,
|
||||
approvers: data.approvers,
|
||||
};
|
||||
await fectOptionType();
|
||||
// await fetchOptionType();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -320,12 +322,11 @@ async function fetchDetailLeave(paramsId: string) {
|
|||
|
||||
const leaveType = ref<LeaveType[]>();
|
||||
/** function เรียกประเภทการลา */
|
||||
async function fectOptionType() {
|
||||
async function fetchOptionType() {
|
||||
await http
|
||||
.get(config.API.leaveType())
|
||||
.then((res) => {
|
||||
leaveType.value = res.data.result;
|
||||
checkLeaveType(formData.leaveTypeId, formData.leaveSubTypeName);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
|
|||
|
|
@ -114,7 +114,10 @@ async function getData() {
|
|||
keyword: keyword.value,
|
||||
isAct: isAct.value,
|
||||
keycloakId: props.keycloakUserId,
|
||||
type: props.profileType === "officer" ? props.profileType : "employee",
|
||||
type:
|
||||
props.profileType?.toLocaleLowerCase() === "officer"
|
||||
? "officer"
|
||||
: "employee",
|
||||
})
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
|
|
@ -150,7 +153,8 @@ function onSubmit() {
|
|||
.post(
|
||||
config.API.addApproverByType(
|
||||
props.type?.toLocaleLowerCase() as string,
|
||||
props.profileType?.toLocaleLowerCase() as string,
|
||||
// props.profileType?.toLocaleLowerCase() as string,
|
||||
"officer",
|
||||
pageId.value
|
||||
),
|
||||
body
|
||||
|
|
@ -161,9 +165,9 @@ function onSubmit() {
|
|||
props.fetchDetailLeave?.(pageId.value);
|
||||
})
|
||||
.catch((e) => {
|
||||
hideLoader();
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 คน");
|
||||
|
|
@ -192,6 +196,7 @@ watch(
|
|||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card class="col-12" style="width: 80%">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue