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(); + }); +}; + /** * ส่วนราชการต้นสังกัด */