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

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

@ -21,7 +21,7 @@ const mixin = useCounterMixin();
const route = useRoute();
const DataStore = usePlacementDataStore();
const storeCommand = useCommandMainStore();
const { dialogConfirm, dateText } = mixin;
const { dialogConfirm, dateText,onSearchDataTable } = mixin;
const modal = defineModel<boolean>("modal", { required: true });
/** props */
@ -32,6 +32,7 @@ const props = defineProps({
const examId = route.params.examId;
const rows = ref<any[]>([]);
const rowsData = ref<any[]>([]);
const commandType = ref<string>("");
const commandOp = ref<ListCommand[]>([]);
const listCommand = ref<ListCommand[]>([]); //
@ -175,6 +176,7 @@ function filterSelectOrder() {
const data = props.rows ? props.rows : [];
selected.value = [];
rows.value = data;
rowsData.value = data;
}
/** ปิด Modal และล้างค่าที่เลือก */
@ -182,6 +184,16 @@ function closeModal() {
modal.value = false;
commandType.value = "";
}
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
columns.value ? columns.value : []
);
}
/**
* เม props.modal เป true
* กำหนดให selected เปนคาวางและกำหนด filter ประเภทตำแหนงตามประเภทการสอบ
@ -191,6 +203,7 @@ watch(
async () => {
if (modal.value === true) {
rows.value = props.rows ? props.rows : [];
rowsData.value = props.rows ? props.rows : [];
selected.value = [];
commandType.value = "";
filter.value = "";
@ -259,6 +272,7 @@ watch(
v-model="filter"
placeholder="ค้นหา"
style="width: 200px; max-width: auto"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -289,7 +303,6 @@ watch(
<d-table
:columns="columns"
:rows="rows"
:filter="filter"
row-key="personalId"
:visible-columns="visibleColumns"
selection="multiple"

View file

@ -36,6 +36,7 @@ const {
success,
dialogConfirm,
date2Thai,
onSearchDataTable
} = mixin;
/** รับค่ามาจากหน้าหลัก */
@ -63,6 +64,7 @@ const filter = ref<string>("");
const Name = ref<string>();
const rowsAll = ref<any>([]);
const rows = ref<any[]>([]);
const rowsData = ref<any[]>([]);
const rowsAwait = ref<any[]>([]);
const rowsFilter = ref<any>([]);
const rowsOrder = ref<any[]>([]);
@ -828,6 +830,14 @@ function updatemodalPersonal(modal: boolean) {
modalPersonal.value = modal;
}
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsAwait.value,
columns.value ? columns.value : []
);
}
onMounted(async () => {
await getWorkFlow();
await getTable();
@ -840,7 +850,6 @@ onMounted(async () => {
:contain-status="containStatus"
:rows="rows"
:columns="columns"
:filter="filter"
:visible-columns="visibleColumns"
v-model:inputfilter="filter"
v-model:inputvisible="visibleColumns"
@ -849,6 +858,7 @@ onMounted(async () => {
@update-modaladdlist="handleModalAddListUpdate"
@update-modaladdSendPerson="openModalOrder"
@update-new-Rows="onUpdateNewRows"
:onSearch="onSearch"
:history="true"
:boss="true"
:saveNoDraft="true"

View file

@ -77,6 +77,10 @@ const props = defineProps({
type: Function,
default: () => console.log("not function"),
},
onSearch: {
type: Function,
default: () => console.log("not function"),
},
edit: {
type: Function,
default: () => console.log("not function"),
@ -238,6 +242,7 @@ function onUpdateNewRows() {
placeholder="ค้นหา"
style="max-width: 200px"
class="q-ml-sm"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />