Reactivated Phases
This commit is contained in:
@@ -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})
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
</script>
|
||||
@@ -257,7 +262,7 @@ const loadPhases = async () => {
|
||||
|
||||
<div class="text-wrap">
|
||||
<p>Kunde: <nuxt-link :to="`/customers/show/${itemInfo.customer.id}`">{{itemInfo.customer.name}}</nuxt-link></p>
|
||||
<p>Objekt: <nuxt-link :to="`/plants/show/${itemInfo.plant.id}`">{{itemInfo.plant ? itemInfo.plant.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 class="">Notizen: {{itemInfo.notes}}</p>
|
||||
</div>
|
||||
|
||||
@@ -283,9 +288,9 @@ const loadPhases = async () => {
|
||||
label="Vorlage laden"
|
||||
v-if="itemInfo.phases.length === 0"
|
||||
>
|
||||
<!-- <InputGroup>
|
||||
<InputGroup>
|
||||
<USelectMenu
|
||||
:options="dataStore.phasesTemplates"
|
||||
:options="phasesTemplates"
|
||||
option-attribute="name"
|
||||
value-attribute="id"
|
||||
v-model="phasesTemplateSelected"
|
||||
@@ -298,7 +303,7 @@ const loadPhases = async () => {
|
||||
>
|
||||
Vorlage laden
|
||||
</UButton>
|
||||
</InputGroup> TODO: Reactivate-->
|
||||
</InputGroup>
|
||||
|
||||
</UFormGroup>
|
||||
|
||||
@@ -341,7 +346,7 @@ const loadPhases = async () => {
|
||||
</template>
|
||||
</UAccordion>
|
||||
</div>
|
||||
<div v-if="item.key === 'tasks'" class="space-y-3">
|
||||
<!--<div v-if="item.key === 'tasks'" class="space-y-3">
|
||||
<Toolbar>
|
||||
<UButton
|
||||
@click="router.push(`/tasks/create?project=${itemInfo.id}`)"
|
||||
@@ -414,12 +419,11 @@ const loadPhases = async () => {
|
||||
</UTable>
|
||||
|
||||
<DocumentList :documents="dataStore.getDocumentsByProjectId(itemInfo.id)"/>
|
||||
<!--
|
||||
<!–
|
||||
{{dataStore.getDocumentsByProjectId(itemInfo.id)}}
|
||||
-->
|
||||
–>
|
||||
|
||||
</div>
|
||||
|
||||
<div v-else-if="item.key === 'timetracking'" class="space-y-3">
|
||||
Projekt Zeit: {{String(projectHours()).replace(".",",")}} Stunden
|
||||
<UTable
|
||||
@@ -471,7 +475,7 @@ const loadPhases = async () => {
|
||||
<div v-else-if="item.key === 'material'" class="space-y-3">
|
||||
Auf das Projekt gebuchte Artikel:
|
||||
|
||||
<!-- <UTable
|
||||
<!– <UTable
|
||||
:rows="dataStore.getStocksByProjectId(itemInfo.id)"
|
||||
:columns="[{key:'productId',label:'Artikel'},{key:'stock',label:'Anzahl'}]"
|
||||
@select="(i) => router.push(`/products/show/${i.productId}`)"
|
||||
@@ -483,9 +487,9 @@ const loadPhases = async () => {
|
||||
{{dataStore.getProductById(row.productId)}}
|
||||
{{row.stock}} {{dataStore.units.find(i => i.id === dataStore.getProductById(row.productId).unit).short}}
|
||||
</template>
|
||||
</UTable>-->
|
||||
</UTable>–>
|
||||
|
||||
</div>
|
||||
</div>-->
|
||||
</UCard>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user