diff --git a/src/components/Dialogs/DialogOrgSelect.vue b/src/components/Dialogs/DialogOrgSelect.vue index 0804dfb5..abf16751 100644 --- a/src/components/Dialogs/DialogOrgSelect.vue +++ b/src/components/Dialogs/DialogOrgSelect.vue @@ -4,7 +4,7 @@ import { useCounterMixin } from "@/stores/mixin"; import { useQuasar } from "quasar"; import { ref, watch, reactive } from "vue"; import type { QTableProps } from "quasar"; - +import CardPosition from "@/modules/05_placement/components/PersonalList/CardPosition.vue"; import http from "@/plugins/http"; import config from "@/app.config"; @@ -389,7 +389,7 @@ async function onClickSelectPos(id: string) { positionId.value = id; selectedPos.value = []; const position: DataPositionNo = positionData.value.find( - (e: DataPositionNo) => e.id === id, + (e: DataPositionNo) => e.id === id ); // หาตำแหน่ง @@ -397,7 +397,7 @@ async function onClickSelectPos(id: string) { rowsPosition.value = position.positions; if (seletcId.value) { selectedPos.value = rowsPosition.value.filter( - (e) => e.id === seletcId.value, + (e) => e.id === seletcId.value ); } } @@ -448,7 +448,7 @@ watch( expanded.value = []; } } - }, + } ); watch( @@ -457,7 +457,7 @@ watch( if (value !== oldVal) { getDataTable(nodeId.value, nodeLevel.value); } - }, + } ); watch( @@ -466,7 +466,7 @@ watch( if (value !== oldVal) { getDataTable(nodeId.value, nodeLevel.value); } - }, + } ); watch( @@ -475,11 +475,11 @@ watch( if (n) { onClickSelectPos(n); } - }, + } ); function onSubmit() { const dataPosMaster = posMasterMain.value?.find( - (e: any) => e.id === positionId.value, + (e: any) => e.id === positionId.value ); console.log(dataPosMaster); @@ -650,6 +650,7 @@ function onSubmit() { map-options :options="columns" option-value="name" + style="min-width: 140px" /> diff --git a/src/components/Dialogs/DialogOrgSelectEmployee.vue b/src/components/Dialogs/DialogOrgSelectEmployee.vue index b3866698..c7eed2b8 100644 --- a/src/components/Dialogs/DialogOrgSelectEmployee.vue +++ b/src/components/Dialogs/DialogOrgSelectEmployee.vue @@ -4,6 +4,7 @@ import { useCounterMixin } from "@/stores/mixin"; import { useQuasar } from "quasar"; import { ref, watch, reactive } from "vue"; import type { QTableProps } from "quasar"; +import CardPosition from "@/modules/05_placement/components/PersonalList/CardPosition.vue"; import http from "@/plugins/http"; import config from "@/app.config"; @@ -367,7 +368,7 @@ async function onClickSelectPos(id: string) { positionId.value = id; selectedPos.value = []; const position: DataPositionNo = positionData.value.find( - (e: DataPositionNo) => e.id === id, + (e: DataPositionNo) => e.id === id ); // หาตำแหน่ง @@ -375,7 +376,7 @@ async function onClickSelectPos(id: string) { rowsPosition.value = position.positions; if (seletcId.value) { selectedPos.value = rowsPosition.value.filter( - (e) => e.id === seletcId.value, + (e) => e.id === seletcId.value ); } } @@ -426,7 +427,7 @@ watch( expanded.value = []; } } - }, + } ); watch( @@ -435,7 +436,7 @@ watch( if (value !== oldVal) { getDataTable(nodeId.value, nodeLevel.value); } - }, + } ); watch( @@ -444,7 +445,7 @@ watch( if (value !== oldVal) { getDataTable(nodeId.value, nodeLevel.value); } - }, + } ); watch( @@ -453,11 +454,11 @@ watch( if (n) { onClickSelectPos(n); } - }, + } ); function onSubmit() { const dataPosMaster = posMasterMain.value?.find( - (e: any) => e.id === positionId.value, + (e: any) => e.id === positionId.value ); console.log(dataPosMaster); @@ -628,6 +629,7 @@ function onSubmit() { map-options :options="columns" option-value="name" + style="min-width: 140px" /> diff --git a/src/modules/02_users/interface/index/Main.ts b/src/modules/02_users/interface/index/Main.ts index 12ac27f9..3e7e4f47 100644 --- a/src/modules/02_users/interface/index/Main.ts +++ b/src/modules/02_users/interface/index/Main.ts @@ -75,7 +75,6 @@ interface DataTree { responsibility: string; isDeputy: boolean; labelName: string; - children?: DataTree[]; } interface DataProfile { diff --git a/src/modules/02_users/views/06_rolePositionSalary.vue b/src/modules/02_users/views/06_rolePositionSalary.vue index ee0d4346..d4208d6b 100644 --- a/src/modules/02_users/views/06_rolePositionSalary.vue +++ b/src/modules/02_users/views/06_rolePositionSalary.vue @@ -97,11 +97,7 @@ async function fetchDataTree(id: string) { .get(config.API.orgByid(id.toString())) .then(async (res) => { const data = await res.data.result; - const dataTreeFormatted = data.map((item: DataTree) => { - const { children, ...itemWithoutChildren } = item; - return itemWithoutChildren; - }); - nodeTree.value.push(...dataTreeFormatted); + nodeTree.value.push(...data); if (data.length === 1) { selectedOrg(data[0].orgTreeId); @@ -313,7 +309,7 @@ onMounted(async () => { class="q-pa-sm q-gutter-sm" dense :nodes="nodeTree" - node-key="orgRootName" + node-key="labelName" label-key="labelName" :filter="filter?.trim()" no-results-label="ไม่พบข้อมูลที่ค้นหา"