ฟิลเตอร์ระบบ บรรจุ

This commit is contained in:
setthawutttty 2024-12-04 13:47:44 +07:00
parent 7ab17d378f
commit 992541eded
20 changed files with 674 additions and 488 deletions

View file

@ -28,6 +28,7 @@ const {
messageError,
date2Thai,
dialogRemove,
onSearchDataTable,
} = useCounterMixin();
const modal = ref<boolean>(false);
@ -36,7 +37,9 @@ const modal = ref<boolean>(false);
* Table
*/
const rows = ref<listMain[]>([]); //
const rowsData = ref<listMain[]>([]); //
const rows2 = ref<listMain[]>([]); //
const rows2Data = ref<listMain[]>([]); //
const filterKeyword = ref<string>(""); //
const filterKeyword2 = ref<string>(""); //
const visibleColumns = ref<string[]>([
@ -138,8 +141,9 @@ async function fecthlistOthet() {
.then((res) => {
let response = res.data.result;
rows.value = response;
rowsData.value = response;
//
rows2.value = rows.value.filter(
const listData = rows.value.filter(
(e: listMain) =>
e.status !== "REPORT" &&
e.status !== "DONE" &&
@ -150,6 +154,8 @@ async function fecthlistOthet() {
e.positionDate &&
e.leaveDate !== null
);
rows2.value = listData;
rows2Data.value = listData;
})
.catch((e) => {
messageError($q, e);
@ -206,6 +212,14 @@ function nextPage(id: string) {
});
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
columns.value ? columns.value : []
);
}
onMounted(() => {
fecthlistOthet();
});
@ -237,6 +251,7 @@ onMounted(() => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -262,7 +277,6 @@ onMounted(() => {
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="id"
:visible-columns="visibleColumns"
v-model:pagination="pagination"
@ -338,7 +352,8 @@ onMounted(() => {
v-model:Modal="modal"
v-model:filter-keyword2="filterKeyword2"
:click-close="clickClose"
:rows2="rows2"
v-model:rows="rows2"
v-model:rowsData="rows2Data"
:fecthlistOthet="fecthlistOthet"
/>
</template>