From f6979d58384a162baa3e31fabd4120c813c19a25 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Fri, 11 Apr 2025 11:54:33 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B9=80=E0=B8=81=E0=B9=89=20?= =?UTF-8?q?=E0=B9=80=E0=B8=9B=E0=B9=89=E0=B8=B2=E0=B8=AB=E0=B8=A1=E0=B8=B2?= =?UTF-8?q?=E0=B8=A2=E0=B8=95=E0=B8=B2=E0=B8=A1=E0=B9=81=E0=B8=9C=E0=B8=99?= =?UTF-8?q?=20=E0=B8=AA=E0=B9=88=E0=B8=87=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../15_development/components/Target.vue | 31 ++++++++++++++----- .../15_development/interface/request/Main.ts | 2 ++ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/modules/15_development/components/Target.vue b/src/modules/15_development/components/Target.vue index 5948b60a6..bc8f366c9 100644 --- a/src/modules/15_development/components/Target.vue +++ b/src/modules/15_development/components/Target.vue @@ -77,10 +77,13 @@ const levelComputed = computed(() => { formGroupTarget.groupTargetSub !== "EMPLOYEETEMP" ) { return ( - posTypeMain.value.find((v) => items.posTypeId === v.id)?.posLevels || [] + posTypeMain.value.find((v) => items.posType === v.posTypeName) + ?.posLevels || [] ); } else { - const v = posTypeMainEMP.value.find((v) => items.posTypeId === v.id); + const v = posTypeMainEMP.value.find( + (v) => items.posType === v.posTypeName + ); return ( v?.posLevels.map((e: any) => ({ id: e.id, @@ -103,6 +106,8 @@ const formGroupTarget = reactive({ amount: null, positions: [ { + posType: "", + posLevel: "", position: "", posTypeId: null, posLevelId: null, @@ -119,6 +124,8 @@ const formGroupRelate = reactive({ /** เพิ่ม object ให้ตัวแปร */ const addGroupTargetData = async () => { formGroupTarget.positions.push({ + posType: "", + posLevel: "", position: "", posTypeId: null, posLevelId: null, @@ -328,6 +335,8 @@ function onClickOpenDialog(type: string, target: string) { if (target === "planned") { (formGroupTarget.positions = [ { + posType: "", + posLevel: "", position: "", posTypeId: null, posLevelId: null, @@ -360,9 +369,9 @@ function onSubmitGroup() { positions: formGroupTarget.groupTarget !== "OUTSIDERS" ? formGroupTarget.positions.map((v) => ({ + posTypePlanned: v.position ? v.posType : "", + posLevelPlanned: v.position ? v.posLevel : "", position: v.position ? v.position : "", - posTypePlannedId: v.posTypeId ? v.posTypeId : null, - posLevelPlannedId: v.posLevelId ? v.posLevelId : null, posExecutive: v.posExecutive ? v.posExecutive : "", })) : [], @@ -561,6 +570,8 @@ function onOpenDialog(data: any) { plannedGoalsData.value.find((item: any) => item.id === data.id)?.position || [] ).map((pos: any) => ({ + posType: pos.posType, + posLevel: pos.posLevel, position: pos.position, posTypeId: pos.posTypeId || null, posLevelId: pos.posLevelId || null, @@ -1168,6 +1179,8 @@ onMounted(() => { updateGroupTarget, (formGroupTarget.positions = [ { + posType: '', + posLevel: '', position: '', posTypeId: null, posLevelId: null, @@ -1214,6 +1227,8 @@ onMounted(() => { @update:model-value=" formGroupTarget.positions = [ { + posType: '', + posLevel: '', position: '', posTypeId: null, posLevelId: null, @@ -1284,7 +1299,7 @@ onMounted(() => { dense outlined class="inputgreen" - v-model="items.posTypeId" + v-model="items.posType" :options=" formGroupTarget.groupTargetSub !== 'EMPLOYEE' && formGroupTarget.groupTargetSub !== 'EMPLOYEETEMP' @@ -1292,7 +1307,7 @@ onMounted(() => { : posTypeOpEMP " option-label="name" - option-value="id" + option-value="name" emit-value map-options input-class="text-red" @@ -1314,10 +1329,10 @@ onMounted(() => { dense outlined class="inputgreen" - v-model="items.posLevelId" + v-model="items.posLevel" :options="levelComputed[index]" option-label="posLevelName" - option-value="id" + option-value="posLevelName" emit-value map-options input-class="text-red" diff --git a/src/modules/15_development/interface/request/Main.ts b/src/modules/15_development/interface/request/Main.ts index a1976a7ec..4f906cfe3 100644 --- a/src/modules/15_development/interface/request/Main.ts +++ b/src/modules/15_development/interface/request/Main.ts @@ -48,6 +48,8 @@ interface FormGroupTargetPlannedGoal { } interface PositionsType { + posType: string; + posLevel: string; position: string; posTypeId: string | null; posLevelId: string | null;