บรรจุ แต่งตั้ง ย้าย โอน => ปรับ code และ load

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-08-19 16:14:43 +07:00
parent 9f4aeec575
commit 34dc306288
30 changed files with 1154 additions and 1429 deletions

View file

@ -256,10 +256,9 @@ async function onClickSubmit() {
await http
.post(config.API.placementPass(), body)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
props.fetchStatCard?.();
props.fetchTable?.();
.then(async () => {
await Promise.all([props.fetchTable?.(), props.fetchStatCard?.()]);
await success($q, "บันทึกข้อมูลสำเร็จ");
closePopup();
})
.catch((err) => {

View file

@ -389,32 +389,6 @@ async function getTable() {
});
}
// function insertAvatar(items: any) {
// items.map((x: any, index: number) => {
// http
// .get(
// config.API.fileByFile(
// "",
// "",
// x.personalId,
// "profile-" + x.personalId
// )
// )
// .then((img) => {
// rows.value[index] = {
// ...x,
// avatar: img.data.downloadUrl,
// };
// })
// .catch(() => {
// rows.value[index] = {
// ...x,
// avatar: avatar,
// };
// });
// });
// }
/**ยืนยันการผ่อนผัน */
async function saveDeferment() {
myForm.value.validate().then(async (result: boolean) => {
@ -430,24 +404,23 @@ async function saveDeferment() {
}
/**post ผ่อนผัน */
async function postDeferment() {
showLoader();
const formData = new FormData();
formData.append("personalId", personalId.value);
formData.append("note", userNote.value);
formData.append("files", files.value[0]);
showLoader();
await http
.post(config.API.deferment(), formData)
.then(() => {
success($q, "บันทึกสำเร็จ");
.then(async () => {
await Promise.all([getTable(), props.statCard()]);
await success($q, "บันทึกสำเร็จ");
userNote.value = "";
modalDefermentDisclaim.value = false;
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await getTable();
props.statCard();
userNote.value = "";
modalDefermentDisclaim.value = false;
.finally(() => {
hideLoader();
});
}
@ -468,24 +441,23 @@ async function saveDisclaim() {
/**post การสละสิทธิ์ */
async function postDisclaimf() {
showLoader();
const dataPost = {
note: userNote.value,
personId: personalId.value,
};
showLoader();
await http
.post(config.API.disclaimF(), {
note: dataPost.note,
personalId: dataPost.personId,
})
.then(() => {
success($q, "บันทึกสำเร็จ");
})
.finally(async () => {
await getTable();
props.statCard();
.then(async () => {
await Promise.all([getTable(), props.statCard()]);
await success($q, "บันทึกสำเร็จ");
userNote.value = "";
modalDefermentDisclaim.value = false;
})
.finally(() => {
hideLoader();
});
}
@ -650,15 +622,15 @@ function savelist() {
showLoader();
await http
.put(config.API.putPosition(examId), personal_selected.value)
.then(() => {
.then(async () => {
await getTable();
await success($q, "ส่งรายชื่อไปยังหน่วยงานสำเร็จ");
modaladdlist.value = false;
success($q, "ส่งรายชื่อไปยังหน่วยงานสำเร็จ");
})
.catch((e: any) => {
messageError($q, e);
})
.finally(async () => {
await getTable();
.finally(() => {
hideLoader();
});
},
@ -697,10 +669,9 @@ function onRestorePos(id: string) {
showLoader();
await http
.post(config.API.clearPosition(id), {})
.then(() => {
success($q, "คืนตำแหน่งสำเร็จ");
getTable();
props.statCard();
.then(async () => {
await Promise.all([getTable(), props.statCard()]);
await success($q, "คืนตำแหน่งสำเร็จ");
})
.catch((e) => {
messageError($q, e);
@ -728,10 +699,9 @@ function onSubmitDate() {
showLoader();
http
.put(config.API.clearDate(rowId.value), { date: reportingDate.value })
.then(() => {
getTable();
props.statCard();
success($q, "บันทึกข้อมูลสำเร็จ");
.then(async () => {
await Promise.all([getTable(), props.statCard()]);
await success($q, "บันทึกข้อมูลสำเร็จ");
modalDate.value = false;
})
.catch((e) => {
@ -1577,6 +1547,7 @@ onMounted(async () => {
</template>
<template #trigger>
<q-input
class="inputgreen"
ref="dateRef"
outlined
dense