บรรจุ แต่งตั้ง ย้าย โอน => ปรับ 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

@ -172,14 +172,14 @@ const SaveData = async () => {
showLoader();
http
.put(config.API.receiveFile(personalId.value), formData)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
.then(async () => {
await success($q, "บันทึกข้อมูลสำเร็จ");
await clickCloseUpload();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await clickCloseUpload();
.finally(() => {
hideLoader();
});
}
@ -245,31 +245,21 @@ const openUpload = (id: string) => {
personalId.value = id;
modalupload.value = true;
};
//
//
const openDelete = (id: string) => {
dialogRemove($q, async () => await fetchDataDelete(id));
};
//
const fetchDataDelete = async (id: string) => {
showLoader();
await http
.delete(config.API.receiveDataId(id))
.then((res) => {
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
fecthlistRecevice();
hideLoader();
});
};
//
const closeModalTree = async () => {
await fecthlistRecevice();
modalTree.value = false;
dialogRemove($q, async () => {
showLoader();
await http
.delete(config.API.receiveDataId(id))
.then(async () => {
await fecthlistRecevice();
await success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
hideLoader();
});
});
};
//
@ -282,8 +272,7 @@ const nextPage = (id: string) => {
function onSave(data: any) {
console.log("not save", data);
const dataAppoint = {
// personalId: data.personalId,
node: data.node,
node: data.node,
nodeId: data.nodeId,
orgRevisionId: data.orgRevisionId,
positionId: data.positionId,
@ -301,15 +290,15 @@ function onSave(data: any) {
showLoader();
http
.put(config.API.receivePosition(personalId.value), dataAppoint)
.then((res) => {
.then(async () => {
await fecthlistRecevice();
await success($q, "บันทึกข้อมูลสำเร็จ");
modalTree.value = false;
success($q, "บันทึกสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
fecthlistRecevice();
.finally(() => {
hideLoader();
});
}
@ -561,6 +550,7 @@ onMounted(() => {
</div>
</q-card>
<!-- ออกคำส -->
<Dialogbody
v-model:Modal="modal"
:clickClose="clickClose"
@ -569,6 +559,8 @@ onMounted(() => {
:fecthlistRecevice="fecthlistRecevice"
:nextPage="nextPage"
/>
<!-- ปโหลดเอกสาร -->
<q-dialog v-model="modalupload">
<q-card style="width: 600px">
<DialogHeader title="อัปโหลดเอกสาร" :close="clickCloseUpload" />
@ -605,14 +597,7 @@ onMounted(() => {
</q-card>
</q-dialog>
<!-- <DialogOrgTree
v-model:modal="modalTree"
:close="closeModalTree"
:personal="personal"
:personalId="personalId"
:dataRows="dataRows"
/> -->
<!-- เลอกหนวยงานทบโอน -->
<DialogOrgSelect
:title="`เลือกหน่วยงานที่รับโอน`"
v-model:modal="modalTree"