From 3ea63a2244945b08db57fa770d201cd2caf80056 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 13 Mar 2024 10:38:19 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=82=E0=B8=84=E0=B8=A3=E0=B8=87=E0=B8=AA?= =?UTF-8?q?=E0=B8=A3=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B8=AD=E0=B8=B1=E0=B8=95?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=81=E0=B8=B3=E0=B8=A5=E0=B8=B1=E0=B8=87?= =?UTF-8?q?=20=3D>=20=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=E0=B8=AA=E0=B9=88=E0=B8=A7=E0=B8=99=E0=B8=A3=E0=B8=B2=E0=B8=8A?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/DialogFormAgency.vue | 70 +++++ .../interface/index/Main.ts | 3 +- .../DialogEmployeeChart.vue | 7 +- .../salaryEmployeeChart/TabCriteria.vue | 242 +++++++++++++++++- .../salaryEmployeeChart/TabStructure.vue | 2 +- 5 files changed, 318 insertions(+), 6 deletions(-) diff --git a/src/modules/02_organizationalNew/components/DialogFormAgency.vue b/src/modules/02_organizationalNew/components/DialogFormAgency.vue index 73847f512..86ca5cfc0 100644 --- a/src/modules/02_organizationalNew/components/DialogFormAgency.vue +++ b/src/modules/02_organizationalNew/components/DialogFormAgency.vue @@ -61,6 +61,8 @@ const orgLevelOptionMain = ref([ { name: "ระดับฝ่าย/กลุ่มงาน", id: "SECTION" }, ]); +const orgLevelSubOptionMain = ref([]); + const orgLevelOption = ref([]); const orgNameRef = ref(null); @@ -70,6 +72,7 @@ const orgCodeRef = ref(null); // const orgPhoneInRef = ref(null); // const orgFaxRef = ref(null); const orgLevelRef = ref(null); +const orgLevelSubRef = ref(null); const formData = reactive({ orgName: "", @@ -79,6 +82,7 @@ const formData = reactive({ orgPhoneIn: "", orgFax: "", orgLevel: "", + orgLevelSub: "", }); /** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */ @@ -90,6 +94,7 @@ const objectComplaintsRef: FormAgencyRef = { // orgPhoneIn: orgPhoneInRef, // orgFax: orgFaxRef, orgLevel: orgLevelRef, + orgLevelSub: orgLevelSubRef, }; /** ฟังก์ชั่นตรวจสอบความถูกต้องของข้อมูลในฟอร์ม */ @@ -141,8 +146,12 @@ function onSubmit() { ["org" + type + "PhoneIn"]: formData.orgPhoneIn, ["org" + type + "Fax"]: formData.orgFax, ["org" + type + "Rank"]: formData.orgLevel, + ["org" + type + "RankSub"]: + level.value !== 0 ? formData.orgLevelSub : undefined, [nameId]: rootId, }; + console.log(body); + if (actionType.value === "ADD") { await http .post(config.API.createOrgLevel(type.toLocaleLowerCase()), body) @@ -229,6 +238,7 @@ watch( props.dataNode.orgTreeRank === "DEPARTMENT" ? orgLevelOptionMain.value : orgLevelOptionMain.value.slice(1, 4); + selectOrgLevele(formData.orgLevel); } } } @@ -245,6 +255,45 @@ const tittleName = computed(() => { return name; }); + +function selectOrgLevele(val: string) { + formData.orgLevelSub = ""; + switch (val) { + case "OFFICE": + orgLevelSubOptionMain.value = [ + { name: "ระดับกอง", id: "DIVISION" }, + { + name: "สำนักงาน", + id: "OFFICE", + }, + { name: "ส่วนราชการ", id: "GOVERNMENT" }, + { name: "โรงพยาบาล", id: "HOSPITAL" }, + { name: "เทียบเท่ากอง", id: "EQUIVALENT" }, + ]; + + break; + case "DIVISION": + orgLevelSubOptionMain.value = [ + { name: "ระดับส่วน", id: "SECTION" }, + { + name: "กลุ่มภารกิจ", + id: "MISSION", + }, + ]; + + case "SECTION": + orgLevelSubOptionMain.value = [ + { name: "ระดับฝ่าย", id: "FACTION" }, + { + name: "กลุ่มงาน", + id: "WORK", + }, + ]; + + default: + break; + } +}