From d95042ba0e8fb70ff0bca416544687ddc8ee4064 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 29 Aug 2025 09:58:27 +0700 Subject: [PATCH] =?UTF-8?q?fix=20=3D=3D>=20=20filter=20=E0=B9=81=E0=B8=95?= =?UTF-8?q?=E0=B9=88=E0=B8=87=E0=B8=95=E0=B8=B1=E0=B9=89=E0=B8=87-?= =?UTF-8?q?=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=99-?= =?UTF-8?q?=E0=B8=A2=E0=B9=89=E0=B8=B2=E0=B8=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/AppointMent/DialogOrders.vue | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/modules/05_placement/components/AppointMent/DialogOrders.vue b/src/modules/05_placement/components/AppointMent/DialogOrders.vue index f335327da..56d81a01b 100644 --- a/src/modules/05_placement/components/AppointMent/DialogOrders.vue +++ b/src/modules/05_placement/components/AppointMent/DialogOrders.vue @@ -276,26 +276,19 @@ async function sendToCommand() { // }); } -/** ฟังก์ชันเลือกประเภทคำสั่ง */ -function filterSelectOrder() { - const data = rowsData.value; - - selected.value = []; - rows.value = data.filter((v: PersonData) => { +function filterSelectOrder(data: PersonData[]) { + return data.filter((v: PersonData) => { switch (commandType.value) { case "C-PM-05": return v.typeCommand === "APPOINT"; - case "C-PM-39": return v.typeCommand === "SLIP"; - case "C-PM-07": return v.typeCommand === "MOVE"; - case "C-PM-47": - return v.posTypeName === "บริหาร" || v.posTypeName === "อำนวยการ"; + return v.typeCommand === "ROYAL"; default: - return []; + return []; // ไม่กรอง ถ้าไม่มีประเภท } }); } @@ -314,9 +307,11 @@ function filterSelector(val: string, update: Function) { } function onSearch() { + selected.value = []; + const filteredByType = filterSelectOrder(rowsData.value); rows.value = onSearchDataTable( filterKeyword2.value, - rowsData.value, + filteredByType, columns2.value ? columns2.value : [] ); } @@ -330,6 +325,7 @@ watch( async () => { if (props.Modal === true) { selected.value = []; + rows.value = rowsData.value; commandType.value = ""; const data = await storeCommand.getCommandTypes(); commandMainOp.value = data.filter( @@ -366,7 +362,7 @@ watch( use-input hide-selected fill-input - @update:model-value="filterSelectOrder" + @update:model-value="onSearch" @filter="(inputValue:string, doneFn:Function) => filterSelector(inputValue, doneFn ) " @@ -456,6 +452,7 @@ watch(
{{ props.row.organizationPositionOld !== null @@ -464,7 +461,10 @@ watch( }}
-
+
{{ props.row.position !== null ? props.row.position : "" }}{{