Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m11s

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-11-21 10:01:39 +07:00
commit acf7e1d300
4 changed files with 80 additions and 36 deletions

View file

@ -395,17 +395,28 @@ async function clickCandidateList() {
} }
async function onCheckShowExaminfo() { async function onCheckShowExaminfo() {
try { dialogMessage(
showLoader(); $q,
await http.post(config.API.checkShowExaminfo, { "ยืนยันการเปิดให้ดาวน์โหลดใบสมัคร แสดงสถานที่สอบ และเลขประจำตัวสอบนี้หรือไม่?",
examId: examId.value, "ยืนยันการเปิดให้ดาวน์โหลดใบสมัคร แสดงสถานที่สอบ และเลขประจำตัวสอบ",
}); "mdi-email-check-outline",
await props.fetchData(); "ยืนยัน",
} catch (error) { "public",
messageError($q, error); async () => {
} finally { try {
hideLoader(); 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 // Pagination - page & change page & get new data

View file

@ -1,7 +1,7 @@
<!-- page:ดการรอบการสอบ สรรหา --> <!-- page:ดการรอบการสอบ สรรหา -->
<script setup lang="ts"> <script setup lang="ts">
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import { onMounted, ref, watch } from "vue"; import { onMounted, ref, watch, computed } from "vue";
import { useQuasar, QForm } from "quasar"; import { useQuasar, QForm } from "quasar";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
@ -225,6 +225,10 @@ const columnsPosition = ref<QTableProps["columns"]>([
}, },
]); ]);
const shouldShowPaymentFields = computed(() => {
return announcementExam.value && fee.value > 0;
});
/** ย้อนกลับไปหน้าหลัก */ /** ย้อนกลับไปหน้าหลัก */
function clickBack() { function clickBack() {
router.push({ name: "qualifyPeriod" }); router.push({ name: "qualifyPeriod" });
@ -389,27 +393,50 @@ async function updateYear(e: number) {
/** saveข้อมูล เพิ่ม แก้ไข */ /** saveข้อมูล เพิ่ม แก้ไข */
async function checkSave() { async function checkSave() {
if (myForm.value !== null) { try {
myForm.value.validate().then(async (success) => { // validation form
if (success) { const isMainFormValid = await myForm.value?.validate();
if (edit.value) { if (!isMainFormValid) return;
if (rowsPosition.value.length == 0 && announcementExam.value) {
notifyWarring($q, "กรุณาเพิ่มตำแหน่ง"); // validation form
} else { const isPositionFormValid = await myFormPosition.value?.validate();
await editData(id.value); if (!isPositionFormValid) return;
}
} else { //
await addData(); if (announcementExam.value && rowsPosition.value.length === 0) {
} notifyWarring($q, "กรุณาเพิ่มตำแหน่ง");
return;
}
//
if (shouldShowPaymentFields.value && pay.value === "") {
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 ข้อมูล */ /** body สำหรับ save ข้อมูล */
function sendData() { function sendData() {
console.log(rowsPosition.value);
const positionData: RequestPosition[] = []; const positionData: RequestPosition[] = [];
rowsPosition.value.map((r: ResponsePosition) => { rowsPosition.value.map((r: ResponsePosition) => {
positionData.push({ positionData.push({
@ -1151,7 +1178,7 @@ onMounted(async () => {
</div> </div>
<div <div
class="col-xs-12 col-sm-3 col-md-3" class="col-xs-12 col-sm-3 col-md-3"
v-if="announcementExam && fee != 0" v-if="shouldShowPaymentFields"
> >
<datepicker <datepicker
v-model="datePayment" v-model="datePayment"
@ -1457,10 +1484,14 @@ onMounted(async () => {
</ProfileTable> </ProfileTable>
</q-form> </q-form>
</div> </div>
<div class="col-12" v-if="announcementExam && fee != 0"> <div class="col-12" v-if="shouldShowPaymentFields">
<q-separator size="5px" color="grey-2" class="q-mt-lg" /> <q-separator size="5px" color="grey-2" class="q-mt-lg" />
</div> </div>
<div class="col-12 q-mt-lg" v-if="announcementExam && fee != 0">
<div
class="col-12 q-mt-lg"
v-if="shouldShowPaymentFields"
>
<div class="text-bold text-subtitle2 q-pb-md"> <div class="text-bold text-subtitle2 q-pb-md">
เลอกวการชำระเง เลอกวการชำระเง
</div> </div>

View file

@ -129,7 +129,7 @@ const columns = ref<QTableProps["columns"]>([
label: "ชื่อ-นามสกุล", label: "ชื่อ-นามสกุล",
sortable: true, sortable: true,
field: "fullname", field: "fullname",
headerStyle: "font-size: 14px; min-width: 200px", headerStyle: "font-size: 14px; min-width: 320px",
style: "font-size: 14px; ", style: "font-size: 14px; ",
}, },
{ {

View file

@ -1,10 +1,8 @@
import config from "@/app.config";
import { getToken } from "@/plugins/auth";
import { defineStore } from "pinia"; import { defineStore } from "pinia";
import { Notify } from "quasar"; import { Notify } from "quasar";
import { io, Socket } from "socket.io-client"; 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";
interface sockeBackup { interface sockeBackup {
message: string; message: string;
success?: boolean; success?: boolean;
@ -12,7 +10,6 @@ interface sockeBackup {
export const useSocketStore = defineStore("socket", () => { export const useSocketStore = defineStore("socket", () => {
let socket: Socket; let socket: Socket;
const storeOrg = useOrganizational();
async function init() { async function init() {
socket = io(new URL(config.API.socket).origin, { socket = io(new URL(config.API.socket).origin, {
@ -24,6 +21,11 @@ export const useSocketStore = defineStore("socket", () => {
notifyStatus(body.message, body.success); 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) => { socket.on("send-create-draft-org", (payload) => {
let body: sockeBackup = JSON.parse(payload); let body: sockeBackup = JSON.parse(payload);
if (body.message == "ระบบกำลังทำการสร้างแบบร่างโครงสร้างหน่วยงาน") { if (body.message == "ระบบกำลังทำการสร้างแบบร่างโครงสร้างหน่วยงาน") {