From aae6311ca10d690ddc0e1fd753261e81e8b946d4 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 20 Nov 2024 17:28:33 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=E0=B8=AB?= =?UTF-8?q?=E0=B8=99=E0=B9=89=E0=B8=B2=E0=B8=88=E0=B8=B1=E0=B8=94=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B8=AA=E0=B8=B4=E0=B8=97=E0=B8=98=E0=B8=B4?= =?UTF-8?q?=E0=B9=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/02_organizational/api.organization.ts | 4 + src/interface/request/main/main.ts | 4 +- .../RoleOrganization/DialogPersonal.vue | 477 ++++++++++++++++++ src/modules/02_users/interface/index/Main.ts | 5 +- .../02_users/views/04_roleOrganization.vue | 117 +++-- .../02_users/views/05_responsIbilities.vue | 3 +- 6 files changed, 561 insertions(+), 49 deletions(-) create mode 100644 src/modules/02_users/components/RoleOrganization/DialogPersonal.vue diff --git a/src/api/02_organizational/api.organization.ts b/src/api/02_organizational/api.organization.ts index fee3c0c8..42094c21 100644 --- a/src/api/02_organizational/api.organization.ts +++ b/src/api/02_organizational/api.organization.ts @@ -89,6 +89,10 @@ export default { orgSearchProfileEmp: `${orgProfile}-employee/search`, orgProfileById: (id: string, type: string) => `${orgProfile}${type}/${id}`, + orgProfileAdminById: (id: string, type: string) => + `${orgProfile}${type}/admin/${id}`, + profileNewGovernmentCard: (id: string, type: string) => + `${orgProfile}${type}/government/admin/${id}`, // noPermission orgDeceasedProfile: `${orgPos}/profile/search`, diff --git a/src/interface/request/main/main.ts b/src/interface/request/main/main.ts index 2c60d49e..989fac5f 100644 --- a/src/interface/request/main/main.ts +++ b/src/interface/request/main/main.ts @@ -118,13 +118,13 @@ const menuList = readonly([ }, { key: 2.0, - label: "กำหนดสิทธิ์จัดการโครงสร้าง", + label: "กำหนดหน้าที่จัดการโครงสร้าง (แบบร่าง)", path: "roleOrganization", role: ["SUPER_ADMIN", "ADMIN"], }, { key: 2.0, - label: "มอบหมายหน้าที่ความรับผิดชอบ", + label: "มอบหมายหน้าที่ความรับผิดชอบตามโครงสร้างปัจจุบัน", path: "responsibilities", role: ["SUPER_ADMIN", "ADMIN"], }, diff --git a/src/modules/02_users/components/RoleOrganization/DialogPersonal.vue b/src/modules/02_users/components/RoleOrganization/DialogPersonal.vue new file mode 100644 index 00000000..7fde64ff --- /dev/null +++ b/src/modules/02_users/components/RoleOrganization/DialogPersonal.vue @@ -0,0 +1,477 @@ + + + + + diff --git a/src/modules/02_users/interface/index/Main.ts b/src/modules/02_users/interface/index/Main.ts index c58034f9..00b43a12 100644 --- a/src/modules/02_users/interface/index/Main.ts +++ b/src/modules/02_users/interface/index/Main.ts @@ -56,8 +56,8 @@ interface DataTree { ancestorDNA: string; createdAt: string; createdFullName: string; - createdUserId: "94ba986d-f871-46a2-be92-46c0cbf0bc56"; - id: string; + createdUserId: string; + id: string | null; lastUpdateFullName: string; lastUpdateUserId: string; lastUpdatedAt: string; @@ -72,6 +72,7 @@ interface DataTree { orgRootRankSub: string; orgRootShortName: string; responsibility: string; + isDeputy: boolean; } interface DataProfile { diff --git a/src/modules/02_users/views/04_roleOrganization.vue b/src/modules/02_users/views/04_roleOrganization.vue index b3ade258..672f90c9 100644 --- a/src/modules/02_users/views/04_roleOrganization.vue +++ b/src/modules/02_users/views/04_roleOrganization.vue @@ -16,6 +16,7 @@ import type { import type { QueryProfile } from "@/modules/02_users/interface/request/Main"; import DialogAddPerson from "@/modules/02_users/components/RoleOrganization/DialogAddPerson.vue"; +import PopupPersonal from "@/modules/02_users/components/RoleOrganization/DialogPersonal.vue"; const $q = useQuasar(); const store = useDataStoreUser(); @@ -24,9 +25,34 @@ const { showLoader, hideLoader, messageError, success, dialogRemove } = /******* โครงสร้าง *******/ const filter = ref(""); // ค้นหาข้อมูลรายการโครงสร้าง -const nodeTree = ref([]); // ข้อมูลรายการโครงสร้าง +const nodeTree = ref([ + { + ancestorDNA: "", + createdAt: "", + createdFullName: "", + createdUserId: "", + id: "", + lastUpdateFullName: "", + lastUpdateUserId: "", + lastUpdatedAt: "", + orgRevisionId: "", + orgRootCode: "", + orgRootFax: "", + orgRootName: "หน่วยงานทั้งหมด", + orgRootOrder: 0, + orgRootPhoneEx: "", + orgRootPhoneIn: "", + orgRootRank: "", + orgRootRankSub: "", + orgRootShortName: "", + responsibility: "", + isDeputy: false, + }, +]); // ข้อมูลรายการโครงสร้าง const expanded = ref>([]); // เปิดรายการโครงสร้าง const orgId = ref(""); // id หน่วยงานที่เลือก +const modalPersonal = ref(false); +const personId = ref(""); /** * ฟังก์ชันดึงข้อมูลโครงสร้าง @@ -38,7 +64,9 @@ async function fatchOrg() { .get(config.API.permissionOrg) .then(async (res) => { const data = await res.data.result; - nodeTree.value = data; + + nodeTree.value.push(...data); + if (data.length === 1) { selectedOrg(data[0].id); } else if (data.length > 1) { @@ -61,7 +89,7 @@ async function fatchOrg() { */ function selectedOrg(id: string) { orgId.value = id; - qureyBody.id = id; + qureyBody.id = id === "" ? null : id; qureyBody.searchKeyword = ""; qureyBody.searchField = "fullName"; qureyBody.page = 1; @@ -85,47 +113,17 @@ const columns = ref([ align: "left", label: "ชื่อ-นามสกุล", sortable: true, - field: (row) => `${row.prefix}${row.firstName} ${row.lastName}`, - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "org", - align: "left", - label: "หน่วยงาน", - sortable: true, - field: "org", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "posNo", - align: "left", - label: "เลขที่ตำแหน่ง", - sortable: true, - field: "posNo", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "position", - align: "left", - label: "ตำแหน่งในสายงาน", - sortable: true, - field: "position", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - - { - name: "posType", - align: "left", - label: "ประเภทตำแหน่ง", - sortable: true, field: (row) => - `${row.posType ? row.posType : "-"} ${ - row.posLevel ? `(${row.posLevel})` : `` - } `, + `${row.rank ? row.rank : row.prefix}${row.firstName} ${row.lastName}`, + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "orgNew", + align: "left", + label: "หน่วยงานที่รับผิดชอบ", + sortable: true, + field: "orgNew", headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -197,6 +195,15 @@ function updatePagination(newPagination: Pagination) { qureyBody.pageSize = newPagination.rowsPerPage; } +function onOpenModalPersonal(id: string) { + personId.value = id; + modalPersonal.value = true; +} + +function updatemodalPersonal(modal: boolean) { + modalPersonal.value = modal; +} + /** * ดูการเปลี่ยนแปลงของ pageSize ใน queryBody * เมื่อ pageSize มีการเปลี่ยนแปลงให้โหลดข้อมูลหน้าแรก @@ -218,7 +225,7 @@ onMounted(async () => {