From e3ca5eb4092032eafcd6e44057bea74fc9e9a7d4 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 23 Jan 2025 09:35:40 +0700 Subject: [PATCH] fix director1_dated,director2_dated --- .../probation/FormEvaluation/FormReport.vue | 105 ++++-------------- 1 file changed, 22 insertions(+), 83 deletions(-) diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue index d620253e9..606c68a33 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue @@ -34,7 +34,7 @@ const assign = ref([]); const mentors = ref([]); const commander = ref([]); const status = ref(true); -const ID = ref(""); +const evaluateId = ref(""); 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 ? director1_dated.value : new Date(), - director2_dated: director2_dated.value ? director2_dated.value : new Date(), + // 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, }; @@ -241,23 +205,24 @@ async function postData(action: string) { .finally(() => { 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(); - }); } + // 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(() => {
แบบรายงานการประเมินฯ
-