Restructuring in Project Page

Added Project Number
This commit is contained in:
2024-08-29 22:31:34 +02:00
parent 133fd1d892
commit 26f8d8f710
3 changed files with 115 additions and 88 deletions

View File

@@ -39,10 +39,6 @@ const tabItems = [
key: "information", key: "information",
label: "Informationen" label: "Informationen"
}, },
{
key: "historyDisplay",
label: "Logbuch"
},
{ {
key: "phases", key: "phases",
label: "Phasen" label: "Phasen"
@@ -255,19 +251,17 @@ const loadPhases = async () => {
v-model="openTab" v-model="openTab"
> >
<template #item="{ item }"> <template #item="{ item }">
<div v-if="item.key === 'information'" class="flex flex-row">
<div class="w-1/2 mr-3">
<UCard class="mt-5"> <UCard class="mt-5">
<div v-if="item.key === 'information'">
<div class="text-wrap"> <div class="text-wrap">
<p>Kunde: <nuxt-link :to="`/customers/show/${itemInfo.customer.id}`">{{itemInfo.customer.name}}</nuxt-link></p> <p>Kunde: <nuxt-link :to="`/customers/show/${itemInfo.customer.id}`">{{itemInfo.customer.name}}</nuxt-link></p>
<p>Objekt: <nuxt-link v-if="itemInfo.plant" :to="`/plants/show/${itemInfo.plant.id}`">{{itemInfo.plant ? itemInfo.plant.name : ""}}</nuxt-link><span v-else>-</span></p> <p>Objekt: <nuxt-link v-if="itemInfo.plant" :to="`/plants/show/${itemInfo.plant.id}`">{{itemInfo.plant ? itemInfo.plant.name : ""}}</nuxt-link><span v-else>-</span></p>
<p class="">Notizen: {{itemInfo.notes}}</p> <p class="">Notizen: {{itemInfo.notes}}</p>
</div> </div>
</UCard>
<UDivider class="my-3"/> <UCard class="mt-3">
<h1 class="font-bold text-lg my-3">Beteiligte Benutzer:</h1> <h1 class="font-bold text-lg mb-3">Beteiligte Benutzer:</h1>
<UAlert <UAlert
v-for="projectUser in itemInfo.users" v-for="projectUser in itemInfo.users"
:avatar="{ alt: dataStore.getProfileById(projectUser).fullName }" :avatar="{ alt: dataStore.getProfileById(projectUser).fullName }"
@@ -275,15 +269,24 @@ const loadPhases = async () => {
class="mb-3" class="mb-3"
/> />
</UCard>
</div> </div>
<div v-else-if="item.key === 'historyDisplay'"> <div class="w-1/2">
<UCard class="mt-5">
<HistoryDisplay <HistoryDisplay
type="project" type="project"
v-if="itemInfo" v-if="itemInfo"
:element-id="itemInfo.id" :element-id="itemInfo.id"
render-headline
/> />
</UCard>
</div>
</div> </div>
<div v-if="item.key === 'phases'" class="space-y-3"> <div v-if="item.key === 'phases'" class="space-y-3">
<UCard class="mt-5">
<UFormGroup <UFormGroup
label="Vorlage laden" label="Vorlage laden"
v-if="itemInfo.phases.length === 0" v-if="itemInfo.phases.length === 0"
@@ -345,8 +348,10 @@ const loadPhases = async () => {
</InputGroup> </InputGroup>
</template> </template>
</UAccordion> </UAccordion>
</UCard>
</div> </div>
<!--<div v-if="item.key === 'tasks'" class="space-y-3"> <div v-if="item.key === 'tasks'" class="space-y-3">
<UCard class="mt-5">
<Toolbar> <Toolbar>
<UButton <UButton
@click="router.push(`/tasks/create?project=${itemInfo.id}`)" @click="router.push(`/tasks/create?project=${itemInfo.id}`)"
@@ -366,23 +371,22 @@ const loadPhases = async () => {
{{dataStore.profiles.find(i => i.id === row.user) ? dataStore.profiles.find(i => i.id === row.user).fullName : ""}} {{dataStore.profiles.find(i => i.id === row.user) ? dataStore.profiles.find(i => i.id === row.user).fullName : ""}}
</template> </template>
</UTable> </UTable>
</UCard>
</div> </div>
<div v-else-if="item.key === 'documents'" class="space-y-3"> <div v-else-if="item.key === 'documents'" class="space-y-3">
<UCard class="mt-5">
<Toolbar> <Toolbar>
<DocumentUpload <DocumentUpload
type="project" type="project"
:element-id="itemInfo.id" :element-id="itemInfo.id"
/> />
<UButton <UButton
@click="router.push(`/createDocument/edit?project=${itemInfo.id}&type=quotes&customer=${itemInfo.customer.id}`)" @click="router.push(`/createDocument/edit?project=${itemInfo.id}&customer=${itemInfo.customer.id}`)"
> >
+ Angebot + Dokument
</UButton>
<UButton
@click="router.push(`/createDocument/edit?project=${itemInfo.id}&type=invoices&customer=${itemInfo.customer.id}`)"
>
+ Rechnung
</UButton> </UButton>
</Toolbar> </Toolbar>
@@ -419,12 +423,14 @@ const loadPhases = async () => {
</UTable> </UTable>
<DocumentList :documents="dataStore.getDocumentsByProjectId(itemInfo.id)"/> <DocumentList :documents="dataStore.getDocumentsByProjectId(itemInfo.id)"/>
&lt;!&ndash; </UCard>
{{dataStore.getDocumentsByProjectId(itemInfo.id)}}
&ndash;&gt;
</div> </div>
<div v-else-if="item.key === 'timetracking'" class="space-y-3"> <div v-else-if="item.key === 'timetracking'" class="space-y-3">
<UCard class="mt-5">
Projekt Zeit: {{String(projectHours()).replace(".",",")}} Stunden Projekt Zeit: {{String(projectHours()).replace(".",",")}} Stunden
<UTable <UTable
:rows="dataStore.getTimesByProjectId(itemInfo.id)" :rows="dataStore.getTimesByProjectId(itemInfo.id)"
@@ -445,8 +451,12 @@ const loadPhases = async () => {
</template> </template>
</UTable> </UTable>
</UCard>
</div> </div>
<div v-else-if="item.key === 'events'" class="space-y-3"> <div v-else-if="item.key === 'events'" class="space-y-3">
<UCard class="mt-5">
<Toolbar> <Toolbar>
<UButton <UButton
@click="router.push(`/events/edit`)" @click="router.push(`/events/edit`)"
@@ -470,12 +480,13 @@ const loadPhases = async () => {
{{row.resources.map(i => i.title).join(", ")}} {{row.resources.map(i => i.title).join(", ")}}
</template> </template>
</UTable> </UTable>
</UCard>
</div> </div>
<div v-else-if="item.key === 'material'" class="space-y-3"> <div v-else-if="item.key === 'material'" class="space-y-3">
<UCard class="mt-5">
Auf das Projekt gebuchte Artikel: Auf das Projekt gebuchte Artikel:
&lt;!&ndash; <UTable <!-- <UTable
:rows="dataStore.getStocksByProjectId(itemInfo.id)" :rows="dataStore.getStocksByProjectId(itemInfo.id)"
:columns="[{key:'productId',label:'Artikel'},{key:'stock',label:'Anzahl'}]" :columns="[{key:'productId',label:'Artikel'},{key:'stock',label:'Anzahl'}]"
@select="(i) => router.push(`/products/show/${i.productId}`)" @select="(i) => router.push(`/products/show/${i.productId}`)"
@@ -487,10 +498,10 @@ const loadPhases = async () => {
{{dataStore.getProductById(row.productId)}} {{dataStore.getProductById(row.productId)}}
{{row.stock}} {{dataStore.units.find(i => i.id === dataStore.getProductById(row.productId).unit).short}} {{row.stock}} {{dataStore.units.find(i => i.id === dataStore.getProductById(row.productId).unit).short}}
</template> </template>
</UTable>&ndash;&gt; </UTable>-->
</div>-->
</UCard> </UCard>
</div>
</template> </template>
@@ -505,6 +516,15 @@ const loadPhases = async () => {
/> />
</UFormGroup> </UFormGroup>
<UFormGroup
label="Projektnummer:"
>
<UInput
v-model="itemInfo.projectNumber"
placeholder="Leer lassen für automatisch generierte Nummer"
/>
</UFormGroup>
<UFormGroup <UFormGroup
label="Kundennummer:" label="Kundennummer:"
> >

View File

@@ -119,12 +119,16 @@ const items = ref([])
const selectedItem = ref(0) const selectedItem = ref(0)
const setupPage = async () => { const setupPage = async () => {
items.value = await useSupabaseSelect("projects","*, customer (name), plant(name)") items.value = await useSupabaseSelect("projects","*, customer (name), plant(name)","projectNumber")
} }
setupPage() setupPage()
const templateColumns = [ const templateColumns = [
{
key: "projectNumber",
label: "Projektnummer"
},
{ {
key: "phase", key: "phase",
label: "Phase" label: "Phase"

View File

@@ -29,6 +29,9 @@ const resources = {
}, },
inventoryitems: { inventoryitems: {
label: "Inventarartikel" label: "Inventarartikel"
},
projects: {
label: "Projekte"
} }
} }