diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue index 88ae71e04..5da05c717 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue @@ -2,6 +2,7 @@ import { ref, onMounted, watch } from "vue"; import { useQuasar } from "quasar"; import { useProbationDataStore } from "@/modules/05_placement/store"; +import { useAssignDataStore } from "@/modules/05_placement/storeAssign"; import { useCounterMixin } from "@/stores/mixin"; import { useRouter, useRoute } from "vue-router"; import http from "@/plugins/http"; @@ -26,12 +27,10 @@ const { } = mixin; const route = useRoute(); const assignId = ref(route.params.form.toString()); +const assignStore = useAssignDataStore(); +const { assign } = assignStore; const personalId = ref(route.params.personalId.toString()); -const saveEdit = (id: string) => { - dialogConfirm($q, () => console.log("save")); -}; - const edit = () => { status.value = true; }; @@ -41,7 +40,6 @@ const cancel = () => { }; const person = ref([]); -const assign = ref([]); const evaluate_no = ref(); const evaluate_id = ref(""); const start_date = ref(new Date()); @@ -106,7 +104,8 @@ onMounted(async () => { if (props.tab && props.action == "edit") { evaluate_no.value = Number(props.tab.charAt(4)); dataArr.value = await props.data; - fecthAssign(); + // fecthAssign(); + fetchEvaluate(); } }); @@ -114,80 +113,90 @@ watch(props, async () => { if (props.tab && props.action == "edit") { evaluate_no.value = Number(props.tab.charAt(4)); dataArr.value = await props.data; - fecthAssign(); + // fecthAssign(); + fetchEvaluate(); } }); -const fecthAssign = async () => { - showLoader(); - await http - .get(config.API.evaluateCreate(assignId.value)) - .then(async (res: any) => { - if (props.action == "add") { - person.value = res.data.data.person; - assign.value = res.data.data.assign; - commander.value = res.data.data.commander; - option.value.push(commander.value); +// const fecthAssign = async () => { +// showLoader(); +// await http +// .get(config.API.evaluateCreate(assignId.value)) +// .then(async (res: any) => { +// console.log(res); - Autherise.value = commander.value.name; - evaluate_no.value = res.data.data.evaluate_no; - start_date.value = res.data.data.start_date; - date_finish.value = res.data.data.end_date; - } - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - if (props.action == "edit") { - fetchEvaluate(); - } - hideLoader(); - }); -}; +// if (props.action == "add") { +// person.value = res.data.data.person; +// // assign.value = res.data.data.assign; +// commander.value = res.data.data.commander; +// option.value.push(commander.value); +// Autherise.value = commander.value.name; +// evaluate_no.value = res.data.data.evaluate_no; +// start_date.value = res.data.data.start_date; +// date_finish.value = res.data.data.end_date; +// } +// }) +// .catch((e) => { +// messageError($q, e); +// }) +// .finally(() => { +// if (props.action == "edit") { +// fetchEvaluate(); +// } +// hideLoader(); +// }); +// }; const fetchEvaluate = async () => { - let data = await dataArr.value; - evaluate_id.value = data.id; - start_date.value = data.date_start; - date_finish.value = data.date_finish; - knowledge_level.value = data.knowledge_level; - skill_level.value = data.skill_level; - competency_level.value = data.competency_level; - learn_level.value = data.learn_level; - apply_level.value = data.apply_level; - success_level.value = data.success_level; - achievement_other.value.text = data.achievement_other_desc; - achievement_other.value.level = data.achievement_other_level; - conduct_level.value[0] = data.conduct1_level; - conduct_level.value[1] = data.conduct2_level; - conduct_level.value[2] = data.conduct3_level; - conduct_level.value[3] = data.conduct4_level; - moral_level.value[0] = data.moral1_level; - moral_level.value[1] = data.moral2_level; - moral_level.value[2] = data.moral3_level; - discipline_level.value[0] = data.discipline1_level; - discipline_level.value[1] = data.discipline2_level; - discipline_level.value[2] = data.discipline3_level; - discipline_level.value[3] = data.discipline4_level; - discipline_level.value[4] = data.discipline5_level; - behavio_orther.value.text = data.behavior_other_desc; - behavio_orther.value.level = data.behavior_other_level; - behavio_strength_desc.value = data.behavior_strength_desc; - behavior_improve_desc.value = data.behavior_improve_desc; - orientation.value = data.orientation.toString(); - self_learning.value = data.self_learning.toString(); - training_seminar.value = data.training_seminar.toString(); - other_training.value = data.other_training.toString(); - if ( - data.achievement_other_desc !== "" && - data.achievement_other_level !== null - ) { - etc.value = true; - } else etc.value = false; - if (data.behavior_other_desc !== "" && data.behavior_other_level !== null) { - etc2.value = true; - } else etc2.value = false; - status.value = false; + // showLoader(); + try { + let data = await dataArr.value; + evaluate_id.value = data.id; + start_date.value = data.date_start; + date_finish.value = data.date_finish; + knowledge_level.value = data.knowledge_level; + skill_level.value = data.skill_level; + competency_level.value = data.competency_level; + learn_level.value = data.learn_level; + apply_level.value = data.apply_level; + success_level.value = data.success_level; + achievement_other.value.text = data.achievement_other_desc; + achievement_other.value.level = data.achievement_other_level; + conduct_level.value[0] = data.conduct1_level; + conduct_level.value[1] = data.conduct2_level; + conduct_level.value[2] = data.conduct3_level; + conduct_level.value[3] = data.conduct4_level; + moral_level.value[0] = data.moral1_level; + moral_level.value[1] = data.moral2_level; + moral_level.value[2] = data.moral3_level; + discipline_level.value[0] = data.discipline1_level; + discipline_level.value[1] = data.discipline2_level; + discipline_level.value[2] = data.discipline3_level; + discipline_level.value[3] = data.discipline4_level; + discipline_level.value[4] = data.discipline5_level; + behavio_orther.value.text = data.behavior_other_desc; + behavio_orther.value.level = data.behavior_other_level; + behavio_strength_desc.value = data.behavior_strength_desc; + behavior_improve_desc.value = data.behavior_improve_desc; + orientation.value = data.orientation.toString(); + self_learning.value = data.self_learning.toString(); + training_seminar.value = data.training_seminar.toString(); + other_training.value = data.other_training.toString(); + if ( + data.achievement_other_desc !== "" && + data.achievement_other_level !== null + ) { + etc.value = true; + } else etc.value = false; + if (data.behavior_other_desc !== "" && data.behavior_other_level !== null) { + etc2.value = true; + } else etc2.value = false; + status.value = false; + // setTimeout(() => { + // hideLoader(); + // }, 1000); + } catch (error) { + hideLoader(); + } }; const Autherise = ref(null); @@ -366,7 +375,9 @@ const save = () => {
- {{ "ครั้งที่ " + evaluate_no }} + {{ + "ครั้งที่ " + evaluate_no + }} ระหว่างวันที่ {{ date2Thai(start_date) }} ถึงวันที่ @@ -549,7 +560,8 @@ const save = () => { - 1.5. ความสามารถในการปรับใช้ความรู้กับงานในหน้าที่ @@ -636,7 +648,8 @@ const save = () => { dense v-model="etc" @click=" - (achievement_other.text = ''), (achievement_other.level = 0) + (achievement_other.text = ''), + (achievement_other.level = 0) " /> @@ -644,7 +657,10 @@ const save = () => { - + @@ -1146,12 +1162,7 @@ const save = () => { - +
diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue index c5502b13a..a582d92d1 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue @@ -2,6 +2,7 @@ import { ref, watch, computed, onMounted } from "vue"; import { useQuasar } from "quasar"; import { useProbationDataStore } from "@/modules/05_placement/store"; +import { useAssignDataStore } from "@/modules/05_placement/storeAssign"; import { useCounterMixin } from "@/stores/mixin"; import { useRouter, useRoute } from "vue-router"; import http from "@/plugins/http"; @@ -12,6 +13,8 @@ const routeName = router.currentRoute.value.name; const $q = useQuasar(); const probationStore = useProbationDataStore(); const { ratingColors } = probationStore; +const assignStore = useAssignDataStore(); +const { assign } = assignStore; const mixin = useCounterMixin(); const { date2Thai, @@ -35,8 +38,6 @@ const edit = () => { const cancel = () => { status.value = false; }; -// const person = ref([]); -const assign = ref([]); const evaluate_no = ref(); const evaluate_id = ref(""); const start_date = ref(new Date()); @@ -46,9 +47,6 @@ const chairman = ref([]); const commander = ref([]); const mentors = ref([{ name: "" }, { name: "" }]); const dataArr = ref(); - -const round = ref(); - const props = defineProps({ tab: String, data: Object, @@ -59,7 +57,7 @@ onMounted(async () => { if (props.tab && props.action == "edit") { evaluate_no.value = Number(props.tab.charAt(4)); dataArr.value = await props.data; - fecthAssign(); + await fetchEvaluate(); } }); @@ -67,95 +65,90 @@ watch(props, async () => { if (props.tab && props.action == "edit") { evaluate_no.value = Number(props.tab.charAt(4)); dataArr.value = await props.data; - fecthAssign(); + await fetchEvaluate(); } }); - - -const fecthAssign = async () => { - showLoader(); - await http - .get(config.API.evaluateChairman(assignId.value)) - .then(async (res: any) => { - if (props.action == "add") { - assign.value = res.data.data.assign; - evaluate_no.value = res.data.data.evaluate_no; - start_date.value = res.data.data.start_date; - date_finish.value = res.data.data.end_date; - chairman.value = res.data.data.chairman; - commander.value = res.data.data.commander; - mentors.value = res.data.data.mentors; - } - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - if (props.action == "edit") { - fetchEvaluate(); - } - hideLoader(); - }); -}; +// const fecthAssign = async () => { +// showLoader(); +// await http +// .get(config.API.evaluateChairman(assignId.value)) +// .then(async (res: any) => { +// if (props.action == "add") { +// assign.value = res.data.data.assign; +// evaluate_no.value = res.data.data.evaluate_no; +// start_date.value = res.data.data.start_date; +// date_finish.value = res.data.data.end_date; +// chairman.value = res.data.data.chairman; +// commander.value = res.data.data.commander; +// mentors.value = res.data.data.mentors; +// } +// }) +// .catch((e) => { +// messageError($q, e); +// }) +// .finally(() => { +// if (props.action == "edit") { +// fetchEvaluate(); +// } +// hideLoader(); +// }); +// }; const fetchEvaluate = async () => { - showLoader(); - let data = await dataArr.value; - evaluate_id.value = data.id; + // showLoader(); + try { + let data = await dataArr.value; + evaluate_id.value = data.id; + start_date.value = data.date_start; + date_finish.value = data.date_finish; + learn_level.value = data.knowledge_level; + apply_level.value = data.apply_level; + success_level.value = data.success_level; + achievement_other.value.text = data.achievement_other_desc; + achievement_other.value.level = data.achievement_other_level; + conduct_level.value[0] = data.conduct1_level; + conduct_level.value[1] = data.conduct2_level; + conduct_level.value[2] = data.conduct3_level; + conduct_level.value[3] = data.conduct4_level; + moral_level.value[0] = data.moral1_level; + moral_level.value[1] = data.moral2_level; + moral_level.value[2] = data.moral3_level; + discipline_level.value[0] = data.discipline1_level; + discipline_level.value[1] = data.discipline2_level; + discipline_level.value[2] = data.discipline3_level; + discipline_level.value[3] = data.discipline4_level; + discipline_level.value[4] = data.discipline5_level; + behavio_orther.value.text = data.behavior_other_desc; + behavio_orther.value.level = data.behavior_other_level; + orientation.value = data.develop_orientation_score; + self_learning.value = data.develop_self_learning_score; + training_seminar.value = data.develop_training_seminar_score; + other_training.value = data.develop_other_training_score; + orientation_percent.value = data.develop_orientation_percent; + self_learning_percent.value = data.develop_self_learning_percent; + training_seminar_percent.value = data.develop_training_seminar_percent; + other_training_percent.value = data.develop_other_training_percent; + develop_result.value = data.develop_result; + evaluate_result.value = data.evaluate_result; - start_date.value = data.date_start; - date_finish.value = data.date_finish; - learn_level.value = data.knowledge_level; - apply_level.value = data.apply_level; - success_level.value = data.success_level; - achievement_other.value.text = data.achievement_other_desc; - achievement_other.value.level = data.achievement_other_level; - conduct_level.value[0] = data.conduct1_level; - conduct_level.value[1] = data.conduct2_level; - conduct_level.value[2] = data.conduct3_level; - conduct_level.value[3] = data.conduct4_level; - moral_level.value[0] = data.moral1_level; - moral_level.value[1] = data.moral2_level; - moral_level.value[2] = data.moral3_level; - discipline_level.value[0] = data.discipline1_level; - discipline_level.value[1] = data.discipline2_level; - discipline_level.value[2] = data.discipline3_level; - discipline_level.value[3] = data.discipline4_level; - discipline_level.value[4] = data.discipline5_level; - behavio_orther.value.text = data.behavior_other_desc; - behavio_orther.value.level = data.behavior_other_level; - orientation.value = data.develop_orientation_score; - self_learning.value = data.develop_self_learning_score; - training_seminar.value = data.develop_training_seminar_score; - other_training.value = data.develop_other_training_score; - orientation_percent.value = data.develop_orientation_percent; - self_learning_percent.value = data.develop_self_learning_percent; - training_seminar_percent.value = data.develop_training_seminar_percent; - other_training_percent.value = data.develop_other_training_percent; - develop_result.value = data.develop_result; - evaluate_result.value = data.evaluate_result; + if ( + data.achievement_other_desc !== "" && + data.achievement_other_level !== null + ) { + etc.value = true; + } else etc.value = false; + if (data.behavior_other_desc !== "" && data.behavior_other_level !== null) { + etc2.value = true; + } else etc2.value = false; - if ( - data.achievement_other_desc !== "" && - data.achievement_other_level !== null - ) { - etc.value = true; - } else etc.value = false; - if (data.behavior_other_desc !== "" && data.behavior_other_level !== null) { - etc2.value = true; - } else etc2.value = false; - - status.value = false; - // }) - // .catch((e) => { - // if (e.data.message !== "Data not found!") { - // messageError($q, e); - // } - // }) - // .finally(() => { - // hideLoader(); - // }); + status.value = false; + // setTimeout(() => { + // hideLoader(); + // }, 1000); + } catch (error) { + // hideLoader(); + } }; const list2_1 = [ @@ -238,7 +231,6 @@ const develop_result_option = ref([ { name: "ไม่ผ่าน (ต่ำกว่าร้อยละ 60)", value: 0 }, ]); // footer -const Autherise = ref(null); const dateAutherise = ref(new Date()); // const option = ref([]); @@ -495,7 +487,9 @@ const putformData = () => {
- {{ "ครั้งที่ " + evaluate_no }} + {{ + "ครั้งที่ " + evaluate_no + }} ระหว่างวันที่ {{ date2Thai(start_date) }} ถึงวันที่ @@ -559,7 +553,8 @@ const putformData = () => { - 1.2. ความสามารถในการปรับใช้ความรู้กับงานในหน้าที่ @@ -646,7 +641,8 @@ const putformData = () => { :disable="!status" v-model="etc" @click=" - (achievement_other.text = ''), (achievement_other.level = 0) + (achievement_other.text = ''), + (achievement_other.level = 0) " /> @@ -654,7 +650,10 @@ const putformData = () => { - + @@ -707,7 +706,7 @@ const putformData = () => {
-
+
คะแนนรวมผลสัมฤทธิ์ของการทดลองฯ
{{ score1 }}
@@ -932,10 +931,9 @@ const putformData = () => { -
-
+
คะแนนรวมพฤติกรรมการปฎิบัติราชการ
{{ score2 }}
@@ -958,7 +956,8 @@ const putformData = () => { - 3.1. ผลสัมฤทธิ์ของการทดลองปฏิบัติบัติหน้าที่ราชการ @@ -1061,7 +1060,7 @@ const putformData = () => { flat bordered class="col-xs-12 col-sm-11 col-md-11 q-pa-sm bg-grey-1" - > + >
หัวข้อ
@@ -1105,7 +1104,7 @@ const putformData = () => {
{
-
ผลคะแนนรวม
+
+ ผลคะแนนรวม +
{{ score4 }}
{{ score5 }}
@@ -1271,7 +1272,7 @@ const putformData = () => {
-
+
สรุปผลการพัฒนา @@ -1321,167 +1322,169 @@ const putformData = () => {
-
-
ผู้บังคับบัญชาผู้มอบหมายงาน
+
+
+ ผู้บังคับบัญชาผู้มอบหมายงาน +
- -
- - - - - -
- - -
- - - - - -
- - -
- - - - - + +
+ + + + + +
+ + +
+ + + + + +
+ + +
+ + + + +
-
+
คณะกรรมการ
{
- + - +
diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue index 89282d810..4df0bea1f 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue @@ -2,9 +2,9 @@ import { ref, onMounted, watch } from "vue"; import { useQuasar } from "quasar"; import { useProbationDataStore } from "@/modules/05_placement/store"; -import { useCounterMixin } from "@/stores/mixin"; +import { useAssignDataStore } from "@/modules/05_placement/storeAssign"; -// import { formatDate } from "@fullcalendar/core"; +import { useCounterMixin } from "@/stores/mixin"; import { useRouter, useRoute } from "vue-router"; import http from "@/plugins/http"; @@ -14,6 +14,9 @@ const routeName = router.currentRoute.value.name; const $q = useQuasar(); const route = useRoute(); const probationStore = useProbationDataStore(); +const assignStore = useAssignDataStore(); +const { fecthAssignoutput, assign } = assignStore; + const mixin = useCounterMixin(); const { date2Thai, @@ -29,8 +32,6 @@ const { ratingColors } = probationStore; const assignId = ref(route.params.form.toString()); const personalId = ref(route.params.personalId.toString()); -const person = ref([]); -const assign = ref([]); const start_date = ref(new Date()); const date_finish = ref(new Date()); const status = ref(false); @@ -54,13 +55,9 @@ const props = defineProps({ }); onMounted(async () => { - // if (props.action == 'add') { - // fecthFormdata(); - // } if (props.tab && props.action == "edit") { evaluate_no.value = Number(props.tab.charAt(4)); dataArr.value = await props.data; - fecthFormdata(); } }); @@ -69,7 +66,7 @@ watch(props, async () => { if (props.tab && props.action == "edit") { evaluate_no.value = Number(props.tab.charAt(4)); dataArr.value = await props.data; - fecthFormdata(); + fectFormfull(); } }); @@ -77,46 +74,55 @@ const fecthFormdata = async () => { await http .get(config.API.formevaluateRecord(assignId.value)) .then(async (res: any) => { - if (props.action == "add") { - evaluate_no.value = res.data.data.evaluate_no; - start_date.value = res.data.data.start_date; - date_finish.value = res.data.data.end_date; - - person.value = res.data.data.person; - option.value.push(res.data.data.director); - } - - Autherise.value = res.data.data.director.name; - - list1_1.value = res.data.data.assign_output; - evaluate_expenct_level.value = await res.data.data.assign_output.map( - (e: any) => ({ - id: e.id, - labal: e.output_desc, - }) - ); - evaluate_ouptut.value = await res.data.data.assign_output.map( - (e: any) => ({ - id: e.id, - }) - ); - - checkArray.value = list1_1.value.length; - - // if (res.data.data.evaluate_no > round.value) { - // await fecthFormRound(assignId.value, round.value); + await fecthAssignoutput(res.data.data); + await fectFormfull(); + // if (props.action == "add") { + // evaluate_no.value = res.data.data.evaluate_no; + // start_date.value = res.data.data.start_date; + // date_finish.value = res.data.data.end_date; + // person.value = res.data.data.person; + // option.value.push(res.data.data.director); // } + // Autherise.value = res.data.data.director.name; + // list1_1.value = res.data.data.assign_output; + // evaluate_expenct_level.value = await res.data.data.assign_output.map( + // (e: any) => ({ + // id: e.id, + // labal: e.output_desc, + // }) + // ); + // evaluate_ouptut.value = await res.data.data.assign_output.map( + // (e: any) => ({ + // id: e.id, + // }) + // ); + + // checkArray.value = list1_1.value.length; }) - .catch((e: any) => { - }) + .catch((e: any) => {}) .finally(() => { if (props.action == "edit") { fecthFormRound(); } }); }; +const fectFormfull = async () => { + Autherise.value = assignStore.director.name; + list1_1.value = assignStore.assignOutput; + evaluate_expenct_level.value = await assignStore.assignOutput.map( + (e: any) => ({ + id: e.id, + labal: e.output_desc, + }) + ); + evaluate_ouptut.value = await assignStore.assignOutput.map((e: any) => ({ + id: e.id, + })); + checkArray.value = list1_1.value.length; + fecthFormRound(); +}; const fecthFormRound = async () => { - showLoader(); + // showLoader(); try { let data = await dataArr.value; evaluate_id.value = data.id; @@ -160,7 +166,6 @@ const fecthFormRound = async () => { if (data.behavior_other_desc !== "" && data.behavior_other_level !== null) { etc2.value = true; } else etc2.value = false; - if (data.achievements) { await data.achievements.map((e: any, index: number) => { evaluate_expenct_level.value[index].level = e.evaluate_expect_level; @@ -170,21 +175,15 @@ const fecthFormRound = async () => { } status.value = false; - setTimeout(() => { - hideLoader(); - }, 1000); + // setTimeout(() => { + // hideLoader(); + // }, 1000); } catch (error) { hideLoader(); } }; const list1_1 = ref([]); -// { id: "1", label: "ผลผลิตของงานที่คาดหวัง 1" }, -// { id: "2", label: "ผลผลิตของงานที่คาดหวัง 2" }, -// { id: "3", label: "ผลผลิตของงานที่คาดหวัง 3" }, -// { id: "4", label: "ผลผลิตของงานที่คาดหวัง 4" }, -// { id: "5", label: "ผลผลิตของงานที่คาดหวัง 5" }, - const list1_2 = [ { id: "", label: "" }, { id: "", label: "" }, @@ -244,10 +243,6 @@ const list2_3 = [ ]; const option = ref([]); -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 }, @@ -268,11 +263,8 @@ 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_improve_desc = ref(""); // part 2 @@ -281,8 +273,6 @@ 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 behavior_strength_desc = ref(""); const behavior_improve_desc = ref(""); // part 3 @@ -303,17 +293,11 @@ 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(); @@ -322,16 +306,7 @@ const savaForm = () => { 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 || @@ -492,7 +467,9 @@ const editData = async (data: any) => {
- {{ "ครั้งที่ " + evaluate_no }} + {{ + "ครั้งที่ " + evaluate_no + }} ระหว่างวันที่ {{ date2Thai(start_date) }} ถึงวันที่ @@ -785,7 +762,8 @@ const editData = async (data: any) => { - 1.6. ความสามารถในการปรับใช้ความรู้กับงานในหน้าที่ @@ -870,7 +848,8 @@ const editData = async (data: any) => { dense v-model="etc" @click=" - (achievement_other.text = ''), (achievement_other.level = 0) + (achievement_other.text = ''), + (achievement_other.level = 0) " :disable="!status" /> @@ -879,7 +858,10 @@ const editData = async (data: any) => { - + @@ -1424,13 +1406,12 @@ const editData = async (data: any) => {
- + - +
diff --git a/src/modules/05_placement/components/probation/FormEvaluation/Header.vue b/src/modules/05_placement/components/probation/FormEvaluation/Header.vue index 2c0037218..d18205347 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/Header.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/Header.vue @@ -1,13 +1,10 @@ + diff --git a/src/modules/05_placement/components/probation/FormEvaluation/Template2Format2.vue b/src/modules/05_placement/components/probation/FormEvaluation/Template2Format2.vue index ad921ce68..e05efbff4 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/Template2Format2.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/Template2Format2.vue @@ -5,9 +5,22 @@ import config from "@/app.config"; import { useQuasar } from "quasar"; import { useRoute, useRouter } from "vue-router"; import { useCounterMixin } from "@/stores/mixin"; +import { useAssignDataStore } from "@/modules/05_placement/storeAssign"; +const assignStore = useAssignDataStore(); +const { fecthdataAssign } = assignStore; -const Header = defineAsyncComponent(() => import("@/modules/05_placement/components/probation/FormEvaluation/Header.vue")); -const FormEvaluateScore = defineAsyncComponent(() => import("@/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue")); +const Header = defineAsyncComponent( + () => + import( + "@/modules/05_placement/components/probation/FormEvaluation/Header.vue" + ) +); +const FormEvaluateScore = defineAsyncComponent( + () => + import( + "@/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue" + ) +); const router = useRouter(); const route = useRoute(); @@ -17,7 +30,7 @@ const { showLoader, hideLoader, messageError, success } = mixin; const assignId = ref(route.params.form.toString()); const personalId = ref(route.params.personalId.toString()); -const fullname = ref("") +const fullname = ref(""); const tab = ref("save1"); const tabs = ref([]); const dataArrayNumber = ref(1); @@ -31,8 +44,9 @@ const fecthAssign = async (id: string) => { showLoader(); await http .get(config.API.createformChairman(id)) - .then((res: any) => { - evaluate.value = res.data.data.evaluate; + .then(async (res: any) => { + await fecthdataAssign(res.data.data); + evaluate.value = assignStore.evaluate; fullname.value = res.data.data.person.name; tabs.value = evaluate.value; dataArrayNumber.value = 1; @@ -62,7 +76,10 @@ const FileDownload = async (type: string) => { responseType: "blob", }) .then(async (res) => { - downloadFile(res, `แบบประเมินผล(คณะกรรมการ)_${fullname.value}_ครั้งที่${numTab.no}.${type}`); + downloadFile( + res, + `แบบประเมินผล(คณะกรรมการ)_${fullname.value}_ครั้งที่${numTab.no}.${type}` + ); }) .catch((e) => { messageError($q, e); @@ -84,11 +101,42 @@ const changeTab = (tabVal: string) => { + + diff --git a/src/modules/05_placement/storeAssign.ts b/src/modules/05_placement/storeAssign.ts new file mode 100644 index 000000000..b699bd025 --- /dev/null +++ b/src/modules/05_placement/storeAssign.ts @@ -0,0 +1,32 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; + +export const useAssignDataStore = defineStore("assign", () => { + const assign = ref([]) + const evaluate = ref([]) + const tabs = ref([]); + + const assignOutput = ref([]) + const director = ref([]) + + const fecthdataAssign = async (data: any) => { + assign.value = await data.assign + evaluate.value = await data.evaluate + tabs.value = await data.evaluate + } + const fecthAssignoutput = (data: any) => { + assignOutput.value = data.assign_output + director.value = data.director + + + } + return { + fecthdataAssign, + fecthAssignoutput, + assign, + evaluate, + tabs, + assignOutput, + director, + }; +});