From dd4f7bd936fc8f383eef683a1e0298f3f813a655 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Tue, 20 Jan 2026 11:48:54 +0700 Subject: [PATCH] fix leave: case request deputy --- .../06_retirement/components/02_resign/ResignByid.vue | 6 ++++-- .../06_retirement/components/03_resignEmp/ResignByid.vue | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/modules/06_retirement/components/02_resign/ResignByid.vue b/src/modules/06_retirement/components/02_resign/ResignByid.vue index f29f64217..9413a3488 100644 --- a/src/modules/06_retirement/components/02_resign/ResignByid.vue +++ b/src/modules/06_retirement/components/02_resign/ResignByid.vue @@ -56,6 +56,7 @@ const roleUser = ref(""); const dataProfile = ref(); const approveStep = ref(""); const group = ref(""); +const deputyName = ref("สำนักปลัดกรุงเทพมหานคร"); const idCheck = computed(() => { if ( @@ -679,7 +680,8 @@ async function checkOfficer() { try { const data = await fetchDataCheckIsoffice("SYS_RESIGN"); isOfficer.value = data.isOfficer; - isStaff.value = data.isStaff; + isStaff.value = + data.isStaff || dataDetail.value.rootOld === deputyName.value; } catch (err) { messageError($q, err); } @@ -730,9 +732,9 @@ onMounted(async () => { await Promise.all([ fetchData(id.value), fetchKeycloakPosition(), - checkOfficer(), fetchFile(), ]).finally(() => { + checkOfficer(); hideLoader(); }); }); diff --git a/src/modules/06_retirement/components/03_resignEmp/ResignByid.vue b/src/modules/06_retirement/components/03_resignEmp/ResignByid.vue index 9383118c8..802f75753 100644 --- a/src/modules/06_retirement/components/03_resignEmp/ResignByid.vue +++ b/src/modules/06_retirement/components/03_resignEmp/ResignByid.vue @@ -78,6 +78,7 @@ const idCheck = computed(() => { } }); +const deputyName = ref("สำนักปลัดกรุงเทพมหานคร"); const isOfficer = ref(false); const isStaff = ref(false); const profileType = ref(""); @@ -707,7 +708,10 @@ async function checkOfficer() { try { const data = await fetchDataCheckIsoffice("SYS_RESIGN_EMP"); isOfficer.value = data.isOfficer; - isStaff.value = data.isStaff; + isStaff.value = + data.isStaff || dataDetail.value.rootOld === deputyName.value; + console.log("rootOld", dataDetail.value.rootOld); + console.log("isStaff", isStaff.value); } catch (err) { messageError($q, err); } @@ -759,8 +763,8 @@ onMounted(async () => { fetchData(id.value), fetchKeycloakPosition(), fetchFile(), - checkOfficer(), ]).finally(() => { + checkOfficer(); hideLoader(); }); });