From 63e5abf7a0c34a0edc4396aad582f656d21f75db Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Mon, 9 Oct 2023 15:28:37 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=9A=E0=B8=9A=E0=B8=AA=E0=B8=AD?= =?UTF-8?q?=E0=B8=9A=E0=B8=96=E0=B8=B2=E0=B8=A1=20Exit=20interview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/06_retirement/api.retirement.ts | 2 + .../components/ExitInterview/EditQuestion.vue | 185 +++++--- .../components/ExitInterview/exitRegistry.vue | 420 +++++++++++++++--- 3 files changed, 484 insertions(+), 123 deletions(-) diff --git a/src/api/06_retirement/api.retirement.ts b/src/api/06_retirement/api.retirement.ts index 7f849e1b0..c49f004fc 100644 --- a/src/api/06_retirement/api.retirement.ts +++ b/src/api/06_retirement/api.retirement.ts @@ -30,6 +30,8 @@ export default { resignConfirm: (role: String, id: string) => `${retirement}/resign/${role}/confirm/${id}`, resignReject: (role: String, id: string) => `${retirement}/resign/${role}/reject/${id}`, listExitInterview: () => `${retirement}/resign/questionnaire`, + commentExitInterview: (id:string) => `${retirement}/resign/questionnaire/comment/${id}`, + questionExitInterview: () => `${retirement}/resign/questionnaire/question`, ExitInterviewByid: (id: string) => `${retirement}/resign/questionnaire/${id}`, ExitInterviewReport: `${retirement}/resign/questionnaire/report`, AppointInterview: (id: string) => `${retirement}/resign/questionnaire/appoint/${id}`, diff --git a/src/modules/06_retirement/components/ExitInterview/EditQuestion.vue b/src/modules/06_retirement/components/ExitInterview/EditQuestion.vue index 756b425ab..c53b2b685 100644 --- a/src/modules/06_retirement/components/ExitInterview/EditQuestion.vue +++ b/src/modules/06_retirement/components/ExitInterview/EditQuestion.vue @@ -4,8 +4,8 @@ import { useQuasar } from "quasar"; import { useRouter } from "vue-router"; import { useCounterMixin } from "@/stores/mixin"; -// import http from "@/plugins/http"; -// import config from "@/app.config"; +import http from "@/plugins/http"; +import config from "@/app.config"; // import keycloak from "@/plugins/keycloak"; import type { QForm } from "quasar"; @@ -14,7 +14,7 @@ const $q = useQuasar(); const router = useRouter(); const mixin = useCounterMixin(); -const { messageError, showLoader, hideLoader } = mixin; +const { messageError, showLoader, hideLoader,dialogConfirm ,success} = mixin; const myForm = ref(null); @@ -22,28 +22,14 @@ const myForm = ref(null); const question1Desc = ref( "เหตุใดท่านจึงตัดสินใจร่วมงานกับกรุงเทพมหานคร (เลือกได้มากกว่า 1 ข้อ)" ); -const question1Score = ref(5); -const question1Answer = ref([ - "ความมั่นคงในการทำงาน", - "สิทธิประโยชน์/สวัสดิการ", - "อัตราเงินเดือน", - "ลักษณะงาน", - "วัฒนธรรมการทำงานของข้าราชการ", - "นโยบายของหน่วยงาน", - "ระบบการทำงาน", - "สมดุลชีวิตการทำงาน", - "บรรยากาศในการทำงาน", - "การพัฒนาในสายอาชีพ", - "โอกาสความก้าวหน้า", - "การได้รับการยอมรับจากสังคม", - // "อื่น ๆ (ระบุ)", -]); +const question1Score = ref(0); +const question1Answer = ref([]); // set คำถามที่ 2 const question2Desc = ref( "สำหรับการลาออกในครั้งนี ท่านได้คิดทบทวนอย่างจริงจังเป็นระยะเวลานานเท่าใด" ); -const question2Score = ref(5); +const question2Score = ref(0); const question2Answer = ref([ "น้อยกว่า 2 สัปดาห์", "1 เดือน - 3 เดือน", @@ -55,7 +41,7 @@ const question2Answer = ref([ const question3Desc = ref( "ปัจจัยใดที่ทำให้ท่านตัดสินใจลาออกจากราชการ (เลือกได้มากกว่า 1 ข้อ)" ); -const question3Score = ref(5); +const question3Score = ref(0); const question3Answer = ref([ "อัตราเงินเดือน", "สวัสดิการ", @@ -78,7 +64,7 @@ const question3Answer = ref([ const question4Desc = ref( "อะไรคือสิ่งที่ท่านเห็นว่าควรปรับปรุง (เลือกได้มากกว่า 1 ข้อ)" ); -const question4Score = ref(5); +const question4Score = ref(0); const question4Answer = ref([ "อัตราเงินเดือน ", "สวัสดิการ", @@ -101,35 +87,38 @@ const question4Answer = ref([ const question5Desc = ref( "โปรดระบุสาเหตุที่แท้จริง ที่ทำให้ท่านตัดสินใจลาออกจากการปฏิบัติราชการกับกรุงเทพมหานคร ?" ); -const question5Score = ref(5); +const question5Answer = ref([]) +const question5Score = ref(0); // set คำถามที่ 6 const question6Desc = ref( "ปัจจัยใดที่จะช่วยทำให้ท่านเปลี่ยนใจ ไม่อยากลาออกจากการปฏิบัติราชการกับกรุงเทพมหานคร" ); -const question6Score = ref(5); +const question6Answer = ref([]) +const question6Score = ref(0); // set คำถามที่ 7 const question7Desc = ref( "ท่านมีงานใหม่หรือไม่ ถ้ามี (โปรดระบุ ชื่อบริษัทเอกชน/หน่วยงานภาครัฐ) และอะไรคือสิ่งที่ที่ทำงานใหม่ให้กับท่าน ซึ่งท่านรู้สึกว่าเป็นที่น่าพอใจมากกว่าการปฏิบัติราชการกับกรุงเทพมหานคร" ); -const question7Score = ref(5); +const question7Score = ref(0); const question7Answer = ref(["มี (ระบุ)", "ไม่มี"]); // set คำถามที่ 8 const question8Desc = ref( "ท่านจะแนะนำเพื่อนให้มาร่วมงานกับกรุงเทพมหานครหรือไม่ (ถ้าไม่ โปรดระบุเหตุผล)" ); -const question8Score = ref(5); +const question8Score = ref(0); const question8Answer = ref(["แนะนำ", "ไม่แนะนำ (ระบุ)"]); // set คำถามที่ 9 const question9Desc = ref( "หากท่านมีโอกาสในอนาคต ท่านอยากกลับมาร่วมงานกับกรุงเทพมหานครหรือไม่ (ถ้าไม่ โปรดระบุเหตุผล)" ); -const question9Score = ref(5); +const question9Score = ref(0); const question9Answer = ref(["อยาก", "ไม่อยาก (ระบุ)"]); // set คำถามที่ 10 const question10Desc = ref("ความคิดเห็นและข้อเสนอแนะอื่น ๆ"); -const question10Score = ref(5); +const question10Answer = ref([]) +const question10Score = ref(0); const exitFactor = ref([]); const reasonWork = ref([]); @@ -183,41 +172,111 @@ onMounted(async () => { //นำข้อมูลมาแสดง const getData = async () => { - // showLoader(); - // await http - // .get(config.API.xxx) - // .then((res: any) => { - // const data = res.data.result; - // avata.value = data.avatar ?? ""; - // Position.value = data.position ?? ""; - // PositionLevel.value = data.positionLevel ?? ""; - // Org.value = data.org ?? ""; - // fullname.value = data.fullname ?? ""; - // prefix.value = data.prefix ?? ""; - // reasonWork.value = data.reasonWork ?? []; - // reasonWorkOther.value = data.reasonWorkOther ?? ""; - // timeThink.value = data.TimeThink ?? 0; - // exitFactor.value = data.exitFactor ?? []; - // exitFactorOther.value = data.exitFactorOther ?? 0; - // adjust.value = data.adjust ?? []; - // adjustOther.value = data.adjustOther ?? ""; - // realReason.value = data.realReason ?? ""; - // notExitFactor.value = data.notExitFactor ?? ""; - // haveJob.value = data.havejob ?? null; - // haveJobReason.value = data.havejobReason ?? ""; - // suggestFriends.value = data.suggestFriends ?? null; - // suggestFriendsReason.value = data.suggestFriendsReason ?? ""; - // futureWork.value = data.futureWork ?? null; - // futureWorkReason.value = data.futureWorkReason ?? ""; - // suggestion.value = data.suggestion ?? ""; - // }) - // .catch((e) => { - // messageError($q, e); - // }) - // .finally(() => { - // hideLoader(); - // }); + showLoader(); + await http + .get(config.API.questionExitInterview()) + .then((res: any) => { + const data = res.data.result; + question1Score.value = data.question1Score ?? 0; + question2Score.value = data.question2Score ?? 0; + question3Score.value = data.question3Score ?? 0; + question4Score.value = data.question4Score ?? 0; + question5Score.value = data.question5Score ?? 0; + question6Score.value = data.question6Score ?? 0; + question7Score.value = data.question7Score ?? 0; + question8Score.value = data.question8Score ?? 0; + question9Score.value = data.question9Score ?? 0; + question10Score.value = data.question10Score ?? 0; + question1Desc.value = data.question1Desc + question1Answer.value = data.question1Answer + question2Desc.value = data.question1Desc + question2Answer.value = data.question1Answer + question3Desc.value = data.question1Desc + question3Answer.value = data.question1Answer + question4Desc.value = data.question1Desc + question4Answer.value = data.question1Answer + question5Desc.value = data.question1Desc + question5Answer.value = data.question1Answer + question6Desc.value = data.question1Desc + question6Answer.value = data.question1Answer + question7Desc.value = data.question1Desc + question7Answer.value = data.question1Answer + question8Desc.value = data.question1Desc + question8Answer.value = data.question1Answer + question9Desc.value = data.question1Desc + question9Answer.value = data.question1Answer + question10Desc.value = data.question1Desc + question10Answer.value = data.question1Answer + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); }; + +const confirmClick = () =>{ + dialogConfirm($q,()=>putData()) +} +const putData = () => { + const body = { + question1Desc:question1Desc.value, + question1Score:question1Score.value, + question1Answer:question1Answer.value, + + question2Desc:question2Desc.value, + question2Score:question2Score.value, + question2Answer:question2Answer.value, + + question3Desc:question3Desc.value, + question3Score:question3Score.value, + question3Answer:question3Answer.value, + + question4Desc:question4Desc.value, + question4Score:question4Score.value, + question4Answer:question4Answer.value, + + question5Desc:question5Desc.value, + question5Score:question5Score.value, + question5Answer:question5Answer.value, + + question6Desc:question6Desc.value, + question6Score:question6Score.value, + question6Answer:question6Answer.value, + + question7Desc:question7Desc.value, + question7Score:question7Score.value, + question7Answer:question7Answer.value, + + question8Desc:question8Desc.value, + question8Score:question8Score.value, + question8Answer:question8Answer.value, + + question9Desc:question9Desc.value, + question9Score:question9Score.value, + question9Answer:question9Answer.value, + + question10Desc:question10Desc.value, + question10Score:question10Score.value, + question10Answer:question10Answer.value, + + + + }; + showLoader(); + http + .put(config.API.questionExitInterview(), body) + .then((res) => { + success($q, "บันทึกข้อมูลสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(async () => { + router.push(`/exit-Interview`) + }); +}