hrms-mgt/src/modules/03_recruiting/views/01_compete/Period.vue

1004 lines
32 KiB
Vue
Raw Normal View History

2023-06-01 12:54:58 +07:00
<!-- page:ดการรอบการสอบ สรรหา -->
2024-09-17 15:56:06 +07:00
<script setup lang="ts">
import type { QTableProps } from "quasar";
import { onMounted, ref } from "vue";
import { useRouter } from "vue-router";
import { useQuasar } from "quasar";
2025-01-13 18:08:51 +07:00
import genReport from "@/plugins/genreport";
2023-08-04 10:04:59 +07:00
2024-09-17 15:56:06 +07:00
import http from "@/plugins/http";
import config from "@/app.config";
import { checkPermission } from "@/utils/permissions";
import { useCounterMixin } from "@/stores/mixin";
2023-08-04 10:04:59 +07:00
2024-09-17 15:56:06 +07:00
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
import type {
ResponseRecruitPeriod,
ResponseHistoryObject,
} from "@/modules/03_recruiting/interface/response/Period";
2023-08-04 10:04:59 +07:00
2024-09-17 15:56:06 +07:00
import Table from "@/modules/03_recruiting/components/Table.vue";
import DialogHeader from "@/components/DialogHeader.vue";
import HistoryTable from "@/components/TableHistory.vue";
2025-07-09 10:02:58 +07:00
import DialogHeadTemplate from "@/modules/03_recruiting/components/DialogHeadTemplate.vue";
2023-08-04 10:04:59 +07:00
2024-09-17 15:56:06 +07:00
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
2025-04-21 17:14:58 +07:00
const {
success,
dateText,
showLoader,
hideLoader,
messageError,
onSearchDataTable,
2025-07-07 15:18:37 +07:00
dialogRemove,
2025-04-21 17:14:58 +07:00
} = mixin;
2023-08-04 10:04:59 +07:00
2024-09-17 15:56:06 +07:00
const router = useRouter();
const name = ref<string>("");
const year = ref<number>(new Date().getFullYear() + 543);
const order = ref<number>(1);
2023-08-04 10:04:59 +07:00
2023-06-01 12:54:58 +07:00
const files = ref<any>(null);
const files_score = ref<any>(null);
const files_candidate = ref<any>(null);
const files_result = ref<any>(null);
2023-06-01 12:54:58 +07:00
const modalAdd = ref<boolean>(false);
const modalScore = ref<boolean>(false);
const modalCandidate = ref<boolean>(false);
const modalResult = ref<boolean>(false);
2023-06-01 12:54:58 +07:00
const selected_row_id = ref<string>("");
const rowsHistory = ref<ResponseHistoryObject[]>([]); //select data history
const tittleHistory = ref<string>("ประวัติการนำเข้าข้อมูล"); //
const filterHistory = ref<string>(""); //search data table history
2023-06-01 12:54:58 +07:00
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
const modalError = ref<boolean>(false); // modal สำหรับแจ้งเตือนerror
const modalErrorTittle = ref<string>(""); // tittle modal error
const modalErrorDetail = ref<string>(""); // detail modal error
const statusCode = ref<number>();
const filter = ref<string>(""); //search data table
const textTittle = ref<string>("");
const textTittleScore = ref<string>("");
const textTittleCandidate = ref<string>("");
const textTittleResult = ref<string>("");
2024-09-17 15:56:06 +07:00
const rows = ref<ResponseRecruitPeriod[]>([]);
const rowsData = ref<ResponseRecruitPeriod[]>([]);
2023-06-01 12:54:58 +07:00
const initialPagination = ref<Pagination>({
2023-08-04 10:04:59 +07:00
rowsPerPage: 0,
2025-02-26 17:15:19 +07:00
sortBy: "year",
2023-06-01 12:54:58 +07:00
});
const visibleColumns = ref<String[]>([
2023-08-04 10:04:59 +07:00
"no",
"name",
"order",
"year",
"examCount",
"scoreCount",
"result",
2023-06-01 12:54:58 +07:00
]);
const columns = ref<QTableProps["columns"]>([
2023-08-04 10:04:59 +07:00
{
name: "no",
align: "left",
label: "ลำดับ",
2023-09-20 14:28:32 +07:00
sortable: false,
2023-08-04 10:04:59 +07:00
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "name",
align: "left",
label: "รอบสอบแข่งขัน",
sortable: true,
field: "name",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "order",
align: "left",
label: "ครั้งที่",
sortable: true,
field: "order",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "year",
align: "left",
label: "ปีงบประมาณ",
sortable: true,
field: "year",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
2025-02-26 17:15:19 +07:00
sort: (a: number, b: number) => b - a,
2023-08-04 10:04:59 +07:00
},
{
name: "examCount",
label: "ข้อมูลผู้สมัครสอบ",
2023-08-04 10:04:59 +07:00
align: "right",
field: "examCount",
sortable: true,
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "scoreCount",
label: "บัญชีรวมคะแนน",
2023-08-04 10:04:59 +07:00
align: "right",
field: "scoreCount",
sortable: true,
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "result",
label: "ผลการสอบ",
align: "right",
field: "result",
sortable: true,
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
2023-06-01 12:54:58 +07:00
]);
const columnsHistory = ref<QTableProps["columns"]>([
2023-08-04 10:04:59 +07:00
{
name: "description",
align: "left",
label: "รายละเอียด",
sortable: true,
field: "description",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "createdAt",
align: "center",
label: "วันที่ดำเนินการ",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "createdFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "createdFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
2023-06-01 12:54:58 +07:00
]);
const visibleColumnsHistory = ref<String[]>([
2023-08-04 10:04:59 +07:00
"description",
"createdAt",
"createdFullName",
2023-06-01 12:54:58 +07:00
]);
/**
* งกนแปลง date เปนภาษาไทย
* @param value นท type datetime จะแปลงเปนไทย
*/
2024-09-17 15:56:06 +07:00
function textDate(value: Date) {
2023-08-04 10:04:59 +07:00
return dateText(value);
2024-09-17 15:56:06 +07:00
}
2023-06-01 12:54:58 +07:00
2024-09-17 15:56:06 +07:00
/** ดึงข้อมูล รอบสอบแข่งขัน */
2025-07-07 15:18:37 +07:00
async function fetchData(actionType?: string) {
2023-08-04 10:04:59 +07:00
showLoader();
await http
.get(config.API.getCandidates)
.then((res) => {
const data = res.data.result;
let result: ResponseRecruitPeriod[] = [];
if (data.length > 0) {
data.map((r: ResponseRecruitPeriod) => {
if (r.score != null) {
r.scoreCount = r.score.scoreCount;
r.scoreImportDate = r.score.importDate;
}
result.push(r);
});
}
rows.value = result;
rowsData.value = result;
2023-08-04 10:04:59 +07:00
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
2025-07-07 15:18:37 +07:00
if (actionType == "delete") {
success($q, "ลบข้อมูลสำเร็จ");
2025-07-07 15:18:37 +07:00
}
2023-08-04 10:04:59 +07:00
});
2024-09-17 15:56:06 +07:00
}
2023-06-01 12:54:58 +07:00
2024-09-17 15:56:06 +07:00
/**
* ดาวนโหลดรายชอผสอบแขงขนได
* @param id รอบสอบเเขงข
*/
async function clickPassExam(id: string) {
2025-01-14 09:33:58 +07:00
showLoader();
await http
2025-01-14 09:33:58 +07:00
.get(config.API.exportPassExamList(id))
.then(async (res) => {
2025-01-14 09:33:58 +07:00
const data = res.data.result;
data.reportName = `CandidateList`;
await genReport(data, data.reportName, "pdf");
2025-01-14 09:33:58 +07:00
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
})
.finally(() => {
hideLoader();
});
2024-09-17 15:56:06 +07:00
}
2023-06-01 12:54:58 +07:00
2024-09-17 15:56:06 +07:00
/**
* ดาวนโหลดรายชอผทธสอบ
* @param id รอบสอบเเขงข
*/
async function clickCandidateList(id: string) {
2025-01-14 09:33:58 +07:00
showLoader();
await http
.get(config.API.exportCandidateListNew(id))
.then(async (res) => {
2025-01-13 18:08:51 +07:00
const data = res.data.result;
2025-01-14 09:33:58 +07:00
data.reportName = `CandidateList`;
await genReport(data, data.reportName, "pdf");
2025-01-13 18:08:51 +07:00
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
2025-01-14 09:33:58 +07:00
})
.finally(() => {
hideLoader();
});
2024-09-17 15:56:06 +07:00
}
2023-06-01 12:54:58 +07:00
2024-09-17 15:56:06 +07:00
/**
* รายละเอยด รอบสอบเเขงข
* @param id รอบสอบเเขงข
*/
function clickDetail(id: string) {
2023-08-04 10:04:59 +07:00
router.push(`/compete/import/${id}`);
2024-09-17 15:56:06 +07:00
}
2023-06-01 12:54:58 +07:00
/**
* นำเขาไฟลสมครสอบอกคร
* @param id รอบสอบเเขงข
*/
async function clickUpload(id: string) {
modalCandidate.value = true;
textTittleCandidate.value = "นำเข้าผู้สมัครสอบแข่งขัน";
selected_row_id.value = id;
}
2024-09-17 15:56:06 +07:00
/**
* นำเขาไฟลผลคะแนนสอบอกคร
* @param id รอบสอบเเขงข
*/
async function clickEdit(id: string) {
2023-08-04 10:04:59 +07:00
modalScore.value = true;
textTittleScore.value = "นำเข้าบัญชีรวมคะแนนทั้งหมด (เรียงตามเลขประจำตัวสอบ)";
2023-08-04 10:04:59 +07:00
selected_row_id.value = id;
2024-09-17 15:56:06 +07:00
}
2023-06-01 12:54:58 +07:00
2024-09-17 15:56:06 +07:00
/**
2025-09-04 10:50:23 +07:00
* นำเขาไฟลลำด
2024-09-17 15:56:06 +07:00
* @param id รอบสอบเเขงข
*/
async function clickResult(id: string) {
modalResult.value = true;
textTittleResult.value = "นำเข้าไฟล์ผลการสอบแข่งขันฯ (บัญชีรายชื่อ)";
2023-08-04 10:04:59 +07:00
selected_row_id.value = id;
2024-09-17 15:56:06 +07:00
}
2023-06-01 12:54:58 +07:00
2024-09-17 15:56:06 +07:00
/**
* แกไขรอบสอบแขงข
* @param id รอบสอบเเขงข
*/
function clickEditPeriod(id: string) {
2023-08-04 10:04:59 +07:00
router.push(`/compete/period/${id}`);
2024-09-17 15:56:06 +07:00
}
2023-06-01 12:54:58 +07:00
2024-09-17 15:56:06 +07:00
/**
* ประว
* @param id รอบสอบเเขงข
*/
async function clickHistory(id: string) {
2023-08-04 10:04:59 +07:00
modalHistory.value = true;
showLoader();
await http
.get(config.API.getImportHistory(id))
.then((res) => {
const data = res.data.result;
rowsHistory.value = [];
if (data.length > 0) {
data.map((i: ResponseHistoryObject) => {
rowsHistory.value.push({
createdAt: i.createdAt,
createdFullName: i.createdFullName,
createdUserId: i.createdUserId,
id: i.id,
isActive: i.isActive,
lastUpdateFullName: i.lastUpdateFullName,
lastUpdateUserId: i.lastUpdateUserId,
lastUpdatedAt: i.lastUpdatedAt,
description: i.description,
});
});
}
})
.catch((e) => {
modalError.value = true;
modalErrorTittle.value = "ไม่พบประวัติการเผยแพร่";
modalErrorDetail.value = e.response.data.message;
statusCode.value = e.response.data.status;
})
.finally(async () => {
hideLoader();
});
2024-09-17 15:56:06 +07:00
}
2023-06-01 12:54:58 +07:00
2024-09-17 15:56:06 +07:00
/**
* ลบขอม
*
* @param id รอบสอบเเขงข
*/
function clickDelete(id: string) {
2025-07-07 15:18:37 +07:00
dialogRemove($q, async () => {
showLoader();
await http
.delete(config.API.deleteCandidates(id))
.then(async (res) => {
await fetchData("delete");
})
.catch((e) => {
messageError($q, e);
hideLoader();
});
});
2024-09-17 15:56:06 +07:00
}
2023-06-01 12:54:58 +07:00
2024-09-17 15:56:06 +07:00
/** ไปหน้าเพิ่มรอบสอบแข่งขัน */
function clickAdd() {
2023-08-04 10:04:59 +07:00
router.push({ name: "competePeriodAdd" });
2024-09-17 15:56:06 +07:00
}
2023-06-01 12:54:58 +07:00
2024-09-17 15:56:06 +07:00
/** ปิด dialog */
async function clickClose() {
2023-08-04 10:04:59 +07:00
modalAdd.value = false;
await fetchData();
2024-09-17 15:56:06 +07:00
}
2023-06-01 12:54:58 +07:00
2024-09-17 15:56:06 +07:00
/** ปิด dialog คะเเนน */
async function clickCloseScore() {
2023-08-04 10:04:59 +07:00
modalScore.value = false;
2025-01-13 18:08:51 +07:00
files_score.value = null;
2024-09-17 15:56:06 +07:00
}
2023-06-01 12:54:58 +07:00
2024-09-17 15:56:06 +07:00
/** ปิด dialog เลือกไฟล์ผู้สมัครสอบแข่งขัน */
async function clickCloseCandidate() {
2023-08-04 10:04:59 +07:00
modalCandidate.value = false;
2025-04-21 17:14:58 +07:00
files_candidate.value = null;
2024-09-17 15:56:06 +07:00
}
2025-09-04 10:50:23 +07:00
/** ปิด dialog เลือกไฟล์ผลการสอบ */
async function clickCloseResult() {
modalResult.value = false;
files_result.value = null;
}
2023-06-01 12:54:58 +07:00
2024-09-17 15:56:06 +07:00
/** บันทึกข้อมูล เลือกไฟล์ผู้สมัครสอบแข่งขัน */
async function checkSaveCandidate() {
2023-08-04 10:04:59 +07:00
const fd = new FormData();
fd.append("attachment", files_candidate.value[0]);
showLoader();
await http
.post(config.API.uploadCandidates(selected_row_id.value), fd)
.then((res) => {
success($q, "นำเข้าข้อมูลผู้สมัครสอบสำเร็จ");
modalCandidate.value = false;
2025-04-21 17:14:58 +07:00
files_candidate.value = null;
2023-08-04 10:04:59 +07:00
selected_row_id.value = "";
fetchData();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
2024-09-17 15:56:06 +07:00
}
2023-06-01 12:54:58 +07:00
2024-09-17 15:56:06 +07:00
/** บันทึด คะเเนน */
async function checkSaveScore() {
2023-08-04 10:04:59 +07:00
const fd = new FormData();
fd.append("attachment", files_score.value[0]);
showLoader();
await http
.post(config.API.saveScores(selected_row_id.value), fd)
.then((res) => {
success($q, "นำเข้าข้อมูลผลคะแนนสอบสำเร็จ");
modalScore.value = false;
2025-01-13 18:08:51 +07:00
files_score.value = null;
2023-08-04 10:04:59 +07:00
selected_row_id.value = "";
fetchData();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
2024-09-17 15:56:06 +07:00
}
2023-06-01 12:54:58 +07:00
/** บันทึกข้อมูล เลือกไฟล์ผลการสอบแข่งขันฯ */
async function checkSaveResult() {
const fd = new FormData();
fd.append("attachment", files_result.value[0]);
showLoader();
await http
.post(config.API.uploadResult(selected_row_id.value), fd)
.then((res) => {
success($q, "นำเข้าข้อมูลผลการสอบแข่งขันฯ (บัญชีรายชื่อ)");
modalResult.value = false;
files_result.value = null;
selected_row_id.value = "";
fetchData();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
2024-09-17 15:56:06 +07:00
/** save data */
async function checkSave() {
2023-08-04 10:04:59 +07:00
const fd = new FormData();
fd.append("attachment", files.value[0]);
fd.append("year", year.value.toString());
fd.append("order", order.value.toString());
fd.append("name", name.value);
showLoader();
await http
.post(config.API.saveCandidates, fd)
.then((res) => {
success($q, "นำเข้าข้อมูลผู้สมัครสอบแข่งขันสำเร็จ");
modalAdd.value = false;
fetchData();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
2024-09-17 15:56:06 +07:00
}
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
columns.value ? columns.value : []
);
}
2024-09-17 15:56:06 +07:00
/** ดึงข้อมูล เมื่อโหลดหน้า component */
onMounted(async () => {
hideLoader();
await fetchData();
});
2023-06-01 12:54:58 +07:00
</script>
2024-09-17 15:56:06 +07:00
<template>
<div class="toptitle text-dark col-12 row items-center">
ดการรอบสอบแขงข
</div>
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
<div>
<Table
style="max-height: 80vh"
:rows="rows"
:columns="columns"
v-model:filter="filter"
:onSearch="onSearch"
2024-09-17 15:56:06 +07:00
:visible-columns="visibleColumns"
v-model:inputfilter="filter"
v-model:inputvisible="visibleColumns"
:pagination="initialPagination"
:nornmalData="true"
:add="clickAdd"
:paging="true"
:titleText="''"
>
<template #columns="props">
2024-09-23 13:40:03 +07:00
<q-tr :props="props">
<q-td auto-width>
2024-09-17 15:56:06 +07:00
<q-btn
2024-09-23 13:40:03 +07:00
icon="mdi-dots-horizontal-circle-outline"
color="secondary"
2024-09-17 15:56:06 +07:00
flat
round
dense
2024-09-23 13:40:03 +07:00
v-if="
checkPermission($route)?.attrIsCreate ||
checkPermission($route)?.attrIsDelete ||
checkPermission($route)?.attrIsGet ||
checkPermission($route)?.attrIsUpdate
"
2024-09-17 15:56:06 +07:00
>
2024-09-23 13:40:03 +07:00
<q-menu transition-show="jump-down" transition-hide="jump-up">
<q-list dense style="min-width: 100px">
<q-item
v-if="checkPermission($route)?.attrIsGet"
clickable
v-close-popup
@click="clickDetail(props.row.id)"
>
<q-item-section style="min-width: 0px" avatar>
<q-icon color="info" size="xs" name="mdi-eye" />
</q-item-section>
<q-item-section>รายละเอยด</q-item-section>
</q-item>
2024-09-17 15:56:06 +07:00
2024-09-23 13:40:03 +07:00
<q-item
v-if="
checkPermission($route)?.attrIsUpdate &&
checkPermission($route)?.attrIsGet
"
clickable
v-close-popup
@click="clickEditPeriod(props.row.id)"
>
<q-item-section style="min-width: 0px" avatar>
<q-icon color="edit" size="xs" name="mdi-pencil" />
</q-item-section>
<q-item-section>แกไขขอม</q-item-section>
</q-item>
<q-item
v-if="checkPermission($route)?.attrIsDelete"
clickable
v-close-popup
@click="clickDelete(props.row.id)"
>
<q-item-section style="min-width: 0px" avatar>
<q-icon color="red" size="xs" name="mdi-delete" />
</q-item-section>
<q-item-section>ลบขอม</q-item-section>
</q-item>
<q-item
v-if="checkPermission($route)?.attrIsGet"
clickable
v-close-popup
@click="clickHistory(props.row.id)"
>
<q-item-section style="min-width: 0px" avatar>
<q-icon
color="deep-purple"
size="xs"
name="mdi-history"
/>
</q-item-section>
<q-item-section
>แสดงประวการนำเขาขอม</q-item-section
>
2024-09-23 13:40:03 +07:00
</q-item>
</q-list>
</q-menu>
2024-09-17 15:56:06 +07:00
</q-btn>
</q-td>
2024-09-23 13:40:03 +07:00
<q-td v-for="col in props.cols" :key="col.name" :props="props">
2024-09-17 15:56:06 +07:00
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else-if="col.name == 'name'" class="table_ellipsis2">
{{ col.value }}
</div>
<div v-else-if="col.name == 'year'" class="table_ellipsis2">
{{ col.value + 543 }}
</div>
<div v-else-if="col.name == 'examCount'" class="table_ellipsis2">
2024-09-17 15:56:06 +07:00
<q-btn
flat
dense
size="12px"
color="green"
round
@click.stop.prevent="clickUpload(props.row.id)"
2024-09-17 15:56:06 +07:00
v-if="
(col.value == null || col.value == '0') &&
checkPermission($route)?.attrIsUpdate
2024-09-17 15:56:06 +07:00
"
>
<q-icon name="mdi-file-excel-outline" size="20px" />
<q-tooltip>นำเขาไฟลสมครสอบ</q-tooltip>
2024-09-17 15:56:06 +07:00
</q-btn>
<div v-else>
{{ col.value }}
2024-09-17 15:56:06 +07:00
<q-btn
v-if="checkPermission($route)?.attrIsUpdate"
dense
size="12px"
flat
round
color="green"
@click.stop.prevent="clickUpload(props.row.id)"
2024-09-17 15:56:06 +07:00
icon="mdi-file-excel-outline"
>
<q-tooltip>นำเขาไฟลสมครสอบอกคร</q-tooltip>
2024-09-17 15:56:06 +07:00
</q-btn>
<q-btn
v-if="checkPermission($route)?.attrIsGet"
dense
size="12px"
flat
round
color="indigo"
@click.stop.prevent="clickCandidateList(props.row.id)"
2024-09-17 15:56:06 +07:00
icon="mdi-clipboard-arrow-down"
>
<q-tooltip>ดาวนโหลดรายชอผทธสอบ</q-tooltip>
2024-09-17 15:56:06 +07:00
</q-btn>
</div>
</div>
<div v-else-if="col.name == 'scoreCount'" class="table_ellipsis2">
<q-btn
:disable="props.row.examCount == 0"
flat
dense
size="12px"
round
color="green"
@click.stop.prevent="clickEdit(props.row.id)"
v-if="
col.value == null && checkPermission($route)?.attrIsUpdate
"
>
<q-icon name="mdi-file-excel-outline" size="20px" />
<!-- นำเขาไฟลผลคะแนนสอบ -->
<q-tooltip
>นำเขาไฟลญชรวมคะแนนทงหมด
(เรยงตามเลขประจำตวสอบ)</q-tooltip
>
</q-btn>
<div v-else>
{{ props.row.score.scoreCount }}
<q-btn
:disable="props.row.examCount == 0"
flat
dense
size="12px"
round
color="green"
@click.stop.prevent="clickEdit(props.row.id)"
v-if="checkPermission($route)?.attrIsUpdate"
>
<q-icon name="mdi-file-excel-outline" size="20px" />
<!-- นำเขาไฟลผลคะแนนสอบ -->
<q-tooltip
>นำเขาไฟลญชรวมคะแนนทงหมด (เรยงตามเลขประจำตวสอบ)
กคร</q-tooltip
>
</q-btn>
</div>
</div>
<div v-else-if="col.name == 'result'" class="table_ellipsis2">
2024-09-17 15:56:06 +07:00
<q-btn
:disable="props.row.score == null"
2024-09-17 15:56:06 +07:00
flat
dense
size="12px"
color="green"
round
@click.stop.prevent="clickResult(props.row.id)"
2024-09-17 15:56:06 +07:00
v-if="
2025-09-04 10:50:23 +07:00
(props.row.score == null || props.row.score.resultCount == 0) &&
2024-09-17 15:56:06 +07:00
checkPermission($route)?.attrIsUpdate
"
>
<q-icon name="mdi-file-excel-outline" size="20px" />
<q-tooltip
>นำเขาไฟลผลการสอบแขงขนฯ (ญชรายช)</q-tooltip
>
2024-09-17 15:56:06 +07:00
</q-btn>
<div v-else>
{{ props.row.score.resultCount }}
2024-09-17 15:56:06 +07:00
<q-btn
v-if="checkPermission($route)?.attrIsUpdate"
dense
size="12px"
flat
round
color="green"
@click.stop.prevent="clickResult(props.row.id)"
2024-09-17 15:56:06 +07:00
icon="mdi-file-excel-outline"
>
<q-tooltip
>นำเขาไฟลผลการสอบแขงขนฯ (ญชรายช)
กคร</q-tooltip
>
2024-09-17 15:56:06 +07:00
</q-btn>
<q-btn
v-if="checkPermission($route)?.attrIsGet"
dense
size="12px"
flat
round
color="indigo"
@click.stop.prevent="clickPassExam(props.row.id)"
2024-09-17 15:56:06 +07:00
icon="mdi-clipboard-arrow-down"
>
<q-tooltip>ดาวนโหลดรายชอผสอบแขงขนได</q-tooltip>
2024-09-17 15:56:06 +07:00
</q-btn>
</div>
</div>
<div v-else>
{{ col.value }}
</div>
</q-td>
</q-tr>
</template>
</Table>
</div>
</q-card>
<HistoryTable
:rows="rowsHistory"
:columns="columnsHistory"
:filter="filterHistory"
:visible-columns="visibleColumnsHistory"
v-model:modal="modalHistory"
v-model:inputvisible="visibleColumnsHistory"
v-model:tittle="tittleHistory"
v-model:inputfilter="filterHistory"
>
<template #columns="props">
<q-tr :props="props">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div v-if="col.name == 'isActive'" class="">
<q-icon
v-if="col.value == false"
name="mdi-close"
color="red"
class="text-h5"
/>
<q-icon v-else name="mdi-check" color="positive" class="text-h5" />
</div>
<div v-else-if="col.name == 'createdAt'" class="">
{{ textDate(col.value) }}
</div>
<div v-else class="">
{{ col.value }}
</div>
</q-td>
</q-tr>
</template>
</HistoryTable>
<!-- popup Edit window-->
<q-dialog v-model="modalAdd" persistent>
<q-card style="width: 600px">
<q-form ref="myForm">
<DialogHeader :tittle="textTittle" :close="clickClose" />
<q-separator />
<q-card-section>
<div class="col-12 row items-center q-col-gutter-sm">
<div class="col-12">
<q-input
outlined
v-model="name"
label="ชื่อการสอบแข่งขัน"
dense
autogrow
lazy-rules
autofocus
hide-bottom-space
></q-input>
</div>
<div class="col-12">
<q-input
outlined
v-model="order"
label="ครั้งที่"
dense
autogrow
lazy-rules
autofocus
hide-bottom-space
></q-input>
</div>
<div class="col-12">
<q-input
outlined
v-model="year"
label="ปีงบประมาณ"
dense
autogrow
lazy-rules
autofocus
hide-bottom-space
></q-input>
</div>
<div class="col-12">
<q-file
v-model="files"
dense
label="เลือกไฟล์รายชื่อผู้สมัครสอบแข่งขัน"
outlined
use-chips
multiple
>
<template v-slot:prepend>
<q-icon name="attach_file" />
</template>
</q-file>
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions class="text-primary q-py-sm">
<q-space />
<q-btn
flat
round
color="public"
@click="checkSave"
icon="mdi-content-save-outline"
>
<q-tooltip>นท</q-tooltip>
</q-btn>
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
<q-dialog v-model="modalCandidate" persistent>
<q-card style="width: 600px">
<q-form ref="myFormScore">
<DialogHeadTemplate
:title="textTittleCandidate"
:close="clickCloseCandidate"
title-type="ข้อมูลผู้สมัครสอบ"
/>
<q-separator />
<q-card-section>
<div class="col-12 row items-center q-col-gutter-sm">
<div class="col-12">
<q-file
v-model="files_candidate"
dense
label="เลือกไฟล์ผู้สมัครสอบแข่งขัน"
outlined
use-chips
multiple
>
<template v-slot:prepend>
<q-icon name="attach_file" />
</template>
</q-file>
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions class="text-primary q-py-sm">
<q-space />
<q-btn
flat
round
color="public"
@click="checkSaveCandidate"
icon="mdi-content-save-outline"
>
<q-tooltip>นท</q-tooltip>
</q-btn>
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
2024-09-17 15:56:06 +07:00
<q-dialog v-model="modalScore" persistent>
<q-card style="width: 600px">
<q-form ref="myFormScore">
2025-07-09 10:02:58 +07:00
<DialogHeadTemplate
:title="textTittleScore"
:close="clickCloseScore"
title-type="บัญชีรวมคะแนนทั้งหมด (เรียงตามเลขประจำตัวสอบ)"
2025-07-09 10:02:58 +07:00
/>
2024-09-17 15:56:06 +07:00
<q-separator />
<q-card-section>
<div class="col-12 row items-center q-col-gutter-sm">
<div class="col-12">
<q-file
v-model="files_score"
dense
label="เลือกไฟล์บัญชีรวมคะแนนทั้งหมด (เรียงตามเลขประจำตัวสอบ)"
2024-09-17 15:56:06 +07:00
outlined
use-chips
multiple
>
<template v-slot:prepend>
<q-icon name="attach_file" />
</template>
</q-file>
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions class="text-primary q-py-sm">
<q-space />
<q-btn
flat
round
color="public"
@click="checkSaveScore"
icon="mdi-content-save-outline"
>
<q-tooltip>นท</q-tooltip>
</q-btn>
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
<q-dialog v-model="modalResult" persistent>
2024-09-17 15:56:06 +07:00
<q-card style="width: 600px">
<q-form ref="myFormScore">
2025-07-09 10:02:58 +07:00
<DialogHeadTemplate
:title="textTittleResult"
:close="clickCloseResult"
title-type="ผลการสอบแข่งขันฯ (บัญชีรายชื่อ)"
2025-07-09 10:02:58 +07:00
/>
2024-09-17 15:56:06 +07:00
<q-separator />
<q-card-section>
<div class="col-12 row items-center q-col-gutter-sm">
<div class="col-12">
<q-file
v-model="files_result"
2024-09-17 15:56:06 +07:00
dense
label="เลือกไฟล์ผลการสอบแข่งขันฯ (บัญชีรายชื่อ)"
2024-09-17 15:56:06 +07:00
outlined
use-chips
multiple
>
<template v-slot:prepend>
<q-icon name="attach_file" />
</template>
</q-file>
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions class="text-primary q-py-sm">
<q-space />
<q-btn
flat
round
color="public"
@click="checkSaveResult"
2024-09-17 15:56:06 +07:00
icon="mdi-content-save-outline"
>
<q-tooltip>นท</q-tooltip>
</q-btn>
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
</template>
2023-06-01 12:54:58 +07:00
<style></style>