diff --git a/src/components/Dialogs/PopupPersonalNew.vue b/src/components/Dialogs/PopupPersonalNew.vue index 4ef7825b6..1b17f7efd 100644 --- a/src/components/Dialogs/PopupPersonalNew.vue +++ b/src/components/Dialogs/PopupPersonalNew.vue @@ -269,14 +269,15 @@ async function fetchProfile(id: string, avatarName: string) { } function redirecToRegistry() { - router.push( + window.open( `/registry-${ employeeClass.value.toLocaleLowerCase() === "perm" ? "employee" : employeeClass.value.toLocaleLowerCase() === "temp" ? "temp" : "officer" - }/${props.id}` + }/${props.id}`, + "_blank" ); modal.value = false; } diff --git a/src/modules/04_registryPerson/components/TableView.vue b/src/modules/04_registryPerson/components/TableView.vue index 284b6cd62..aad2bd2c8 100644 --- a/src/modules/04_registryPerson/components/TableView.vue +++ b/src/modules/04_registryPerson/components/TableView.vue @@ -196,9 +196,9 @@ function onClickHistory() { */ function onClickViewDetail(id: string) { if (empType.value === "officer") { - router.push(`/registry-officer/${id}`); + window.open(`/registry-officer/${id}`, "_blank"); } else { - router.push(`/registry-employee/${id}`); + window.open(`/registry-employee/${id}`, "_blank"); } } diff --git a/src/modules/04_registryPerson/views/detailView.vue b/src/modules/04_registryPerson/views/detailView.vue index 9690c31c5..f5e951411 100644 --- a/src/modules/04_registryPerson/views/detailView.vue +++ b/src/modules/04_registryPerson/views/detailView.vue @@ -800,6 +800,19 @@ function openDialogSendTransferResign( : (modalDialogResign.value = true); } +/** ฟังก์ชันจัดการการกลับหน้า*/ +function handleBackNavigation() { + if (window.history.length > 1) { + router.go(-1); + } else { + if (empType.value === "") { + router.push("/registry-officer"); + } else if (empType.value === "-employee") { + router.push("/registry-employee"); + } + } +} + onMounted(async () => { await fetchDataPersonal(); }); @@ -816,7 +829,7 @@ onMounted(async () => { flat color="primary" class="q-mr-sm" - @click="router.go(-1)" + @click="handleBackNavigation" /> {{ titleName }} diff --git a/src/modules/13_salary/components/DialogInfoMain.vue b/src/modules/13_salary/components/DialogInfoMain.vue index 71fe5997f..3da947277 100644 --- a/src/modules/13_salary/components/DialogInfoMain.vue +++ b/src/modules/13_salary/components/DialogInfoMain.vue @@ -82,10 +82,11 @@ async function fetchProfile(id: string, avatarName: string) { * function rediract ไปทะเบียนประวัติ */ function redirecToRegistry() { - router.push( + window.open( `/registry${props.employeeClass ? props.employeeClass : "-officer"}/${ profileId.value - }` + }`, + "_blank" ); modal.value = false; }