From 133fd1d8924ee7c5100fe929f0671cc9982e6d2d Mon Sep 17 00:00:00 2001 From: flfeders Date: Thu, 29 Aug 2024 20:43:15 +0200 Subject: [PATCH] Reactivated Phases --- pages/projects/[mode]/[[id]].vue | 36 ++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/pages/projects/[mode]/[[id]].vue b/pages/projects/[mode]/[[id]].vue index fde5fd5..3253795 100644 --- a/pages/projects/[mode]/[[id]].vue +++ b/pages/projects/[mode]/[[id]].vue @@ -3,7 +3,6 @@ import dayjs from "dayjs"; import HistoryDisplay from "~/components/HistoryDisplay.vue"; import DocumentUpload from "~/components/DocumentUpload.vue"; import DocumentList from "~/components/DocumentList.vue"; -import {useSupabaseSelectSingle} from "~/composables/useSupabase.js"; definePageMeta({ middleware: "auth" @@ -101,6 +100,8 @@ const itemInfo = ref({ }) const oldItemInfo = ref({}) const tags = dataStore.getDocumentTags +const phasesTemplates = ref([]) +const phasesTemplateSelected = ref(null) //Functions @@ -122,6 +123,13 @@ const setupPage = async() => { } } if(itemInfo.value) oldItemInfo.value = JSON.parse(JSON.stringify(itemInfo.value)) + + phasesTemplates.value = await useSupabaseSelect("phasesTemplates","*","created_at") + if(phasesTemplates.value.length > 0) { + phasesTemplateSelected.value = phasesTemplates.value[0].id + } + + } setupPage() @@ -167,7 +175,6 @@ const projectHours = () => { label: 'Abgeschlossen', icon: 'i-heroicons-check' }])*/ -//const phasesTemplateSelected = ref(dataStore.phasesTemplates[0].id) const changeActivePhase = async (phase) => { itemInfo.value = await useSupabaseSelectSingle("projects",route.params.id,'*') @@ -187,12 +194,10 @@ const savePhases = () => { dataStore.updateItem("projects", itemInfo.value) } -/* const loadPhases = async () => { itemInfo.value.phases = dataStore.phasesTemplates.find(i => i.id === phasesTemplateSelected.value).initialPhases - await dataStore.updateItem("projects", itemInfo.value) + await dataStore.updateItem("projects", {...itemInfo.value, customer: itemInfo.value.customer ? itemInfo.value.customer.id : null, plant: itemInfo.value.plant ? itemInfo.value.plant.id : null}) } -*/ @@ -257,7 +262,7 @@ const loadPhases = async () => {

Kunde: {{itemInfo.customer.name}}

-

Objekt: {{itemInfo.plant ? itemInfo.plant.name : ""}}

+

Objekt: {{itemInfo.plant ? itemInfo.plant.name : ""}}-

Notizen: {{itemInfo.notes}}

@@ -283,9 +288,9 @@ const loadPhases = async () => { label="Vorlage laden" v-if="itemInfo.phases.length === 0" > - + @@ -341,7 +346,7 @@ const loadPhases = async () => { -
+ +–>
-
Projekt Zeit: {{String(projectHours()).replace(".",",")}} Stunden {
Auf das Projekt gebuchte Artikel: - + –> -
+
-->