diff --git a/src/modules/06_retirement/components/01_retirement/RetirementDetail.vue b/src/modules/06_retirement/components/01_retirement/RetirementDetail.vue index cc344037b..5c14be956 100644 --- a/src/modules/06_retirement/components/01_retirement/RetirementDetail.vue +++ b/src/modules/06_retirement/components/01_retirement/RetirementDetail.vue @@ -31,6 +31,7 @@ const { date2Thai, dateToISO, findOrgName, + onSearchDataTable, } = mixin; const myForm = ref(null); @@ -120,6 +121,7 @@ const columns = ref([ }, ]); const rows = ref([]); +const rowsData = ref([]); const visibleColumns = ref([ "order", "name", @@ -157,7 +159,7 @@ async function fetchlistprofile(id: string) { // รายชื่อผู้เกษียณอายุราชการ if (data.profile !== null) { - rows.value = data.profile.map((e: any) => ({ + const listData = data.profile.map((e: any) => ({ id: e.id, profileId: e.profileId, order: e.order, @@ -183,6 +185,8 @@ async function fetchlistprofile(id: string) { child4: e.child4, child4Id: e.child4Id, })); + rows.value = listData; + rowsData.value = listData; } if (statusReport.value == false) { @@ -407,6 +411,14 @@ function updatemodalPersonal(modal: boolean) { modalPersonal.value = modal; } +async function onSearch() { + rows.value = onSearchDataTable( + filter.value, + rowsData.value, + columns.value ? columns.value : [] + ); +} + /** Hook */ onMounted(async () => { retireld.value = retireld_params.toString(); @@ -517,6 +529,7 @@ onMounted(async () => { placeholder="ค้นหา" style="max-width: 200px" class="q-ml-sm" + @keydown.enter="onSearch" >