เพิ่ม api ยกเลิกการสมัครสอบ

This commit is contained in:
AnandaTon 2023-10-20 15:56:08 +07:00
parent 61cc07ee75
commit 7367123a09
3 changed files with 100 additions and 1 deletions

View file

@ -51,7 +51,7 @@
</q-tr>
</template>
<template #bottom="props">
<div style="width: 64% !important" />
<div style="width: 67% !important" />
<div
:props="props"

View file

@ -12,6 +12,11 @@
@click="router.go(-1)"
/>
ตรวจสอบคณสมบสมครสอบรอบคดเลอก
{{
rejectDetail == null || rejectDetail == ""
? ""
: "(เหตุผล: " + rejectDetail + ")"
}}
<q-space />
<q-btn
color="blue"
@ -36,6 +41,17 @@
>
<q-tooltip>ตรวจสอบขอม</q-tooltip>
</q-btn>
<q-btn
color="red"
flat
round
icon="close"
class="bg-red-1"
@click="modalReverse"
v-if="status == 'payment' || status == 'checkSeat'"
>
<q-tooltip>อนกลบใหเจาหนาทตรวจสอบ</q-tooltip>
</q-btn>
</div>
<q-card class="q-pa-md">
<div>
@ -124,6 +140,55 @@
</q-form>
</q-card>
</q-dialog>
<q-dialog :model-value="modalReverseOfficer" persistent>
<q-card style="min-width: 700px">
<q-form ref="myForm">
<div class="row items-center q-pa-sm">
<div class="row">
<div class="text-bold">อนกลบใหเจาหนาทตรวจสอบ</div>
</div>
<q-space />
<q-btn
icon="close"
unelevated
round
dense
style="color: #ff8080; background-color: #ffdede"
size="12px"
@click="closeReverse"
/>
</div>
<q-separator />
<!-- header บน table นหา แสดงคอลมน (status nornmalData true) -->
<div class="col-12 row q-pa-md">
<q-input
class="col-12 q-px-sm q-pt-sm"
outlined
stack-label
v-model="reason"
label="หมายเหตุ"
lazy-rules
autofocus
hide-bottom-space
type="textarea"
></q-input>
</div>
<q-separator />
<q-card-actions align="right" class="bg-white text-teal">
<q-btn
flat
round
color="public"
@click="checkSaveReverse"
icon="mdi-content-save-outline"
>
<q-tooltip>นทกตรวจสอบ</q-tooltip>
</q-btn>
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
</template>
<script setup lang="ts">
@ -157,6 +222,7 @@ const route = useRoute();
const examId = ref<string>(route.params.examId.toString());
const candidateId = ref<string>(route.params.candidateId.toString());
const modal = ref<boolean>(false);
const modalReverseOfficer = ref<boolean>(false);
const approve = ref<string>("1");
const reason = ref<string>("");
const formInformation = ref<any>({});
@ -165,6 +231,7 @@ const formEducation = ref<any>({});
const formOccupation = ref<any>({});
const formContact = ref<any>({});
const status = ref<string>("");
const rejectDetail = ref<string>("");
onMounted(async () => {
await fetchStatus();
@ -177,6 +244,8 @@ const fetchStatus = async () => {
.then((res) => {
const data = res.data.result;
status.value = data.status;
rejectDetail.value = data.rejectDetail;
console.log(rejectDetail.value);
})
.catch((e) => {
messageError($q, e);
@ -221,6 +290,10 @@ const reject = async (reason: string) => {
});
};
const checkSaveReverse = () => {
rejectReverse(reason.value);
};
const checkSave = () => {
if (approve.value == "1") {
confirm(true, "");
@ -235,6 +308,30 @@ const modalCheck = () => {
modal.value = true;
};
const rejectReverse = async (reason: string) => {
showLoader();
await http
.put(config.API.candidateCheckRegisterReject(candidateId.value), {
reason: reason,
})
.then((res) => {})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
success($q, "สำเร็จ");
router.push(`/qualify/manage/${examId.value}`);
});
};
const modalReverse = () => {
modalReverseOfficer.value = true;
};
const closeReverse = () => {
modalReverseOfficer.value = false;
};
const close = () => {
modal.value = false;
};