อัตรากำลังลูกจ้างประจำ ฯ => refactor code

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-25 15:00:26 +07:00
parent 7e2350eef8
commit 81e0a82b0e
18 changed files with 377 additions and 188 deletions

View file

@ -49,7 +49,9 @@ const selectedTree = ref<string>("");
const filterRef = ref();
const levelTree = ref<number>(0);
/** function เรียกข้อมูล Tree แบบ ปัจจุบัน*/
/**
* function เรยกขอม Tree แบบ จจ
*/
async function fetchTree() {
showLoader();
const id: string = store.activeId ? store.activeId?.toString() : "";
@ -66,16 +68,20 @@ async function fetchTree() {
});
}
/** resetFilterTree*/
/**
* resetFilterTree
*/
function resetFilter() {
filterTree.value = "";
filterRef.value.focus();
}
/** function เลือกหน่วยงาน*/
/**
* function เลอกหนวยงาน
*/
async function updateSelected(data: DataTree) {
levelTree.value = data.orgLevel;
selectedTree.value = data.orgTreeId;
levelTree.value = await data.orgLevel;
selectedTree.value = await data.orgTreeId;
reqMaster.id = await data.orgTreeId;
reqMaster.type = await data.orgLevel;
await fetchTable();
@ -116,7 +122,9 @@ const reqMaster = reactive<FilterMaster>({
const totalRow = ref<number>(0);
const selectedPos = ref<PosMaster[]>([]);
/** function เรียกข้อมูล Table Position*/
/**
* function เรยกขอม Table Position
*/
async function fetchTable() {
selectedPos.value = [];
await http
@ -148,13 +156,17 @@ function updatePagination(newPagination: NewPagination) {
reqMaster.page = 1;
}
/** funcion ค้นหาข้อมูลใน Table*/
/**
funcion นหาขอมลใน Table
*/
async function filterKeyword() {
reqMaster.page = 1;
fetchTable();
reqMaster.page = await 1;
await fetchTable();
}
/** function ยืนยันกาสืบทอดตำแหน่ง */
/**
* function นยนกาสบทอดตำแหน
*/
function onClickConfirm() {
if (selectedPos.value.length === 0) {
dialogMessageNotify($q, "กรุณาเลือกตำแหน่งสืบทอด");
@ -186,20 +198,26 @@ function onClickConfirm() {
}
}
/** callblck function ทำการ fetch ข้อมูล tree เมื่อเปิด popup*/
/**
* callblck function ทำการ fetch อม tree เมอเป popup
*/
watch(
() => modal.value,
async () => {
modal.value ? await fetchTree() : clearForm();
() => {
modal.value ? fetchTree() : clearForm();
}
);
/** callblck function ทำการ fetch ข้อมูล Table เมื่อมีการเปลี่ยนหน้า*/
/**
* callblck function ทำการ fetch อม Table เมอมการเปลยนหน
*/
watch([() => reqMaster.page, () => reqMaster.pageSize], async () => {
await fetchTable();
});
/** function clear ข้อมูล*/
/**
* function clear อม
*/
function clearForm() {
nodeTree.value = [];
rows.value = [];