From 0796c36f73bc9c315da5d84d9f23662018dcf1e0 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 10 Dec 2024 13:37:22 +0700 Subject: [PATCH] =?UTF-8?q?fix=20filter=20=20=3D=3D>=20=E0=B8=A3=E0=B8=B2?= =?UTF-8?q?=E0=B8=A2=E0=B8=8A=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=A5=E0=B8=B9?= =?UTF-8?q?=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B8=8A=E0=B8=B1?= =?UTF-8?q?=E0=B9=88=E0=B8=A7=E0=B8=84=E0=B8=A3=E0=B8=B2=E0=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/DialogSelectPos.vue | 95 ++++--------------- .../components/DialogSendOrder.vue | 27 ++++-- 2 files changed, 38 insertions(+), 84 deletions(-) diff --git a/src/modules/08_registryEmployee/components/DialogSelectPos.vue b/src/modules/08_registryEmployee/components/DialogSelectPos.vue index 34cecdf7e..92b88294c 100644 --- a/src/modules/08_registryEmployee/components/DialogSelectPos.vue +++ b/src/modules/08_registryEmployee/components/DialogSelectPos.vue @@ -29,6 +29,7 @@ const { messageError, dialogMessageNotify, dialogConfirm, + onSearchDataTable, } = useCounterMixin(); const route = useRoute(); @@ -197,6 +198,8 @@ const visibleColumns = ref([ /** Position*/ const positionNo = ref([]); //รายการตำแหน่ง +const positionNoMain = ref([]); //รายการตำแหน่ง + const positionId = ref(""); //id ตำแหน่ง const seletcId = ref(""); // id ที่ตเ้องการ const selectedPos = ref([]); //ตำแหน่ง ที่ต้องการ @@ -278,6 +281,7 @@ async function fetchDataTable(id: string, level: number = 0) { } }); positionNo.value = dataMain; + positionNoMain.value = dataMain; }) .catch((err) => { messageError($q, err); @@ -416,6 +420,14 @@ async function onClickSelectPos(id: string) { } } +function serchDataTable() { + positionNo.value = onSearchDataTable( + filters.value, + positionNoMain.value, + columns.value ? columns.value : [] + ); +} + /** callback function เมื่อมีการเปิด popup*/ watch( () => modal.value, @@ -489,12 +501,7 @@ onBeforeMount(async () => { label="ค้นหา" > { default-expand-all :nodes="lazy" node-key="orgTreeId" - label-key="orgTreeName" + label-key="labelName" :filter="filterTree.trim()" no-results-label="ไม่พบข้อมูลที่ค้นหา" no-nodes-label="ไม่มีข้อมูล" @@ -566,7 +573,7 @@ onBeforeMount(async () => {
-
+
{
-
+
{ dense v-model="filters" label="ค้นหา" + @keydown.enter.pervent="serchDataTable" > - -
diff --git a/src/modules/08_registryEmployee/components/DialogSendOrder.vue b/src/modules/08_registryEmployee/components/DialogSendOrder.vue index 7942bc4c6..de1374645 100644 --- a/src/modules/08_registryEmployee/components/DialogSendOrder.vue +++ b/src/modules/08_registryEmployee/components/DialogSendOrder.vue @@ -17,7 +17,7 @@ import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCom const $q = useQuasar(); const { - success, + onSearchDataTable, messageError, showLoader, hideLoader, @@ -38,6 +38,7 @@ const props = defineProps({ const filter = ref(""); //ค้นหารายชื่อไปออกคำสั่ง const rows = ref([]); //รายชื่อไปออกคำสั่ง +const rowsMain = ref([]); //รายชื่อไปออกคำสั่ง const selected = ref([]); //รายชื่อที่เลือกไปออกคำสั่ง const columns = ref([ { @@ -63,7 +64,10 @@ const columns = ref([ align: "left", label: "ชื่อ-นามสกุล", sortable: true, - field: (row) => `${row.prefix}${row.firstName} ${row.lastName}`, + field: "fullname", + format(val, row) { + return `${row.prefix}${row.firstName} ${row.lastName}`; + }, headerStyle: "font-size: 14px; min-width: 200px", style: "font-size: 14px; ", }, @@ -147,7 +151,10 @@ const columns = ref([ align: "left", label: "สถานะ", sortable: true, - field: (row) => statusText(row.draftOrgEmployeeStatus), + field: "statustext", + format(val, row) { + return statusText(row.draftOrgEmployeeStatus); + }, headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -195,6 +202,8 @@ function fetchList() { ...e, profileId: e.id, })); + + rowsMain.value = rows.value; }) .catch((err) => { messageError($q, err); @@ -209,6 +218,14 @@ function closeDialog() { modal.value = false; } +function serchDataTable() { + rows.value = onSearchDataTable( + filter.value, + rowsMain.value, + columns.value ? columns.value : [] + ); +} + /** * ทำเมื่อ modal เป็น true * ทำการเรียก fetchList เพื่อข้อมูลราชชื่อส่งออกคำสั่ง @@ -235,10 +252,10 @@ watch( borderless outlined dense - debounce="300" v-model="filter" ref="filterRef" placeholder="ค้นหา" + @keydown.enter.pervent="serchDataTable" style="max-width: auto" >