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 : "-" }}