From 563514584c4d2ae9c68c8dc6ff4163f7c97e4075 Mon Sep 17 00:00:00 2001 From: AnandaTon Date: Fri, 15 Sep 2023 15:49:03 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=20tree=20=E0=B8=9D=E0=B8=B1=E0=B8=87=E0=B9=82=E0=B8=84?= =?UTF-8?q?=E0=B8=A3=E0=B8=87=E0=B8=AA=E0=B8=A3=E0=B9=89=E0=B8=B2=E0=B8=87?= =?UTF-8?q?=E0=B8=A5=E0=B8=B9=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/MainTreeEmployee.vue | 1040 +++++++++-------- 1 file changed, 569 insertions(+), 471 deletions(-) diff --git a/src/modules/02_organizational/views/MainTreeEmployee.vue b/src/modules/02_organizational/views/MainTreeEmployee.vue index 8278e3329..44e92526f 100644 --- a/src/modules/02_organizational/views/MainTreeEmployee.vue +++ b/src/modules/02_organizational/views/MainTreeEmployee.vue @@ -51,321 +51,379 @@ - - + + - -
-
-
- {{ "โครงสร้างหน่วยงาน" }} -
-
- +
+
+ + + + + + + + + + + +
+
+ + +
+
+
+ {{ "โครงสร้างหน่วยงาน" }} +
+
+ -
-
- +
+
+ -
-
- +
+
+ -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ -
-
- +
+
+ -
-
- +
+
+ -
-
- +
+
+ -
-
- -
-
- +
+
+ +
+
+ -
-
- +
+
+ -
-
- +
+
+ -
-
- -
+ option-label="name" + option-value="id" + map-options + emit-value + clearable + /> +
+
+ +
-
- {{ "โครงสร้างตำแหน่ง" }} -
- -
- + -
-
- + -
-
- + - -
- +
+ - -
- + -
-
- +
+
+ -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- - ปกติ - - - ติดเงื่อนไข - -
-
- -
+ :rules="[(val:any) => !!val || `${'กรุณาเลือกสถานภาพของตำแหน่ง'}`]" + /> +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + ปกติ + + + ติดเงื่อนไข + +
+
+ +
+
+ +
@@ -671,6 +737,7 @@ import type { DataOption, GovermentOption, } from "@/modules/02_organizational/interface/index/Main"; +import type { treeTab } from "@/components/information/interface/index/Main"; import type { Pagination } from "@/modules/03_recruiting/interface/index/Main"; import http from "@/plugins/http"; import config from "@/app.config"; @@ -707,6 +774,10 @@ const positionEmployeePositionSidesId = ref([]); const positionEmployeeLevelId = ref([]); const positionEmployeeStatusId = ref(); +const selected = ref(""); +const search = ref(""); +const nodesTree = ref([]); +const expanded = ref([]); const organizationShortName = ref(); const agency = ref(); const government = ref(); @@ -722,7 +793,8 @@ const isActive = ref(false); const isCondition = ref(false); const conditionNote = ref(); const posNo = ref(); - +const posNoOptions = ref([]); +const posNoOptionsFilter = ref([]); const organizationOrganizationOption = ref([]); const organizationAgencyCodeOption = ref([]); const organizationGovernmentCodeOption = ref([]); @@ -768,7 +840,7 @@ const modalEdit = ref(false); //modal ที่แสดงใช้ส const editRow = ref(false); //เช็คมีการแก้ไขข้อมูล const statusCode = ref(); const checkValidate = ref(false); //validate data ผ่านหรือไม่ - +const organizationId = ref(""); const rows = ref([]); const filter = ref(""); //search data table @@ -898,8 +970,15 @@ onMounted(async () => { await fetchOrganizationAgencyCode(); await fetchPosition(); await fetchData(); + await nodeTree(); }); +const onSelected = async (id: string) => { + // await fetchPositionNumber(id); + organizationId.value = id; + console.log(organizationId.value); +}; + /** * ฟังก์ชัน get data ล่าสุด */ @@ -1104,6 +1183,25 @@ const fetchOrganizationAgency = async () => { }); }; +const nodeTree = async () => { + showLoader(); + await http + .get(config.API.profileOrganizRoot) + .then((res: any) => { + const data = res.data.result; + nodesTree.value = data; + if (data.length > 0) { + expanded.value = [data[0].id]; + } + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); +}; + /** * ส่วนราชการต้นสังกัด */