diff --git a/src/pages/01_branch-management/MainPage.vue b/src/pages/01_branch-management/MainPage.vue index f6657265..1ed8ca5a 100644 --- a/src/pages/01_branch-management/MainPage.vue +++ b/src/pages/01_branch-management/MainPage.vue @@ -164,6 +164,8 @@ onMounted(async () => { }; }, }, + // track of the currently selected HQ branch, so when we reset it to an empty + // object, we are effectively unselecting any HQ branch. ]; await branchStore.fetchList({ pageSize: 99999 }); @@ -539,6 +541,29 @@ watch( if (v) modeView.value = true; }, ); + +watch(currentHq, () => { + const tmp: typeof utilsStore.currentTitle.path = [ + { + text: 'branchManagementCaption', + handler: () => { + fieldSelectedBranch.value.value = 'branchHQLabel'; + currentHq.value = { + id: '', + code: '', + }; + }, + }, + ]; + + if (currentHq.value.id !== '') { + tmp.push({ + text: currentHq.value.code, + }); + } + + utilsStore.currentTitle.path = tmp; +});