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

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

@ -30,6 +30,7 @@ const {
messageError,
date2Thai,
dialogRemove,
onSearchDataTable
} = useCounterMixin();
const modal = ref<boolean>(false); // popup
@ -48,7 +49,9 @@ const type = ref<string>("");
//table
const rows = ref<PersonData[]>([]); //--
const rowsData = ref<PersonData[]>([]); //--
const rows2 = ref<PersonData[]>([]); //
const rows2Data = ref<PersonData[]>([]); //
const filterKeyword = ref<string>(""); //--
const filterKeyword2 = ref<string>(""); //
const columns = ref<QTableProps["columns"]>([
@ -167,8 +170,10 @@ async function fecthlistappointment() {
let response = res.data.result;
listRecevice.value = response;
rows.value = response;
rowsData.value = response;
//
rows2.value = rows.value.filter(
const listData =
rows.value.filter(
(e: any) =>
e.root !== null &&
e.status !== "REPORT" &&
@ -180,6 +185,8 @@ async function fecthlistappointment() {
e.positionNumberOld &&
e.positionDate
);
rows2.value = listData
rows2Data.value = listData
})
.catch((e) => {
messageError($q, e);
@ -277,6 +284,14 @@ function clickClose() {
modal.value = false;
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
columns.value ? columns.value : []
);
}
/** ทำงานเมื่อมีการเรียกใช้ Components*/
onMounted(() => {
fecthlistappointment();
@ -313,6 +328,7 @@ onMounted(() => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -339,7 +355,6 @@ onMounted(() => {
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="citizenId"
:visible-columns="visibleColumns"
v-model:pagination="pagination"
@ -553,7 +568,8 @@ onMounted(() => {
:options-type="optionsType"
:next-page="nextPage"
:fetch-data="fecthlistappointment"
:rows2="rows2"
v-model:rows="rows2"
v-model:rowsData="rows2Data"
/>
<DialogOrgSelect