diff --git a/src/modules/03_logs/components/LogTable.vue b/src/modules/03_logs/components/LogTable.vue index 276b1b50..f4d9be6e 100644 --- a/src/modules/03_logs/components/LogTable.vue +++ b/src/modules/03_logs/components/LogTable.vue @@ -243,6 +243,7 @@ async function selectedOrg(id: string) { * ฟังชั่นสำหรับดึงไอดีโครงสร้างปัจจุบัน */ async function fetchOrganizationActive() { + showLoader(); await http .get(config.API.activeOrganization) .then(async (res) => { @@ -253,6 +254,9 @@ async function fetchOrganizationActive() { }) .catch((err) => { messageError($q, err); + }) + .finally(() => { + hideLoader(); }); } @@ -279,9 +283,7 @@ async function fatchOrg(id: string) { }) .catch((err) => { messageError($q, err); - hideLoader(); - }) - .finally(() => {}); + }); } /*** scroll และโหลดข้อมูลรายการ Logs เพิ่ม */ @@ -441,6 +443,7 @@ function updateDate() { } function onSendCSV() { + showLoader(); const queryString = { rootId: qureyBody.rootId ?? undefined, // size: size.value ?? undefined, @@ -455,14 +458,16 @@ function onSendCSV() { .get(config.API.reportLog, { params: queryString, }) - .then((res) => { + .then(async (res) => { const data = res.data; - genReportXLSX(data, `LOG_${date2Thai(new Date(startDate.value))}`); + await genReportXLSX(data, `LOG_${date2Thai(new Date(startDate.value))}`); }) .catch((e) => { messageError($q, e); }) - .finally(() => {}); + .finally(() => { + hideLoader(); + }); } async function downloadTxt() {