From ecaaacbe1d236365ac1b2349d297a9aaee8c7742 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 17 Jan 2024 10:32:17 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=84=E0=B8=A7=E0=B8=B2=E0=B8=A1?= =?UTF-8?q?=E0=B9=81=E0=B8=88=E0=B9=89=E0=B8=87=E0=B9=80=E0=B8=95=E0=B8=B7?= =?UTF-8?q?=E0=B8=AD=E0=B8=99=20=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B8=AD?= =?UTF-8?q?=E0=B8=81=E0=B8=84=E0=B8=B8=E0=B8=93=E0=B8=AA=E0=B8=A1=E0=B8=9A?= =?UTF-8?q?=E0=B8=B1=E0=B8=95=E0=B8=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/05_leave/components/Calendar.vue | 10 +- .../components/EvaluateStepMain.vue | 104 ++++++++++-------- src/modules/06_evaluate/interface/evalute.ts | 1 + src/stores/mixin.ts | 21 ++++ 4 files changed, 82 insertions(+), 54 deletions(-) diff --git a/src/modules/05_leave/components/Calendar.vue b/src/modules/05_leave/components/Calendar.vue index 3d7fc23..ad2ac1a 100644 --- a/src/modules/05_leave/components/Calendar.vue +++ b/src/modules/05_leave/components/Calendar.vue @@ -103,10 +103,7 @@ async function fetchDataCalendar() { const eventData = filterVal.value.map((item: any) => { return mainData.value .filter( - (e: DataCalendar) => - e.keycloakId === item && - e.status != "REJECT" && - e.status != "DELETE" + (e: DataCalendar) => e.keycloakId === item && e.status === "APPROVE" ) .map((e) => ({ id: e.id, @@ -246,10 +243,7 @@ watch( const eventData = filterVal.value.map((item: any) => { return mainData.value .filter( - (e: DataCalendar) => - e.keycloakId === item && - e.status != "REJECT" && - e.status != "DELETE" + (e: DataCalendar) => e.keycloakId === item && e.status === "APPROVE" ) .map((e) => ({ id: e.id, diff --git a/src/modules/06_evaluate/components/EvaluateStepMain.vue b/src/modules/06_evaluate/components/EvaluateStepMain.vue index 4586298..62accc5 100644 --- a/src/modules/06_evaluate/components/EvaluateStepMain.vue +++ b/src/modules/06_evaluate/components/EvaluateStepMain.vue @@ -41,7 +41,13 @@ const mixin = useCounterMixin(); const $q = useQuasar(); const splitterModel = 20; -const { showLoader, hideLoader, messageError, dialogConfirm } = mixin; +const { + showLoader, + hideLoader, + messageError, + dialogConfirm, + dialogMessageNotify, +} = mixin; const externalLink = "https://accreditation.ocsc.go.th/accreditation/search/curriculum"; @@ -56,14 +62,18 @@ function onClickPopupHistory() { /** function NextToStep*/ async function onCilckNextStep() { const functionCreateDoc: (() => Promise) | null = - store.step === 1 - ? await saveStep1 - : store.step === 3 + // store.step === 1 + // ? await saveStep1 + // : + store.step === 3 ? await saveStep3 : store.step === 7 ? await saveStep7 : null; - store.step === 2 || store.step === 6 + + store.step === 1 + ? checkSelectForm() + : store.step === 2 || store.step === 6 ? validateForm() : store.step == 3 || store.step == 7 ? dialogConfirm( @@ -74,16 +84,7 @@ async function onCilckNextStep() { "ยืนยันการยื่นเอกสาร", "ต้องการยืนยันการยื่นเอกสารใช่หรือไม่? หากยืนยันแล้วคุณจะไม่สามารถกลับมาแก้ไขเอกสารได้อีก" ) - : store.step < 9 && - dialogConfirm( - $q, - async () => { - showLoader(); - await functionCreateDoc?.(); - }, - "ยืนยันการดำเนินการ", - "ต้องการยืนยันการดำเนินการต่อใช่หรือไม่?" - ); + : null; } /** function validateForm Step 2,4*/ @@ -187,6 +188,7 @@ const formSpec = reactive({ }); const formDetail = ref(); const formDataStep1 = ref(); + /** * function เรียกข่้อมูลตรวจสอบคุณสมบัติ * @param id id ประเมิน @@ -222,6 +224,7 @@ async function updateCheckSpec(data: FormSpec) { formSpec.isHaveProLicense = data.isHaveProLicense; formSpec.isHaveMinPeriodOrHoldPos = data.isHaveMinPeriodOrHoldPos; } + /** * funciton อัปเดทข้อมูลส่วนตัว * @param data ข้อมูลส่วนตัว @@ -229,6 +232,21 @@ async function updateCheckSpec(data: FormSpec) { function updateFormDetail(data: any) { formDetail.value = data; } +/** function เช็คการการคุณสมบัติ*/ +function checkSelectForm() { + const isTrue = Object.keys(formSpec).find((key) => formSpec[key] === true); + isTrue + ? dialogConfirm( + $q, + async () => { + showLoader(); + saveStep1(); + }, + "ยืนยันการดำเนินการ", + "ต้องการยืนยันการดำเนินการต่อใช่หรือไม่?" + ) + : dialogMessageNotify($q, "กรุณาเลือกคุณสมบัติ"); +} /** function บันทักตรวจสอบคุณสมบัติ*/ async function saveStep1() { const salaries = formDetail.value.trainings.map((e: any) => ({ @@ -579,7 +597,7 @@ onMounted(async () => {
-
+
{{ @@ -588,7 +606,7 @@ onMounted(async () => { : "ประเมินชำนาญการพิเศษ" }}
- +
{ color="primary" icon="history" @click="onClickPopupHistory" - > + > ประวัติการประเมิน
@@ -607,7 +625,7 @@ onMounted(async () => {
- +
@@ -648,39 +666,33 @@ onMounted(async () => { " > - - - - - - - - - + + + + + + + + +
-
+
{ }); }; + const dialogMessageNotify = ( + q: any, + desc?: string, // ถ้ามี cancel action ใส่เป็น null + cancel?: Function + ) => { + q.dialog({ + component: CustomComponent, + componentProps: { + title: "ข้อความแจ้งเตือน", + message: desc && desc != null ? desc : "กรุณากรอกข้อมูลให้ครบ", + icon: "warning", + color: "orange", + textOk: "ตกลง", + onlycancel: true, + }, + }).onCancel(() => { + if (cancel) cancel(); + }); + }; + /** * ฟังก์ชั่นเช็คและแปลงตัวเลขก่อนส่งไป convert เป็นข้อความที่ฟังก์ชั่น arabicNumberToText * @param Number จำนวนเงินเดือน @@ -1043,6 +1063,7 @@ export const useCounterMixin = defineStore("mixin", () => { fails, dialogConfirm, dialogRemove, + dialogMessageNotify, arabicNumberToText, calculateDurationYmd, };