diff --git a/src/modules/12_evaluatePersonal/components/Detail/step/step3.vue b/src/modules/12_evaluatePersonal/components/Detail/step/step3.vue index 3e9433e61..c38e6a3fe 100644 --- a/src/modules/12_evaluatePersonal/components/Detail/step/step3.vue +++ b/src/modules/12_evaluatePersonal/components/Detail/step/step3.vue @@ -37,8 +37,8 @@ function handleItemClick(itemNumber: number) { * @param volume index item */ function getFile(volume: number) { - const fileText = numToThai(volume); showLoader(); + const fileText = numToThai(volume); http .get(config.API.evaluationFilebyId("เล่ม 1", id.value, fileText)) .then((res) => { @@ -46,10 +46,8 @@ function getFile(volume: number) { const type = res.data.fileType; getPDF(link, type); }) - .catch(() => { - // messageError($q, e); - }) - .finally(() => { + .catch((e) => { + messageError($q, e); hideLoader(); }); } @@ -76,7 +74,6 @@ function getPDF(url: string, type: string) { const objectUrl = URL.createObjectURL(blob); const pdfData = await usePDF(`${objectUrl}`); - showLoader(); setTimeout(() => { store.log = 1; store.pdfSrcStore = pdfData.pdf.value; @@ -84,8 +81,8 @@ function getPDF(url: string, type: string) { hideLoader(); }, 1500); }) - .catch(async (e) => { - messageError($q, JSON.parse(await e.response.data.text())); + .catch(() => { + hideLoader(); }) .finally(() => { store.log = 0; diff --git a/src/modules/12_evaluatePersonal/components/Detail/step/step4.vue b/src/modules/12_evaluatePersonal/components/Detail/step/step4.vue index fae4b9eb2..97d6dec5a 100644 --- a/src/modules/12_evaluatePersonal/components/Detail/step/step4.vue +++ b/src/modules/12_evaluatePersonal/components/Detail/step/step4.vue @@ -265,9 +265,10 @@ async function upLoadFile(file: any) { }) .catch((e) => { messageError($q, e); + hideLoader(); }) .finally(() => { - hideLoader(); + // hideLoader(); }); } } @@ -282,12 +283,13 @@ function fileUpLoad(url: string) { headers: { "Content-Type": fileEvaluationUpload.value?.type }, onUploadProgress: (e) => console.log(e), }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { + .then(() => { checkDoc10(); success($q, "อัปโหลดไฟล์สำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + hideLoader(); }); } @@ -333,6 +335,7 @@ async function checkDoc10() { ) .then((res: any) => { download10Url.value = res.data.downloadUrl; + fetchProfile(); }) .catch(() => { // messageError($q, e); @@ -340,12 +343,11 @@ async function checkDoc10() { .finally(() => { hideLoader(); }); - fetchProfile(); } /** function เรียกข้แมูลคุณสมบัติ*/ async function fetchProfile() { - showLoader(); + // showLoader(); await http .get(config.API.evaluateGetDetail(id.value)) .then((res) => { @@ -356,7 +358,7 @@ async function fetchProfile() { messageError($q, err); }) .finally(() => { - hideLoader(); + // hideLoader(); }); } @@ -430,14 +432,14 @@ onMounted(async () => { -