แก้สรรหา ฟิลเตอร์

This commit is contained in:
setthawutttty 2025-01-29 11:21:54 +07:00
parent 711d104516
commit 6f05aa81ee
3 changed files with 24 additions and 15 deletions

View file

@ -365,8 +365,10 @@ async function clickPassExam() {
showLoader();
await http
.get(config.API.exportExamPassExamList(examId.value))
.then(() => {
window.open(config.API.exportExamPassExamList(examId.value));
.then(async(res) => {
const data = res.data.result;
data.reportName = `Candidate_Dashboard_${dateToISO(new Date())}`;
await genReport(data, data.reportName,'pdf');
})
.catch((e) => {
messageError($q, e);
@ -380,8 +382,10 @@ async function clickCandidateList() {
showLoader();
await http
.get(config.API.exportExamCandidateList(examId.value))
.then(() => {
window.open(config.API.exportExamCandidateList(examId.value));
.then(async(res) => {
const data = res.data.result;
data.reportName = `Candidate_Dashboard_${dateToISO(new Date())}`;
await genReport(data, data.reportName,'pdf');
})
.catch((e) => {
messageError($q, e);

View file

@ -24,7 +24,8 @@ import HistoryTable from "@/components/TableHistory.vue";
const $q = useQuasar(); // show dialog
const router = useRouter();
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const { success, dateText, messageError, showLoader, hideLoader, date2Thai } =
mixin;
const name = ref<string>("");
const year = ref<number>(new Date().getFullYear() + 543);
@ -41,6 +42,7 @@ const tittleHistory = ref<string>("ประวัติการนำเข้
const modalHistory = ref<boolean>(false); //modal
const rows = ref<any[]>([]);
const filter = ref<string>(""); //search data table
const filterHistory = ref<string>(""); //search data table
const textTittle = ref<string>("");
const textTittleScore = ref<string>("");
const textTittleCandidate = ref<string>("");
@ -92,6 +94,9 @@ const columns = ref<QTableProps["columns"]>([
field: "year",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${row.year + 543}`;
},
},
{
name: "examCount",
@ -125,12 +130,15 @@ const columnsHistory = ref<QTableProps["columns"]>([
},
{
name: "createdAt",
align: "center",
align: "left",
label: "วันที่ดำเนินการ",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${date2Thai(row.createdAt)}`;
},
},
{
name: "createdFullName",
@ -504,9 +512,6 @@ onMounted(async () => {
<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 == 'scoreCount'" class="table_ellipsis2">
<q-btn
flat
@ -617,6 +622,8 @@ onMounted(async () => {
v-model:modal="modalHistory"
v-model:inputvisible="visibleColumnsHistory"
v-model:tittle="tittleHistory"
v-model:inputfilter="filterHistory"
:filter="filterHistory"
>
<template #columns="props">
<q-tr :props="props">
@ -630,9 +637,6 @@ onMounted(async () => {
/>
<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 }}

View file

@ -77,6 +77,9 @@ const columns = ref<QTableProps["columns"]>([
field: "yearly",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${row.round}/${row.yearly + 543}`;
},
},
// {
// name: "category",
@ -351,9 +354,7 @@ onMounted(async () => {
<div v-if="col.name == 'no'" class="table_ellipsis2">
{{ props.rowIndex + 1 }}
</div>
<div v-else-if="col.name == 'yearly'" class="table_ellipsis2">
{{ props.row.round }}/{{ col.value + 543 }}
</div>
<div
v-else-if="
col.name == 'dateRegister' ||