fix filter ==> รายชื่อลูกจ้างชั่วคราว

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-12-10 13:37:22 +07:00
parent e7a271dd8e
commit 0796c36f73
2 changed files with 38 additions and 84 deletions

View file

@ -17,7 +17,7 @@ import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCom
const $q = useQuasar();
const {
success,
onSearchDataTable,
messageError,
showLoader,
hideLoader,
@ -38,6 +38,7 @@ const props = defineProps({
const filter = ref<string>(""); //
const rows = ref<DataEmployee[]>([]); //
const rowsMain = ref<DataEmployee[]>([]); //
const selected = ref<DataEmployee[]>([]); //
const columns = ref<QTableProps["columns"]>([
{
@ -63,7 +64,10 @@ const columns = ref<QTableProps["columns"]>([
align: "left",
label: "ชื่อ-นามสกุล",
sortable: true,
field: (row) => `${row.prefix}${row.firstName} ${row.lastName}`,
field: "fullname",
format(val, row) {
return `${row.prefix}${row.firstName} ${row.lastName}`;
},
headerStyle: "font-size: 14px; min-width: 200px",
style: "font-size: 14px; ",
},
@ -147,7 +151,10 @@ const columns = ref<QTableProps["columns"]>([
align: "left",
label: "สถานะ",
sortable: true,
field: (row) => statusText(row.draftOrgEmployeeStatus),
field: "statustext",
format(val, row) {
return statusText(row.draftOrgEmployeeStatus);
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
@ -195,6 +202,8 @@ function fetchList() {
...e,
profileId: e.id,
}));
rowsMain.value = rows.value;
})
.catch((err) => {
messageError($q, err);
@ -209,6 +218,14 @@ function closeDialog() {
modal.value = false;
}
function serchDataTable() {
rows.value = onSearchDataTable(
filter.value,
rowsMain.value,
columns.value ? columns.value : []
);
}
/**
* ทำเม modal เป true
* ทำการเรยก fetchList เพอขอมลราชชอสงออกคำส
@ -235,10 +252,10 @@ watch(
borderless
outlined
dense
debounce="300"
v-model="filter"
ref="filterRef"
placeholder="ค้นหา"
@keydown.enter.pervent="serchDataTable"
style="max-width: auto"
>
<template v-slot:append>
@ -256,7 +273,6 @@ watch(
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
class="gt-xs q-ml-sm"
/>
@ -267,7 +283,6 @@ watch(
:rows="rows"
:columns="columns"
:visible-columns="visibleColumns"
:filter="filter"
row-key="id"
selection="multiple"
v-model:selected="selected"