diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue index a9ba07dd1..03af99113 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue @@ -22,7 +22,7 @@ const { const route = useRoute(); const assignId = ref(route.params.form.toString()); const personalId = ref(route.params.personalId.toString()); -const action = ref('add') +const action = ref("add"); const assign = ref([]); const mentors = ref([]); const commander = ref([]); @@ -93,7 +93,7 @@ const fecthResult = async (id: string) => { director1_dated.value = data.director1_dated; director2_dated.value = data.director2_dated; status.value = false; - action.value = 'edit'; + action.value = "edit"; }) .catch((e) => { console.log(e); @@ -142,9 +142,7 @@ const postData = async () => { .post(config.API.createformReport(assignId.value), data) .then(() => { success($q, "บันทึกสำเร็จ"); - router.push( - `/probation/detail/${personalId.value}/${assignId.value}` - ); + router.push(`/probation/detail/${personalId.value}/${assignId.value}`); }) .catch((e: any) => { console.log(e); @@ -160,7 +158,13 @@ const postData = async () => {
- + แก้ไขข้อมูล
@@ -168,103 +172,32 @@ const postData = async () => { ยกเลิก - + บันทึกข้อมูล
-
-
-
- - - - - -
-
- - - - - -
-
-
- -
-
-
- -
-
-
-
-
-
- -
-
-
-
-
- -
-
- -
- -
- -
-
-
- ประธานคณะกรรมการประเมินผลการปฏิบัติหน้าที่ราชการ -
+ +
- -
- +
+ @@ -272,10 +205,64 @@ const postData = async () => { {{ parseInt(value + 543) }} + +
+
+ + + + diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue index 08cec9763..33634d46b 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue @@ -51,14 +51,14 @@ const cancel = () => { const props = defineProps({ tab: String, data: Object, - action: String + action: String, }); onMounted(async () => { // if (props.action == 'add') { // fecthFormdata(); // } - if (props.tab && props.action == 'edit') { + if (props.tab && props.action == "edit") { evaluate_no.value = Number(props.tab.charAt(4)); dataArr.value = await props.data; fecthFormdata(); @@ -66,20 +66,20 @@ onMounted(async () => { }); watch(props, async () => { - if (props.tab && props.action == 'edit') { + if (props.tab && props.action == "edit") { evaluate_no.value = Number(props.tab.charAt(4)); dataArr.value = await props.data; fecthFormdata(); - // console.log("props===>", props); + // console.log("props===>", props.data); } -}) +}); const fecthFormdata = async () => { await http .get(config.API.formevaluateRecord(assignId.value)) .then(async (res: any) => { // console.log(res); - if (props.action == 'add') { + 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; @@ -91,13 +91,17 @@ const fecthFormdata = async () => { 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, - })); + 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; @@ -107,8 +111,9 @@ const fecthFormdata = async () => { }) .catch((e: any) => { console.log(e); - }).finally(() => { - if (props.action == 'edit') { + }) + .finally(() => { + if (props.action == "edit") { fecthFormRound(); } }); @@ -116,6 +121,8 @@ const fecthFormdata = async () => { const fecthFormRound = async () => { showLoader(); try { + console.log(dataArr.value); + // await http // .get(config.API.formevaluateround(assignId.value, round.value)) // .then(async(res: any) => { @@ -158,23 +165,22 @@ const fecthFormRound = async () => { data.achievement_other_level !== null ) { etc.value = true; - } - if ( - data.behavior_other_desc !== "" && - data.behavior_other_level !== null - ) { + } else etc.value = false; + 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 - evaluate_ouptut.value[index].text = e.evaluate_output_desc - evaluate_ouptut.value[index].level = e.evaluate_output_level + evaluate_expenct_level.value[index].level = e.evaluate_expect_level; + evaluate_ouptut.value[index].text = e.evaluate_output_desc; + evaluate_ouptut.value[index].level = e.evaluate_output_level; }); } status.value = false; + console.log(etc.value); + // }) // .catch((e) => { // console.log(e); @@ -188,7 +194,6 @@ const fecthFormRound = async () => { } catch (error) { hideLoader(); } - }; const list1_1 = ref([]); @@ -426,7 +431,9 @@ const putformData = () => { // commander_dated: dateAutherise.value, }; - dialogConfirm($q, () => props.action == 'edit' ? editData(data) : saveformdata(data)); + dialogConfirm($q, () => + props.action == "edit" ? editData(data) : saveformdata(data) + ); }; const saveformdata = async (data: any) => { @@ -435,9 +442,7 @@ const saveformdata = async (data: any) => { .then((res: any) => { // console.log(res); success($q, "บันทึกสำเร็จ"); - router.push( - `/probation/detail/${personalId.value}/${assignId.value}` - ); + router.push(`/probation/detail/${personalId.value}/${assignId.value}`); }) .catch((e: any) => { messageError($q, e); @@ -455,7 +460,6 @@ const editData = async (data: any) => { messageError($q, e); }); }; -