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

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

@ -34,6 +34,7 @@ const {
dialogRemove,
findOrgNameOld,
findPosMasterNoOld,
onSearchDataTable
} = mixin;
/**
@ -44,7 +45,9 @@ const modal = ref<boolean>(false); //แสดง popup ส่งไปออก
const filterKeyword = ref<string>(""); //
const filterKeyword2 = ref<string>(""); //
const rows = ref<officerType[]>([]); //
const rowsData = ref<officerType[]>([]); //
const rows2 = ref<officerType[]>([]); //
const rows2Data = ref<officerType[]>([]); //
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -192,6 +195,7 @@ async function getData() {
.then(async (res) => {
const data = await res.data.result;
rows.value = data;
rowsData.value = data;
})
.catch((e) => {
messageError($q, e);
@ -246,6 +250,7 @@ function openModalOrder() {
item.dateEnd
);
rows2.value = row;
rows2Data.value = row;
modal.value = true;
}
@ -265,6 +270,14 @@ function resetFilter() {
filterKeyword2.value = "";
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
columns.value ? columns.value : []
);
}
/**
* ทำงานเมอมการเรยกใช Components
*/
@ -300,6 +313,7 @@ onMounted(() => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -326,7 +340,6 @@ onMounted(() => {
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="id"
:visible-columns="visibleColumns"
>
@ -406,7 +419,8 @@ onMounted(() => {
v-model:filter-keyword2="filterKeyword2"
:get-data="getData"
:close-modal="closeModal"
:rows2="rows2"
v-model:rows2="rows2"
v-model:rows2Data="rows2Data"
/>
</template>
<style scoped lang="scss"></style>