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() {
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

View file

@ -1,7 +1,7 @@
<!-- page:ดการรอบการสอบ สรรหา -->
<script setup lang="ts">
import type { QTableProps } from "quasar";
import { onMounted, ref, watch } from "vue";
import { onMounted, ref, watch, computed } from "vue";
import { useQuasar, QForm } from "quasar";
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() {
router.push({ name: "qualifyPeriod" });
@ -389,27 +393,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 (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 ข้อมูล */
function sendData() {
console.log(rowsPosition.value);
const positionData: RequestPosition[] = [];
rowsPosition.value.map((r: ResponsePosition) => {
positionData.push({
@ -1151,7 +1178,7 @@ onMounted(async () => {
</div>
<div
class="col-xs-12 col-sm-3 col-md-3"
v-if="announcementExam && fee != 0"
v-if="shouldShowPaymentFields"
>
<datepicker
v-model="datePayment"
@ -1457,10 +1484,14 @@ onMounted(async () => {
</ProfileTable>
</q-form>
</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" />
</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>

View file

@ -129,7 +129,7 @@ const columns = ref<QTableProps["columns"]>([
label: "ชื่อ-นามสกุล",
sortable: true,
field: "fullname",
headerStyle: "font-size: 14px; min-width: 200px",
headerStyle: "font-size: 14px; min-width: 320px",
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 { 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";
interface sockeBackup {
message: string;
success?: boolean;
@ -12,7 +10,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 +21,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 == "ระบบกำลังทำการสร้างแบบร่างโครงสร้างหน่วยงาน") {