diff --git a/src/pages/01_branch-management/MainPage.vue b/src/pages/01_branch-management/MainPage.vue index a24b296c..a3cbd2b3 100644 --- a/src/pages/01_branch-management/MainPage.vue +++ b/src/pages/01_branch-management/MainPage.vue @@ -39,6 +39,11 @@ const { data: branchData } = storeToRefs(branchStore); const modal = ref(false); +const currentHeadOfficeId = ref(); +const currentHeadOfficeName = ref<{ + nameTh: string; + nameEn: string; +}>({ nameTh: '', nameEn: '' }); const currentBranchIdEdit = ref(''); const currentBranchContactIdEdit = ref(''); const showCurrentBranch = ref(); @@ -161,6 +166,8 @@ async function getTree() { })); subBranch.value = false; + showCurrentBranch.value = undefined; + currentHeadOfficeId.value = undefined; } } @@ -391,6 +398,13 @@ async function fetchSubBranch(id: string) { }); if (result) { + if (result.isHeadOffice) { + currentHeadOfficeId.value = result.id; + currentHeadOfficeName.value = { + nameTh: result.name, + nameEn: result.nameEN, + }; + } rowsBranch.value = result.branch.map((v) => ({ id: v.id, name: v.code, @@ -401,6 +415,8 @@ async function fetchSubBranch(id: string) { type: v.isHeadOffice, status: v.status, })); + + showCurrentBranch.value = undefined; subBranch.value = true; openCardDetails.value = false; openTableCard.value = true; @@ -462,10 +478,39 @@ onMounted(async () => {
{{ $t('headQuarters') }} + + +
+
ทั้งหมด
+
>
+
+ {{ currentHeadOfficeName.nameTh }} +
+ +
+ > +
+
+ {{ showCurrentBranch.code }} +
+
+
+
{ >