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

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

@ -31,6 +31,7 @@ const {
messageError,
date2Thai,
dialogRemove,
onSearchDataTable
} = mixin;
const dataRecevice = ref<ResponseData[]>([]); //
@ -52,7 +53,9 @@ const type = ref<string | null>(null);
//Table
const rows = ref<ResponseRow[]>([]); //
const rowsData = ref<ResponseRow[]>([]); //
const rows2 = ref<ResponseRow[]>([]); //
const rows2Data = ref<ResponseRow[]>([]); //
const filterKeyword = ref<string>(""); //
const filterKeyword2 = ref<string>(""); //
const visibleColumns = ref<string[]>([
@ -157,6 +160,7 @@ async function fecthlistRecevice() {
const data = await res.data.result;
dataRecevice.value = data;
rows.value = data;
rowsData.value = data;
filters.value = data;
})
.catch((e) => {
@ -227,7 +231,6 @@ function openModalTree(id: string, data: any) {
dataRows.value = data;
modalTree.value = true;
type.value = null;
dataRows.value = data;
posType.value = data.posTypeOldId;
posLevel.value = data.posLevelOldId;
position.value = data.positionOld;
@ -292,6 +295,7 @@ function openModalOrder() {
);
rows2.value = row;
rows2Data.value = row;
modal.value = true;
}
@ -328,6 +332,15 @@ async function onSave(data: any) {
});
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
columns.value ? columns.value : []
);
}
/**
* ทำงานเมอมการเรยกใช Components
*/
@ -372,6 +385,7 @@ onMounted(() => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -403,7 +417,6 @@ onMounted(() => {
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="id"
:visible-columns="visibleColumns"
>
@ -610,7 +623,8 @@ onMounted(() => {
v-model:modal="modal"
v-model:filter-keyword2="filterKeyword2"
:click-close="clickClose"
:rows2="rows2"
v-model:rows="rows2"
v-model:rowsData="rows2Data"
:fecthlist-recevice="fecthlistRecevice"
:next-page="nextPage"
/>