สอบคัดเลือกตรวจสอบหลายคน

This commit is contained in:
Kittapath 2023-10-02 11:39:20 +07:00
parent 178a6ac8c7
commit a74ab974b4
4 changed files with 121 additions and 3 deletions

View file

@ -69,6 +69,19 @@
>
<q-tooltip>บรรจานการคดเลอก</q-tooltip>
</q-btn>
<q-btn
size="md"
icon="mdi-email-check-outline"
round
flat
color="green-6"
@click="candidateCheckProfileDialog"
:disabled="
attrs.rows.filter((r) => r.status == 'checkRegister').length == 0
"
>
<q-tooltip>ตรวจสอบขอม</q-tooltip>
</q-btn>
<q-space />
<div class="items-center" style="display: flex">
<!-- นหาขอความใน table -->
@ -166,6 +179,7 @@ const table = ref<any>(null);
const files = ref<File[]>([]);
const filterRef = ref<any>(null);
const examId = ref<string>(route.params.examId.toString());
const candidateId = ref<string[]>([]);
const { messageError, showLoader, hideLoader } = mixin;
const props = defineProps({
inputfilter: String,
@ -391,6 +405,24 @@ const downloadFileDetail = async () => {
});
};
const checkCandidates = async () => {
showLoader();
await http
.post(config.API.candidateCheckRegisters, {
candidateId: candidateId.value,
})
.then((res) => {
success($q, "ตรวจสอบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
props.fetchData();
});
};
const downloadFilePDF = async (res: string, fileName: string) => {
const link = document.createElement("a");
link.href = window.URL.createObjectURL(
@ -426,6 +458,27 @@ const publishModal = () => {
}
};
const candidateCheckProfileDialog = async () => {
dialogMessage(
$q,
"ยืนยันการตรวจสอบข้อมูลนี้หรือไม่?",
"ยืนยันการตรวจสอบข้อมูล",
"mdi-email-check-outline",
"ยืนยัน",
"public",
candidateCheckProfile,
undefined
);
};
const candidateCheckProfile = async () => {
const filter = attrs.value.rows.filter((r: any) => r.check == true);
filter.map((r: any) => {
candidateId.value.push(r.id.toString());
});
await checkCandidates();
};
const resetFilter = () => {
// reset X
emit("update:inputfilter", "");