From dd9239ac25ba90ef1ef18282315c52355f2e7df8 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 1 Feb 2024 09:27:56 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=20fetch=20=E0=B8=82=E0=B9=89=E0=B8=AD?= =?UTF-8?q?=E0=B8=A1=E0=B8=B9=E0=B8=A5=20tree?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/DialogFormAgency.vue | 4 ++-- .../components/DialogFormPosition.vue | 13 ++++++++----- .../02_organizationalNew/components/listView.vue | 2 +- .../02_organizationalNew/components/mainTree.vue | 1 - .../02_organizationalNew/components/tableTree.vue | 4 ++-- .../02_organizationalNew/interface/index/Main.ts | 4 ++++ src/modules/02_organizationalNew/views/main.vue | 2 +- 7 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/modules/02_organizationalNew/components/DialogFormAgency.vue b/src/modules/02_organizationalNew/components/DialogFormAgency.vue index b547feb1e..3ac9508d3 100644 --- a/src/modules/02_organizationalNew/components/DialogFormAgency.vue +++ b/src/modules/02_organizationalNew/components/DialogFormAgency.vue @@ -141,14 +141,14 @@ function onSubmit() { if (actionType.value === "ADD") { await http .post(config.API.createOrgLevel(type.toLocaleLowerCase()), body) - .then((res) => { + .then(() => { success($q, "บันทึกข้อมูลสำเร็จ"); }) .catch((err) => { messageError($q, err); }) .finally(() => { - props.fetchDataTree(); + props.fetchDataTree(store.draftId); closeClear(); hideLoader(); }); diff --git a/src/modules/02_organizationalNew/components/DialogFormPosition.vue b/src/modules/02_organizationalNew/components/DialogFormPosition.vue index 82c99b880..23e390591 100644 --- a/src/modules/02_organizationalNew/components/DialogFormPosition.vue +++ b/src/modules/02_organizationalNew/components/DialogFormPosition.vue @@ -324,10 +324,8 @@ function validateFormPositionEdit() { /** ฟังชั่น บันทึก */ function onSubmit() { - console.log(props.orgLevel); - dialogConfirm($q, async () => { - const positionsData = rows.value.map((e) => ({ + const positionsData = rows.value.map((e: any) => ({ posDictName: e.positionName, //ชื่อตำแหน่งในสายงาน (ชื่อตำแหน่ง) posDictField: e.positionField, //สายงาน posTypeId: e.posTypeId, //*ประเภทตำแหน่ง @@ -471,7 +469,7 @@ watch( ); function addPosition(data: RowDetailPositions) { - const isIdExist = rows.value.some((item) => item.id === data.id); + const isIdExist = rows.value.some((item: any) => item.id === data.id); if (!isIdExist) { rows.value = [data, ...rows.value]; @@ -521,7 +519,12 @@ async function clearFormPositionSelect() {