Deprecated Events as non Standard Entity
Repaired query Reparied Document Show
This commit is contained in:
@@ -32,6 +32,7 @@ defineShortcuts({
|
||||
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const dataStore = useDataStore()
|
||||
const profileStore = useProfileStore()
|
||||
const supabase = useSupabaseClient()
|
||||
@@ -64,9 +65,23 @@ const setupCreate = () => {
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
setupCreate()
|
||||
|
||||
const setupQuery = () => {
|
||||
if(route.query) {
|
||||
console.log(route.query)
|
||||
|
||||
Object.keys(route.query).forEach(key => {
|
||||
if(["customer","contract","plant","contact"].includes(key)){
|
||||
props.item[key] = Number(route.query[key])
|
||||
} else {
|
||||
props.item[key] = route.query[key]
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
setupQuery()
|
||||
|
||||
const loadedOptions = ref({})
|
||||
const loadOptions = async () => {
|
||||
let optionsToLoad = dataType.templateColumns.filter(i => i.selectDataType).map(i => {
|
||||
@@ -315,7 +330,7 @@ const contentChanged = (content, datapoint) => {
|
||||
</div>
|
||||
</div>
|
||||
<UFormGroup
|
||||
v-for="datapoint in dataType.templateColumns.filter(i => i.inputType && i.inputColumn === columnName)"
|
||||
v-for="datapoint in dataType.templateColumns.filter(i => i.inputType)"
|
||||
:label="datapoint.label"
|
||||
>
|
||||
<template #help>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup>
|
||||
import dayjs from "dayjs";
|
||||
import {useSupabaseSelectSomeDocuments} from "~/composables/useSupabase.js";
|
||||
|
||||
const props = defineProps({
|
||||
type: {
|
||||
@@ -37,6 +38,17 @@ const profileStore = useProfileStore()
|
||||
|
||||
const dataType = dataStore.dataTypes[type]
|
||||
|
||||
const documents = ref([])
|
||||
|
||||
const setup = async () => {
|
||||
if(props.item.documents) {
|
||||
documents.value = await useSupabaseSelectSomeDocuments(props.item.documents.map(i => i.id)) || []
|
||||
}
|
||||
}
|
||||
|
||||
setup()
|
||||
|
||||
|
||||
const openTab = ref(0)
|
||||
|
||||
const renderedPhases = computed(() => {
|
||||
@@ -162,17 +174,16 @@ const renderedPhases = computed(() => {
|
||||
</div>
|
||||
<div v-else-if="item.label === 'Dokumente'">
|
||||
<UCard class="mt-5">
|
||||
<!-- <Toolbar>
|
||||
<DocumentUpload
|
||||
type="vehicle"
|
||||
:element-id="item.id"
|
||||
/>
|
||||
</Toolbar>
|
||||
<Toolbar>
|
||||
<DocumentUpload
|
||||
:type="type.substring(0,type.length-1)"
|
||||
:element-id="item.id"
|
||||
/>
|
||||
</Toolbar>
|
||||
|
||||
<DocumentList
|
||||
:documents="dataStore.getDocumentsByVehicleId(item.id)"
|
||||
/>-->
|
||||
{{props.item.documents}}
|
||||
<DocumentList
|
||||
:documents="documents"
|
||||
/>
|
||||
</UCard>
|
||||
</div>
|
||||
<div v-else-if="item.label === 'Projekte'">
|
||||
@@ -206,6 +217,12 @@ const renderedPhases = computed(() => {
|
||||
>
|
||||
+ Objekt
|
||||
</UButton>
|
||||
<UButton
|
||||
v-if="type === 'customers'"
|
||||
@click="router.push(`/standardEntity/plants/create?${type.substring(0,type.length-1)}=${props.item.id}&name=${encodeURIComponent(`${props.item.infoData.street}, ${props.item.infoData.zip} ${props.item.infoData.city}`)}`)"
|
||||
>
|
||||
+ Kundenadresse als Objekt
|
||||
</UButton>
|
||||
</Toolbar>
|
||||
<UTable
|
||||
:rows="props.item.plants"
|
||||
|
||||
@@ -35,7 +35,7 @@ const links = computed(() => {
|
||||
}] : [],
|
||||
... profileStore.ownTenant.features.calendar ? [{
|
||||
label: "Termine",
|
||||
to: "/events",
|
||||
to: "/standardEntity/events",
|
||||
icon: "i-heroicons-calendar-days"
|
||||
}] : [],
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user