@@ -867,7 +926,7 @@ const getData = async () => {
-
+
diff --git a/src/modules/06_retirement/components/ExitInterview/exitRegistry.vue b/src/modules/06_retirement/components/ExitInterview/exitRegistry.vue
index 021ed848e..265e4ae66 100644
--- a/src/modules/06_retirement/components/ExitInterview/exitRegistry.vue
+++ b/src/modules/06_retirement/components/ExitInterview/exitRegistry.vue
@@ -4,6 +4,11 @@ import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
+import type {
+ OptionQuestions,
+ OptionQuestions2,
+} from "@/modules/06_retirement/interface/request/Main";
+
import http from "@/plugins/http";
import config from "@/app.config";
import keycloak from "@/plugins/keycloak";
@@ -16,7 +21,14 @@ const router = useRouter();
const mixin = useCounterMixin();
const dataId = route.params.id.toString();
-const { messageError, showLoader, hideLoader } = mixin;
+const {
+ messageError,
+ showLoader,
+ hideLoader,
+ dialogConfirm,
+ success,
+ dialogMessageNotify,
+} = mixin;
const myForm = ref
(null);
const roleAdmin = ref(false);
@@ -39,100 +51,101 @@ const futureWork = ref();
const suggestion = ref("");
const comment = ref("");
const score = reactive([
- { no: 1, score: 0 },
- { no: 2, score: 0 },
- { no: 3, score: 0 },
- { no: 4, score: 0 },
- { no: 5, score: 0 },
- { no: 6, score: 0 },
- { no: 7, score: 0 },
- { no: 8, score: 0 },
- { no: 9, score: 0 },
- { no: 10, score: 0 },
+ { no: 1, score: "" },
+ { no: 2, score: "" },
+ { no: 3, score: "" },
+ { no: 4, score: "" },
+ { no: 5, score: "" },
+ { no: 6, score: "" },
+ { no: 7, score: "" },
+ { no: 8, score: "" },
+ { no: 9, score: "" },
+ { no: 10, score: "" },
]);
-const scoreTotal = ref(0);
+const scoreTotal = ref('');
const reasonWorkOther = ref("");
-const reasonWork_option = ref([
- { label: "ความมั่นคงในการทำงาน ", value: 0 },
- { label: "สิทธิประโยชน์/สวัสดิการ", value: 1 },
- { label: "อัตราเงินเดือน ", value: 2 },
- { label: "ลักษณะงาน ", value: 3 },
- { label: "วัฒนธรรมการทำงานของข้าราชการ ", value: 4 },
- { label: "นโยบายของหน่วยงาน ", value: 5 },
- { label: "ระบบการทำงาน", value: 6 },
- { label: "สมดุลชีวิตการทำงาน ", value: 7 },
- { label: "บรรยากาศในการทำงาน ", value: 8 },
- { label: "การพัฒนาในสายอาชีพ ", value: 9 },
- { label: "โอกาสความก้าวหน้า ", value: 10 },
- { label: "การได้รับการยอมรับจากสังคม ", value: 11 },
- { label: "อื่น ๆ (ระบุ) ", value: 12 },
-]);
+// const reasonWork_option = ref([
+// { label: "ความมั่นคงในการทำงาน ", value: 0 },
+// { label: "สิทธิประโยชน์/สวัสดิการ", value: 1 },
+// { label: "อัตราเงินเดือน ", value: 2 },
+// { label: "ลักษณะงาน ", value: 3 },
+// { label: "วัฒนธรรมการทำงานของข้าราชการ ", value: 4 },
+// { label: "นโยบายของหน่วยงาน ", value: 5 },
+// { label: "ระบบการทำงาน", value: 6 },
+// { label: "สมดุลชีวิตการทำงาน ", value: 7 },
+// { label: "บรรยากาศในการทำงาน ", value: 8 },
+// { label: "การพัฒนาในสายอาชีพ ", value: 9 },
+// { label: "โอกาสความก้าวหน้า ", value: 10 },
+// { label: "การได้รับการยอมรับจากสังคม ", value: 11 },
+// { label: "อื่น ๆ (ระบุ) ", value: 12 },
+// ]);
const exitFactorOther = ref("");
-const exitFactor_option = ref([
- { label: "อัตราเงินเดือน ", value: 0 },
- { label: "สวัสดิการ", value: 1 },
- { label: "ลักษณะงาน ", value: 2 },
- { label: "ระบบการทำงาน ", value: 3 },
- { label: "ระบบสนับสนุนการปฏิบัติงาน ", value: 4 },
- { label: "การมอบหมายงานที่ชัดเจนและเหมาะสม ", value: 5 },
- { label: "การบริหารงานของผู้บังคับบัญชา", value: 6 },
- { label: "การทำงานเป็นทีมกับเพื่อนร่วมงาน ", value: 7 },
- { label: "ระบบบริหารงานภายในหน่วยงาน ", value: 8 },
- { label: "บรรยากาศในการทำงาน ", value: 9 },
- { label: "การปฏิบัติอย่างเป็นธรรม ", value: 10 },
- { label: "การยอมรับความแตกต่างหลากหลาย ", value: 11 },
- { label: "การดูแลและให้ความช่วยเหลือในช่วงเริ่มต้นปฏิบัติงาน ", value: 12 },
- { label: "การพัฒนาอย่างเป็นระบบและต่อเนื่อง ", value: 13 },
- { label: "โอกาสความก้าวหน้า ", value: 14 },
- { label: "อื่น ๆ (ระบุ) ", value: 15 },
-]);
+// const exitFactor_option = ref([
+// { label: "อัตราเงินเดือน ", value: 0 },
+// { label: "สวัสดิการ", value: 1 },
+// { label: "ลักษณะงาน ", value: 2 },
+// { label: "ระบบการทำงาน ", value: 3 },
+// { label: "ระบบสนับสนุนการปฏิบัติงาน ", value: 4 },
+// { label: "การมอบหมายงานที่ชัดเจนและเหมาะสม ", value: 5 },
+// { label: "การบริหารงานของผู้บังคับบัญชา", value: 6 },
+// { label: "การทำงานเป็นทีมกับเพื่อนร่วมงาน ", value: 7 },
+// { label: "ระบบบริหารงานภายในหน่วยงาน ", value: 8 },
+// { label: "บรรยากาศในการทำงาน ", value: 9 },
+// { label: "การปฏิบัติอย่างเป็นธรรม ", value: 10 },
+// { label: "การยอมรับความแตกต่างหลากหลาย ", value: 11 },
+// { label: "การดูแลและให้ความช่วยเหลือในช่วงเริ่มต้นปฏิบัติงาน ", value: 12 },
+// { label: "การพัฒนาอย่างเป็นระบบและต่อเนื่อง ", value: 13 },
+// { label: "โอกาสความก้าวหน้า ", value: 14 },
+// { label: "อื่น ๆ (ระบุ) ", value: 15 },
+// ]);
const suggestFriendsReason = ref("");
-const suggestFriends_option = ref([
- { label: "แนะนำ ", value: true },
- { label: "ไม่แนะนำ (ระบุ)", value: false },
-]);
-const timeThink_option = ref([
- { label: "น้อยกว่า 2 สัปดาห์ ", value: 0 },
- { label: "1 เดือน - 3 เดือน", value: 1 },
- { label: "3 เดือน - 6 เดือน ", value: 2 },
- { label: "6 เดือนขึ้นไป ", value: 3 },
-]);
+// const suggestFriends_option = ref([
+// { label: "แนะนำ ", value: true },
+// { label: "ไม่แนะนำ (ระบุ)", value: false },
+// ]);
+// const timeThink_option = ref([
+// { label: "น้อยกว่า 2 สัปดาห์ ", value: 0 },
+// { label: "1 เดือน - 3 เดือน", value: 1 },
+// { label: "3 เดือน - 6 เดือน ", value: 2 },
+// { label: "6 เดือนขึ้นไป ", value: 3 },
+// ]);
const haveJobReason = ref("");
-const haveJob_option = ref([
- { label: "มี (ระบุ) ", value: true },
- { label: "ไม่มี", value: false },
-]);
+// const haveJob_option = ref([
+// { label: "มี (ระบุ) ", value: true },
+// { label: "ไม่มี", value: false },
+// ]);
const futureWorkReason = ref("");
-const futureWork_option = ref([
- { label: "อยาก ", value: true },
- { label: "ไม่อยาก (ระบุ)", value: false },
-]);
+// const futureWork_option = ref([
+// { label: "อยาก", value: true },
+// { label: "ไม่อยาก (ระบุ)", value: false },
+// ]);
const adjustOther = ref("");
-const adjust_option = ref([
- { label: "อัตราเงินเดือน ", value: 0 },
- { label: "สวัสดิการ", value: 1 },
- { label: "ลักษณะงาน ", value: 2 },
- { label: "ระบบการทำงาน ", value: 3 },
- { label: "ระบบสนับสนุนการปฏิบัติงาน ", value: 4 },
- { label: "การมอบหมายงานที่ชัดเจนและเหมาะสม ", value: 5 },
- { label: "การบริหารงานของผู้บังคับบัญชา", value: 6 },
- { label: "การทำงานเป็นทีมกับเพื่อนร่วมงาน ", value: 7 },
- { label: "ระบบบริหารงานภายในหน่วยงาน ", value: 8 },
- { label: "บรรยากาศในการทำงาน ", value: 9 },
- { label: "การปฏิบัติอย่างเป็นธรรม ", value: 10 },
- { label: "การยอมรับความแตกต่างหลากหลาย ", value: 11 },
- { label: "การดูแลและให้ความช่วยเหลือในช่วงเริ่มต้นปฏิบัติงาน ", value: 12 },
- { label: "การพัฒนาอย่างเป็นระบบและต่อเนื่อง ", value: 13 },
- { label: "โอกาสความก้าวหน้า ", value: 14 },
- { label: "อื่น ๆ (ระบุ) ", value: 15 },
-]);
+// const adjust_option = ref([
+// { label: "อัตราเงินเดือน ", value: 0 },
+// { label: "สวัสดิการ", value: 1 },
+// { label: "ลักษณะงาน ", value: 2 },
+// { label: "ระบบการทำงาน ", value: 3 },
+// { label: "ระบบสนับสนุนการปฏิบัติงาน ", value: 4 },
+// { label: "การมอบหมายงานที่ชัดเจนและเหมาะสม ", value: 5 },
+// { label: "การบริหารงานของผู้บังคับบัญชา", value: 6 },
+// { label: "การทำงานเป็นทีมกับเพื่อนร่วมงาน ", value: 7 },
+// { label: "ระบบบริหารงานภายในหน่วยงาน ", value: 8 },
+// { label: "บรรยากาศในการทำงาน ", value: 9 },
+// { label: "การปฏิบัติอย่างเป็นธรรม ", value: 10 },
+// { label: "การยอมรับความแตกต่างหลากหลาย ", value: 11 },
+// { label: "การดูแลและให้ความช่วยเหลือในช่วงเริ่มต้นปฏิบัติงาน ", value: 12 },
+// { label: "การพัฒนาอย่างเป็นระบบและต่อเนื่อง ", value: 13 },
+// { label: "โอกาสความก้าวหน้า ", value: 14 },
+// { label: "อื่น ๆ (ระบุ) ", value: 15 },
+// ]);
onMounted(async () => {
if (keycloak.tokenParsed != null) {
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
}
await getData();
+ await fecthquestion();
});
//นำข้อมูลมาแสดง
@@ -164,6 +177,12 @@ const getData = async () => {
futureWork.value = data.futureWork ?? null;
futureWorkReason.value = data.futureWorkReason ?? "";
suggestion.value = data.suggestion ?? "";
+ score.forEach((item, index) => {
+ const scoreKey = `score${item.no}`;
+ item.score = data[scoreKey] ?? 0;
+ scoreTotal.value = data.scoreTotal ?? 0;
+ comment.value = data.comment;
+ });
})
.catch((e) => {
messageError($q, e);
@@ -172,16 +191,146 @@ const getData = async () => {
hideLoader();
});
};
+// เรียกคำถามแบบสอบถาม
+const questionDesc = reactive([
+ {
+ question1Desc: "",
+ question2Desc: "",
+ question3Desc: "",
+ question4Desc: "",
+ question5Desc: "",
+ question6Desc: "",
+ question7Desc: "",
+ question8Desc: "",
+ question9Desc: "",
+ question10Desc: "",
+ },
+]);
+const question1Answer = ref([]);
+const question2Answer = ref([]);
+const question3Answer = ref([]);
+const question4Answer = ref([]);
+const question7Answer = ref([]);
+const question8Answer = ref([]);
+const question9Answer = ref([]);
+async function fecthquestion() {
+ await http
+ .get(config.API.questionnaireList())
+ .then((result) => {
+ const data = result.data.result;
+ console.log(data);
+ // คำถามแบบสอบถามหลัก
+ for (let i = 1; i <= 10; i++) {
+ questionDesc[`question${i}Desc`] =
+ `${i}.` + " " + data[`question${i}Desc`];
+ }
+ // คำถามแบบสอบถามย่อย
+ question1Answer.value = data.question1Answer.map(
+ (e: any, index: number) => ({
+ label: e,
+ value: index,
+ })
+ );
+ question2Answer.value = data.question2Answer.map(
+ (e: any, index: number) => ({
+ label: e,
+ value: index,
+ })
+ );
+ question3Answer.value = data.question3Answer.map(
+ (e: any, index: number) => ({
+ label: e,
+ value: index,
+ })
+ );
+ question4Answer.value = data.question4Answer.map(
+ (e: any, index: number) => ({
+ label: e,
+ value: index,
+ })
+ );
+ question7Answer.value = data.question7Answer.map((e: any) => ({
+ label: e,
+ value: e == "ไม่มี" ? false : true,
+ }));
+ question8Answer.value = data.question8Answer.map((e: any) => ({
+ label: e,
+ value: e == "แนะนำ" ? true : false,
+ }));
+ question9Answer.value = data.question9Answer.map((e: any) => ({
+ label: e,
+ value: e == "อยาก" ? true : false,
+ }));
+ })
+ .catch((err) => {
+ messageError($q, err);
+ });
+}
watch(score, () => {
scoreTotal.value = score.reduce((accumulator, object) => {
return accumulator + Number(object.score);
}, 0);
-})
+});
+const saveClick = () => {
+ if (comment.value === "" ||
+ score[0].score === "" ||
+ score[1].score === "" ||
+ score[2].score === "" ||
+ score[3].score === "" ||
+ score[4].score === "" ||
+ score[5].score === "" ||
+ score[6].score === "" ||
+ score[7].score === "" ||
+ score[8].score === "" ||
+ score[9].score === "" ||
+ scoreTotal.value === "") {
+ dialogMessageNotify($q, "กรุณากรอกคะแนน เเละ ความคิดเห็น");
+ } else {
+ dialogConfirm($q, () => putData());
+ }
+};
+const putData = () => {
+ const body = {
+ score1: Number(score[0].score),
+ score2: Number(score[1].score),
+ score3: Number(score[2].score),
+ score4: Number(score[3].score),
+ score5: Number(score[4].score),
+ score6: Number(score[5].score),
+ score7: Number(score[6].score),
+ score8: Number(score[7].score),
+ score9: Number(score[8].score),
+ score10: Number(score[9].score),
+ scoreTotal: scoreTotal.value,
+ comment: comment.value,
+ };
+ showLoader();
+ http
+ .put(config.API.commentExitInterview(dataId), body)
+ .then((res) => {
+ success($q, "บันทึกข้อมูลสำเร็จ");
+ })
+ .catch((e) => {
+ messageError($q, e);
+ })
+ .finally(async () => {
+ router.push(`/exit-Interview`);
+ });
+};
-
+
รายละเอียด Exit interview ของ {{ prefix }} {{ fullname }}
@@ -238,180 +387,418 @@ watch(score, () => {
-
+
แบบสอบถาม
+
- 1. เหตุใดท่านจึงตัดสินใจร่วมงานกับกรุงเทพมหานคร (เลือกได้มากกว่า
- 1 ข้อ)
+
+ {{ questionDesc.question1Desc }}
-
+
-
+
-
+ ]"
+ />
- 2. สำหรับการลาออกในครั้งนี้
- ท่านได้คิดทบทวนอย่างจริงจังเป็นระยะเวลานานเท่าใด
+
+ {{ questionDesc.question2Desc }}
-
+
-
+
- 3. ปัจจัยใดที่ทำให้ท่านตัดสินใจลาออกจากราชการ (เลือกได้มากกว่า 1
- ข้อ )
+
+ {{ questionDesc.question3Desc }}
-
+
-
+
-
+ ]"
+ />
- 4. อะไรคือสิ่งที่ท่านเห็นว่าควรปรับปรุง (เลือกได้มากกว่า 1 ข้อ)
+
+ {{ questionDesc.question4Desc }}
-
+
-
+
-
+ ]"
+ />
- 5. โปรดระบุสาเหตุที่แท้จริง
- ที่ทำให้ท่านตัดสินใจลาออกจากการปฏิบัติราชการกับกรุงเทพมหานคร ?
+
+ {{ questionDesc.question5Desc }}
-
+
-
+
- 6. ปัจจัยใดที่จะช่วยทำให้ท่านเปลี่ยนใจ
- ไม่อยากลาออกจากการปฏิบัติราชการกับกรุงเทพมหานคร
+
+ {{ questionDesc.question6Desc }}
-
+
-
+
- 7. ท่านมีงานใหม่หรือไม่ ถ้ามี (โปรดระบุ
+
+ {{ questionDesc.question7Desc }}
-
+
-
+
-
+ ]"
+ />
- 8. ท่านจะแนะนำเพื่อนให้มาร่วมงานกับกรุงเทพมหานครหรือไม่ (ถ้าไม่
- โปรดระบุเหตุผล)
+
+ {{ questionDesc.question8Desc }}
-
+
-
+
-
+ ]"
+ />
- 9. หากท่านมีโอกาสในอนาคต
+
+ {{ questionDesc.question9Desc }}
-
+
-
-
+
-
+ ]"
+ />
- 10. ความคิดเห็นและข้อเสนอแนะอื่น ๆ
+
+ {{ questionDesc.question10Desc }}
-
+
-
-
+
-
+
ความคิดเห็น
-
@@ -419,10 +806,14 @@ watch(score, () => {
-
+
-
diff --git a/src/modules/06_retirement/interface/request/Main.ts b/src/modules/06_retirement/interface/request/Main.ts
index e4ea7770c..010a13d45 100644
--- a/src/modules/06_retirement/interface/request/Main.ts
+++ b/src/modules/06_retirement/interface/request/Main.ts
@@ -1 +1,14 @@
-export type {};
+interface OptionQuestions {
+ label: string;
+ value: number;
+}
+interface OptionQuestions2 {
+ label: string;
+ value: boolean;
+}
+
+
+export type {
+ OptionQuestions,
+ OptionQuestions2
+};