fix:filter examResult

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-10-17 10:02:24 +07:00
parent 3880953988
commit 3210bbf687
3 changed files with 82 additions and 143 deletions

View file

@ -43,6 +43,7 @@ const totalList = ref<number>(0);
const importId = ref<string>(route.params.id as string); // Period Import Id
const filter = ref<string>(""); //search data table
const examResult = ref<string>(""); //
const visibleColumns = ref<String[]>([
"examID",
"profileID",
@ -59,7 +60,7 @@ const visibleColumns = ref<String[]>([
"examAttribute",
"examScore",
"examResult",
"exam_order",
"number",
"applyDate",
]);
const columns = ref<QTableProps["columns"]>([
@ -67,18 +68,16 @@ const columns = ref<QTableProps["columns"]>([
name: "examID",
align: "left",
label: "เลขประจำตัวสอบ",
sortable: true,
sortable: false,
field: "examID",
headerStyle: "font-size: 14px; min-width: 20px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "profileID",
align: "left",
label: "เลขประจำตัวประชาชน",
sortable: true,
sortable: false,
field: "profileID",
headerStyle: "font-size: 14px; min-width: 20px",
style: "font-size: 14px; ",
@ -87,7 +86,7 @@ const columns = ref<QTableProps["columns"]>([
name: "fullName",
align: "left",
label: "ชื่อ-นามสกุล",
sortable: true,
sortable: false,
field: "personName",
headerStyle: "font-size: 14px; min-width: 250px",
style: "font-size: 14px; ",
@ -96,7 +95,7 @@ const columns = ref<QTableProps["columns"]>([
name: "hddPosition",
align: "left",
label: "บัญชีสอบ",
sortable: true,
sortable: false,
field: "hddPosition",
headerStyle: "font-size: 14px; min-width: 250px",
style: "font-size: 14px; ",
@ -105,106 +104,88 @@ const columns = ref<QTableProps["columns"]>([
name: "dateOfBirth",
align: "left",
label: "วัน เดือน ปีเกิด",
sortable: true,
sortable: false,
field: "dateOfBirth",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "gender",
align: "left",
label: "เพศ",
sortable: true,
sortable: false,
field: "gender",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "position_name",
align: "left",
label: "ตำแหน่งที่สมัคร",
sortable: true,
sortable: false,
field: "position_name",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "university",
align: "left",
label: "สถานศึกษา",
sortable: true,
sortable: false,
field: "university",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "degree",
align: "left",
label: "วุฒิการศึกษา",
sortable: true,
sortable: false,
field: "degree",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "major",
align: "left",
label: "สาขาวิชาเอก",
sortable: true,
sortable: false,
field: "major",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "certificateNo",
align: "left",
label: "เลขที่ใบประกอบวิชาชีพ",
sortable: true,
sortable: false,
field: "certificateNo",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "certificateIssueDate",
align: "left",
label: "วันที่ได้รับใบประกอบวิชาชีพฯ",
sortable: true,
sortable: false,
field: "certificateIssueDate",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "examAttribute",
align: "left",
label: "สถานะการคัดกรองคุณสมบัติ",
sortable: true,
sortable: false,
field: "examAttribute",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "examScore",
align: "left",
label: "คะแนนรวม",
sortable: true,
sortable: false,
field: "examScore",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
@ -213,19 +194,17 @@ const columns = ref<QTableProps["columns"]>([
name: "examResult",
align: "left",
label: "ผลการสอบ",
sortable: true,
sortable: false,
field: "examResult",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "exam_order",
name: "number",
align: "center",
label: "ลำดับที่สอบได้",
sortable: true,
field: "exam_order",
sortable: false,
field: "number",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
@ -233,12 +212,10 @@ const columns = ref<QTableProps["columns"]>([
name: "applyDate",
align: "left",
label: "วันที่สมัครสอบ",
sortable: true,
sortable: false,
field: "applyDate",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const rows = ref<RecruitDetailResponse[]>([]);
@ -310,7 +287,7 @@ async function fetchData() {
.post(config.API.getDisableExamResultById(importId.value), {
examAttribute: "",
keyword: filter.value,
examResult: "",
examResult: examResult.value ? examResult.value : "",
page: initialPagination.value.page,
pageSize: initialPagination.value.rowsPerPage,
})
@ -469,6 +446,7 @@ onMounted(async () => {
v-model:inputfilter="filter"
v-model:total="total"
v-model:inputvisible="visibleColumns"
v-model:exam-result="examResult"
:nornmalData="false"
:conclude="true"
:fetchData="fetchData"
@ -516,8 +494,8 @@ onMounted(async () => {
<div v-else-if="col.name == 'c5'">
<q-checkbox disable v-model="props.row.c5" />
</div>
<div v-else-if="col.name == 'exam_order'">
{{ col.value ? col.value : " " }}
<div v-else-if="col.name == 'number'">
{{ col.value ? col.value : "" }}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}