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

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

@ -16,17 +16,21 @@ import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCom
const $q = useQuasar();
const { statusText } = useTransferDataStore();
const mixin = useCounterMixin();
const { dialogConfirm, findPosMasterNoOld, date2Thai } = mixin;
const { dialogConfirm, findPosMasterNoOld, date2Thai, onSearchDataTable } =
mixin;
/** props*/
const props = defineProps({
Modal: Boolean,
closeModal: Function,
getData: Function,
rows2: Array,
filterKeyword2: String,
});
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
const rows = defineModel<any[]>("rows", { required: true });
const rowsData = defineModel<any[]>("rowsData", { required: true });
const filterKeyword2 = defineModel<string>("filterKeyword2", {
required: true,
});
//table
const selected = ref<officerType[]>([]);
@ -167,17 +171,12 @@ function saveOrder() {
);
}
/**
* ปเดทค filter
* @param value คำคนหา
*/
function updateInput(value: string | number | null) {
emit("update:filterKeyword2", value);
}
/** รีเซ็ตค่าในช่องค้นหา*/
function Reset() {
emit("update:filterKeyword2", "");
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword2.value,
rowsData.value,
columns2.value ? columns2.value : []
);
}
watch(
@ -203,9 +202,9 @@ watch(
outlined
dense
debounce="300"
:model-value="filterKeyword2"
@update:model-value="updateInput"
v-model="filterKeyword2"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -229,8 +228,7 @@ watch(
<div class="col-12">
<d-table
:columns="columns2"
:rows="rows2"
:filter="filterKeyword2"
:rows="rows"
row-key="id"
class="custom-header-table"
:visible-columns="visibleColumns2"