diff --git a/src/api/06_retirement/api.retirement.ts b/src/api/06_retirement/api.retirement.ts index bca70474b..7cf8a8057 100644 --- a/src/api/06_retirement/api.retirement.ts +++ b/src/api/06_retirement/api.retirement.ts @@ -4,12 +4,9 @@ const retirement = `${env.API_URI}/retirement` export default { profile: (type: string, year: string) => `${retirement}/profile/${type}/${year}`, - profileRetire: (retireId: string) => `${retirement}/profile/${retireId}`, + profileRetire: (retireProfileId: string) => `${retirement}/profile/${retireProfileId}`, listRetire: (retireId: string) => `${retirement}/${retireId}`, createnote: () => `${retirement}/reason`, reasonId: (retireId:string) => `${retirement}/reason/${retireId}`, retirement:(type:string,year:string) => `${retirement}/${type}/${year}` - - - }; diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue index 15c6ee09e..b78d8d0bf 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue @@ -4,67 +4,181 @@ import { useQuasar } from "quasar"; import { useProbationDataStore } from "@/modules/05_placement/store"; import { useCounterMixin } from "@/stores/mixin"; -const Part2 = defineAsyncComponent( - () => - import( - "@/modules/05_placement/components/probation/FormEvaluation/SubForm/Part2.vue" - ) -); -const Part3 = defineAsyncComponent( - () => - import( - "@/modules/05_placement/components/probation/FormEvaluation/SubForm/Part3.vue" - ) -); -const Footer = defineAsyncComponent( - () => - import( - "@/modules/05_placement/components/probation/FormEvaluation/Footer.vue" - ) -); - const $q = useQuasar(); const probationStore = useProbationDataStore(); const { ratingColors } = probationStore; -const list1_1 = [ - { id: "1", label: "ผลผลิตของงานที่คาดหวัง 1" }, - { id: "2", label: "ผลผลิตของงานที่คาดหวัง 2" }, - { id: "3", label: "ผลผลิตของงานที่คาดหวัง 3" }, - { id: "4", label: "ผลผลิตของงานที่คาดหวัง 4" }, - { id: "5", label: "ผลผลิตของงานที่คาดหวัง 5" }, +const list2_1 = [ + { id: "1", label: "ให้บริการประชาชนหรือผู้รับบริการด้วยอัธยาศัยดี" }, + { id: "2", label: "มีความรับผิดชอบในการปฏิบัติบัติงาน" }, + { + id: "3", + label: + "ให้บริการประชาชนหรือผู้รับบริการด้วยความรวดเร็ว เอาใจใส่เป็นมาตรฐานเดียวกัน", + }, + { + id: "4", + label: "ตั้งใจปฏิบัติบัติหน้าที่ราชการด้วยความอุตสาหะ ขยันหมั่นเพียร", + }, ]; -const list1_2 = [ - { id: "1", label: "ผลผลิตของงานที่เกิดขึ้น 1" }, - { id: "2", label: "ผลผลิตของงานที่เกิดขึ้น 2" }, - { id: "3", label: "ผลผลิตของงานที่เกิดขึ้น 3" }, - { id: "4", label: "ผลผลิตของงานที่เกิดขึ้น 4" }, - { id: "5", label: "ผลผลิตของงานที่เกิดขึ้น 5" }, +const list2_2 = [ + { + id: "1", + label: "อุทิศตนและเสียสละเวลาในการปฏิบัติบัติงานอย่างเต็มกำลังความสามารถ", + }, + { id: "2", label: "มีจิตสำนึกที่ดี ปฏิบัติบัติงานด้วยความซื่อสัตย์ สุจริต" }, + { + id: "3", + label: + "ยึดมั่นในสถาบันบัพระมหากษัตริย์ และไม่กระทำการใด ๆ อันจะก่อให้เกิดความเสียหายต่อประเทศชาติ", + }, +]; +const list2_3 = [ + { id: "1", label: "มีความรับรัผิดชอบในการรักษาเวลาทำงาน" }, + { + id: "2", + label: "แต่งกายในการปฏิบัติบัติงานได้อย่างเหมาะสมกับการเป็นข้าราชการ", + }, + { + id: "3", + label: "ไม่กระทำการใด ๆ อันอาจก่อให้เกิดความเสียหายแก่ชื่อเสียงของหน่วยงาน", + }, + { + id: "4", + label: + "ไม่กระทำการใด ๆ อันเป็นการเสื่อมเกียรติและศักดิ์ศรีของความเป็นข้าราชการ", + }, + { + id: "5", + label: "ปฏิบัติบัติหน้าที่อย่างตรงไปตรงมาโดยยึกหลักจรรยาบรรณวิชาชีพ", + }, ]; - -const etc_text = ref(null); -const text2_1 = ref(""); - -const model = ref(0); -const model1 = ref(0); -const model1_2 = ref(0); -const model1_3 = ref(0); -const model1_4 = ref(0); -const model1_5 = ref(0); -const model1_6 = ref(0); -const modelEtc = ref(0); -const etc = ref(false); const mixin = useCounterMixin(); -const { date2Thai } = mixin; +const { date2Thai, notifyError } = mixin; const dateToday = ref(new Date("10-10-2023")); const dateEnd = ref(new Date("12-10-2023")); const period = ref(1); +// part 1 +const knowledge_level = ref(0); +const skill_level = ref(0); +const competency_level = ref(0); +const learn_level = ref(0); +const apply_level = ref(0); +const success_level = ref(0); +const etc = ref(false); +const achievement_other = ref([{ text: "", level: 0 }]); +// part 2 +const conduct_level = ref([]); +const moral_level = ref([]); +const discipline_level = ref([]); +const etc2 = ref(false); // checkBox 2.4 +const behavio_orther = ref([{ text: "", level: 0 }]); +const behavio_strength_desc = ref(""); +const behavio_inprove_desc = ref(""); +// part 3 +const orientation = ref(null); +const self_learning = ref(null); +const training_seminar = ref(null); +const other_training = ref(null); +//rules +const behavio_strengthRef = ref(null); +const behavio_strengthRules = [ + (val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น", +]; +const behavio_inproveRef = ref(null); +const behavio_inproveRules = [ + (val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลสิ่งที่ควรปรับปรุง", +]; + +const savaForm = () => { + let hasError = false; + behavio_strengthRef.value.validate(); + behavio_inproveRef.value.validate(); + if ( + knowledge_level.value === 0 || + skill_level.value === 0 || + competency_level.value === 0 || + learn_level.value === 0 || + apply_level.value === 0 || + success_level.value === 0 || + conduct_level.value.length < 4 || + moral_level.value.length < 3 || + discipline_level.value.length < 5 || + behavio_strength_desc.value === "" || + behavio_inprove_desc.value === "" || + orientation.value === null || + self_learning.value === null || + training_seminar.value === null + ) { + hasError = true; + } else if ( + (etc.value == true && + (achievement_other.value.text === undefined || + achievement_other.value.text == "" || + achievement_other.value.level == undefined || + achievement_other.value.level === 0)) || + (etc2.value == true && + (behavio_orther.value.text === undefined || + behavio_orther.value.text == "" || + behavio_orther.value.level === undefined || + behavio_orther.value.level == 0)) + ) { + hasError = true; + } else putformData(); + + if (hasError === true) { + notifyError($q, "กรุณากรอกข้อมูลให้ครบ"); + } +}; +const putformData = () => { + const data = { + knowledge_level: knowledge_level.value, + skill_level: skill_level.value, + competency_level: competency_level.value, + learn_level: learn_level.value, + apply_level: apply_level.value, + success_level: success_level.value, + achievement_other: achievement_other.value, + conduct1_level: conduct_level.value[0], + conduct2_level: conduct_level.value[1], + conduct3_level: conduct_level.value[2], + conduct4_level: conduct_level.value[3], + moral1_level: moral_level.value[0], + moral2_level: moral_level.value[1], + moral3_level: moral_level.value[2], + discipline1_level: discipline_level.value[0], + discipline2_level: discipline_level.value[1], + discipline3_level: discipline_level.value[2], + discipline4_level: discipline_level.value[3], + discipline5_level: discipline_level.value[4], + behavio_orther: behavio_orther.value, + behavio_strength_desc: behavio_strength_desc.value, + behavio_inprove_desc: behavio_inprove_desc.value, + orientation: Number(orientation.value), + self_learning: Number(self_learning.value), + training_seminar: Number(training_seminar.value), + other_training: Number(other_training.value), + }; + $q.dialog({ + title: "ยืนยันการบันทึกข้อมูล", + message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?", + cancel: { + flat: true, + color: "negative", + }, + persistent: true, + }) + .onOk(async () => { + console.log("บันทึกข้อมูล", data); + }) + .onCancel(() => {}) + .onDismiss(() => {}); +}; diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue new file mode 100644 index 000000000..43a2e4262 --- /dev/null +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue @@ -0,0 +1,748 @@ + + + + + diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue index c5aa2bc4f..767b28d88 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue @@ -3,27 +3,11 @@ import { ref, defineAsyncComponent } from "vue"; import { useQuasar } from "quasar"; import { useProbationDataStore } from "@/modules/05_placement/store"; import { useCounterMixin } from "@/stores/mixin"; +import { formatDate } from "@fullcalendar/core"; -const Part2 = defineAsyncComponent( - () => - import( - "@/modules/05_placement/components/probation/FormEvaluation/SubForm/Part2.vue" - ) -); -const Part3 = defineAsyncComponent( - () => - import( - "@/modules/05_placement/components/probation/FormEvaluation/SubForm/Part3.vue" - ) -); -const Footer = defineAsyncComponent( - () => - import( - "@/modules/05_placement/components/probation/FormEvaluation/Footer.vue" - ) -); const $q = useQuasar(); const probationStore = useProbationDataStore(); + const { ratingColors } = probationStore; const list1_1 = [ @@ -40,26 +24,234 @@ const list1_2 = [ { id: "4", label: "ผลผลิตของงานที่เกิดขึ้น 4" }, { id: "5", label: "ผลผลิตของงานที่เกิดขึ้น 5" }, ]; - -const etc_text = ref(null); -const text2_1 = ref(""); - -const model = ref(0); -const model1 = ref(0); -const model1_2 = ref(0); -const model1_3 = ref(0); -const model1_4 = ref(0); -const model1_5 = ref(0); -const model1_6 = ref(0); -const modelEtc = ref(0); -const text2_2 = ref(""); -const etc = ref(false); +const list2_1 = [ + { id: "1", label: "ให้บริการประชาชนหรือผู้รับบริการด้วยอัธยาศัยดี" }, + { id: "2", label: "มีความรับผิดชอบในการปฏิบัติบัติงาน" }, + { + id: "3", + label: + "ให้บริการประชาชนหรือผู้รับบริการด้วยความรวดเร็ว เอาใจใส่เป็นมาตรฐานเดียวกัน", + }, + { + id: "4", + label: "ตั้งใจปฏิบัติบัติหน้าที่ราชการด้วยความอุตสาหะ ขยันหมั่นเพียร", + }, +]; +const list2_2 = [ + { + id: "1", + label: "อุทิศตนและเสียสละเวลาในการปฏิบัติบัติงานอย่างเต็มกำลังความสามารถ", + }, + { id: "2", label: "มีจิตสำนึกที่ดี ปฏิบัติบัติงานด้วยความซื่อสัตย์ สุจริต" }, + { + id: "3", + label: + "ยึดมั่นในสถาบันบัพระมหากษัตริย์ และไม่กระทำการใด ๆ อันจะก่อให้เกิดความเสียหายต่อประเทศชาติ", + }, +]; +const list2_3 = [ + { id: "1", label: "มีความรับรัผิดชอบในการรักษาเวลาทำงาน" }, + { + id: "2", + label: "แต่งกายในการปฏิบัติบัติงานได้อย่างเหมาะสมกับการเป็นข้าราชการ", + }, + { + id: "3", + label: "ไม่กระทำการใด ๆ อันอาจก่อให้เกิดความเสียหายแก่ชื่อเสียงของหน่วยงาน", + }, + { + id: "4", + label: + "ไม่กระทำการใด ๆ อันเป็นการเสื่อมเกียรติและศักดิ์ศรีของความเป็นข้าราชการ", + }, + { + id: "5", + label: "ปฏิบัติบัติหน้าที่อย่างตรงไปตรงมาโดยยึกหลักจรรยาบรรณวิชาชีพ", + }, +]; +const option = ref(["นาย ภูริณัฐ บุญขาว", "นาย พงศกร วรารักษ์"]); const mixin = useCounterMixin(); -const { date2Thai } = mixin; +const { date2Thai, success, notifyError } = mixin; const dateToday = ref(new Date("10-10-2023")); const dateEnd = ref(new Date("12-10-2023")); const period = ref(1); + +// part 1 +const evaluate_expenct_level = ref([ + { id: "1", label: "ผลผลิตของงานที่คาดหวัง 1", level: 0 }, + { id: "2", label: "ผลผลิตของงานที่คาดหวัง 2", level: 0 }, + { id: "3", label: "ผลผลิตของงานที่คาดหวัง 3", level: 0 }, + { id: "4", label: "ผลผลิตของงานที่คาดหวัง 4", level: 0 }, + { id: "5", label: "ผลผลิตของงานที่คาดหวัง 5", level: 0 }, +]); +const evaluate_ouptut = ref([ + { level: 0, text: "" }, + { level: 0, text: "" }, + { level: 0, text: "" }, + { level: 0, text: "" }, + { level: 0, text: "" }, +]); +const knowledge_level = ref(0); +const skill_level = ref(0); +const competency_level = ref(0); +const learn_level = ref(0); +const apply_level = ref(0); +const success_level = ref(0); +const etc = ref(false); // checkBox 1.8 +const achievement_other = ref([{ text: "", level: 0 }]); +// const etc_text = ref(""); +// const ext_value = ref(0); +const achievement_strength_desc = ref(""); +const achievement_inprove_desc = ref(""); +// part 2 +const conduct_level = ref([]); +const moral_level = ref([]); +const discipline_level = ref([]); +const etc2 = ref(false); // checkBox 2.4 +const behavio_orther = ref([{ text: "", level: 0 }]); +// const etc_text2 = ref(""); +// const ext_value2 = ref(0); +const behavio_strength_desc = ref(""); +const behavio_inprove_desc = ref(""); +// part 3 +const orientation = ref(null); +const self_learning = ref(null); +const training_seminar = ref(null); +const other_training = ref(null); +// footer +const Autherise = ref(null); +const dateAutherise = ref(new Date()); + +//rules +const evaluate_ouptutRules = [ + (val: any) => (val && val.length > 0) || "กรุณากรอกเหตุผลที่เกิดขึ้น", +]; +const achievement_strengthRef = ref(null); +const achievement_strengthRules = [ + (val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น", +]; +const achievement_inproveRef = ref(null); +const achievement_inproveRules = [ + (val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลสิ่งที่ควรปรับปรุง", +]; +const behavio_strengthRef = ref(null); +const behavio_strengthRules = [ + (val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น", +]; +const behavio_inproveRef = ref(null); +const behavio_inproveRules = [ + (val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลสิ่งที่ควรปรับปรุง", +]; + +const savaForm = () => { + achievement_strengthRef.value.validate(); + achievement_inproveRef.value.validate(); + behavio_strengthRef.value.validate(); + behavio_inproveRef.value.validate(); + + let hasError = false; + const filterlevel1_1 = evaluate_expenct_level.value.filter( + (e: any) => e.level == 0 + ); + const filter_ouptut1_2 = evaluate_ouptut.value.filter( + (e: any) => e.level == 0 || e.text == "" + ); + + if ( + filterlevel1_1.length != 0 || + filter_ouptut1_2.length != 0 || + knowledge_level.value === 0 || + skill_level.value === 0 || + competency_level.value === 0 || + learn_level.value === 0 || + apply_level.value === 0 || + success_level.value === 0 || + achievement_strength_desc.value === "" || + achievement_inprove_desc.value === "" || + conduct_level.value.length < 4 || + moral_level.value.length < 3 || + discipline_level.value.length < 5 || + behavio_strength_desc.value === "" || + behavio_inprove_desc.value === "" || + orientation.value === null || + self_learning.value === null || + training_seminar.value === null + ) { + hasError = true; + } else if ( + (etc.value == true && + (achievement_other.value.text === undefined || + achievement_other.value.text == "" || + achievement_other.value.level == undefined || + achievement_other.value.level === 0)) || + (etc2.value == true && + (behavio_orther.value.text === "" || + behavio_orther.value.text == undefined || + behavio_orther.value.level === undefined || + behavio_orther.value.level == 0)) + ) { + hasError = true; + } else putformData(); + + if (hasError === true) { + notifyError($q, "กรุณากรอกข้อมูลให้ครบ"); + } +}; +const putformData = () => { + const data = { + evaluate_expenct_level: evaluate_expenct_level.value, + evaluate_ouptut: evaluate_ouptut.value, + knowledge_level: knowledge_level.value, + skill_level: skill_level.value, + competency_level: competency_level.value, + learn_level: learn_level.value, + apply_level: apply_level.value, + success_level: success_level.value, + achievement_other: achievement_other.value, + // achievement_other_desc: etc_text.value, + // achievement_other_level: ext_value.value, + achievement_strength_desc: achievement_strength_desc.value, + achievement_inprove_desc: achievement_inprove_desc.value, + conduct1_level: conduct_level.value[0], + conduct2_level: conduct_level.value[1], + conduct3_level: conduct_level.value[2], + conduct4_level: conduct_level.value[3], + moral1_level: moral_level.value[0], + moral2_level: moral_level.value[1], + moral3_level: moral_level.value[2], + discipline1_level: discipline_level.value[0], + discipline2_level: discipline_level.value[1], + discipline3_level: discipline_level.value[2], + discipline4_level: discipline_level.value[3], + discipline5_level: discipline_level.value[4], + // behavio_orther_desc: etc_text2.value, + // behavio_orther_level: ext_value2.value, + behavio_orther: behavio_orther.value, + behavio_strength_desc: behavio_strength_desc.value, + behavio_inprove_desc: behavio_inprove_desc.value, + orientation: Number(orientation.value), + self_learning: Number(self_learning.value), + training_seminar: Number(training_seminar.value), + other_training: Number(other_training.value), + + // commander_dated: dateAutherise.value, + }; + $q.dialog({ + title: "ยืนยันการบันทึกข้อมูล", + message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?", + cancel: { + flat: true, + color: "negative", + }, + persistent: true, + }) + .onOk(async () => { + console.log("บันทึกข้อมูล", data); + }) + .onCancel(() => {}) + .onDismiss(() => {}); +}; diff --git a/src/modules/05_placement/components/probation/FormEvaluation/Template2Format2.vue b/src/modules/05_placement/components/probation/FormEvaluation/Template2Format2.vue new file mode 100644 index 000000000..228f8de5a --- /dev/null +++ b/src/modules/05_placement/components/probation/FormEvaluation/Template2Format2.vue @@ -0,0 +1,29 @@ + + + \ No newline at end of file diff --git a/src/modules/05_placement/components/probation/MainDetail.vue b/src/modules/05_placement/components/probation/MainDetail.vue index 1a58e429e..0eade7fc3 100644 --- a/src/modules/05_placement/components/probation/MainDetail.vue +++ b/src/modules/05_placement/components/probation/MainDetail.vue @@ -11,6 +11,9 @@ const TabsTemplate1 = defineAsyncComponent( const TabsTemplate2 = defineAsyncComponent( () => import("@/modules/05_placement/components/probation/FormEvaluation/Template2.vue") ); +const TabsTemplate2Format2 = defineAsyncComponent( + () => import("@/modules/05_placement/components/probation/FormEvaluation/Template2Format2.vue") +); const TabsTemplate3 = defineAsyncComponent( () => import("@/modules/05_placement/components/probation/FormEvaluation/Template3.vue") ); @@ -32,109 +35,70 @@ const activeTab = ref("tab1");