diff --git a/src/modules/05_placement/components/probation/FormAssign.vue b/src/modules/05_placement/components/probation/FormAssign.vue index 0b9a9f707..9f0ed72c1 100644 --- a/src/modules/05_placement/components/probation/FormAssign.vue +++ b/src/modules/05_placement/components/probation/FormAssign.vue @@ -775,7 +775,7 @@ async function getAssign() { ...dataPerson, name: `${dataPerson.name} (${dataPerson.position}${ dataPerson.positionLevel && dataPerson.positionType - ? ", " + dataPerson.positionType + " : " + dataPerson.positionLevel + ? dataPerson.positionLevel : "" })`, })); @@ -1009,7 +1009,7 @@ function updateAppointMent() { ...dataPerson, name: `${dataPerson.name} (${dataPerson.position}${ dataPerson.positionLevel && dataPerson.positionType - ? ", " + dataPerson.positionType + " : " + dataPerson.positionLevel + ? + dataPerson.positionLevel : "" })`, })); @@ -1035,7 +1035,7 @@ function updateAppointMent() { label: dataPerson.position ? `${dataPerson.name} (${dataPerson.position}${ dataPerson.positionLevel && dataPerson.positionType - ? ", " + dataPerson.positionType + " : " + dataPerson.positionLevel + ? +dataPerson.positionLevel : "" })` : dataPerson.name, diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue index 296e2319e..cb51e5263 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue @@ -63,63 +63,93 @@ const optionsResult = ref([ }, ]); +const props = defineProps({ + tab: { type: String, require: true }, + data: { type: Object, require: true }, +}); + /** get ข้อมูลรายการมอยหมาย เก็บไว้ตัวแปร * @param id personal id */ -async function fecthAssign(id: string) { - showLoader(); - await http - .get(config.API.evaluateReportcreate(id)) - .then((res) => { - assign.value = res.data.result.assign; - person.value = res.data.result.person; - mentors.value = res.data.result.mentors; - date_start.value = res.data.result.assign.date_start; - date_finish.value = res.data.result.assign.date_finish; +async function fecthAssign() { + const data = props.data; - if ( - res.data.result.result.develop_complete != null && - res.data.result.result.evaluate_result != null - ) { - develop.value = res.data.result.result.develop_complete; - result.value = res.data.result.result.evaluate_result; - changeReson52(Number(res.data.result.result.evaluate_result)); - } + assign.value = data?.assign; + person.value = data?.person; + mentors.value = data?.mentors; + date_start.value = data?.assign.date_start; + date_finish.value = data?.assign.date_finish; + if ( + data?.result.develop_complete != null && + data?.result.evaluate_result != null + ) { + develop.value = data.result.develop_complete; + result.value = data.result.evaluate_result; + changeReson52(Number(data.result.evaluate_result)); + } + director_id.value = data?.chairman; + director_id2.value = data?.commander; + if (mentors.value.length != 0) { + director_id3.value = mentors.value[0]; + } + commander.value = data?.commander; + optionDirector.value = mentors.value; - director_id.value = res.data.result.chairman; - director_id2.value = res.data.result.commander; - if (mentors.value.length != 0) { - director_id3.value = mentors.value[0]; - } - commander.value = res.data.result.commander; - optionDirector.value = mentors.value; - }) - .catch((e) => { - // messageError($q, e); - }) - .finally(() => { - hideLoader(); - }); + // showLoader(); + // await http + // .get(config.API.evaluateReportcreate(id)) + // .then((res) => { + // assign.value = res.data.result.assign; + // person.value = res.data.result.person; + // mentors.value = res.data.result.mentors; + // date_start.value = res.data.result.assign.date_start; + // date_finish.value = res.data.result.assign.date_finish; + + // if ( + // res.data.result.result.develop_complete != null && + // res.data.result.result.evaluate_result != null + // ) { + // develop.value = res.data.result.result.develop_complete; + // result.value = res.data.result.result.evaluate_result; + // changeReson52(Number(res.data.result.result.evaluate_result)); + // } + + // director_id.value = res.data.result.chairman; + // director_id2.value = res.data.result.commander; + // if (mentors.value.length != 0) { + // director_id3.value = mentors.value[0]; + // } + // commander.value = res.data.result.commander; + // optionDirector.value = mentors.value; + // }) + // .catch((e) => { + // // messageError($q, e); + // }) + // .finally(() => { + // hideLoader(); + // }); } /** get ข้อมูล เก็บไว้ตัวแปร * @param id personal id */ const fecthResult = async (id: string) => { + const noNumber = props?.tab ? Number(props?.tab.charAt(4)) : ""; + await http - .get(config.API.createformReport(id)) + .get(config.API.createformReport(id) + `&evaluate_no=${noNumber}`) .then(async (res: any) => { if (res.data.result != null) { const data = await res.data.result.evaluate; ID.value = data.id; date_start.value = data.date_start; date_finish.value = data.date_finish; - develop.value = await Number(data.develop_complete); - result.value = await Number(data.pass_result); - reson.value = await data.reson; - chairman_dated.value = await data.chairman_dated; - director1_dated.value = await data.director1_dated; - director2_dated.value = await data.director2_dated; + develop.value = Number(data.develop_complete); + result.value = Number(data.pass_result); + reson.value = data.reson; + chairman_dated.value = data.chairman_dated; + director1_dated.value = data.director1_dated; + director2_dated.value = data.director2_dated; status.value = false; action.value = "edit"; expand_month.value = data.expand_month; @@ -188,7 +218,8 @@ async function postData(action: string) { chairman_dated: chairman_dated.value, director1_dated: director1_dated.value, director2_dated: director2_dated.value, - expand_month: expand_month.value, + expand_month: expand_month.value ? expand_month.value : undefined, + evaluate_no: props?.tab ? Number(props?.tab.charAt(4)) : undefined, }; if (action === "post") { showLoader(); @@ -255,7 +286,7 @@ function changeReson52(val: number) { } onMounted(() => { - fecthAssign(assignId.value); + fecthAssign(); fecthResult(assignId.value); }); @@ -264,7 +295,7 @@ onMounted(() => {
แบบรายงานการประเมินฯ
- { - + -->
@@ -317,7 +348,9 @@ onMounted(() => {
ประเมินผล - ครั้งที่ 1 + + ครั้งที่ {{ props?.tab ? props?.tab.charAt(4) : "" }}
@@ -326,7 +359,7 @@ onMounted(() => {
- +
@@ -507,6 +540,11 @@ onMounted(() => { label="จำนวนเดือน" :rules="[(val:string) => !!val || 'กรุณากรอกจำนวนเดือน']" type="number" + :readonly=" + !status || + checkRoutePermisson || + probationStore.dataPermissions?.tab6.isEdit == false + " />
@@ -621,11 +659,8 @@ onMounted(() => {
-
-
- คณะกรรมการ - -
+ -
+
@@ -753,7 +787,7 @@ onMounted(() => {
- + --> diff --git a/src/modules/05_placement/components/probation/FormEvaluation/Template3.vue b/src/modules/05_placement/components/probation/FormEvaluation/Template3.vue index 149f87d7c..3bed65d0c 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/Template3.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/Template3.vue @@ -1,16 +1,166 @@ + +