From ec8ff08b4059b8621f2506504f84c98544989a8d Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Wed, 21 Aug 2024 16:34:22 +0700 Subject: [PATCH] check permission get data detail registry --- src/components/CardNotPermission.vue | 16 + .../04_registryPerson/views/detailView.vue | 360 ++++++++++-------- 2 files changed, 209 insertions(+), 167 deletions(-) create mode 100644 src/components/CardNotPermission.vue diff --git a/src/components/CardNotPermission.vue b/src/components/CardNotPermission.vue new file mode 100644 index 000000000..42e62a79c --- /dev/null +++ b/src/components/CardNotPermission.vue @@ -0,0 +1,16 @@ + + + diff --git a/src/modules/04_registryPerson/views/detailView.vue b/src/modules/04_registryPerson/views/detailView.vue index 9cf8c56be..c432e35b3 100644 --- a/src/modules/04_registryPerson/views/detailView.vue +++ b/src/modules/04_registryPerson/views/detailView.vue @@ -30,6 +30,7 @@ import TabMain from "@/modules/04_registryPerson/components/detail/TabMain.vue"; */ import { useCounterMixin } from "@/stores/mixin"; import avatar from "@/assets/avatar_user.jpg"; +import CardNotPermission from "@/components/CardNotPermission.vue"; /** * use @@ -50,6 +51,9 @@ const { pathRegistryEmp, } = useCounterMixin(); +const isPermission = ref(null); +const notPermissionMsg = ref(""); + /** ถึงเเก่กรรม */ const dialogPassaway = ref(false); const placeDeathCertificate = ref(""); @@ -275,9 +279,16 @@ async function fetchDataPersonal() { } else { profilePicture.value = avatar; } + + isPermission.value = true; }) .catch((err) => { - messageError($q, err); + if (err.response.data.status == 403) { + isPermission.value = false; + notPermissionMsg.value = err.response.data.message; + } else { + messageError($q, err); + } }) .finally(() => { hideLoader(); @@ -654,190 +665,205 @@ onMounted(async () => { - - - - - {{ item.name }} - - - - - - - - - {{ item.name }} - - - - - - ดาวน์โหลดไฟล์ - - - - ก.พ.7/ก.ก.1 - - - ประวัติแบบย่อ +
+ + + + + {{ item.name }} - - + + + + + + + {{ item.name }} + + + + + + ดาวน์โหลดไฟล์ + + + + ก.พ.7/ก.ก.1 + + + ประวัติแบบย่อ + + + + +
- - -
-
-
-
-

- {{ - `${formDetail?.prefix ? formDetail?.prefix : ""}${ - formDetail?.firstName - } ${formDetail?.lastName} ${leaveReason}` - }} -

+
+ + +
+
+
+
+

+ {{ + `${formDetail?.prefix ? formDetail?.prefix : ""}${ + formDetail?.firstName + } ${formDetail?.lastName} ${leaveReason}` + }} +

+
-
- - -
- - - - + +
- แก้ไขรูปโปรไฟล์ - -
+ + + + + แก้ไขรูปโปรไฟล์ + +
-
-
-
-
-
- {{ empType === "" ? "ตำแหน่งในสายงาน" : "ตำแหน่ง" }} -
-
{{ formDetail?.position || "-" }}
-
-
-
-
-
- {{ empType === "" ? "ตำแหน่งประเภท" : "กลุ่มงาน" }} -
-
- {{ formDetail?.posType?.posTypeName || "-" }} +
+
+
+
+
+ {{ empType === "" ? "ตำแหน่งในสายงาน" : "ตำแหน่ง" }} +
+
{{ formDetail?.position || "-" }}
-
-
-
-
- {{ empType === "" ? "ระดับ" : "ระดับชั้นงาน" }} +
+
+
+ {{ empType === "" ? "ตำแหน่งประเภท" : "กลุ่มงาน" }} +
+
+ {{ formDetail?.posType?.posTypeName || "-" }} +
-
- {{ formDetail?.posLevel?.posLevelName || "-" }} +
+
+
+
+ {{ empType === "" ? "ระดับ" : "ระดับชั้นงาน" }} +
+
+ {{ formDetail?.posLevel?.posLevelName || "-" }} +
-
- + - - + + - - - + + + +
+
+ +