From f09860b79bf9aa5ad1972acab1f862de74747cc2 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 2 Sep 2024 10:27:59 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9E=E0=B9=89=E0=B8=99=E0=B8=88=E0=B8=B2?= =?UTF-8?q?=E0=B8=81=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=81=E0=B8=B2=E0=B8=A3?= =?UTF-8?q?=20=3D=3D>=20=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20form=20Exit?= =?UTF-8?q?=20interview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ExitInterview/EditQuestion.vue | 11 +- .../components/ExitInterview/exitMain.vue | 64 +- .../components/ExitInterview/exitRegistry.vue | 911 +++++++++--------- .../components/resign/DetailDeceased.vue | 32 +- 4 files changed, 503 insertions(+), 515 deletions(-) diff --git a/src/modules/06_retirement/components/ExitInterview/EditQuestion.vue b/src/modules/06_retirement/components/ExitInterview/EditQuestion.vue index fe5353037..409a0f07e 100644 --- a/src/modules/06_retirement/components/ExitInterview/EditQuestion.vue +++ b/src/modules/06_retirement/components/ExitInterview/EditQuestion.vue @@ -177,8 +177,8 @@ const getData = async () => { showLoader(); await http .get(config.API.questionExitInterview()) - .then((res: any) => { - const data = res.data.result; + .then(async (res) => { + const data = await res.data.result; question1Score.value = data.question1Score ?? 0; question2Score.value = data.question2Score ?? 0; question3Score.value = data.question3Score ?? 0; @@ -269,14 +269,15 @@ const putData = () => { showLoader(); http .put(config.API.questionExitInterview(), body) - .then((res) => { + .then(() => { + router.push(`/retirement/exit-interview`); success($q, "บันทึกข้อมูลสำเร็จ"); }) .catch((e) => { messageError($q, e); }) - .finally(async () => { - router.push(`/retirement/exit-interview`); + .finally(() => { + hideLoader(); }); }; diff --git a/src/modules/06_retirement/components/ExitInterview/exitMain.vue b/src/modules/06_retirement/components/ExitInterview/exitMain.vue index bacac0c05..d1432abee 100644 --- a/src/modules/06_retirement/components/ExitInterview/exitMain.vue +++ b/src/modules/06_retirement/components/ExitInterview/exitMain.vue @@ -170,8 +170,8 @@ const fecthlist = async () => { showLoader(); await http .get(config.API.listExitInterview()) - .then((res: any) => { - const data = res.data.result; + .then(async (res) => { + const data = await res.data.result; let list: ResponseItems[] = []; data.map((r: ResponseItems) => { list.push({ @@ -215,7 +215,8 @@ const saveAppoint = async () => { showLoader(); await http .put(config.API.AppointInterview(id.value), body) - .then((res: any) => { + .then(async () => { + await fecthlist(); success($q, "วันนัดหมายเพื่อทําการสัมภาษณ์การลาออกสำเร็จ"); closeModal(); }) @@ -223,7 +224,6 @@ const saveAppoint = async () => { messageError($q, e); }) .finally(async () => { - await fecthlist(); hideLoader(); }); }); @@ -378,7 +378,10 @@ const openModalCalendar = (rows: any) => { รายละเอียด { แก้ไขข้อมูล { {{ props.rowIndex + 1 }} - + {{ props.row.fullname }} - + {{ props.row.realReason }} - + {{ props.row.notExitFactor }} - + {{ props.row.futureWork ? "ใช่" : "ไม่" }} - + {{ props.row.futureWorkReason }} - + {{ props.row.havejob ? "ใช่" : "ไม่" }} - +
{{ props.row.havejobReason }}
- + {{ props.row.appointDate == null ? "-" : props.row.appointDate }} - + {{ props.row.datetext }} diff --git a/src/modules/06_retirement/components/ExitInterview/exitRegistry.vue b/src/modules/06_retirement/components/ExitInterview/exitRegistry.vue index 8b8612f0d..37f26baec 100644 --- a/src/modules/06_retirement/components/ExitInterview/exitRegistry.vue +++ b/src/modules/06_retirement/components/ExitInterview/exitRegistry.vue @@ -95,8 +95,8 @@ const getData = async () => { showLoader(); await http .get(config.API.ExitInterviewByid(dataId)) - .then((res: any) => { - const data = res.data.result; + .then(async (res) => { + const data = await res.data.result; dataProfile.value = data as DataProfile; avata.value = data.avatar ?? ""; Position.value = data.position ?? ""; @@ -157,10 +157,11 @@ const question7Answer = ref([]); const question8Answer = ref([]); const question9Answer = ref([]); async function fecthquestion() { + showLoader(); await http .get(config.API.questionnaireList()) - .then((result) => { - const data = result.data.result; + .then(async (result) => { + const data = await result.data.result; // คำถามแบบสอบถามหลัก for (let i = 1; i <= 10; i++) { questionDesc[`question${i}Desc`] = @@ -221,6 +222,9 @@ async function fecthquestion() { }) .catch((err) => { messageError($q, err); + }) + .finally(() => { + hideLoader(); }); } //รวมคะเเนน @@ -275,17 +279,19 @@ const putData = () => { showLoader(); http .put(config.API.commentExitInterview(dataId), body) - .then((res) => { + .then(() => { + router.push(`/retirement/exit-interview`); success($q, "บันทึกข้อมูลสำเร็จ"); }) .catch((e) => { messageError($q, e); }) - .finally(async () => { - router.push(`/retirement/exit-interview`); + .finally(() => { + hideLoader(); }); }; + +