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..1aff7102a 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/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/06_retirement/components/ListRetirement/AddList.vue b/src/modules/06_retirement/components/ListRetirement/AddList.vue index 7f72cdc63..98126b058 100644 --- a/src/modules/06_retirement/components/ListRetirement/AddList.vue +++ b/src/modules/06_retirement/components/ListRetirement/AddList.vue @@ -12,20 +12,20 @@ const { messageError, success, showLoader, hideLoader } = mixin; const route = useRoute(); const type_params = route.params.type; -const id = route.params.id; +const retireld_params = route.params.id; const props = defineProps({ retireld: String, - listId: String, + profileId: String, UpdateListId: { - type: Function, - default: () => console.log("UpdateListId"), - }, + type: Function, + default: () => console.log("UpdateListId"), + }, }); const modal = ref(false); const retireld = ref(); const type = ref(); -const listId = ref(props.listId); +const filter = ref(""); const columns = ref([ { @@ -63,13 +63,6 @@ const columns = ref([ field: "organizationOrganization", align: "left", }, - { - name: "funtion", - required: true, - label: "", - field: "funtion", - align: "left", - }, ]); const rows = ref([ // { @@ -115,10 +108,8 @@ const rows = ref([ // affiliation: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒", // }, ]); -const filter = ref(""); -watch(modal, () => { - // console.log(props); +watch(modal, () => { if (modal.value === true) { retireld.value = props.retireld; if (type_params === "officer") { @@ -128,16 +119,15 @@ watch(modal, () => { fecthlistRetire(); } }); -const updateListData = (retireld: string, pId: string) => { - props.UpdateListId(retireld, pId); -}; +// fecth profile const fecthlistRetire = async () => { showLoader(); await http .get(config.API.profileOrganizRoot) .then((res) => { + // console.log(res); + const id = res.data.result[0].id; - // console.log(id); if (id !== "") { findlist(id); } @@ -146,13 +136,11 @@ const fecthlistRetire = async () => { messageError($q, e); }); }; - const findlist = async (id: string) => { let data = [{}]; if (type.value === "officer") { data = [{ criteriaType: "is_retire", criteriaValue: "false" }]; } else if (type.value === "all") { - // console.log("all"); data = [ { criteriaType: "is_retire", criteriaValue: "false" }, { criteriaType: "employee_class", criteriaValue: "perm" }, @@ -181,15 +169,16 @@ const findlist = async (id: string) => { hideLoader(); }); }; + +// putlist const clickAdd = (props: any) => { // console.log("props===>",props.row.id) if (retireld.value == undefined) { - retireld.value = id; + retireld.value = retireld_params; } let data: any = props.row.id; - - console.log("retireld & profileId",retireld.value, data); + // console.log("retireld & profileId", retireld.value, data); $q.dialog({ title: "ยืนยันการเพิ่มข้อมูล", @@ -219,6 +208,11 @@ const clickAdd = (props: any) => { .onCancel(() => {}) .onDismiss(() => {}); }; +// update retireld +const updateListData = (retireld: string, pId: string) => { + props.UpdateListId(retireld, pId); +}; + const paging = ref(true); const pagination = ref({ sortBy: "fullname", @@ -296,6 +290,7 @@ const paginationLabel = (start: number, end: number, total: number) => { {{ col.label }} +