Merge branch 'develop' into working

This commit is contained in:
Suphonchai Phoonsawat 2025-11-20 13:25:02 +07:00
commit cc08b74dd7
2 changed files with 61 additions and 26 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

@ -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 () => {
<div class="col-12" v-if="announcementExam && fee != 0">
<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="text-bold text-subtitle2 q-pb-md">
เลอกวการชำระเง