diff --git a/src/modules/05_placement/components/probation/FormAssign.vue b/src/modules/05_placement/components/probation/FormAssign.vue index b31b3ad2d..f9c183113 100644 --- a/src/modules/05_placement/components/probation/FormAssign.vue +++ b/src/modules/05_placement/components/probation/FormAssign.vue @@ -1145,11 +1145,12 @@ onMounted(async () => { -
+
{ } return 0; }); + +const score1Per60 = computed(() => { + if ( + etc.value === true && + achievement_other.value.text !== undefined && + achievement_other.value.level !== undefined + ) { + return ( + ((learn_level.value + + apply_level.value + + success_level.value + + achievement_other.value.level) / + achievement_score_total.value) * + 60 + ); + } + return ( + ((learn_level.value + apply_level.value + success_level.value) / + achievement_score_total.value) * + 60 + ); +}); + const score2 = computed(() => { let sum_conduct = conduct_level.value.reduce( (sum: number, level: number) => sum + level, @@ -430,7 +453,8 @@ onMounted(async () => { {
-
{{ score1 }}
+
{{ score1Per60 }}
{{ percent_score1 }}
@@ -987,7 +1011,7 @@ onMounted(async () => {
-
{{ score1 + score2 }}
+
{{ (score1Per60 + score2) / 2 }}
{{ percent_sum }}
@@ -1360,7 +1384,6 @@ onMounted(async () => {
(""); const date_start = ref(new Date()); const date_finish = ref(); const develop = ref(); @@ -139,13 +139,12 @@ async function fecthAssign() { */ const fecthResult = async (id: string) => { const noNumber = props?.tab ? Number(props?.tab.charAt(4)) : ""; - await http .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; + evaluateId.value = data.id; date_start.value = data.date_start; date_finish.value = data.date_finish; develop.value = Number(data.develop_complete); @@ -174,54 +173,19 @@ async function savaForm() { }); } -/** แปลงรหัสไฟล์ */ -function downloadFile(response: any, filename: string) { - const link = document.createElement("a"); - var fileName = filename; - link.href = window.URL.createObjectURL(new Blob([response.data])); - link.setAttribute("download", fileName); - document.body.appendChild(link); - link.click(); - document.body.removeChild(link); -} - -/** - * ดาว์โหลดไฟล์ - * @param type docx/pdf - */ -async function clickdownloadFile(type: string) { - showLoader(); - await http - .get(config.API.reportEvaluateResult(type, assignId.value)) - .then(async (res) => { - const data = res.data.result; - await genReport( - data, - `แบบรายงานการประเมินฯ_${person.value.name}.${type}`, - type - ); - hideLoader(); - }) - .catch(async (e) => { - messageError($q, JSON.parse(await e.response.data.text())); - hideLoader(); - }) - .finally(() => {}); -} - /** post/put data * @param action post put */ async function postData(action: string) { - const data = await { + const data = { start_date: date_start.value, date_finish: date_finish.value, develop_complete: develop.value, pass_result: result.value, reson: reson.value, chairman_dated: chairman_dated.value, - director1_dated: director1_dated.value, - director2_dated: director2_dated.value, + // director1_dated: director1_dated.value ? director1_dated.value : new Date(), + // director2_dated: director2_dated.value ? director2_dated.value : new Date(), expand_month: expand_month.value ? expand_month.value : undefined, evaluate_no: props?.tab ? Number(props?.tab.charAt(4)) : undefined, }; @@ -233,31 +197,32 @@ async function postData(action: string) { success($q, "บันทึกสำเร็จ"); fecthResult(assignId.value); router.push(`/probation/detail/${personalId.value}/${assignId.value}`); + status.value = false; }) .catch((e: any) => { messageError($q, e); }) .finally(() => { - status.value = false; - hideLoader(); - }); - } else if (action === "put") { - showLoader(); - await http - .put(config.API.createformReport(assignId.value), data) - .then(() => { - success($q, "บันทึกสำเร็จ"); - fecthResult(assignId.value); - router.push(`/probation/detail/${personalId.value}/${assignId.value}`); - }) - .catch((e: any) => { - messageError($q, e); - }) - .finally(() => { - status.value = false; hideLoader(); }); } + // else if (action === "put") { + // showLoader(); + // await http + // .put(config.API.createformReport(assignId.value), data) + // .then(() => { + // success($q, "บันทึกสำเร็จ"); + // fecthResult(assignId.value); + // status.value = false; + // router.push(`/probation/detail/${personalId.value}/${assignId.value}`); + // }) + // .catch((e: any) => { + // messageError($q, e); + // }) + // .finally(() => { + // hideLoader(); + // }); + // } } /** ผลการประเมินการทดลองปฏิบัติหน้าที่ราชการ */ @@ -299,32 +264,6 @@ onMounted(() => {
แบบรายงานการประเมินฯ
-
@@ -795,17 +734,6 @@ onMounted(() => {
- - + +
diff --git a/src/modules/05_placement/components/probation/MainSurvey.vue b/src/modules/05_placement/components/probation/MainSurvey.vue index 076a15051..900148b20 100644 --- a/src/modules/05_placement/components/probation/MainSurvey.vue +++ b/src/modules/05_placement/components/probation/MainSurvey.vue @@ -193,7 +193,7 @@ onMounted(async () => { v-model="filterKeyword" ref="filterRef" outlined - placeholder="ค้นหา ชื่อ - นามสกุลผู้ทดลองฯ /ตำแหน่ง" + placeholder="ค้นหาจากชื่อ - นามสกุล /ตำแหน่ง" @keydown.enter.prevent="getData()" style="width: 350px" >