From ad8cf4553aa69148afa854d74cf00b989f29b4e1 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 31 Jan 2024 12:02:11 +0700 Subject: [PATCH 1/2] load --- .../components/DialogFormAgency.vue | 8 +- .../components/DialogFormPosition.vue | 22 +++- .../components/mainTree.vue | 4 +- .../components/tableTree.vue | 110 +++++++++++++++++- 4 files changed, 136 insertions(+), 8 deletions(-) diff --git a/src/modules/02_organizationalNew/components/DialogFormAgency.vue b/src/modules/02_organizationalNew/components/DialogFormAgency.vue index 5392d33fc..f6ecc0d64 100644 --- a/src/modules/02_organizationalNew/components/DialogFormAgency.vue +++ b/src/modules/02_organizationalNew/components/DialogFormAgency.vue @@ -151,8 +151,8 @@ function onSubmit() { }) .finally(async () => { await props.fetchDataTree?.(); - await closeClear(); - await hideLoader(); + closeClear(); + hideLoader(); }); } else { props.dataNode && @@ -175,8 +175,8 @@ function onSubmit() { }) .finally(async () => { // await props.fetchDataTree?.(); - await closeClear(); - await hideLoader(); + closeClear(); + hideLoader(); })); } }); diff --git a/src/modules/02_organizationalNew/components/DialogFormPosition.vue b/src/modules/02_organizationalNew/components/DialogFormPosition.vue index c4c58b053..46dc3330a 100644 --- a/src/modules/02_organizationalNew/components/DialogFormPosition.vue +++ b/src/modules/02_organizationalNew/components/DialogFormPosition.vue @@ -211,7 +211,27 @@ function validateFormPositionEdit() { /** ฟังชั่น บันทึก */ function onSubmit() { dialogConfirm($q, () => { - console.log(formData); + const positionsData = rows.value.map((e) => ({ + posDictName: e.positionName, //ชื่อตำแหน่งในสายงาน (ชื่อตำแหน่ง) + posDictField: e.positionField, //สายงาน + posTypeId: e.positionName, //*ประเภทตำแหน่ง + posLevelId: e.positionName, //*ระดับตำแหน่ง + posExecutiveId: e.positionName, //ตำแหน่งทางการบริหาร + posDictExecutiveField: e.positionName, //ด้านทางการบริหาร + posDictArea: e.positionArea, //ด้าน/สาขา + })); + const body = { + posMasterNoPrefix: formData.prefixNo, //*Prefix นำหน้าเลขที่ตำแหน่ง เป็น Optional (ไม่ใช่อักษรย่อของหน่วยงาน/ส่วนราชการ) + posMasterNo: Number(formData.positionNo), //*เลขที่ตำแหน่ง เป็นตัวเลข + posMasterNoSuffix: formData.suffixNo, //Suffix หลังเลขที่ตำแหน่ง เช่น ช. + // orgRootId: Guid, //Id สำนัก + // orgChild1Id: Guid, //Id โครงสร้างระดับ1 + // orgChild2Id: Guid, //Id โครงสร้างระดับ2 + // orgChild3Id: Guid, //Id โครงสร้างระดับ3 + // orgChild4Id: Guid, //Id โครงสร้างระดับ4 + positions: [positionsData], + }; + console.log(body); }); } /** ฟังชั่น บันทึก */ diff --git a/src/modules/02_organizationalNew/components/mainTree.vue b/src/modules/02_organizationalNew/components/mainTree.vue index 84afe164a..cbb1e22d7 100644 --- a/src/modules/02_organizationalNew/components/mainTree.vue +++ b/src/modules/02_organizationalNew/components/mainTree.vue @@ -208,8 +208,8 @@ async function onClickDel(type: number, id: string) { messageError($q, err); }) .finally(async () => { - await props.fetchDataTree?.(); - await hideLoader(); + props.fetchDataTree?.(); + hideLoader(); }); }); } diff --git a/src/modules/02_organizationalNew/components/tableTree.vue b/src/modules/02_organizationalNew/components/tableTree.vue index 24d23e211..e433ede5a 100644 --- a/src/modules/02_organizationalNew/components/tableTree.vue +++ b/src/modules/02_organizationalNew/components/tableTree.vue @@ -101,6 +101,13 @@ const rows = ref([ levelPositoion: "ชำนาญการ / ?", isStatus: "ไม่มี", }, + { + noPosition: "สกง.2", + namePosition: "นักทรัพยากรบุคคล", + typePosition: "ทั่วไป", + levelPositoion: "ชำนาญการ / ?", + isStatus: "ไม่มี", + }, ]); const dialogPosition = ref(false); @@ -173,7 +180,7 @@ function onClickViewDetail() { ref="table" :columns="columns" :rows="rows" - row-key="id" + row-key="noPosition" flat bordered :paging="true" @@ -184,6 +191,7 @@ function onClickViewDetail() { > + +
+ +
+
+ {{ prop.node.orgTreeName }} +
+
+ {{ prop.node.orgCode == null ? null : prop.node.orgCode }} + {{ + prop.node.orgTreeShortName == null + ? null + : prop.node.orgTreeShortName + }} +
+
+
+ + + + + + + + +
+ {{ item.label }}หน่วยงาน +
+
+
+
+
+ + + +
orgRootId = {{ idVal }}
+
+ {{ dataObject }} +
+ + + +