From b598f761c42ff2c099ca41f9c00ce7bc10c50f29 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Wed, 21 Aug 2024 11:36:52 +0700 Subject: [PATCH 1/2] updated retire --- .../components/ListRetirement/TableList.vue | 46 +++++++++++-------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/src/modules/06_retirement/components/ListRetirement/TableList.vue b/src/modules/06_retirement/components/ListRetirement/TableList.vue index 0a6065621..caddb0cd7 100644 --- a/src/modules/06_retirement/components/ListRetirement/TableList.vue +++ b/src/modules/06_retirement/components/ListRetirement/TableList.vue @@ -327,7 +327,7 @@ const uploadFile = async (event: any, signDate: any) => { config.API.fileRetirement(retireld.value.toString()), formdata ) - .then(async(res) => { + .then(async (res) => { fileUpload.value = null; signDate.value = null; modalUpload.value = false; @@ -339,9 +339,7 @@ const uploadFile = async (event: any, signDate: any) => { .catch((err) => { messageError($q, err); }) - .finally(() => { - - }); + .finally(() => {}); }, "ยืนยันการอัปโหลดเอกสาร", "ต้องการยืนยันการอัปโหลดเอกสารนี้หรือไม่ ?" @@ -458,9 +456,9 @@ function updatemodalPersonal(modal: boolean) { :UpdateListId="UpdateListId" v-if=" !checkRoutePermisson && - statusReport === false && + !statusReport && (typeReport == 'ADD' || typeReport == '' || typeReport == null) && - statusUpload !== true + !statusUpload " /> @@ -474,7 +472,7 @@ function updatemodalPersonal(modal: boolean) { (modalUpload = true), (signDate = null), (fileUpload = null) " target="_blank" - v-if="statusUpload !== true && !checkRoutePermisson" + v-if="!statusUpload && !checkRoutePermisson" > - + ดูข้อมูลในทะเบียนประวัติ ข้อมูลดูเหตุผล - +
@@ -747,9 +754,12 @@ function updatemodalPersonal(modal: boolean) {
- + - + Date: Wed, 21 Aug 2024 16:34:22 +0700 Subject: [PATCH 2/2] 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 || "-" }} +
-
- + - - + + - - - + + + +
+
+ +