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

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

View file

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

View file

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