From 999a2d1b4568ebcb3e68dbbe5e89e2dfa103cb1a Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 5 May 2026 17:39:52 +0700 Subject: [PATCH] refactor(DialogOrgSelect): reset positionData to default values --- src/components/Dialogs/DialogOrgSelect.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/Dialogs/DialogOrgSelect.vue b/src/components/Dialogs/DialogOrgSelect.vue index af860b60e..b6a4ed6ae 100644 --- a/src/components/Dialogs/DialogOrgSelect.vue +++ b/src/components/Dialogs/DialogOrgSelect.vue @@ -244,10 +244,16 @@ function close() { expanded.value = []; nodeLevel.value = 0; nodeId.value = ""; + positionData.value = []; + positionNo.value = []; + rowData.value = []; } async function getDataTable(id: string, level: number = 0) { showLoader(); + positionData.value = []; + positionNo.value = []; + rowData.value = []; const body = { node: level, nodeId: id, @@ -261,7 +267,7 @@ async function getDataTable(id: string, level: number = 0) { await http .post(config.API.orgPosPlacement, body) - .then((res) => { + .then(async (res) => { const dataMain: PositionMain[] = []; posMasterMain.value = res.data.result.data; @@ -299,7 +305,6 @@ async function getDataTable(id: string, level: number = 0) { positionNo.value = listPosNo; rowData.value = listPosNo; - // positionData.value = listPosNo; if (props.dataRows?.posmasterId) { const newUse = positionUse.value.filter( @@ -313,6 +318,7 @@ async function getDataTable(id: string, level: number = 0) { (e: any) => !positionUse.value.includes(e.id) ); } + await onClickSelectPos(positionId.value); }) .catch((err) => { messageError($q, err); @@ -409,7 +415,6 @@ async function fetchPosFind(level: number, id: string) { seletcId.value = props?.dataRows?.positionId; datePos.value = props?.dataRows?.reportingDate; await getDataTable(nodeId.value, level); - await onClickSelectPos(positionId.value); }) .catch((e) => { messageError($q, e);