From 0dba62fb43eee3f99c2d27a2db6c24486e5f3ea2 Mon Sep 17 00:00:00 2001 From: oat_dev Date: Thu, 18 Apr 2024 10:11:57 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9B=E0=B9=89=E0=B8=B2=E0=B8=AB?= =?UTF-8?q?=E0=B8=A1=E0=B8=B2=E0=B8=A2:=20=E0=B9=81=E0=B8=81=E0=B9=89?= =?UTF-8?q?=E0=B9=84=E0=B8=82=E0=B8=9A=E0=B8=B1=E0=B8=84+=E0=B9=80?= =?UTF-8?q?=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1column=20=E0=B9=80=E0=B8=9B?= =?UTF-8?q?=E0=B9=89=E0=B8=B2=E0=B8=AB=E0=B8=A1=E0=B8=B2=E0=B8=A2=E0=B8=A2?= =?UTF-8?q?=E0=B9=88=E0=B8=AD=E0=B8=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../15_development/components/Target.vue | 56 ++++++++++++------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/src/modules/15_development/components/Target.vue b/src/modules/15_development/components/Target.vue index 151005c5b..389d74033 100644 --- a/src/modules/15_development/components/Target.vue +++ b/src/modules/15_development/components/Target.vue @@ -21,7 +21,6 @@ import type { import DialogHeader from "@/components/DialogHeader.vue"; -import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore"; import { useCounterMixin } from "@/stores/mixin"; const route = useRoute(); const projectId = ref(route.params.id.toLocaleString()); @@ -42,6 +41,16 @@ const columnsPlannedGoals = ref([ style: "font-size: 14px", format: (val) => convertNameGoals(val), }, + { + name: "groupTargetSub", + align: "left", + label: "กลุ่มเป้าหมายย่อย", + sortable: true, + field: "groupTargetSub", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + format: (val) => convertNameSubGoals(val), + }, { name: "posTypePlannedId", align: "left", @@ -75,6 +84,16 @@ const columnsActualGoals = ref([ style: "font-size: 14px", format: (val) => convertNameGoals(val), }, + { + name: "groupTargetSub", + align: "left", + label: "กลุ่มเป้าหมายย่อย", + sortable: true, + field: "groupTargetSub", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + format: (val) => convertNameSubGoals(val), + }, { name: "posTypeActualId", align: "left", @@ -83,9 +102,7 @@ const columnsActualGoals = ref([ field: "posTypeActualId", headerStyle: "font-size: 14px", style: "font-size: 14px", - // format: (val) => convertTypeGoals(val), }, - { name: "amount", align: "left", @@ -248,12 +265,18 @@ async function onSubmitGroup() { { groupTarget: formGroupTarget.groupTarget, groupTargetSub: formGroupTarget.groupTargetSub, - positions: formGroupTarget.positions.map((v) => ({ - position: v.position ? v.position : "", - posTypePlannedId: v.posTypeId ? v.posTypeId : "", - posLevelPlannedId: v.posLevelId ? v.posLevelId : "", - })), - type: formGroupTarget.type ? formGroupTarget.type : "", + positions: + formGroupTarget.groupTarget !== "OUTSIDERS" + ? formGroupTarget.positions.map((v) => ({ + position: v.position ? v.position : "", + posTypePlannedId: v.posTypeId ? v.posTypeId : "", + posLevelPlannedId: v.posLevelId ? v.posLevelId : "", + })) + : [], + type: + formGroupTarget.groupTarget === "OUTSIDERS" + ? formGroupTarget.type + : "", amount: formGroupTarget.amount, } ) @@ -416,6 +439,11 @@ function convertNameGoals(id: string) { return data && data?.name; } +function convertNameSubGoals(id: string) { + const data = groupSubOp.value.find((e: DataOption) => e.id === id); + return data && data?.name; +} + function convertNamePeoples(id: string) { const data = peoplesOp.value.find((e: DataOption) => e.id === id); return data && data?.name; @@ -665,16 +693,6 @@ onMounted(() => {
{{ col.value ? col.value : "-" }}
-
{{ col.value ? col.value : "-" }}