diff --git a/src/modules/18_command/components/Step/2_ListPersons.vue b/src/modules/18_command/components/Step/2_ListPersons.vue index 6aa42f6be..63e30f59a 100644 --- a/src/modules/18_command/components/Step/2_ListPersons.vue +++ b/src/modules/18_command/components/Step/2_ListPersons.vue @@ -28,6 +28,7 @@ const { showLoader, hideLoader, success, + onSearchDataTable, } = useCounterMixin(); // const isChangeData = defineModel("isChangeData", { required: true }); //การเปลี่ยนแปลงของข้อมูล @@ -61,6 +62,8 @@ const position = ref(""); const filter = ref(""); const rows = ref([]); +const rowsMain = ref([]); + const columns = ref([ { name: "no", @@ -236,12 +239,21 @@ async function getPersonList() { templatePos.value = data.commandSalaryId; position.value = data.positionDetail; rows.value = data.commandRecives; + rowsMain.value = data.commandRecives; }) .catch((e) => { messageError($q, e); }); } +function onSearchData() { + rows.value = onSearchDataTable( + filter.value, + rowsMain.value, + columns.value ? columns.value : [] + ); +} + onMounted(async () => { const promises = [getPersonList()]; @@ -325,8 +337,8 @@ onMounted(async () => { v-model="filter" ref="filterRef" outlined - debounce="300" placeholder="ค้นหา" + @keydown.enter="onSearchData()" >