From e48606fc75408ab3b6a2a6cb002bc1aef2648791 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 21 Jan 2025 17:00:55 +0700 Subject: [PATCH] =?UTF-8?q?fix=20=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=97?= =?UTF-8?q?=E0=B8=94=E0=B8=A5=E0=B8=AD=E0=B8=87=E0=B8=9B=E0=B8=8F=E0=B8=B4?= =?UTF-8?q?=E0=B8=9A=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=AB=E0=B8=99=E0=B9=89?= =?UTF-8?q?=E0=B8=B2=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B8=A3=E0=B8=B2=E0=B8=8A?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/probation/FormAssign.vue | 27 ++-- .../probation/FormEvaluation/FormEvaluate.vue | 18 ++- .../FormEvaluation/FormEvaluateScore.vue | 19 ++- .../probation/FormEvaluation/FormReport.vue | 15 ++ .../FormEvaluation/FormSaveResult.vue | 22 ++- .../FormEvaluation/FormSaveResultCommader.vue | 15 +- .../FormEvaluation/FormUploadFile.vue | 143 ++++++++++++++++++ .../probation/FormEvaluation/Template3.vue | 8 +- 8 files changed, 244 insertions(+), 23 deletions(-) create mode 100644 src/modules/05_placement/components/probation/FormEvaluation/FormUploadFile.vue diff --git a/src/modules/05_placement/components/probation/FormAssign.vue b/src/modules/05_placement/components/probation/FormAssign.vue index 9f0ed72c1..b31b3ad2d 100644 --- a/src/modules/05_placement/components/probation/FormAssign.vue +++ b/src/modules/05_placement/components/probation/FormAssign.vue @@ -5,6 +5,7 @@ import { useQuasar } from "quasar"; import http from "@/plugins/http"; import config from "@/app.config"; +import genReport from "@/plugins/genreport"; import { useProbationDataStore } from "@/modules/05_placement/storeProbation"; import { useCounterMixin } from "@/stores/mixin"; @@ -13,7 +14,7 @@ import type { AppointTopicMain, } from "@/modules/05_placement/interface/index/Main"; -import genReport from "@/plugins/genreport"; +import FormUploadFile from "@/modules/05_placement/components/probation/FormEvaluation/FormUploadFile.vue"; const $q = useQuasar(); const isEdit = ref(false); @@ -86,6 +87,7 @@ const activityCount = ref(2); const activity_desc = ref(Array(activityCount.value).fill("")); const goal_desc = ref(Array(activityCount.value).fill("")); const checkRule = ref([]); +const isCheckFile = ref(false); const isDatePicker2Readonly = computed(() => { return date_start.value === undefined; @@ -167,13 +169,12 @@ interface CheckboxItem { status_select: number; checked: number; } + /** * update edit * @param id personal id */ async function dataEdit(id: string) { - // await myForm.value.validate().then((result: boolean) => { - // if (result) { showLoader(); const data = putDataEdit(id); http @@ -185,10 +186,6 @@ async function dataEdit(id: string) { getAssign(); hideLoader(); }); - // } else { - // dialogMessageNotify($q, "กรุณากรอกข้อมูลให้ครบ"); - // } - // }); } /** @@ -1009,7 +1006,7 @@ function updateAppointMent() { ...dataPerson, name: `${dataPerson.name} (${dataPerson.position}${ dataPerson.positionLevel && dataPerson.positionType - ? + dataPerson.positionLevel + ? +dataPerson.positionLevel : "" })`, })); @@ -1148,7 +1145,7 @@ onMounted(async () => { -
+
+
(new Date()); const date_finish = ref(new Date()); const status = ref(true); const dataArr = ref(); +const isCheckFile = ref(false); const behavio_strengthRules = [ (val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น", @@ -298,10 +301,10 @@ onMounted(async () => {
แบบประเมินผล (ผู้บังคับบัญชา)
-
+
{
+ + diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue index 34a4c5c2c..c3f143415 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue @@ -9,6 +9,7 @@ import config from "@/app.config"; import criterion from "@/modules/05_placement/components/probation/Criterion.vue"; import type { ListDataText } from "@/modules/05_placement/interface/index/Main"; +import FormUploadFile from "@/modules/05_placement/components/probation/FormEvaluation/FormUploadFile.vue"; const optionText = ref([ { value: "1", label: "ต่ำกว่าความคาดหวังมาก (1)" }, @@ -94,6 +95,8 @@ const develop_result_option = ref([ { name: "ไม่ผ่าน (ต่ำกว่าร้อยละ 60)", value: 0 }, ]); +const isCheckFile = ref(false); + // score const score1 = computed(() => { if ( @@ -423,11 +426,11 @@ onMounted(async () => {
แบบประเมินผล (คณะกรรมการ)
-
+
{
+ + (false); + /** get ข้อมูลรายการมอยหมาย เก็บไว้ตัวแปร * @param id personal id */ @@ -791,6 +795,17 @@ onMounted(() => {
+ + (""); const evaluate_no = ref(1); const dataArr = ref(); +const isCheckFile = ref(false); + const checkArray = ref(0); const list1_1 = ref([]); const option = ref([]); @@ -373,10 +377,10 @@ onMounted(async () => {
แบบบันทึกผล (ผู้ดูเเล)
-
+
{
+ + + (route.params.form.toString()); const personalId = ref(route.params.personalId.toString()); +const isCheckFile = ref(false); const start_date = ref(new Date()); const date_finish = ref(new Date()); @@ -382,7 +384,7 @@ onMounted(async () => {
{
+ + +import { onMounted, ref } from "vue"; +import { useQuasar } from "quasar"; +import axios from "axios"; + +import { useRoute } from "vue-router"; +import { useCounterMixin } from "@/stores/mixin"; +import http from "@/plugins/http"; +import config from "@/app.config"; + +const $q = useQuasar(); +const route = useRoute(); +const mixin = useCounterMixin(); +const { + messageError, + date2Thai, + showLoader, + hideLoader, + success, + dialogConfirm, + dialogRemove, +} = mixin; + +const group = defineModel("group", { required: true }); +const isCheckFile = defineModel("isCheckFile", { required: true }); +const checkRoutePermisson = defineModel("checkRoutePermisson", { + required: true, +}); +const dataPermissions = defineModel("dataPermissions", { + required: true, +}); + +const assignId = ref(route.params.form as string); +const file = ref(); + +function onUploadFiles() { + showLoader(); + http + .post(config.API.file("ทดลองงาน", group.value, assignId.value), { + replace: true, + fileList: [ + { + fileName: file.value.name, + }, + ], + }) + .then(async (res) => { + const foundKey: string | undefined = Object.keys(res.data).find( + (key) => + res.data[key]?.fileName !== undefined && + res.data[key]?.fileName !== "" + ); + foundKey && (await uploadFileURL(res.data[foundKey]?.uploadUrl)); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); +} + +async function uploadFileURL(uploadUrl: string) { + const Data = new FormData(); + Data.append("file", file.value); + showLoader(); + await axios + .put(uploadUrl, file.value, { + headers: { + "Content-Type": file.value.type, + }, + }) + .then(async () => { + await success($q, "อัปโหลดไฟล์สำเร็จ"); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + file.value = null; + }); +} + +/** function เช็คไฟล์*/ +async function fetchCheckfile() { + isCheckFile.value = false; + http + .get(config.API.file("ทดลองงาน", group.value, assignId.value)) + .then(async (res) => { + if (res.data.length >= 1) { + isCheckFile.value = true; + console.log(isCheckFile.value); + } + }) + .catch((e) => { + messageError($q, e); + }); +} + +onMounted(() => { + fetchCheckfile(); +}); + + + + diff --git a/src/modules/05_placement/components/probation/FormEvaluation/Template3.vue b/src/modules/05_placement/components/probation/FormEvaluation/Template3.vue index 3bed65d0c..2429603f2 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/Template3.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/Template3.vue @@ -38,7 +38,7 @@ const { } = useCounterMixin(); const tab = ref("save1"); -const tabs = ref([{ no: 1 }, { no: 2 }]); +const tabs = ref([]); const dataArrayNumber = ref(1); const evaluate = ref([]); const assignId = ref(route.params.form.toString()); @@ -59,8 +59,6 @@ async function fecthAssign(id: string) { .then((res) => { dataResult.value = res.data.result; fullName.value = res.data.result.person.name; - console.log(); - tabs.value = res.data.result.result.map((e: any, index: number) => { return { no: index + 1, ...e }; }); @@ -121,9 +119,7 @@ onMounted(() => { :add-data="addData" :loop="tabs.length" :FileDownload="onDownloadFile" - :checkPermission=" - probationStore?.dataPermissions?.tab6?.isEdit && tabs.length === 1 - " + :checkPermission="false" />