Many Changes

This commit is contained in:
2024-07-12 22:05:48 +02:00
parent 1e952e008e
commit d01869fca8
12 changed files with 653 additions and 485 deletions

View File

@@ -105,8 +105,10 @@ const tags = dataStore.getDocumentTags
//Functions
const setupPage = async() => {
if(mode.value === "show" || mode.value === "edit"){
itemInfo.value = await useSupabaseSelectSingle("projects",route.params.id,"*, customer(*), plant(*)")//dataStore.getProjectById(Number(useRoute().params.id))
if(mode.value === "show" ){
itemInfo.value = await useSupabaseSelectSingle("projects",route.params.id,"*, customer(*), plant(*)")
} else if (mode.value === "edit") {
itemInfo.value = await useSupabaseSelectSingle("projects",route.params.id,"*")
}
if(mode.value === "create") {
@@ -166,7 +168,9 @@ const projectHours = () => {
icon: 'i-heroicons-check'
}])*/
//const phasesTemplateSelected = ref(dataStore.phasesTemplates[0].id)
const changeActivePhase = (phase) => {
const changeActivePhase = async (phase) => {
itemInfo.value = await useSupabaseSelectSingle("projects",route.params.id,'*')
itemInfo.value.phases = itemInfo.value.phases.map(p => {
if(p.active) delete p.active
@@ -175,8 +179,8 @@ const changeActivePhase = (phase) => {
return p
})
savePhases()
await savePhases()
setupPage()
}
const savePhases = () => {
@@ -396,6 +400,8 @@ const loadPhases = async () => {
]"
@select="(row) => row.state === 'Entwurf' ? router.push(`/createDocument/edit/${row.id}`) : router.push(`/createDocument/show/${row.id}`)"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine zugehörigen erstellten Dokumente' }"
>
<template #type-data="{row}">
<span v-if="row.type === 'invoices'">Rechnung</span>

View File

@@ -120,8 +120,6 @@ const selectedItem = ref(0)
const setupPage = async () => {
items.value = await useSupabaseSelect("projects","*, customer (name), plant(name)")
console.log(items.value)
}
setupPage()