From 989d70d97a101bb2c56c0dd56a7e6705fc62b39b Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 20 Nov 2025 10:14:39 +0700 Subject: [PATCH 1/7] fix:bug validate --- .../views/02_qualify/PeriodAdd.vue | 54 +++++++++++++------ 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue b/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue index 66c2fc382..65a425669 100644 --- a/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue +++ b/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue @@ -389,27 +389,50 @@ async function updateYear(e: number) { /** saveข้อมูล เพิ่ม แก้ไข */ async function checkSave() { - if (myForm.value !== null) { - myForm.value.validate().then(async (success) => { - if (success) { - if (edit.value) { - if (rowsPosition.value.length == 0 && announcementExam.value) { - notifyWarring($q, "กรุณาเพิ่มตำแหน่ง"); - } else { - await editData(id.value); - } - } else { - await addData(); - } + try { + // เช็ค validation form หลัก + const isMainFormValid = await myForm.value?.validate(); + if (!isMainFormValid) return; + + // เช็ค validation form ตำแหน่ง + const isPositionFormValid = await myFormPosition.value?.validate(); + if (!isPositionFormValid) return; + + // เช็คการเพิ่มตำแหน่ง + if (announcementExam.value && rowsPosition.value.length === 0) { + notifyWarring($q, "กรุณาเพิ่มตำแหน่ง"); + return; + } + + // เช็คการเลือกวิธีการชำระเงิน + if (announcementExam.value && fee.value != 0) { + notifyWarring($q, "กรุณาเลือกวิธีการชำระเงิน"); + return; + } + + // เช็ค validation form วิธีการชำระเงิน ชำระเงินค่าสมัครสอบผ่านสำนัก/หน่วยงาน + if (pay.value === "payment2") { + const isPaymentFormValid = await myFormPayment.value?.validate(); + if (!isPaymentFormValid) return; + + if (rowsPayment.value.length === 0) { + notifyWarring($q, "กรุณาเพิ่มวิธีการชำระเงิน"); + return; } - }); + } + + if (edit.value) { + await editData(id.value); + } else { + await addData(); + } + } catch (error) { + messageError($q, error); } } /** body สำหรับ save ข้อมูล */ function sendData() { - console.log(rowsPosition.value); - const positionData: RequestPosition[] = []; rowsPosition.value.map((r: ResponsePosition) => { positionData.push({ @@ -1460,6 +1483,7 @@ onMounted(async () => {
+
เลือกวิธีการชำระเงิน From adde8fac6f9ef7361917f562c724d8411567e569 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 20 Nov 2025 10:25:52 +0700 Subject: [PATCH 2/7] fix:dialogConfrim --- .../components/TableCandidate.vue | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/modules/03_recruiting/components/TableCandidate.vue b/src/modules/03_recruiting/components/TableCandidate.vue index 9744c90ef..456c48064 100644 --- a/src/modules/03_recruiting/components/TableCandidate.vue +++ b/src/modules/03_recruiting/components/TableCandidate.vue @@ -395,17 +395,28 @@ async function clickCandidateList() { } async function onCheckShowExaminfo() { - try { - showLoader(); - await http.post(config.API.checkShowExaminfo, { - examId: examId.value, - }); - await props.fetchData(); - } catch (error) { - messageError($q, error); - } finally { - hideLoader(); - } + dialogMessage( + $q, + "ยืนยันการเปิดให้ดาวน์โหลดใบสมัคร แสดงสถานที่สอบ และเลขประจำตัวสอบนี้หรือไม่?", + "ยืนยันการเปิดให้ดาวน์โหลดใบสมัคร แสดงสถานที่สอบ และเลขประจำตัวสอบ", + "mdi-email-check-outline", + "ยืนยัน", + "public", + async () => { + try { + showLoader(); + await http.post(config.API.checkShowExaminfo, { + examId: examId.value, + }); + await props.fetchData(); + } catch (error) { + messageError($q, error); + } finally { + hideLoader(); + } + }, + undefined + ); } // Pagination - page & change page & get new data From 57b6bf26276890bda3765b2f614e84e715556268 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Thu, 20 Nov 2025 12:51:15 +0700 Subject: [PATCH 3/7] add support socket noti --- src/stores/socket.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/stores/socket.ts b/src/stores/socket.ts index 0b5ae15a6..e69f7270a 100644 --- a/src/stores/socket.ts +++ b/src/stores/socket.ts @@ -3,8 +3,8 @@ import { Notify } from "quasar"; import { io, Socket } from "socket.io-client"; import config from "@/app.config"; -import { getToken } from "@/plugins/auth"; import { useOrganizational } from "@/modules/02_organization/store/organizational"; +import { getToken } from "@/plugins/auth"; interface sockeBackup { message: string; success?: boolean; @@ -12,7 +12,6 @@ interface sockeBackup { export const useSocketStore = defineStore("socket", () => { let socket: Socket; - const storeOrg = useOrganizational(); async function init() { socket = io(new URL(config.API.socket).origin, { @@ -24,6 +23,11 @@ export const useSocketStore = defineStore("socket", () => { notifyStatus(body.message, body.success); }); + socket.on("send-notification", (payload) => { + let body: sockeBackup = JSON.parse(payload); + notifyStatus(body.message, body.success); + }); + socket.on("send-create-draft-org", (payload) => { let body: sockeBackup = JSON.parse(payload); if (body.message == "ระบบกำลังทำการสร้างแบบร่างโครงสร้างหน่วยงาน") { From 54b6835cb57641b472dff0ea36a08debd71e67a5 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Thu, 20 Nov 2025 13:02:53 +0700 Subject: [PATCH 4/7] change socket event --- src/stores/socket.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/stores/socket.ts b/src/stores/socket.ts index e69f7270a..1b75d50f3 100644 --- a/src/stores/socket.ts +++ b/src/stores/socket.ts @@ -3,8 +3,6 @@ import { Notify } from "quasar"; import { io, Socket } from "socket.io-client"; import config from "@/app.config"; -import { useOrganizational } from "@/modules/02_organization/store/organizational"; -import { getToken } from "@/plugins/auth"; interface sockeBackup { message: string; success?: boolean; @@ -23,7 +21,7 @@ export const useSocketStore = defineStore("socket", () => { notifyStatus(body.message, body.success); }); - socket.on("send-notification", (payload) => { + socket.on("socket-notification", (payload) => { let body: sockeBackup = JSON.parse(payload); notifyStatus(body.message, body.success); }); From b56b412bacd16c132217a39731ef8d77b74d8b48 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Thu, 20 Nov 2025 13:24:36 +0700 Subject: [PATCH 5/7] fix code --- src/stores/socket.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stores/socket.ts b/src/stores/socket.ts index 1b75d50f3..0d5ea4c64 100644 --- a/src/stores/socket.ts +++ b/src/stores/socket.ts @@ -1,8 +1,8 @@ +import config from "@/app.config"; +import { getToken } from "@/plugins/auth"; import { defineStore } from "pinia"; import { Notify } from "quasar"; import { io, Socket } from "socket.io-client"; - -import config from "@/app.config"; interface sockeBackup { message: string; success?: boolean; @@ -21,7 +21,7 @@ export const useSocketStore = defineStore("socket", () => { notifyStatus(body.message, body.success); }); - socket.on("socket-notification", (payload) => { + socket.on("send-notification", (payload) => { let body: sockeBackup = JSON.parse(payload); notifyStatus(body.message, body.success); }); From f287d57a5cc5f3656e52478f2bd529ce79c5be28 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 20 Nov 2025 13:37:29 +0700 Subject: [PATCH 6/7] fix:bug fee --- .../views/02_qualify/PeriodAdd.vue | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue b/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue index 65a425669..53924ea73 100644 --- a/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue +++ b/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue @@ -1,7 +1,7 @@