fix leave: case request deputy

This commit is contained in:
Warunee Tamkoo 2026-01-20 11:48:54 +07:00
parent e61f97faaf
commit dd4f7bd936
2 changed files with 10 additions and 4 deletions

View file

@ -56,6 +56,7 @@ const roleUser = ref<string>("");
const dataProfile = ref<DataProfile>();
const approveStep = ref<string>("");
const group = ref<string>("");
const deputyName = ref<string>("สำนักปลัดกรุงเทพมหานคร");
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();
});
});

View file

@ -78,6 +78,7 @@ const idCheck = computed(() => {
}
});
const deputyName = ref<string>("สำนักปลัดกรุงเทพมหานคร");
const isOfficer = ref<boolean>(false);
const isStaff = ref<boolean>(false);
const profileType = ref<string>("");
@ -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();
});
});