From 0bc0c2efa9d2bd7c96199e4217dae1f25ec6bfbe Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Wed, 26 Jun 2024 14:03:44 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20=E0=B9=81=E0=B8=81=E0=B9=89=20=E0=B8=81?= =?UTF-8?q?=E0=B8=94=20=E0=B8=94=E0=B8=B9=E0=B8=A3=E0=B8=B2=E0=B8=A2?= =?UTF-8?q?=E0=B8=A5=E0=B8=B0=E0=B9=80=E0=B8=AD=E0=B8=B5=E0=B8=A2=E0=B8=94?= =?UTF-8?q?=E0=B9=80=E0=B9=80=E0=B8=A5=E0=B9=89=E0=B8=A7=20=E0=B8=AA?= =?UTF-8?q?=E0=B8=B2=E0=B8=82=E0=B8=B2=20=E0=B9=81=E0=B8=AA=E0=B8=94?= =?UTF-8?q?=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/01_branch-management/MainPage.vue | 28 ++++++++++++--------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/pages/01_branch-management/MainPage.vue b/src/pages/01_branch-management/MainPage.vue index 94f07d86..5290fc03 100644 --- a/src/pages/01_branch-management/MainPage.vue +++ b/src/pages/01_branch-management/MainPage.vue @@ -277,17 +277,18 @@ async function triggerEdit( code: currentRecord.code, }; - const currentRecordHead = branchData.value.result.find( - (x) => x.id === currentRecord.headOfficeId, - ); + if (typeBranch === 'subBranch') { + const currentRecordHead = branchData.value.result.find( + (x) => x.id === currentRecord.headOfficeId, + ); - if (currentRecordHead) { - currentHq.value.id = currentRecordHead.id; - currentHq.value.code = currentRecordHead.code; - } else { - currentHq.value = currentEdit.value; + if (currentRecordHead) { + currentHq.value.id = currentRecordHead.id; + currentHq.value.code = currentRecordHead.code; + } else { + currentHq.value = currentEdit.value; + } } - formTypeBranch.value = typeBranch; } @@ -505,7 +506,7 @@ watch(locale, () => { style="height: 50px; display: flex; align-items: center" > - ทั้งหมด + {{ $t('all') }} { { return false; } - if (!!currentHq.id && currentHq.id === v.headOfficeId) + if (!!currentHq.id && currentHq.id === v.headOfficeId) { + console.log('ทำงาน'); + return true; + } if (fieldSelectedBranch.value === 'all') return true; if (fieldSelectedBranch.value === 'branchHQLabel') return v.isHeadOffice;