Introduced EntityEdit.vue
Introduced EntityShow.vue Deprecated following as non standardEntity contracts, customers, vendors, projects, plants, vehicles
This commit is contained in:
280
components/EntityEdit.vue
Normal file
280
components/EntityEdit.vue
Normal file
@@ -0,0 +1,280 @@
|
|||||||
|
<script setup>
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
type: {
|
||||||
|
required: true,
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
item: {
|
||||||
|
required: true,
|
||||||
|
type: Object
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const {type} = props
|
||||||
|
|
||||||
|
defineShortcuts({
|
||||||
|
'backspace': () => {
|
||||||
|
router.push(`/${type}`)
|
||||||
|
},
|
||||||
|
'arrowleft': () => {
|
||||||
|
if(openTab.value > 0){
|
||||||
|
openTab.value -= 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'arrowright': () => {
|
||||||
|
if(openTab.value < 3) {
|
||||||
|
openTab.value += 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
|
const dataStore = useDataStore()
|
||||||
|
const profileStore = useProfileStore()
|
||||||
|
const supabase = useSupabaseClient()
|
||||||
|
|
||||||
|
const dataType = dataStore.dataTypes[type]
|
||||||
|
const openTab = ref(0)
|
||||||
|
|
||||||
|
const oldItem = ref(null)
|
||||||
|
const generateOldItemData = () => {
|
||||||
|
oldItem.value = JSON.parse(JSON.stringify(props.item))
|
||||||
|
}
|
||||||
|
generateOldItemData()
|
||||||
|
|
||||||
|
|
||||||
|
const setupCreate = () => {
|
||||||
|
dataType.templateColumns.forEach(datapoint => {
|
||||||
|
if(datapoint.key.includes(".")){
|
||||||
|
props.item[datapoint.key.split(".")[0]] = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(datapoint.inputType === "editor") {
|
||||||
|
if(datapoint.key.includes(".")){
|
||||||
|
props.item[datapoint.key.split(".")[0]][datapoint.key.split(".")[1]] = {}
|
||||||
|
} else {
|
||||||
|
props.item[datapoint.key] = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setupCreate()
|
||||||
|
|
||||||
|
const loadedOptions = ref({})
|
||||||
|
const loadOptions = async () => {
|
||||||
|
let optionsToLoad = dataType.templateColumns.filter(i => i.selectDataType).map(i => {
|
||||||
|
return {
|
||||||
|
option: i.selectDataType,
|
||||||
|
key: i.key
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
for await(const option of optionsToLoad) {
|
||||||
|
if(option.option === "countrys") {
|
||||||
|
loadedOptions.value[option.option] = (await supabase.from("countrys").select()).data
|
||||||
|
} else {
|
||||||
|
loadedOptions.value[option.option] = (await useSupabaseSelect(option.option))
|
||||||
|
|
||||||
|
if(dataType.templateColumns.find(x => x.key === option.key).selectDataTypeFilter){
|
||||||
|
loadedOptions.value[option.option] = loadedOptions.value[option.option].filter(i => dataType.templateColumns.find(x => x.key === option.key).selectDataTypeFilter(i, props.item))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
loadOptions()
|
||||||
|
|
||||||
|
const contentChanged = (content, datapoint) => {
|
||||||
|
if(datapoint.key.includes(".")){
|
||||||
|
props.item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]].html = content.html
|
||||||
|
props.item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]].text = content.text
|
||||||
|
props.item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]].json = content.json
|
||||||
|
} else {
|
||||||
|
props.item[datapoint.key].html = content.html
|
||||||
|
props.item[datapoint.key].text = content.text
|
||||||
|
props.item[datapoint.key].json = content.json
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<UDashboardNavbar
|
||||||
|
:ui="{center: 'flex items-stretch gap-1.5 min-w-0'}"
|
||||||
|
>
|
||||||
|
<template #left>
|
||||||
|
<UButton
|
||||||
|
icon="i-heroicons-chevron-left"
|
||||||
|
variant="outline"
|
||||||
|
@click="router.push(`/standardEntity/${type}`)"
|
||||||
|
>
|
||||||
|
{{dataType.label}}
|
||||||
|
</UButton>
|
||||||
|
</template>
|
||||||
|
<template #center>
|
||||||
|
<h1
|
||||||
|
v-if="props.item"
|
||||||
|
:class="['text-xl','font-medium']"
|
||||||
|
>{{props.item.id ? `${dataType.labelSingle} bearbeiten` : `${dataType.labelSingle} erstellen` }}</h1>
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<UButton
|
||||||
|
v-if="props.item.id"
|
||||||
|
@click="dataStore.updateItem(type,props.item, oldItem)"
|
||||||
|
>
|
||||||
|
Speichern
|
||||||
|
</UButton>
|
||||||
|
<UButton
|
||||||
|
v-else
|
||||||
|
@click="dataStore.createNewItem(type,props.item)"
|
||||||
|
>
|
||||||
|
Erstellen
|
||||||
|
</UButton>
|
||||||
|
<UButton
|
||||||
|
@click="router.push(props.item.id ? `/standardEntity/${type}/show/${props.item.id}` : `/standardEntity/${type}`)"
|
||||||
|
color="red"
|
||||||
|
class="ml-2"
|
||||||
|
>
|
||||||
|
Abbrechen
|
||||||
|
</UButton>
|
||||||
|
</template>
|
||||||
|
</UDashboardNavbar>
|
||||||
|
<UDashboardPanelContent>
|
||||||
|
<UForm
|
||||||
|
class="p-5"
|
||||||
|
>
|
||||||
|
<UFormGroup
|
||||||
|
v-for="datapoint in dataType.templateColumns.filter(i => i.inputType)"
|
||||||
|
:label="datapoint.label"
|
||||||
|
>
|
||||||
|
<div v-if="datapoint.key.includes('.')">
|
||||||
|
<UInput
|
||||||
|
v-if="['text','number'].includes(datapoint.inputType)"
|
||||||
|
v-model="props.item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]]"
|
||||||
|
:type="datapoint.inputType"
|
||||||
|
:placeholder="datapoint.inputIsNumberRange ? 'Leer lassen für automatisch generierte Nummer' : ''"
|
||||||
|
/>
|
||||||
|
<UToggle
|
||||||
|
v-else-if="datapoint.inputType === 'bool'"
|
||||||
|
v-model="props.item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]]"
|
||||||
|
/>
|
||||||
|
<USelectMenu
|
||||||
|
v-else-if="datapoint.inputType === 'select'"
|
||||||
|
v-model="props.item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]]"
|
||||||
|
:option-attribute="datapoint.selectOptionAttribute"
|
||||||
|
:value-attribute="datapoint.selectValueAttribute || 'id'"
|
||||||
|
:options="datapoint.selectManualOptions || loadedOptions[datapoint.selectDataType]"
|
||||||
|
:searchable="datapoint.selectSearchAttributes"
|
||||||
|
:search-attributes="datapoint.selectSearchAttributes"
|
||||||
|
:multiple="datapoint.selectMultiple"
|
||||||
|
/>
|
||||||
|
<UTextarea
|
||||||
|
v-else-if="datapoint.inputType === 'textarea'"
|
||||||
|
v-model="props.item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]]"
|
||||||
|
rows="4"
|
||||||
|
/>
|
||||||
|
<UPopover :popper="{ placement: 'bottom-start' }" v-else-if="datapoint.inputType === 'date'">
|
||||||
|
<UButton
|
||||||
|
icon="i-heroicons-calendar-days-20-solid"
|
||||||
|
:label="props.item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]] ? dayjs(props.item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]]).format('DD.MM.YYYY') : 'Datum auswählen'"
|
||||||
|
variant="outline"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<template #panel="{ close }">
|
||||||
|
<LazyDatePicker v-model="props.item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]]" @close="close" />
|
||||||
|
</template>
|
||||||
|
</UPopover>
|
||||||
|
<Tiptap
|
||||||
|
v-else-if="datapoint.inputType === 'editor'"
|
||||||
|
@updateContent="(i) => contentChanged(i,datapoint)"
|
||||||
|
:preloadedContent="props.item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]].html"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<UInput
|
||||||
|
v-if="['text','number'].includes(datapoint.inputType)"
|
||||||
|
v-model="props.item[datapoint.key]"
|
||||||
|
:type="datapoint.inputType"
|
||||||
|
:placeholder="datapoint.inputIsNumberRange ? 'Leer lassen für automatisch generierte Nummer' : ''"
|
||||||
|
/>
|
||||||
|
<UToggle
|
||||||
|
v-else-if="datapoint.inputType === 'bool'"
|
||||||
|
v-model="props.item[datapoint.key]"
|
||||||
|
/>
|
||||||
|
<USelectMenu
|
||||||
|
v-else-if="datapoint.inputType === 'select'"
|
||||||
|
v-model="props.item[datapoint.key]"
|
||||||
|
:option-attribute="datapoint.selectOptionAttribute"
|
||||||
|
:value-attribute="datapoint.selectValueAttribute || 'id'"
|
||||||
|
:options="datapoint.selectManualOptions || loadedOptions[datapoint.selectDataType]"
|
||||||
|
:searchable="datapoint.selectSearchAttributes"
|
||||||
|
:search-attributes="datapoint.selectSearchAttributes"
|
||||||
|
:multiple="datapoint.selectMultiple"
|
||||||
|
searchable-placeholder="Suche..."
|
||||||
|
/>
|
||||||
|
<UTextarea
|
||||||
|
v-else-if="datapoint.inputType === 'textarea'"
|
||||||
|
v-model="props.item[datapoint.key]"
|
||||||
|
rows="4"
|
||||||
|
/>
|
||||||
|
<UPopover :popper="{ placement: 'bottom-start' }" v-else-if="datapoint.inputType === 'date'">
|
||||||
|
<UButton
|
||||||
|
icon="i-heroicons-calendar-days-20-solid"
|
||||||
|
:label="props.item[datapoint.key] ? dayjs(props.item[datapoint.key]).format('DD.MM.YYYY') : 'Datum auswählen'"
|
||||||
|
variant="outline"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<template #panel="{ close }">
|
||||||
|
<LazyDatePicker v-model="props.item[datapoint.key]" @close="close" />
|
||||||
|
</template>
|
||||||
|
</UPopover>
|
||||||
|
<Tiptap
|
||||||
|
v-else-if="datapoint.inputType === 'editor'"
|
||||||
|
@updateContent="(i) => contentChanged(i,datapoint)"
|
||||||
|
:preloadedContent="props.item[datapoint.key].html"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="profileStore.ownTenant.ownFields"
|
||||||
|
>
|
||||||
|
<UDivider
|
||||||
|
class="mt-3"
|
||||||
|
>Eigene Felder</UDivider>
|
||||||
|
|
||||||
|
<UFormGroup
|
||||||
|
v-for="field in profileStore.ownTenant.ownFields.contracts"
|
||||||
|
:key="field.key"
|
||||||
|
:label="field.label"
|
||||||
|
>
|
||||||
|
<UInput
|
||||||
|
v-if="field.type === 'text'"
|
||||||
|
v-model="props.item.ownFields[field.key]"
|
||||||
|
/>
|
||||||
|
<USelectMenu
|
||||||
|
v-else-if="field.type === 'select'"
|
||||||
|
:options="field.options"
|
||||||
|
v-model="props.item.ownFields[field.key]"
|
||||||
|
/>
|
||||||
|
</UFormGroup>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</UFormGroup>
|
||||||
|
</UForm>
|
||||||
|
</UDashboardPanelContent>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
td {
|
||||||
|
border-bottom: 1px solid lightgrey;
|
||||||
|
vertical-align: top;
|
||||||
|
padding-bottom: 0.15em;
|
||||||
|
padding-top: 0.15em;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -55,8 +55,8 @@ const dataType = dataStore.dataTypes[type]
|
|||||||
const selectedItem = ref(0)
|
const selectedItem = ref(0)
|
||||||
|
|
||||||
|
|
||||||
const selectedColumns = ref(dataType.templateColumns)
|
const selectedColumns = ref(dataType.templateColumns.filter(i => !i.disabledInTable))
|
||||||
const columns = computed(() => dataType.templateColumns.filter((column) => selectedColumns.value.includes(column)))
|
const columns = computed(() => dataType.templateColumns.filter((column) => !column.disabledInTable && selectedColumns.value.includes(column)))
|
||||||
|
|
||||||
const searchString = ref('')
|
const searchString = ref('')
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ const filteredRows = computed(() => {
|
|||||||
</template>
|
</template>
|
||||||
</UInput>
|
</UInput>
|
||||||
|
|
||||||
<UButton v-if="useRole().checkRight(`${type}-create`)" @click="router.push(`/${type}/create`)">+ {{dataType.labelSingle}}</UButton>
|
<UButton v-if="useRole().checkRight(`${type}-create`)" @click="router.push(`/standardEntity/${type}/create`)">+ {{dataType.labelSingle}}</UButton>
|
||||||
</template>
|
</template>
|
||||||
</UDashboardNavbar>
|
</UDashboardNavbar>
|
||||||
|
|
||||||
@@ -127,10 +127,11 @@ const filteredRows = computed(() => {
|
|||||||
<USelectMenu
|
<USelectMenu
|
||||||
v-model="selectedColumns"
|
v-model="selectedColumns"
|
||||||
icon="i-heroicons-adjustments-horizontal-solid"
|
icon="i-heroicons-adjustments-horizontal-solid"
|
||||||
:options="dataType.templateColumns"
|
:options="dataType.templateColumns.filter(i => !i.disabledInTable)"
|
||||||
multiple
|
multiple
|
||||||
class="hidden lg:block"
|
class="hidden lg:block"
|
||||||
by="key"
|
by="key"
|
||||||
|
:color="selectedColumns.length !== dataType.templateColumns.filter(i => !i.disabledInTable).length ? 'primary' : 'white'"
|
||||||
>
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
Spalten
|
Spalten
|
||||||
@@ -142,6 +143,7 @@ const filteredRows = computed(() => {
|
|||||||
multiple
|
multiple
|
||||||
v-model="selectedFilters"
|
v-model="selectedFilters"
|
||||||
:options="selectableFilters"
|
:options="selectableFilters"
|
||||||
|
:color="selectedFilters.length > 0 ? 'primary' : 'white'"
|
||||||
>
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
Filter
|
Filter
|
||||||
@@ -154,7 +156,7 @@ const filteredRows = computed(() => {
|
|||||||
:columns="columns"
|
:columns="columns"
|
||||||
class="w-full"
|
class="w-full"
|
||||||
:ui="{ divide: 'divide-gray-200 dark:divide-gray-800' }"
|
:ui="{ divide: 'divide-gray-200 dark:divide-gray-800' }"
|
||||||
@select="(i) => router.push(`/${type}/show/${i.id}`) "
|
@select="(i) => router.push(`/standardEntity/${type}/show/${i.id}`) "
|
||||||
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: `Keine ${dataType.label} anzuzeigen` }"
|
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: `Keine ${dataType.label} anzuzeigen` }"
|
||||||
>
|
>
|
||||||
<template #name-data="{row}">
|
<template #name-data="{row}">
|
||||||
@@ -185,10 +187,10 @@ const filteredRows = computed(() => {
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template
|
<template
|
||||||
v-for="column in dataType.templateColumns.filter(i => i.key !== 'name' && i.key !== 'fullName' && i.key !== 'licensePlate')"
|
v-for="column in dataType.templateColumns.filter(i => i.key !== 'name' && i.key !== 'fullName' && i.key !== 'licensePlate' && !i.disabledInTable)"
|
||||||
v-slot:[`${column.key}-data`]="{row}">
|
v-slot:[`${column.key}-data`]="{row}">
|
||||||
<component v-if="column.component" :is="column.component" :row="row"></component>
|
<component v-if="column.component" :is="column.component" :row="row"></component>
|
||||||
<span v-else>{{row[column.key]}}</span>
|
<span v-else>{{row[column.key] ? `${row[column.key]} ${column.unit ? column.unit : ''}`: ''}}</span>
|
||||||
</template>
|
</template>
|
||||||
</UTable>
|
</UTable>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
352
components/EntityShow.vue
Normal file
352
components/EntityShow.vue
Normal file
@@ -0,0 +1,352 @@
|
|||||||
|
<script setup>
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
type: {
|
||||||
|
required: true,
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
item: {
|
||||||
|
required: true,
|
||||||
|
type: Object
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const {type} = props
|
||||||
|
|
||||||
|
defineShortcuts({
|
||||||
|
'backspace': () => {
|
||||||
|
router.push(`/${type}`)
|
||||||
|
},
|
||||||
|
'arrowleft': () => {
|
||||||
|
if(openTab.value > 0){
|
||||||
|
openTab.value -= 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'arrowright': () => {
|
||||||
|
if(openTab.value < 3) {
|
||||||
|
openTab.value += 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
|
const dataStore = useDataStore()
|
||||||
|
const profileStore = useProfileStore()
|
||||||
|
|
||||||
|
const dataType = dataStore.dataTypes[type]
|
||||||
|
|
||||||
|
const openTab = ref(0)
|
||||||
|
|
||||||
|
const renderedPhases = computed(() => {
|
||||||
|
|
||||||
|
if(type === "projects" && props.item.phases) {
|
||||||
|
return props.item.phases.map((phase,index,array) => {
|
||||||
|
|
||||||
|
let isAvailable = false
|
||||||
|
|
||||||
|
if(phase.active) {
|
||||||
|
isAvailable = true
|
||||||
|
} else if(index > 0 && array[index-1].active ){
|
||||||
|
isAvailable = true
|
||||||
|
} else if(index > 1 && array[index-1].optional && array[index-2].active){
|
||||||
|
isAvailable = true
|
||||||
|
} else if(array.findIndex(i => i.active) > index) {
|
||||||
|
isAvailable = true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
...phase,
|
||||||
|
label: phase.optional ? `${phase.label}(optional)`: phase.label,
|
||||||
|
disabled: !isAvailable,
|
||||||
|
defaultOpen: phase.active ? true : false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<UDashboardNavbar
|
||||||
|
:ui="{center: 'flex items-stretch gap-1.5 min-w-0'}"
|
||||||
|
>
|
||||||
|
<template #left>
|
||||||
|
<UButton
|
||||||
|
icon="i-heroicons-chevron-left"
|
||||||
|
variant="outline"
|
||||||
|
@click="router.push(`/standardEntity/${type}`)"
|
||||||
|
>
|
||||||
|
{{dataType.label}}
|
||||||
|
</UButton>
|
||||||
|
</template>
|
||||||
|
<template #center>
|
||||||
|
<h1
|
||||||
|
v-if="item"
|
||||||
|
:class="['text-xl','font-medium']"
|
||||||
|
>{{item ? `${dataType.labelSingle}: ${props.item[dataType.templateColumns.find(i => i.title).key]}`: '' }}</h1>
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<ButtonWithConfirm
|
||||||
|
color="rose"
|
||||||
|
variant="outline"
|
||||||
|
@confirmed="dataStore.updateItem(type,{...item, archived: true})"
|
||||||
|
>
|
||||||
|
<template #button>
|
||||||
|
Archivieren
|
||||||
|
</template>
|
||||||
|
<template #header>
|
||||||
|
<span class="text-md text-black font-bold">Archivieren bestätigen</span>
|
||||||
|
</template>
|
||||||
|
Möchten Sie das Fahrzeug {{item.name}} wirklich archivieren?
|
||||||
|
</ButtonWithConfirm>
|
||||||
|
<UButton
|
||||||
|
@click="router.push(`/standardEntity/${type}/edit/${item.id}`)"
|
||||||
|
>
|
||||||
|
Bearbeiten
|
||||||
|
</UButton>
|
||||||
|
</template>
|
||||||
|
</UDashboardNavbar>
|
||||||
|
<UTabs
|
||||||
|
:items="dataType.showTabs"
|
||||||
|
v-if="props.item.id"
|
||||||
|
class="p-5"
|
||||||
|
v-model="openTab"
|
||||||
|
>
|
||||||
|
<template #item="{item}">
|
||||||
|
<div v-if="item.label === 'Informationen'" class="flex flex-row mt-5">
|
||||||
|
<UCard class="w-1/2 mr-5">
|
||||||
|
<UAlert
|
||||||
|
v-if="item.archived"
|
||||||
|
color="rose"
|
||||||
|
variant="outline"
|
||||||
|
:title="`${dataType.labelSingle} archiviert`"
|
||||||
|
icon="i-heroicons-light-bulb"
|
||||||
|
class="mb-5"
|
||||||
|
/>
|
||||||
|
<div class="text-wrap">
|
||||||
|
<table class="w-full">
|
||||||
|
<tbody>
|
||||||
|
<tr
|
||||||
|
v-for="datapoint in dataType.templateColumns"
|
||||||
|
>
|
||||||
|
<td>{{datapoint.label}}:</td>
|
||||||
|
<td>
|
||||||
|
<component v-if="datapoint.component" :is="datapoint.component" :row="props.item"></component>
|
||||||
|
<div v-else>
|
||||||
|
<span v-if="datapoint.key.includes('.')">{{props.item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]]}}{{datapoint.unit}}</span>
|
||||||
|
<span v-else>{{props.item[datapoint.key]}} {{datapoint.unit}}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</UCard>
|
||||||
|
<UCard class="w-1/2">
|
||||||
|
<HistoryDisplay
|
||||||
|
:type="type.substring(0,type.length-1)"
|
||||||
|
v-if="props.item.id"
|
||||||
|
:element-id="props.item.id"
|
||||||
|
render-headline
|
||||||
|
/>
|
||||||
|
</UCard>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="item.label === 'Dokumente'">
|
||||||
|
<UCard class="mt-5">
|
||||||
|
<!-- <Toolbar>
|
||||||
|
<DocumentUpload
|
||||||
|
type="vehicle"
|
||||||
|
:element-id="item.id"
|
||||||
|
/>
|
||||||
|
</Toolbar>
|
||||||
|
|
||||||
|
<DocumentList
|
||||||
|
:documents="dataStore.getDocumentsByVehicleId(item.id)"
|
||||||
|
/>-->
|
||||||
|
{{props.item.documents}}
|
||||||
|
</UCard>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="item.label === 'Projekte'">
|
||||||
|
<UCard class="mt-5">
|
||||||
|
<Toolbar>
|
||||||
|
<UButton
|
||||||
|
@click="router.push(`/standardEntity/projects/create?${type.substring(0,type.length-1)}=${props.item.id}`)"
|
||||||
|
>
|
||||||
|
+ Projekt
|
||||||
|
</UButton>
|
||||||
|
</Toolbar>
|
||||||
|
<UTable
|
||||||
|
:rows="props.item.projects"
|
||||||
|
@select="(row) => router.push(`/standardEntity/projects/show/${row.id}`)"
|
||||||
|
:columns="[{label: 'Name', key: 'name'},{label: 'Phase', key: 'phase'}]"
|
||||||
|
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine zugehörigen Projekte' }"
|
||||||
|
|
||||||
|
>
|
||||||
|
<template #phase-data="{row}">
|
||||||
|
{{row.phases ? row.phases.find(i => i.active).label : ""}}
|
||||||
|
</template>
|
||||||
|
</UTable>
|
||||||
|
|
||||||
|
</UCard>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="item.label === 'Objekte'">
|
||||||
|
<UCard class="mt-5">
|
||||||
|
<Toolbar>
|
||||||
|
<UButton
|
||||||
|
@click="router.push(`/standardEntity/plants/create?${type.substring(0,type.length-1)}=${props.item.id}`)"
|
||||||
|
>
|
||||||
|
+ Objekt
|
||||||
|
</UButton>
|
||||||
|
</Toolbar>
|
||||||
|
<UTable
|
||||||
|
:rows="props.item.plants"
|
||||||
|
@select="(row) => router.push(`/standardEntity/plants/show/${row.id}`)"
|
||||||
|
:columns="[{label: 'Name', key: 'name'}]"
|
||||||
|
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine zugehörigen Objekte' }"
|
||||||
|
|
||||||
|
>
|
||||||
|
|
||||||
|
</UTable>
|
||||||
|
</UCard>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="item.label === 'Aufgaben'">
|
||||||
|
<UCard class="mt-5">
|
||||||
|
<Toolbar>
|
||||||
|
<UButton
|
||||||
|
@click="router.push(`/standardEntity/tasks/create?${type.substring(0,type.length-1)}=${props.item.id}`)"
|
||||||
|
>
|
||||||
|
+ Aufgabe
|
||||||
|
</UButton>
|
||||||
|
</Toolbar>
|
||||||
|
<UTable
|
||||||
|
:rows="props.item.tasks"
|
||||||
|
@select="(row) => router.push(`/standardEntity/tasks/show/${row.id}`)"
|
||||||
|
:columns="[{label: 'Name', key: 'name'}]"
|
||||||
|
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine zugehörigen Aufgaben' }"
|
||||||
|
/>
|
||||||
|
</UCard>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="item.label === 'Verträge'">
|
||||||
|
<UCard class="mt-5">
|
||||||
|
<Toolbar>
|
||||||
|
<UButton
|
||||||
|
@click="router.push(`/standardEntity/contracts/create?${type.substring(0,type.length-1)}=${props.item.id}`)"
|
||||||
|
>
|
||||||
|
+ Vertrag
|
||||||
|
</UButton>
|
||||||
|
</Toolbar>
|
||||||
|
<UTable
|
||||||
|
:rows="props.item.contracts"
|
||||||
|
@select="(row) => router.push(`/standardEntity/contracts/show/${row.id}`)"
|
||||||
|
:columns="[{label: 'Name', key: 'name'},{label: 'Aktiv', key: 'active'}]"
|
||||||
|
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine zugehörigen Verträge' }"
|
||||||
|
|
||||||
|
></UTable>
|
||||||
|
</UCard>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="item.label === 'Überprüfungen'">
|
||||||
|
<UCard class="mt-5">
|
||||||
|
<UTable
|
||||||
|
:rows="props.item.checks"
|
||||||
|
:columns="[{key:'name',label: 'Name'},{key:'rhythm',label: 'Rhythmus'},{key:'description',label: 'Beschreibung'}]"
|
||||||
|
class="w-full"
|
||||||
|
:ui="{ divide: 'divide-gray-200 dark:divide-gray-800' }"
|
||||||
|
@select="(i) => router.push(`/checks/show/${i.id}`) "
|
||||||
|
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine Überprüfungen anzuzeigen' }"
|
||||||
|
>
|
||||||
|
<template #rhythm-data="{row}">
|
||||||
|
{{row.distance}}
|
||||||
|
<span v-if="row.distanceUnit === 'dayjs'">Tage</span>
|
||||||
|
<span v-if="row.distanceUnit === 'years'">Jahre</span>
|
||||||
|
</template>
|
||||||
|
</UTable>
|
||||||
|
</UCard>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="item.label === 'Phasen'">
|
||||||
|
<UCard class="mt-5">
|
||||||
|
<UAccordion
|
||||||
|
:items="renderedPhases"
|
||||||
|
>
|
||||||
|
<template #default="{item,index,open}">
|
||||||
|
<UButton
|
||||||
|
variant="ghost"
|
||||||
|
:color="item.active ? 'primary' : 'white'"
|
||||||
|
class="mb-1"
|
||||||
|
:disabled="true"
|
||||||
|
>
|
||||||
|
<template #leading>
|
||||||
|
<div class="w-6 h-6 flex items-center justify-center -my-1">
|
||||||
|
<UIcon :name="item.icon" class="w-4 h-4 " />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<span class="truncate"> {{item.label}}</span>
|
||||||
|
|
||||||
|
<template #trailing>
|
||||||
|
<UIcon
|
||||||
|
name="i-heroicons-chevron-right-20-solid"
|
||||||
|
class="w-5 h-5 ms-auto transform transition-transform duration-200"
|
||||||
|
:class="[open && 'rotate-90']"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</UButton>
|
||||||
|
</template>
|
||||||
|
<template #item="{item, index}">
|
||||||
|
<UCard class="mx-5">
|
||||||
|
<template #header>
|
||||||
|
<span class="text-black">{{item.label}}</span>
|
||||||
|
</template>
|
||||||
|
<InputGroup>
|
||||||
|
<!-- TODO: Reactive Change Phase -->
|
||||||
|
<UButton
|
||||||
|
v-if="!item.activated_at && index !== 0 "
|
||||||
|
@click="changeActivePhase(item.key)"
|
||||||
|
>
|
||||||
|
Phase aktivieren
|
||||||
|
</UButton>
|
||||||
|
<UButton
|
||||||
|
v-if="item.active"
|
||||||
|
v-for="button in item.quickactions"
|
||||||
|
@click="router.push(`${button.link}&customer=${itemInfo.customer.id}&project=${itemInfo.id}`)"
|
||||||
|
>
|
||||||
|
{{button.label}}
|
||||||
|
</UButton>
|
||||||
|
</InputGroup>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p v-if="item.activated_at" class="text-black">Aktiviert am: {{dayjs(item.activated_at).format("DD.MM.YY HH:mm")}} Uhr</p>
|
||||||
|
<p v-if="item.activated_by" class="text-black">Aktiviert durch: {{profileStore.getProfileById(item.activated_by).fullName}}</p>
|
||||||
|
<p v-if="item.description" class="text-black">Beschreibung: {{item.description}}</p>
|
||||||
|
</div>
|
||||||
|
</UCard>
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</UAccordion>
|
||||||
|
</UCard>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</UTabs>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
td {
|
||||||
|
border-bottom: 1px solid lightgrey;
|
||||||
|
vertical-align: top;
|
||||||
|
padding-bottom: 0.15em;
|
||||||
|
padding-top: 0.15em;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -72,17 +72,17 @@ const links = computed(() => {
|
|||||||
children: [
|
children: [
|
||||||
... role.checkRight("customers") ? [{
|
... role.checkRight("customers") ? [{
|
||||||
label: "Kunden",
|
label: "Kunden",
|
||||||
to: "/customers",
|
to: "/standardEntity/customers",
|
||||||
icon: "i-heroicons-user-group"
|
icon: "i-heroicons-user-group"
|
||||||
}] : [],
|
}] : [],
|
||||||
... role.checkRight("vendors") ? [{
|
... role.checkRight("vendors") ? [{
|
||||||
label: "Lieferanten",
|
label: "Lieferanten",
|
||||||
to: "/vendors",
|
to: "/standardEntity/vendors",
|
||||||
icon: "i-heroicons-truck"
|
icon: "i-heroicons-truck"
|
||||||
}] : [],
|
}] : [],
|
||||||
... role.checkRight("contacts") ? [{
|
... role.checkRight("contacts") ? [{
|
||||||
label: "Ansprechpartner",
|
label: "Ansprechpartner",
|
||||||
to: "/contacts",
|
to: "/standardEntity/contacts",
|
||||||
icon: "i-heroicons-user-group"
|
icon: "i-heroicons-user-group"
|
||||||
}] : [],
|
}] : [],
|
||||||
]
|
]
|
||||||
@@ -210,17 +210,17 @@ const links = computed(() => {
|
|||||||
},] : [],
|
},] : [],
|
||||||
... role.checkRight("projects") ? [{
|
... role.checkRight("projects") ? [{
|
||||||
label: "Projekte",
|
label: "Projekte",
|
||||||
to: "/projects",
|
to: "/standardEntity/projects",
|
||||||
icon: "i-heroicons-clipboard-document-check"
|
icon: "i-heroicons-clipboard-document-check"
|
||||||
},] : [],
|
},] : [],
|
||||||
... role.checkRight("contracts") ? [{
|
... role.checkRight("contracts") ? [{
|
||||||
label: "Verträge",
|
label: "Verträge",
|
||||||
to: "/contracts",
|
to: "/standardEntity/contracts",
|
||||||
icon: "i-heroicons-clipboard-document"
|
icon: "i-heroicons-clipboard-document"
|
||||||
}] : [],
|
}] : [],
|
||||||
... role.checkRight("plants") ? [{
|
... role.checkRight("plants") ? [{
|
||||||
label: "Objekte",
|
label: "Objekte",
|
||||||
to: "/plants",
|
to: "/standardEntity/plants",
|
||||||
icon: "i-heroicons-clipboard-document"
|
icon: "i-heroicons-clipboard-document"
|
||||||
},] : [],
|
},] : [],
|
||||||
|
|
||||||
|
|||||||
@@ -9,5 +9,6 @@ const props = defineProps({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<span>{{props.row.active ? 'Ja' : 'Nein'}}</span>
|
<span v-if="props.row.active" class="text-primary">Ja</span>
|
||||||
|
<span v-else class="text-rose-600">Nein</span>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
17
components/columnRenderings/address.vue
Normal file
17
components/columnRenderings/address.vue
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<script setup>
|
||||||
|
const props = defineProps({
|
||||||
|
row: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
default: {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<span v-if="props.row.infoData.streetNumber">{{props.row.infoData.streetNumber}},</span>
|
||||||
|
<span v-if="props.row.infoData.special">{{props.row.infoData.special}},</span>
|
||||||
|
<span v-if="props.row.infoData.zip">{{props.row.infoData.zip}},</span>
|
||||||
|
<span v-if="props.row.infoData.city">{{props.row.infoData.city}}</span>
|
||||||
|
|
||||||
|
</template>
|
||||||
13
components/columnRenderings/contact.vue
Normal file
13
components/columnRenderings/contact.vue
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<script setup>
|
||||||
|
const props = defineProps({
|
||||||
|
row: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
default: {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<span>{{props.row.contact ? props.row.contact.name : ''}}</span>
|
||||||
|
</template>
|
||||||
13
components/columnRenderings/description.vue
Normal file
13
components/columnRenderings/description.vue
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<script setup>
|
||||||
|
const props = defineProps({
|
||||||
|
row: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
default: {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div v-if="props.row.description" v-html="props.row.description.html"/>
|
||||||
|
</template>
|
||||||
13
components/columnRenderings/isCompany.vue
Normal file
13
components/columnRenderings/isCompany.vue
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<script setup>
|
||||||
|
const props = defineProps({
|
||||||
|
row: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
default: {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<span>{{props.row.isCompany ? 'Unternehmen' : 'Privat'}}</span>
|
||||||
|
</template>
|
||||||
14
components/columnRenderings/recurring.vue
Normal file
14
components/columnRenderings/recurring.vue
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<script setup>
|
||||||
|
const props = defineProps({
|
||||||
|
row: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
default: {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<span v-if="props.row.recurring">Ja</span>
|
||||||
|
<span v-else>Nein</span>
|
||||||
|
</template>
|
||||||
14
components/columnRenderings/sepa.vue
Normal file
14
components/columnRenderings/sepa.vue
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<script setup>
|
||||||
|
const props = defineProps({
|
||||||
|
row: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
default: {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<span v-if="props.row.hasSEPA">Ja</span>
|
||||||
|
<span v-else>Nein</span>
|
||||||
|
</template>
|
||||||
@@ -252,92 +252,95 @@ setup()
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<table class="w-full" v-if="itemInfo.id">
|
<table class="w-full" v-if="itemInfo.id">
|
||||||
<tr class="flex-row flex justify-between">
|
<tbody>
|
||||||
<td>
|
<tr class="flex-row flex justify-between">
|
||||||
<span class="font-semibold">Buchungsdatum:</span>
|
<td>
|
||||||
</td>
|
<span class="font-semibold">Buchungsdatum:</span>
|
||||||
<td>
|
</td>
|
||||||
{{dayjs(itemInfo.date).format("DD.MM.YYYY")}}
|
<td>
|
||||||
</td>
|
{{dayjs(itemInfo.date).format("DD.MM.YYYY")}}
|
||||||
</tr>
|
</td>
|
||||||
<tr class="flex-row flex justify-between">
|
</tr>
|
||||||
<td>
|
<tr class="flex-row flex justify-between">
|
||||||
<span class="font-semibold">Wertstellungsdatum:</span>
|
<td>
|
||||||
</td>
|
<span class="font-semibold">Wertstellungsdatum:</span>
|
||||||
<td>
|
</td>
|
||||||
{{dayjs(itemInfo.valueDate).format("DD.MM.YYYY")}}
|
<td>
|
||||||
</td>
|
{{dayjs(itemInfo.valueDate).format("DD.MM.YYYY")}}
|
||||||
</tr>
|
</td>
|
||||||
<tr class="flex-row flex justify-between text-right">
|
</tr>
|
||||||
<td>
|
<tr class="flex-row flex justify-between text-right">
|
||||||
<span class="font-semibold">Partner:</span>
|
<td>
|
||||||
</td>
|
<span class="font-semibold">Partner:</span>
|
||||||
<td>
|
</td>
|
||||||
{{itemInfo.amount > 0 ? itemInfo.debName : itemInfo.credName}}
|
<td>
|
||||||
|
{{itemInfo.amount > 0 ? itemInfo.debName : itemInfo.credName}}
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="flex-row flex justify-between">
|
<tr class="flex-row flex justify-between">
|
||||||
<td>
|
<td>
|
||||||
<span class="font-semibold">Partner IBAN:</span>
|
<span class="font-semibold">Partner IBAN:</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{itemInfo.amount > 0 ? separateIBAN(itemInfo.debIban) : separateIBAN(itemInfo.credIban)}}
|
{{itemInfo.amount > 0 ? separateIBAN(itemInfo.debIban) : separateIBAN(itemInfo.credIban)}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="flex-row flex justify-between">
|
<tr class="flex-row flex justify-between">
|
||||||
<td>
|
<td>
|
||||||
<span class="font-semibold">Konto:</span>
|
<span class="font-semibold">Konto:</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{dataStore.getBankAccountById(itemInfo.account) ? dataStore.getBankAccountById(itemInfo.account).name || separateIBAN(dataStore.getBankAccountById(itemInfo.account).iban) : ""}}
|
{{dataStore.getBankAccountById(itemInfo.account) ? dataStore.getBankAccountById(itemInfo.account).name || separateIBAN(dataStore.getBankAccountById(itemInfo.account).iban) : ""}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="flex-row flex justify-between">
|
<tr class="flex-row flex justify-between">
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<span class="font-semibold">Verknüpfte Dokumente:</span>
|
<span class="font-semibold">Verknüpfte Dokumente:</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr
|
<tr
|
||||||
class="flex-row flex justify-between mb-3"
|
class="flex-row flex justify-between mb-3"
|
||||||
v-for="item in itemInfo.statementallocations"
|
v-for="item in itemInfo.statementallocations"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<!-- <span v-if="itemInfo.createdDocument"><nuxt-link :to="`/createDocument/show/${itemInfo.createdDocument}`">{{dataStore.createddocuments.find(i => i.id === itemInfo.createdDocument).documentNumber}}</nuxt-link></span>
|
||||||
|
<span v-else-if="itemInfo.incomingInvoice"><nuxt-link :to="`/incominInvoices/show/${itemInfo.incomingInvoice}`">{{dataStore.getIncomingInvoiceById(itemInfo.incomingInvoice).reference}}</nuxt-link></span>-->
|
||||||
|
<span v-if="item.cd_id">
|
||||||
|
{{dataStore.getCreatedDocumentById(item.cd_id).documentNumber}}
|
||||||
|
</span>
|
||||||
|
<span v-else-if="item.ii_id">
|
||||||
|
{{dataStore.getVendorById(dataStore.getIncomingInvoiceById(item.ii_id).vendor).name}} - {{dataStore.getIncomingInvoiceById(item.ii_id).reference}}
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<UButton
|
||||||
|
variant="outline"
|
||||||
|
icon="i-heroicons-arrow-right-end-on-rectangle"
|
||||||
|
@click="router.push(`/createDocument/show/${item.cd_id}`)"
|
||||||
|
v-if="item.cd_id"
|
||||||
|
/>
|
||||||
|
<UButton
|
||||||
|
variant="outline"
|
||||||
|
icon="i-heroicons-arrow-right-end-on-rectangle"
|
||||||
|
@click="router.push(`/incominginvoices/show/${item.ii_id}`)"
|
||||||
|
v-else-if="item.ii_id"
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="flex-row flex justify-between">
|
||||||
|
<td colspan="2">
|
||||||
|
<span class="font-semibold">Beschreibung:</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
{{itemInfo.text}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
<td>
|
|
||||||
<!-- <span v-if="itemInfo.createdDocument"><nuxt-link :to="`/createDocument/show/${itemInfo.createdDocument}`">{{dataStore.createddocuments.find(i => i.id === itemInfo.createdDocument).documentNumber}}</nuxt-link></span>
|
|
||||||
<span v-else-if="itemInfo.incomingInvoice"><nuxt-link :to="`/incominInvoices/show/${itemInfo.incomingInvoice}`">{{dataStore.getIncomingInvoiceById(itemInfo.incomingInvoice).reference}}</nuxt-link></span>-->
|
|
||||||
<span v-if="item.cd_id">
|
|
||||||
{{dataStore.getCreatedDocumentById(item.cd_id).documentNumber}}
|
|
||||||
</span>
|
|
||||||
<span v-else-if="item.ii_id">
|
|
||||||
{{dataStore.getVendorById(dataStore.getIncomingInvoiceById(item.ii_id).vendor).name}} - {{dataStore.getIncomingInvoiceById(item.ii_id).reference}}
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<UButton
|
|
||||||
variant="outline"
|
|
||||||
icon="i-heroicons-arrow-right-end-on-rectangle"
|
|
||||||
@click="router.push(`/createDocument/show/${item.cd_id}`)"
|
|
||||||
v-if="item.cd_id"
|
|
||||||
/>
|
|
||||||
<UButton
|
|
||||||
variant="outline"
|
|
||||||
icon="i-heroicons-arrow-right-end-on-rectangle"
|
|
||||||
@click="router.push(`/incominginvoices/show/${item.ii_id}`)"
|
|
||||||
v-else-if="item.ii_id"
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="flex-row flex justify-between">
|
|
||||||
<td colspan="2">
|
|
||||||
<span class="font-semibold">Beschreibung:</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
{{itemInfo.text}}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</UCard>
|
</UCard>
|
||||||
|
|||||||
@@ -1388,379 +1388,379 @@ setupPage()
|
|||||||
|
|
||||||
<table class="w-full" v-if="itemInfo.rows.length > 0">
|
<table class="w-full" v-if="itemInfo.rows.length > 0">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th>Pos.</th>
|
<th>Pos.</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Menge</th>
|
<th>Menge</th>
|
||||||
<th>Einheit</th>
|
<th>Einheit</th>
|
||||||
<th v-if="itemInfo.type !== 'deliveryNotes'">Preis</th>
|
<th v-if="itemInfo.type !== 'deliveryNotes'">Preis</th>
|
||||||
<th v-if="itemInfo.type !== 'deliveryNotes'">Steuer</th>
|
<th v-if="itemInfo.type !== 'deliveryNotes'">Steuer</th>
|
||||||
<th v-if="itemInfo.type !== 'deliveryNotes'">Rabatt</th>
|
<th v-if="itemInfo.type !== 'deliveryNotes'">Rabatt</th>
|
||||||
<th>Beschreibung</th>
|
<th>Beschreibung</th>
|
||||||
<th v-if="itemInfo.type !== 'deliveryNotes'">Gesamt</th>
|
<th v-if="itemInfo.type !== 'deliveryNotes'">Gesamt</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<draggable
|
||||||
<draggable
|
v-model="itemInfo.rows"
|
||||||
v-model="itemInfo.rows"
|
handle=".handle"
|
||||||
handle=".handle"
|
tag="tbody"
|
||||||
tag="tbody"
|
itemKey="pos"
|
||||||
itemKey="pos"
|
@end="setPosNumbers"
|
||||||
@end="setPosNumbers"
|
>
|
||||||
>
|
<template #item="{element: row}">
|
||||||
<template #item="{element: row}">
|
<tr>
|
||||||
<tr>
|
<td>
|
||||||
<td>
|
<UIcon
|
||||||
<UIcon
|
class="handle"
|
||||||
class="handle"
|
name="i-mdi-menu"
|
||||||
name="i-mdi-menu"
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
v-if="row.mode === 'pagebreak'"
|
|
||||||
colspan="9"
|
|
||||||
>
|
|
||||||
<UDivider/>
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
v-if="row.mode === 'text'"
|
|
||||||
colspan="9"
|
|
||||||
>
|
|
||||||
<UInput
|
|
||||||
v-model="row.text"
|
|
||||||
placeholder="Titel"
|
|
||||||
maxlength="60"
|
|
||||||
/>
|
|
||||||
<UTextarea
|
|
||||||
class="mt-2"
|
|
||||||
v-model="row.description"
|
|
||||||
placeholder="Text"
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
v-if="!['pagebreak','text'].includes(row.mode)"
|
|
||||||
>{{row.pos}}</td>
|
|
||||||
<td
|
|
||||||
class="w-120"
|
|
||||||
v-if="row.mode === 'free'"
|
|
||||||
>
|
|
||||||
<UInput
|
|
||||||
v-model="row.text"
|
|
||||||
placeholder="Name"
|
|
||||||
class="min-w-40"
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
class="w-120"
|
|
||||||
v-else-if="row.mode === 'normal'"
|
|
||||||
>
|
|
||||||
<InputGroup class="w-full">
|
|
||||||
<USelectMenu
|
|
||||||
class="flex-auto"
|
|
||||||
:options="products"
|
|
||||||
:color="row.product ? 'primary' : 'rose'"
|
|
||||||
option-attribute="name"
|
|
||||||
value-attribute="id"
|
|
||||||
searchable
|
|
||||||
searchable-placeholder="Suche ..."
|
|
||||||
:search-attributes="['name']"
|
|
||||||
v-model="row.product"
|
|
||||||
@change="row.unit = products.find(i => i.id === row.product).unit,
|
|
||||||
row.price = (products.find(i => i.id === row.product).sellingPrice || 0),
|
|
||||||
row.description = products.find(i => i.id === row.product).description"
|
|
||||||
>
|
|
||||||
<template #label>
|
|
||||||
<span class="truncate">{{row.product ? products.find(i => i.id === row.product).name : "Kein Produkt ausgewählt" }}</span>
|
|
||||||
</template>
|
|
||||||
</USelectMenu>
|
|
||||||
<UButton
|
|
||||||
icon="i-heroicons-magnifying-glass"
|
|
||||||
@click="showProductSelectionModal = true"
|
|
||||||
/>
|
/>
|
||||||
<UModal v-model="showProductSelectionModal">
|
</td>
|
||||||
<UCard>
|
<td
|
||||||
<template #header>
|
v-if="row.mode === 'pagebreak'"
|
||||||
Artikel Auswählen
|
colspan="9"
|
||||||
</template>
|
>
|
||||||
|
<UDivider/>
|
||||||
<InputGroup class="w-full">
|
</td>
|
||||||
<UFormGroup label="Artikelkategorie:">
|
<td
|
||||||
<USelectMenu
|
v-if="row.mode === 'text'"
|
||||||
v-if="productcategories.length > 0"
|
colspan="9"
|
||||||
:options="[{name: 'Nicht zugeordnet',id:'not set'},...productcategories]"
|
>
|
||||||
value-attribute="id"
|
<UInput
|
||||||
option-attribute="name"
|
v-model="row.text"
|
||||||
v-model="selectedProductcategorie"
|
placeholder="Titel"
|
||||||
/>
|
maxlength="60"
|
||||||
</UFormGroup>
|
|
||||||
</InputGroup>
|
|
||||||
<UTable
|
|
||||||
:rows="selectedProductcategorie !== 'not set' ? products.filter(i => i.productcategories.includes(selectedProductcategorie)) : products.filter(i => i.productcategories.length === 0)"
|
|
||||||
:columns="[
|
|
||||||
{key: 'name',label:'Name'},
|
|
||||||
{key: 'manufacturer',label:'Hersteller'},
|
|
||||||
{key: 'articleNumber',label:'Artikelnummer'},
|
|
||||||
]"
|
|
||||||
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine Artikel anzuzeigen' }"
|
|
||||||
@select=" (i) => {
|
|
||||||
row.product = i.id
|
|
||||||
row.unit = products.find(i => i.id === row.product).unit,
|
|
||||||
row.price = (products.find(i => i.id === row.product).sellingPrice || 0),
|
|
||||||
row.description = products.find(i => i.id === row.product).description
|
|
||||||
showProductSelectionModal = false}"
|
|
||||||
>
|
|
||||||
|
|
||||||
</UTable>
|
|
||||||
</UCard>
|
|
||||||
</UModal>
|
|
||||||
</InputGroup>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
class="w-120"
|
|
||||||
v-else-if="row.mode === 'service'"
|
|
||||||
>
|
|
||||||
<InputGroup class="w-full">
|
|
||||||
<USelectMenu
|
|
||||||
class="flex-auto"
|
|
||||||
:options="services"
|
|
||||||
:color="row.service ? 'primary' : 'rose'"
|
|
||||||
option-attribute="name"
|
|
||||||
value-attribute="id"
|
|
||||||
searchable
|
|
||||||
searchable-placeholder="Suche ..."
|
|
||||||
:search-attributes="['name']"
|
|
||||||
v-model="row.service"
|
|
||||||
@change="row.unit = dataStore.getServiceById(row.service).unit,
|
|
||||||
row.price = dataStore.getServiceById(row.service).sellingPrice || 0,
|
|
||||||
row.description = dataStore.getServiceById(row.service).description"
|
|
||||||
>
|
|
||||||
<template #label>
|
|
||||||
<span class="truncate">{{dataStore.getServiceById(row.service) ? dataStore.getServiceById(row.service).name : "Keine Leistung ausgewählt" }}</span>
|
|
||||||
</template>
|
|
||||||
</USelectMenu>
|
|
||||||
<UButton
|
|
||||||
icon="i-heroicons-magnifying-glass"
|
|
||||||
@click="showServiceSelectionModal = true"
|
|
||||||
/>
|
/>
|
||||||
<UModal v-model="showServiceSelectionModal">
|
<UTextarea
|
||||||
<UCard>
|
class="mt-2"
|
||||||
<template #header>
|
v-model="row.description"
|
||||||
Leistung Auswählen
|
placeholder="Text"
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
v-if="!['pagebreak','text'].includes(row.mode)"
|
||||||
|
>{{row.pos}}</td>
|
||||||
|
<td
|
||||||
|
class="w-120"
|
||||||
|
v-if="row.mode === 'free'"
|
||||||
|
>
|
||||||
|
<UInput
|
||||||
|
v-model="row.text"
|
||||||
|
placeholder="Name"
|
||||||
|
class="min-w-40"
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
class="w-120"
|
||||||
|
v-else-if="row.mode === 'normal'"
|
||||||
|
>
|
||||||
|
<InputGroup class="w-full">
|
||||||
|
<USelectMenu
|
||||||
|
class="flex-auto"
|
||||||
|
:options="products"
|
||||||
|
:color="row.product ? 'primary' : 'rose'"
|
||||||
|
option-attribute="name"
|
||||||
|
value-attribute="id"
|
||||||
|
searchable
|
||||||
|
searchable-placeholder="Suche ..."
|
||||||
|
:search-attributes="['name']"
|
||||||
|
v-model="row.product"
|
||||||
|
@change="row.unit = products.find(i => i.id === row.product).unit,
|
||||||
|
row.price = (products.find(i => i.id === row.product).sellingPrice || 0),
|
||||||
|
row.description = products.find(i => i.id === row.product).description"
|
||||||
|
>
|
||||||
|
<template #label>
|
||||||
|
<span class="truncate">{{row.product ? products.find(i => i.id === row.product).name : "Kein Produkt ausgewählt" }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
</USelectMenu>
|
||||||
|
<UButton
|
||||||
|
icon="i-heroicons-magnifying-glass"
|
||||||
|
@click="showProductSelectionModal = true"
|
||||||
|
/>
|
||||||
|
<UModal v-model="showProductSelectionModal">
|
||||||
|
<UCard>
|
||||||
|
<template #header>
|
||||||
|
Artikel Auswählen
|
||||||
|
</template>
|
||||||
|
|
||||||
<InputGroup class="w-full">
|
<InputGroup class="w-full">
|
||||||
<UFormGroup label="Leistungskategorie:">
|
<UFormGroup label="Artikelkategorie:">
|
||||||
<USelectMenu
|
<USelectMenu
|
||||||
v-if="servicecategories.length > 0"
|
v-if="productcategories.length > 0"
|
||||||
:options="[{name: 'Nicht zugeordnet',id:'not set'},...servicecategories]"
|
:options="[{name: 'Nicht zugeordnet',id:'not set'},...productcategories]"
|
||||||
value-attribute="id"
|
value-attribute="id"
|
||||||
option-attribute="name"
|
option-attribute="name"
|
||||||
v-model="selectedServicecategorie"
|
v-model="selectedProductcategorie"
|
||||||
/>
|
/>
|
||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
</InputGroup>
|
</InputGroup>
|
||||||
<UTable
|
<UTable
|
||||||
:rows="selectedServicecategorie !== 'not set' ? services.filter(i => i.servicecategories.includes(selectedServicecategorie)) : services.filter(i => i.servicecategories.length === 0)"
|
:rows="selectedProductcategorie !== 'not set' ? products.filter(i => i.productcategories.includes(selectedProductcategorie)) : products.filter(i => i.productcategories.length === 0)"
|
||||||
:columns="[
|
:columns="[
|
||||||
{key: 'name',label:'Name'},
|
{key: 'name',label:'Name'},
|
||||||
{key: 'serviceNumber',label:'Leistungsnummer'},
|
{key: 'manufacturer',label:'Hersteller'},
|
||||||
{key: 'sellingPrice',label:'Verkaufspreis'},
|
{key: 'articleNumber',label:'Artikelnummer'},
|
||||||
]"
|
]"
|
||||||
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine Leistungen anzuzeigen' }"
|
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine Artikel anzuzeigen' }"
|
||||||
@select=" (i) => {
|
@select=" (i) => {
|
||||||
row.service = i.id
|
row.product = i.id
|
||||||
row.unit = dataStore.getServiceById(row.service).unit,
|
row.unit = products.find(i => i.id === row.product).unit,
|
||||||
row.price = dataStore.getServiceById(row.service).sellingPrice || 0,
|
row.price = (products.find(i => i.id === row.product).sellingPrice || 0),
|
||||||
row.description = dataStore.getServiceById(row.service).description
|
row.description = products.find(i => i.id === row.product).description
|
||||||
showServiceSelectionModal = false}"
|
showProductSelectionModal = false}"
|
||||||
|
>
|
||||||
|
|
||||||
|
</UTable>
|
||||||
|
</UCard>
|
||||||
|
</UModal>
|
||||||
|
</InputGroup>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
class="w-120"
|
||||||
|
v-else-if="row.mode === 'service'"
|
||||||
|
>
|
||||||
|
<InputGroup class="w-full">
|
||||||
|
<USelectMenu
|
||||||
|
class="flex-auto"
|
||||||
|
:options="services"
|
||||||
|
:color="row.service ? 'primary' : 'rose'"
|
||||||
|
option-attribute="name"
|
||||||
|
value-attribute="id"
|
||||||
|
searchable
|
||||||
|
searchable-placeholder="Suche ..."
|
||||||
|
:search-attributes="['name']"
|
||||||
|
v-model="row.service"
|
||||||
|
@change="row.unit = dataStore.getServiceById(row.service).unit,
|
||||||
|
row.price = dataStore.getServiceById(row.service).sellingPrice || 0,
|
||||||
|
row.description = dataStore.getServiceById(row.service).description"
|
||||||
|
>
|
||||||
|
<template #label>
|
||||||
|
<span class="truncate">{{dataStore.getServiceById(row.service) ? dataStore.getServiceById(row.service).name : "Keine Leistung ausgewählt" }}</span>
|
||||||
|
</template>
|
||||||
|
</USelectMenu>
|
||||||
|
<UButton
|
||||||
|
icon="i-heroicons-magnifying-glass"
|
||||||
|
@click="showServiceSelectionModal = true"
|
||||||
|
/>
|
||||||
|
<UModal v-model="showServiceSelectionModal">
|
||||||
|
<UCard>
|
||||||
|
<template #header>
|
||||||
|
Leistung Auswählen
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<InputGroup class="w-full">
|
||||||
|
<UFormGroup label="Leistungskategorie:">
|
||||||
|
<USelectMenu
|
||||||
|
v-if="servicecategories.length > 0"
|
||||||
|
:options="[{name: 'Nicht zugeordnet',id:'not set'},...servicecategories]"
|
||||||
|
value-attribute="id"
|
||||||
|
option-attribute="name"
|
||||||
|
v-model="selectedServicecategorie"
|
||||||
|
/>
|
||||||
|
</UFormGroup>
|
||||||
|
</InputGroup>
|
||||||
|
<UTable
|
||||||
|
:rows="selectedServicecategorie !== 'not set' ? services.filter(i => i.servicecategories.includes(selectedServicecategorie)) : services.filter(i => i.servicecategories.length === 0)"
|
||||||
|
:columns="[
|
||||||
|
{key: 'name',label:'Name'},
|
||||||
|
{key: 'serviceNumber',label:'Leistungsnummer'},
|
||||||
|
{key: 'sellingPrice',label:'Verkaufspreis'},
|
||||||
|
]"
|
||||||
|
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine Leistungen anzuzeigen' }"
|
||||||
|
@select=" (i) => {
|
||||||
|
row.service = i.id
|
||||||
|
row.unit = dataStore.getServiceById(row.service).unit,
|
||||||
|
row.price = dataStore.getServiceById(row.service).sellingPrice || 0,
|
||||||
|
row.description = dataStore.getServiceById(row.service).description
|
||||||
|
showServiceSelectionModal = false}"
|
||||||
|
>
|
||||||
|
|
||||||
|
</UTable>
|
||||||
|
</UCard>
|
||||||
|
</UModal>
|
||||||
|
</InputGroup>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
class="w-20"
|
||||||
|
v-if="!['pagebreak','title','text'].includes(row.mode)"
|
||||||
|
>
|
||||||
|
<UInput
|
||||||
|
v-model="row.quantity"
|
||||||
|
type="number"
|
||||||
|
:step="dataStore.units.find(i => i.id === row.unit) ? dataStore.units.find(i => i.id === row.unit).step : '1' "
|
||||||
|
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
class="w-40"
|
||||||
|
v-if="!['pagebreak','title','text'].includes(row.mode)"
|
||||||
|
>
|
||||||
|
<USelectMenu
|
||||||
|
v-model="row.unit"
|
||||||
|
:options="dataStore.units"
|
||||||
|
option-attribute="name"
|
||||||
|
value-attribute="id"
|
||||||
|
>
|
||||||
|
<template #label>
|
||||||
|
{{dataStore.units.find(i => i.id === row.unit) ? dataStore.units.find(i => i.id === row.unit).name : "Keine Einheit gewählt"}}
|
||||||
|
</template>
|
||||||
|
</USelectMenu>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
class="w-40"
|
||||||
|
v-if="!['pagebreak','title','text'].includes(row.mode) && itemInfo.type !== 'deliveryNotes'"
|
||||||
|
>
|
||||||
|
<UInput
|
||||||
|
v-model="row.price"
|
||||||
|
type="number"
|
||||||
|
step="0.001"
|
||||||
|
:color="getRowMargin(row) > 0 ? 'primary' : 'rose'"
|
||||||
|
>
|
||||||
|
<template #trailing>
|
||||||
|
<span class="text-gray-500 dark:text-gray-400 text-xs">EUR</span>
|
||||||
|
</template>
|
||||||
|
</UInput>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
class="w-40"
|
||||||
|
v-if="!['pagebreak','title','text'].includes(row.mode)&& itemInfo.type !== 'deliveryNotes'"
|
||||||
|
|
||||||
|
>
|
||||||
|
<USelectMenu
|
||||||
|
:options="[19,7,0]"
|
||||||
|
v-model="row.taxPercent"
|
||||||
|
>
|
||||||
|
<template #option="{option}">
|
||||||
|
{{option}} %
|
||||||
|
</template>
|
||||||
|
<template #label>
|
||||||
|
{{row.taxPercent}} %
|
||||||
|
</template>
|
||||||
|
</USelectMenu>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
class="w-40"
|
||||||
|
v-if="!['pagebreak','title','text'].includes(row.mode)&& itemInfo.type !== 'deliveryNotes'"
|
||||||
|
>
|
||||||
|
<UInput
|
||||||
|
v-model="row.discountPercent"
|
||||||
|
type="number"
|
||||||
|
step="0.01"
|
||||||
|
placeholder="0"
|
||||||
|
>
|
||||||
|
<template #trailing>
|
||||||
|
<span class="text-gray-500 dark:text-gray-400 text-xs">%</span>
|
||||||
|
</template>
|
||||||
|
</UInput>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
class="w-40"
|
||||||
|
v-if="!['pagebreak','title','text'].includes(row.mode)"
|
||||||
|
>
|
||||||
|
<UButton
|
||||||
|
icon="i-heroicons-document-text"
|
||||||
|
@click="row.showEdit = true"
|
||||||
|
/>
|
||||||
|
<UButton
|
||||||
|
icon="i-mdi-water-drop-outline"
|
||||||
|
class="ml-3"
|
||||||
|
v-if="row.agriculture"
|
||||||
|
@click="row.showEditDiesel = true"
|
||||||
|
/>
|
||||||
|
<UModal v-model="row.showEdit">
|
||||||
|
<UCard>
|
||||||
|
<template #header>
|
||||||
|
Beschreibung bearbeiten
|
||||||
|
</template>
|
||||||
|
<UTextarea
|
||||||
|
v-model="row.description"
|
||||||
|
|
||||||
>
|
>
|
||||||
|
|
||||||
</UTable>
|
</UTextarea>
|
||||||
|
<template #footer>
|
||||||
|
<UButton
|
||||||
|
@click="row.showEdit = false"
|
||||||
|
>
|
||||||
|
Speichern
|
||||||
|
</UButton>
|
||||||
|
</template>
|
||||||
</UCard>
|
</UCard>
|
||||||
|
|
||||||
|
|
||||||
</UModal>
|
</UModal>
|
||||||
</InputGroup>
|
<UModal v-model="row.showEditDiesel">
|
||||||
</td>
|
<UCard>
|
||||||
<td
|
<template #header>
|
||||||
class="w-20"
|
Dieselverbrauch bearbeiten
|
||||||
v-if="!['pagebreak','title','text'].includes(row.mode)"
|
</template>
|
||||||
>
|
<UFormGroup
|
||||||
<UInput
|
label="Menge:"
|
||||||
v-model="row.quantity"
|
|
||||||
type="number"
|
|
||||||
:step="dataStore.units.find(i => i.id === row.unit) ? dataStore.units.find(i => i.id === row.unit).step : '1' "
|
|
||||||
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
class="w-40"
|
|
||||||
v-if="!['pagebreak','title','text'].includes(row.mode)"
|
|
||||||
>
|
|
||||||
<USelectMenu
|
|
||||||
v-model="row.unit"
|
|
||||||
:options="dataStore.units"
|
|
||||||
option-attribute="name"
|
|
||||||
value-attribute="id"
|
|
||||||
>
|
|
||||||
<template #label>
|
|
||||||
{{dataStore.units.find(i => i.id === row.unit) ? dataStore.units.find(i => i.id === row.unit).name : "Keine Einheit gewählt"}}
|
|
||||||
</template>
|
|
||||||
</USelectMenu>
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
class="w-40"
|
|
||||||
v-if="!['pagebreak','title','text'].includes(row.mode) && itemInfo.type !== 'deliveryNotes'"
|
|
||||||
>
|
|
||||||
<UInput
|
|
||||||
v-model="row.price"
|
|
||||||
type="number"
|
|
||||||
step="0.001"
|
|
||||||
:color="getRowMargin(row) > 0 ? 'primary' : 'rose'"
|
|
||||||
>
|
|
||||||
<template #trailing>
|
|
||||||
<span class="text-gray-500 dark:text-gray-400 text-xs">EUR</span>
|
|
||||||
</template>
|
|
||||||
</UInput>
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
class="w-40"
|
|
||||||
v-if="!['pagebreak','title','text'].includes(row.mode)&& itemInfo.type !== 'deliveryNotes'"
|
|
||||||
|
|
||||||
>
|
|
||||||
<USelectMenu
|
|
||||||
:options="[19,7,0]"
|
|
||||||
v-model="row.taxPercent"
|
|
||||||
>
|
|
||||||
<template #option="{option}">
|
|
||||||
{{option}} %
|
|
||||||
</template>
|
|
||||||
<template #label>
|
|
||||||
{{row.taxPercent}} %
|
|
||||||
</template>
|
|
||||||
</USelectMenu>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
class="w-40"
|
|
||||||
v-if="!['pagebreak','title','text'].includes(row.mode)&& itemInfo.type !== 'deliveryNotes'"
|
|
||||||
>
|
|
||||||
<UInput
|
|
||||||
v-model="row.discountPercent"
|
|
||||||
type="number"
|
|
||||||
step="0.01"
|
|
||||||
placeholder="0"
|
|
||||||
>
|
|
||||||
<template #trailing>
|
|
||||||
<span class="text-gray-500 dark:text-gray-400 text-xs">%</span>
|
|
||||||
</template>
|
|
||||||
</UInput>
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
class="w-40"
|
|
||||||
v-if="!['pagebreak','title','text'].includes(row.mode)"
|
|
||||||
>
|
|
||||||
<UButton
|
|
||||||
icon="i-heroicons-document-text"
|
|
||||||
@click="row.showEdit = true"
|
|
||||||
/>
|
|
||||||
<UButton
|
|
||||||
icon="i-mdi-water-drop-outline"
|
|
||||||
class="ml-3"
|
|
||||||
v-if="row.agriculture"
|
|
||||||
@click="row.showEditDiesel = true"
|
|
||||||
/>
|
|
||||||
<UModal v-model="row.showEdit">
|
|
||||||
<UCard>
|
|
||||||
<template #header>
|
|
||||||
Beschreibung bearbeiten
|
|
||||||
</template>
|
|
||||||
<UTextarea
|
|
||||||
v-model="row.description"
|
|
||||||
|
|
||||||
>
|
|
||||||
|
|
||||||
</UTextarea>
|
|
||||||
<template #footer>
|
|
||||||
<UButton
|
|
||||||
@click="row.showEdit = false"
|
|
||||||
>
|
>
|
||||||
Speichern
|
<UInput
|
||||||
</UButton>
|
v-model="row.agriculture.dieselUsage"
|
||||||
</template>
|
>
|
||||||
</UCard>
|
<template #trailing>
|
||||||
|
L
|
||||||
|
</template>
|
||||||
</UModal>
|
</UInput>
|
||||||
<UModal v-model="row.showEditDiesel">
|
</UFormGroup>
|
||||||
<UCard>
|
<UFormGroup
|
||||||
<template #header>
|
label="Preis:"
|
||||||
Dieselverbrauch bearbeiten
|
|
||||||
</template>
|
|
||||||
<UFormGroup
|
|
||||||
label="Menge:"
|
|
||||||
>
|
|
||||||
<UInput
|
|
||||||
v-model="row.agriculture.dieselUsage"
|
|
||||||
>
|
>
|
||||||
<template #trailing>
|
<UInput
|
||||||
L
|
v-model="row.agriculture.dieselPrice"
|
||||||
</template>
|
type="number"
|
||||||
</UInput>
|
steps="0.01"
|
||||||
</UFormGroup>
|
>
|
||||||
<UFormGroup
|
<template #trailing>
|
||||||
label="Preis:"
|
€/L
|
||||||
>
|
</template>
|
||||||
<UInput
|
</UInput>
|
||||||
v-model="row.agriculture.dieselPrice"
|
</UFormGroup>
|
||||||
type="number"
|
<template #footer>
|
||||||
steps="0.01"
|
<UButton
|
||||||
>
|
@click="row.showEditDiesel = false,
|
||||||
<template #trailing>
|
processDieselPosition()"
|
||||||
€/L
|
>
|
||||||
</template>
|
Speichern
|
||||||
</UInput>
|
</UButton>
|
||||||
</UFormGroup>
|
</template>
|
||||||
<template #footer>
|
</UCard>
|
||||||
<UButton
|
|
||||||
@click="row.showEditDiesel = false,
|
|
||||||
processDieselPosition()"
|
|
||||||
>
|
|
||||||
Speichern
|
|
||||||
</UButton>
|
|
||||||
</template>
|
|
||||||
</UCard>
|
|
||||||
|
|
||||||
|
|
||||||
</UModal>
|
</UModal>
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
v-if="!['pagebreak','title','text'].includes(row.mode) && itemInfo.type !== 'deliveryNotes'"
|
v-if="!['pagebreak','title','text'].includes(row.mode) && itemInfo.type !== 'deliveryNotes'"
|
||||||
>
|
>
|
||||||
|
|
||||||
<p class="text-right font-bold whitespace-nowrap"><span v-if="row.discountPercent !== 0" class="line-through mr-2 text-rose-500">{{getRowAmountUndiscounted(row)}} €</span>{{getRowAmount(row)}} €</p>
|
<p class="text-right font-bold whitespace-nowrap"><span v-if="row.discountPercent !== 0" class="line-through mr-2 text-rose-500">{{getRowAmountUndiscounted(row)}} €</span>{{getRowAmount(row)}} €</p>
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
v-if="row.mode === 'title'"
|
v-if="row.mode === 'title'"
|
||||||
colspan="8"
|
colspan="8"
|
||||||
>
|
>
|
||||||
<UInput
|
<UInput
|
||||||
v-model="row.text"
|
v-model="row.text"
|
||||||
placeholder="Titel"
|
placeholder="Titel"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<UButton
|
<UButton
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
color="rose"
|
color="rose"
|
||||||
icon="i-heroicons-x-mark-16-solid"
|
icon="i-heroicons-x-mark-16-solid"
|
||||||
@click="removePosition(row.id)"
|
@click="removePosition(row.id)"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</template>
|
</template>
|
||||||
</draggable>
|
</draggable>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<UAlert
|
<UAlert
|
||||||
v-else
|
v-else
|
||||||
|
|||||||
@@ -344,17 +344,7 @@ setupPage()
|
|||||||
label="Vertragsstart:"
|
label="Vertragsstart:"
|
||||||
class="mt-2"
|
class="mt-2"
|
||||||
>
|
>
|
||||||
<UPopover :popper="{ placement: 'bottom-start' }">
|
|
||||||
<UButton
|
|
||||||
icon="i-heroicons-calendar-days-20-solid"
|
|
||||||
:label="itemInfo.startDate ? dayjs(itemInfo.startDate).format('DD.MM.YYYY') : 'Datum auswählen'"
|
|
||||||
variant="outline"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<template #panel="{ close }">
|
|
||||||
<LazyDatePicker v-model="itemInfo.startDate" @close="close" />
|
|
||||||
</template>
|
|
||||||
</UPopover>
|
|
||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
<UFormGroup
|
<UFormGroup
|
||||||
label="Vertragsende(voraussichtlich):"
|
label="Vertragsende(voraussichtlich):"
|
||||||
@@ -189,24 +189,7 @@ setupPage()
|
|||||||
<UCard class="mt-5" v-else>
|
<UCard class="mt-5" v-else>
|
||||||
|
|
||||||
<div v-if="item.label === 'Projekte'">
|
<div v-if="item.label === 'Projekte'">
|
||||||
<Toolbar>
|
|
||||||
<UButton
|
|
||||||
@click="router.push(`/projects/create?customer=${itemInfo.id}`)"
|
|
||||||
>
|
|
||||||
+ Projekt
|
|
||||||
</UButton>
|
|
||||||
</Toolbar>
|
|
||||||
<UTable
|
|
||||||
:rows="dataStore.getProjectsByCustomerId(itemInfo.id)"
|
|
||||||
@select="(row) => router.push(`/projects/show/${row.id}`)"
|
|
||||||
:columns="[{label: 'Name', key: 'name'},{label: 'Phase', key: 'phase'}]"
|
|
||||||
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine zugehörigen Projekte' }"
|
|
||||||
|
|
||||||
>
|
|
||||||
<template #phase-data="{row}">
|
|
||||||
{{row.phases ? row.phases.find(i => i.active).label : ""}}
|
|
||||||
</template>
|
|
||||||
</UTable>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="item.label === 'Objekte'">
|
<div v-else-if="item.label === 'Objekte'">
|
||||||
<Toolbar>
|
<Toolbar>
|
||||||
236
pages/deprecated/entitys/vehicles/[mode]/[[id]].vue
Normal file
236
pages/deprecated/entitys/vehicles/[mode]/[[id]].vue
Normal file
@@ -0,0 +1,236 @@
|
|||||||
|
<script setup>
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import {useSupabaseSelectSingle} from "~/composables/useSupabase.js";
|
||||||
|
|
||||||
|
definePageMeta({
|
||||||
|
middleware: "auth"
|
||||||
|
})
|
||||||
|
|
||||||
|
defineShortcuts({
|
||||||
|
'backspace': () => {
|
||||||
|
router.push("/vehicles")
|
||||||
|
},
|
||||||
|
'arrowleft': () => {
|
||||||
|
if(openTab.value > 0){
|
||||||
|
openTab.value -= 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'arrowright': () => {
|
||||||
|
if(openTab.value < 3) {
|
||||||
|
openTab.value += 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const dataStore = useDataStore()
|
||||||
|
const profileStore = useProfileStore()
|
||||||
|
const route = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
|
const toast = useToast()
|
||||||
|
const id = ref(route.params.id ? route.params.id : null )
|
||||||
|
const openTab = ref(0)
|
||||||
|
|
||||||
|
|
||||||
|
//Working
|
||||||
|
const mode = ref(route.params.mode || "show")
|
||||||
|
const itemInfo = ref({
|
||||||
|
name: "",
|
||||||
|
licensePlate: "",
|
||||||
|
type: "",
|
||||||
|
driver: null,
|
||||||
|
active: true
|
||||||
|
})
|
||||||
|
const oldItemInfo = ref({})
|
||||||
|
|
||||||
|
|
||||||
|
//Functions
|
||||||
|
const setupPage = async () => {
|
||||||
|
if(mode.value === "show"){
|
||||||
|
itemInfo.value = await useSupabaseSelectSingle("vehicles",route.params.id,"*, checks(*)")
|
||||||
|
} else if(mode.value === "edit"){
|
||||||
|
itemInfo.value = await useSupabaseSelectSingle("vehicles",route.params.id,"*")
|
||||||
|
}
|
||||||
|
|
||||||
|
if(itemInfo.value) oldItemInfo.value = JSON.parse(JSON.stringify(itemInfo.value))
|
||||||
|
}
|
||||||
|
|
||||||
|
const cancelEditorCreate = () => {
|
||||||
|
if(itemInfo.value.id) {
|
||||||
|
router.push(`/vehicles/show/${itemInfo.value.id}`)
|
||||||
|
} else {
|
||||||
|
router.push(`/vehicles`)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
setupPage()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<EntityEdit
|
||||||
|
v-if="mode === 'edit' || mode === 'create'"
|
||||||
|
type="vehicles"
|
||||||
|
:item="itemInfo"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <UDashboardNavbar
|
||||||
|
:ui="{center: 'flex items-stretch gap-1.5 min-w-0'}"
|
||||||
|
>
|
||||||
|
<template #left>
|
||||||
|
<UButton
|
||||||
|
icon="i-heroicons-chevron-left"
|
||||||
|
variant="outline"
|
||||||
|
@click="router.push(`/vehicles`)"
|
||||||
|
>
|
||||||
|
Fahrzeuge
|
||||||
|
</UButton>
|
||||||
|
</template>
|
||||||
|
<template #center>
|
||||||
|
<h1
|
||||||
|
v-if="itemInfo"
|
||||||
|
:class="['text-xl','font-medium']"
|
||||||
|
>{{itemInfo ? `Fahrzeug: ${itemInfo.licensePlate}` : (mode === 'create' ? 'Fahrzeug erstellen' : 'Fahrzeug bearbeiten')}}</h1>
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<ButtonWithConfirm
|
||||||
|
color="rose"
|
||||||
|
variant="outline"
|
||||||
|
@confirmed="dataStore.updateItem('vehicles',{...itemInfo, archived: true})"
|
||||||
|
v-if="mode === 'edit'"
|
||||||
|
>
|
||||||
|
<template #button>
|
||||||
|
Archivieren
|
||||||
|
</template>
|
||||||
|
<template #header>
|
||||||
|
<span class="text-md text-black font-bold">Archivieren bestätigen</span>
|
||||||
|
</template>
|
||||||
|
Möchten Sie das Fahrzeug {{itemInfo.name}} wirklich archivieren?
|
||||||
|
</ButtonWithConfirm>
|
||||||
|
<UButton
|
||||||
|
v-if="mode === 'edit'"
|
||||||
|
@click="dataStore.updateItem('vehicles',itemInfo, oldItemInfo)"
|
||||||
|
>
|
||||||
|
Speichern
|
||||||
|
</UButton>
|
||||||
|
<UButton
|
||||||
|
v-else-if="mode === 'create'"
|
||||||
|
@click="dataStore.createNewItem('vehicles',itemInfo)"
|
||||||
|
>
|
||||||
|
Erstellen
|
||||||
|
</UButton>
|
||||||
|
<UButton
|
||||||
|
@click="cancelEditorCreate"
|
||||||
|
color="red"
|
||||||
|
class="ml-2"
|
||||||
|
v-if="mode === 'edit' || mode === 'create'"
|
||||||
|
>
|
||||||
|
Abbrechen
|
||||||
|
</UButton>
|
||||||
|
</template>
|
||||||
|
</UDashboardNavbar>-->
|
||||||
|
|
||||||
|
<!-- <UForm
|
||||||
|
class="p-5"
|
||||||
|
>
|
||||||
|
|
||||||
|
<UFormGroup
|
||||||
|
label="Kennzeichen:"
|
||||||
|
>
|
||||||
|
<UInput
|
||||||
|
v-model="itemInfo.licensePlate"
|
||||||
|
/>
|
||||||
|
</UFormGroup>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<UFormGroup
|
||||||
|
label="Fahrzeug aktiv:"
|
||||||
|
>
|
||||||
|
<UCheckbox
|
||||||
|
v-model="itemInfo.active"
|
||||||
|
/>
|
||||||
|
</UFormGroup>
|
||||||
|
<UFormGroup
|
||||||
|
label="Fahrgestellnummer:"
|
||||||
|
>
|
||||||
|
<UInput
|
||||||
|
v-model="itemInfo.vin"
|
||||||
|
/>
|
||||||
|
</UFormGroup>
|
||||||
|
<UFormGroup
|
||||||
|
label="Typ:"
|
||||||
|
>
|
||||||
|
<UTextarea
|
||||||
|
v-model="itemInfo.type"
|
||||||
|
/>
|
||||||
|
</UFormGroup>
|
||||||
|
<UFormGroup
|
||||||
|
label="Fahrer:"
|
||||||
|
>
|
||||||
|
<USelectMenu
|
||||||
|
v-model="itemInfo.driver"
|
||||||
|
:options="[{id: null, fullName: 'Kein Fahrer'},...profileStore.profiles]"
|
||||||
|
option-attribute="fullName"
|
||||||
|
value-attribute="id"
|
||||||
|
|
||||||
|
>
|
||||||
|
<template #label>
|
||||||
|
{{profileStore.profiles.find(profile => profile.id === itemInfo.driver) ? profileStore.profiles.find(profile => profile.id === itemInfo.driver).fullName : 'Kein Fahrer ausgewählt'}}
|
||||||
|
</template>
|
||||||
|
</USelectMenu>
|
||||||
|
</UFormGroup>
|
||||||
|
<UFormGroup
|
||||||
|
label="Tankvolumen:"
|
||||||
|
>
|
||||||
|
<UInput
|
||||||
|
v-model="itemInfo.tankSize"
|
||||||
|
type="number"
|
||||||
|
>
|
||||||
|
<template #trailing>
|
||||||
|
L
|
||||||
|
</template>
|
||||||
|
</UInput>
|
||||||
|
</UFormGroup>
|
||||||
|
<UFormGroup
|
||||||
|
label="Baujahr:"
|
||||||
|
>
|
||||||
|
<UInput
|
||||||
|
v-model="itemInfo.buildYear"
|
||||||
|
type="number"
|
||||||
|
/>
|
||||||
|
</UFormGroup>
|
||||||
|
<UFormGroup
|
||||||
|
label="Anhängelast:"
|
||||||
|
>
|
||||||
|
<UInput
|
||||||
|
v-model="itemInfo.towingCapacity"
|
||||||
|
type="number"
|
||||||
|
>
|
||||||
|
<template #trailing>kg</template>
|
||||||
|
</UInput>
|
||||||
|
</UFormGroup>
|
||||||
|
<UFormGroup
|
||||||
|
label="Farbe:"
|
||||||
|
>
|
||||||
|
<UInput
|
||||||
|
v-model="itemInfo.color"
|
||||||
|
type="text"
|
||||||
|
/>
|
||||||
|
</UFormGroup>
|
||||||
|
<UFormGroup
|
||||||
|
label="Leistung:"
|
||||||
|
>
|
||||||
|
<UInput
|
||||||
|
v-model="itemInfo.powerInKW"
|
||||||
|
type="number"
|
||||||
|
>
|
||||||
|
<template #trailing>kW</template>
|
||||||
|
</UInput>
|
||||||
|
</UFormGroup>
|
||||||
|
</UForm>-->
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
33
pages/deprecated/entitys/vehicles/show/[id].vue
Normal file
33
pages/deprecated/entitys/vehicles/show/[id].vue
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<script setup>
|
||||||
|
import {useSupabaseSelectSingle} from "~/composables/useSupabase.js";
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
|
const itemInfo = ref({})
|
||||||
|
|
||||||
|
const tabItems = [{
|
||||||
|
label: 'Informationen',
|
||||||
|
}, {
|
||||||
|
label: 'Dokumente',
|
||||||
|
}, {
|
||||||
|
label: 'Überprüfungen',
|
||||||
|
}]
|
||||||
|
|
||||||
|
const setupPage = async () => {
|
||||||
|
itemInfo.value = await useSupabaseSelectSingle("vehicles",route.params.id,"*, checks(*), documents(*)")
|
||||||
|
console.log(itemInfo.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
setupPage()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<EntityShow
|
||||||
|
type="vehicles"
|
||||||
|
:item="itemInfo"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -6,7 +6,6 @@ definePageMeta({
|
|||||||
const supabase = useSupabaseClient()
|
const supabase = useSupabaseClient()
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
const profileStore = useProfileStore()
|
const profileStore = useProfileStore()
|
||||||
const profileStore = useProfileStore()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
60
pages/standardEntity/[type]/[[mode]]/[[id]].vue
Normal file
60
pages/standardEntity/[type]/[[mode]]/[[id]].vue
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<script setup>
|
||||||
|
const route = useRoute()
|
||||||
|
const dataStore = useDataStore()
|
||||||
|
|
||||||
|
const type = route.params.type
|
||||||
|
|
||||||
|
const dataType = dataStore.dataTypes[route.params.type]
|
||||||
|
|
||||||
|
const loaded = ref(false)
|
||||||
|
const mode = ref("list")
|
||||||
|
const items = ref([])
|
||||||
|
const item = ref({})
|
||||||
|
|
||||||
|
const setupPage = async () => {
|
||||||
|
if(route.params.mode) mode.value = route.params.mode
|
||||||
|
|
||||||
|
if(mode.value === "show") {
|
||||||
|
//Load Data for Show
|
||||||
|
item.value = await useSupabaseSelectSingle(type, route.params.id, dataType.supabaseSelectWithInformation || "*")
|
||||||
|
} else if(mode.value === "edit") {
|
||||||
|
//Load Data for Edit
|
||||||
|
item.value = await useSupabaseSelectSingle(type, route.params.id)
|
||||||
|
} else if(mode.value === "list") {
|
||||||
|
//Load Data for List
|
||||||
|
items.value = await useSupabaseSelect(type, dataType.supabaseSelectWithInformation || "*", dataType.supabaseSortColumn)
|
||||||
|
}
|
||||||
|
|
||||||
|
loaded.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
setupPage()
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<EntityShow
|
||||||
|
v-if="loaded && mode === 'show'"
|
||||||
|
:type="route.params.type"
|
||||||
|
:item="item"
|
||||||
|
/>
|
||||||
|
<EntityEdit
|
||||||
|
v-else-if="loaded && (mode === 'edit' || mode === 'create')"
|
||||||
|
:type="route.params.type"
|
||||||
|
:item="item"
|
||||||
|
/>
|
||||||
|
<EntityList
|
||||||
|
v-else-if="loaded && mode === 'list'"
|
||||||
|
:type="type"
|
||||||
|
:items="items"
|
||||||
|
/>
|
||||||
|
<UProgress
|
||||||
|
v-else
|
||||||
|
animation="carousel"
|
||||||
|
class="p-5 mt-10"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -1,406 +0,0 @@
|
|||||||
<script setup>
|
|
||||||
import dayjs from "dayjs";
|
|
||||||
import {useSupabaseSelectSingle} from "~/composables/useSupabase.js";
|
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
defineShortcuts({
|
|
||||||
'backspace': () => {
|
|
||||||
router.push("/vehicles")
|
|
||||||
},
|
|
||||||
'arrowleft': () => {
|
|
||||||
if(openTab.value > 0){
|
|
||||||
openTab.value -= 1
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'arrowright': () => {
|
|
||||||
if(openTab.value < 3) {
|
|
||||||
openTab.value += 1
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const dataStore = useDataStore()
|
|
||||||
const profileStore = useProfileStore()
|
|
||||||
const route = useRoute()
|
|
||||||
const router = useRouter()
|
|
||||||
const toast = useToast()
|
|
||||||
const id = ref(route.params.id ? route.params.id : null )
|
|
||||||
const openTab = ref(0)
|
|
||||||
|
|
||||||
|
|
||||||
//Working
|
|
||||||
const mode = ref(route.params.mode || "show")
|
|
||||||
const itemInfo = ref({
|
|
||||||
name: "",
|
|
||||||
licensePlate: "",
|
|
||||||
type: "",
|
|
||||||
driver: null,
|
|
||||||
active: true
|
|
||||||
})
|
|
||||||
const oldItemInfo = ref({})
|
|
||||||
|
|
||||||
const tabItems = [{
|
|
||||||
label: 'Informationen',
|
|
||||||
}, {
|
|
||||||
label: 'Dokumente',
|
|
||||||
}, {
|
|
||||||
label: 'Überprüfungen',
|
|
||||||
}]
|
|
||||||
|
|
||||||
const incomingInvoicesColumns = [
|
|
||||||
{
|
|
||||||
key: "state",
|
|
||||||
label: "Status",
|
|
||||||
sortable: true
|
|
||||||
},{
|
|
||||||
key: "vendor",
|
|
||||||
label: "Lieferant",
|
|
||||||
sortable: true
|
|
||||||
},{
|
|
||||||
key: "date",
|
|
||||||
label: "Datum",
|
|
||||||
sortable: true
|
|
||||||
},{
|
|
||||||
key: "description",
|
|
||||||
label: "Beschreibung",
|
|
||||||
sortable: true
|
|
||||||
},{
|
|
||||||
key: "accounts",
|
|
||||||
label: "Betrag",
|
|
||||||
sortable: true
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
//Functions
|
|
||||||
const setupPage = async () => {
|
|
||||||
if(mode.value === "show"){
|
|
||||||
itemInfo.value = await useSupabaseSelectSingle("vehicles",route.params.id,"*, checks(*)")
|
|
||||||
} else if(mode.value === "edit"){
|
|
||||||
itemInfo.value = await useSupabaseSelectSingle("vehicles",route.params.id,"*")
|
|
||||||
}
|
|
||||||
|
|
||||||
if(itemInfo.value) oldItemInfo.value = JSON.parse(JSON.stringify(itemInfo.value))
|
|
||||||
}
|
|
||||||
|
|
||||||
const cancelEditorCreate = () => {
|
|
||||||
if(itemInfo.value.id) {
|
|
||||||
router.push(`/vehicles/show/${itemInfo.value.id}`)
|
|
||||||
} else {
|
|
||||||
router.push(`/vehicles`)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const getRowAmount = (row) => {
|
|
||||||
let amount = 0
|
|
||||||
|
|
||||||
row.accounts.forEach(account => {
|
|
||||||
amount += account.amountNet
|
|
||||||
amount += account.amountTax
|
|
||||||
})
|
|
||||||
|
|
||||||
return amount
|
|
||||||
}
|
|
||||||
|
|
||||||
setupPage()
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<UDashboardNavbar
|
|
||||||
:title="itemInfo ? itemInfo.licensePlate : (mode === 'create' ? 'Fahrzeug erstellen' : 'Fahrzeug bearbeiten')"
|
|
||||||
:ui="{center: 'flex items-stretch gap-1.5 min-w-0'}"
|
|
||||||
>
|
|
||||||
<template #left>
|
|
||||||
<UButton
|
|
||||||
icon="i-heroicons-chevron-left"
|
|
||||||
variant="outline"
|
|
||||||
@click="router.push(`/vehicles`)"
|
|
||||||
>
|
|
||||||
Fahrzeuge
|
|
||||||
</UButton>
|
|
||||||
</template>
|
|
||||||
<template #center>
|
|
||||||
<h1
|
|
||||||
v-if="itemInfo"
|
|
||||||
:class="['text-xl','font-medium']"
|
|
||||||
>{{itemInfo ? `Fahrzeug: ${itemInfo.licensePlate}` : (mode === 'create' ? 'Fahrzeug erstellen' : 'Fahrzeug bearbeiten')}}</h1>
|
|
||||||
</template>
|
|
||||||
<template #right>
|
|
||||||
<ButtonWithConfirm
|
|
||||||
color="rose"
|
|
||||||
variant="outline"
|
|
||||||
@confirmed="dataStore.updateItem('vehicles',{...itemInfo, archived: true})"
|
|
||||||
v-if="mode === 'edit'"
|
|
||||||
>
|
|
||||||
<template #button>
|
|
||||||
Archivieren
|
|
||||||
</template>
|
|
||||||
<template #header>
|
|
||||||
<span class="text-md text-black font-bold">Archivieren bestätigen</span>
|
|
||||||
</template>
|
|
||||||
Möchten Sie das Fahrzeug {{itemInfo.name}} wirklich archivieren?
|
|
||||||
</ButtonWithConfirm>
|
|
||||||
<UButton
|
|
||||||
v-if="mode === 'edit'"
|
|
||||||
@click="dataStore.updateItem('vehicles',itemInfo, oldItemInfo)"
|
|
||||||
>
|
|
||||||
Speichern
|
|
||||||
</UButton>
|
|
||||||
<UButton
|
|
||||||
v-else-if="mode === 'create'"
|
|
||||||
@click="dataStore.createNewItem('vehicles',itemInfo)"
|
|
||||||
>
|
|
||||||
Erstellen
|
|
||||||
</UButton>
|
|
||||||
<UButton
|
|
||||||
@click="cancelEditorCreate"
|
|
||||||
color="red"
|
|
||||||
class="ml-2"
|
|
||||||
v-if="mode === 'edit' || mode === 'create'"
|
|
||||||
>
|
|
||||||
Abbrechen
|
|
||||||
</UButton>
|
|
||||||
<UButton
|
|
||||||
v-if="mode === 'show'"
|
|
||||||
@click="router.push(`/vehicles/edit/${itemInfo.id}`)"
|
|
||||||
>
|
|
||||||
Bearbeiten
|
|
||||||
</UButton>
|
|
||||||
</template>
|
|
||||||
</UDashboardNavbar>
|
|
||||||
<UTabs
|
|
||||||
:items="tabItems"
|
|
||||||
v-if="mode === 'show' && itemInfo.id"
|
|
||||||
class="p-5"
|
|
||||||
v-model="openTab"
|
|
||||||
>
|
|
||||||
<template #item="{item}">
|
|
||||||
<div v-if="item.label === 'Informationen'" class="flex flex-row mt-5">
|
|
||||||
<UCard class="w-1/2 mr-5">
|
|
||||||
<UAlert
|
|
||||||
v-if="itemInfo.archived"
|
|
||||||
color="rose"
|
|
||||||
variant="outline"
|
|
||||||
title="Objekt archiviert"
|
|
||||||
icon="i-heroicons-light-bulb"
|
|
||||||
class="mb-5"
|
|
||||||
/>
|
|
||||||
<div class="text-wrap">
|
|
||||||
<table class="w-full">
|
|
||||||
<tr>
|
|
||||||
<td>Kennzeichen: </td>
|
|
||||||
<td>{{itemInfo.licensePlate}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Typ: </td>
|
|
||||||
<td>{{itemInfo.type}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Fahrgestellnummer: </td>
|
|
||||||
<td>{{itemInfo.vin}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Fahrer:</td>
|
|
||||||
<td>{{profileStore.profiles.find(profile => profile.id === itemInfo.driver) ? profileStore.profiles.find(profile => profile.id === itemInfo.driver).fullName : 'Kein Fahrer gewählt'}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Tankvolumen:</td>
|
|
||||||
<td>{{itemInfo.tankSize !== 0 ? `${itemInfo.tankSize} L` : "Kein Tank verbaut"}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Baujahr:</td>
|
|
||||||
<td>{{itemInfo.buildYear}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Anhänglast:</td>
|
|
||||||
<td>{{itemInfo.towingCapacity}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Farbe:</td>
|
|
||||||
<td>{{itemInfo.color}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Leistung:</td>
|
|
||||||
<td>{{itemInfo.powerInKW && itemInfo.powerInKW + " kW"}}</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</UCard>
|
|
||||||
<UCard class="w-1/2">
|
|
||||||
<HistoryDisplay
|
|
||||||
type="vehicle"
|
|
||||||
v-if="itemInfo"
|
|
||||||
:element-id="itemInfo.id"
|
|
||||||
/>
|
|
||||||
</UCard>
|
|
||||||
</div>
|
|
||||||
<div v-else-if="item.label === 'Eingangsrechnungen'">
|
|
||||||
<UTable
|
|
||||||
:rows="dataStore.getIncomingInvoicesByVehicleId(itemInfo.id)"
|
|
||||||
:columns="incomingInvoicesColumns"
|
|
||||||
@select="(row) => router.push('/receipts/show/' + row.id)"
|
|
||||||
>
|
|
||||||
<template #vendor-data="{row}">
|
|
||||||
{{dataStore.getVendorById(row.vendor) ? dataStore.getVendorById(row.vendor).name : ""}}
|
|
||||||
</template>
|
|
||||||
<template #date-data="{row}">
|
|
||||||
{{dayjs(row.date).format("DD.MM.YYYY")}}
|
|
||||||
</template>
|
|
||||||
<template #accounts-data="{row}">
|
|
||||||
{{getRowAmount(row) ? String(getRowAmount(row).toFixed(2)).replace('.',',') + " €" : ""}}
|
|
||||||
</template>
|
|
||||||
</UTable>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div v-else-if="item.label === 'Dokumente'">
|
|
||||||
<UCard class="mt-5">
|
|
||||||
<Toolbar>
|
|
||||||
<DocumentUpload
|
|
||||||
type="vehicle"
|
|
||||||
:element-id="itemInfo.id"
|
|
||||||
/>
|
|
||||||
</Toolbar>
|
|
||||||
|
|
||||||
<DocumentList
|
|
||||||
:documents="dataStore.getDocumentsByVehicleId(itemInfo.id)"
|
|
||||||
/>
|
|
||||||
</UCard>
|
|
||||||
</div>
|
|
||||||
<div v-else-if="item.label === 'Überprüfungen'">
|
|
||||||
<UCard class="mt-5">
|
|
||||||
<UTable
|
|
||||||
:rows="itemInfo.checks"
|
|
||||||
:columns="[{key:'name',label: 'Name'},{key:'rhythm',label: 'Rhythmus'},{key:'description',label: 'Beschreibung'}]"
|
|
||||||
class="w-full"
|
|
||||||
:ui="{ divide: 'divide-gray-200 dark:divide-gray-800' }"
|
|
||||||
@select="(i) => router.push(`/checks/show/${i.id}`) "
|
|
||||||
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine Überprüfungen anzuzeigen' }"
|
|
||||||
>
|
|
||||||
<template #rhythm-data="{row}">
|
|
||||||
{{row.distance}}
|
|
||||||
<span v-if="row.distanceUnit === 'dayjs'">Tage</span>
|
|
||||||
<span v-if="row.distanceUnit === 'years'">Jahre</span>
|
|
||||||
</template>
|
|
||||||
</UTable>
|
|
||||||
</UCard>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</UTabs>
|
|
||||||
<UForm
|
|
||||||
v-else-if="mode == 'edit' || mode == 'create'"
|
|
||||||
class="p-5"
|
|
||||||
>
|
|
||||||
|
|
||||||
<UFormGroup
|
|
||||||
label="Kennzeichen:"
|
|
||||||
>
|
|
||||||
<UInput
|
|
||||||
v-model="itemInfo.licensePlate"
|
|
||||||
/>
|
|
||||||
</UFormGroup>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<UFormGroup
|
|
||||||
label="Fahrzeug aktiv:"
|
|
||||||
>
|
|
||||||
<UCheckbox
|
|
||||||
v-model="itemInfo.active"
|
|
||||||
/>
|
|
||||||
</UFormGroup>
|
|
||||||
<UFormGroup
|
|
||||||
label="Fahrgestellnummer:"
|
|
||||||
>
|
|
||||||
<UInput
|
|
||||||
v-model="itemInfo.vin"
|
|
||||||
/>
|
|
||||||
</UFormGroup>
|
|
||||||
<UFormGroup
|
|
||||||
label="Typ:"
|
|
||||||
>
|
|
||||||
<UTextarea
|
|
||||||
v-model="itemInfo.type"
|
|
||||||
/>
|
|
||||||
</UFormGroup>
|
|
||||||
<UFormGroup
|
|
||||||
label="Fahrer:"
|
|
||||||
>
|
|
||||||
<USelectMenu
|
|
||||||
v-model="itemInfo.driver"
|
|
||||||
:options="[{id: null, fullName: 'Kein Fahrer'},...profileStore.profiles]"
|
|
||||||
option-attribute="fullName"
|
|
||||||
value-attribute="id"
|
|
||||||
|
|
||||||
>
|
|
||||||
<template #label>
|
|
||||||
{{profileStore.profiles.find(profile => profile.id === itemInfo.driver) ? profileStore.profiles.find(profile => profile.id === itemInfo.driver).fullName : 'Kein Fahrer ausgewählt'}}
|
|
||||||
</template>
|
|
||||||
</USelectMenu>
|
|
||||||
</UFormGroup>
|
|
||||||
<UFormGroup
|
|
||||||
label="Tankvolumen:"
|
|
||||||
>
|
|
||||||
<UInput
|
|
||||||
v-model="itemInfo.tankSize"
|
|
||||||
type="number"
|
|
||||||
>
|
|
||||||
<template #trailing>
|
|
||||||
L
|
|
||||||
</template>
|
|
||||||
</UInput>
|
|
||||||
</UFormGroup>
|
|
||||||
<UFormGroup
|
|
||||||
label="Baujahr:"
|
|
||||||
>
|
|
||||||
<UInput
|
|
||||||
v-model="itemInfo.buildYear"
|
|
||||||
type="number"
|
|
||||||
/>
|
|
||||||
</UFormGroup>
|
|
||||||
<UFormGroup
|
|
||||||
label="Anhängelast:"
|
|
||||||
>
|
|
||||||
<UInput
|
|
||||||
v-model="itemInfo.towingCapacity"
|
|
||||||
type="number"
|
|
||||||
>
|
|
||||||
<template #trailing>kg</template>
|
|
||||||
</UInput>
|
|
||||||
</UFormGroup>
|
|
||||||
<UFormGroup
|
|
||||||
label="Farbe:"
|
|
||||||
>
|
|
||||||
<UInput
|
|
||||||
v-model="itemInfo.color"
|
|
||||||
type="text"
|
|
||||||
/>
|
|
||||||
</UFormGroup>
|
|
||||||
<UFormGroup
|
|
||||||
label="Leistung:"
|
|
||||||
>
|
|
||||||
<UInput
|
|
||||||
v-model="itemInfo.powerInKW"
|
|
||||||
type="number"
|
|
||||||
>
|
|
||||||
<template #trailing>kW</template>
|
|
||||||
</UInput>
|
|
||||||
</UFormGroup>
|
|
||||||
</UForm>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
td {
|
|
||||||
border-bottom: 1px solid lightgrey;
|
|
||||||
vertical-align: top;
|
|
||||||
padding-bottom: 0.15em;
|
|
||||||
padding-top: 0.15em;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
479
stores/data.js
479
stores/data.js
@@ -7,12 +7,17 @@ import {useNumberRange} from "~/composables/useNumberRange.js";
|
|||||||
|
|
||||||
import projecttype from "~/components/columnRenderings/projecttype.vue"
|
import projecttype from "~/components/columnRenderings/projecttype.vue"
|
||||||
import customer from "~/components/columnRenderings/customer.vue"
|
import customer from "~/components/columnRenderings/customer.vue"
|
||||||
|
import contact from "~/components/columnRenderings/contact.vue"
|
||||||
import plant from "~/components/columnRenderings/plant.vue"
|
import plant from "~/components/columnRenderings/plant.vue"
|
||||||
import vendor from "~/components/columnRenderings/vendor.vue"
|
import vendor from "~/components/columnRenderings/vendor.vue"
|
||||||
import active from "~/components/columnRenderings/active.vue"
|
import active from "~/components/columnRenderings/active.vue"
|
||||||
import sellingPrice from "~/components/columnRenderings/sellingPrice.vue";
|
import sellingPrice from "~/components/columnRenderings/sellingPrice.vue";
|
||||||
import unit from "~/components/columnRenderings/unit.vue";
|
import unit from "~/components/columnRenderings/unit.vue";
|
||||||
|
import isCompany from "~/components/columnRenderings/isCompany.vue"
|
||||||
|
import address from "~/components/columnRenderings/address.vue"
|
||||||
|
import sepa from "~/components/columnRenderings/sepa.vue"
|
||||||
|
import recurring from "~/components/columnRenderings/recurring.vue"
|
||||||
|
import description from "~/components/columnRenderings/description.vue"
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
export const useDataStore = defineStore('data', () => {
|
export const useDataStore = defineStore('data', () => {
|
||||||
@@ -33,37 +38,112 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
customers: {
|
customers: {
|
||||||
label: "Kunden",
|
label: "Kunden",
|
||||||
labelSingle: "Kunde",
|
labelSingle: "Kunde",
|
||||||
|
isStandardEntity: true,
|
||||||
redirect:true,
|
redirect:true,
|
||||||
numberRangeHolder: "customerNumber",
|
numberRangeHolder: "customerNumber",
|
||||||
historyItemHolder: "customer",
|
historyItemHolder: "customer",
|
||||||
|
supabaseSortColumn: "customerNumber",
|
||||||
|
supabaseSelectWithInformation: "*, projects(*), plants(*), contracts(*), contacts(*)",
|
||||||
filters: [],
|
filters: [],
|
||||||
templateColumns: [
|
templateColumns: [
|
||||||
{
|
{
|
||||||
key: 'customerNumber',
|
key: 'customerNumber',
|
||||||
label: "Kundennummer",
|
label: "Kundennummer",
|
||||||
|
inputIsNumberRange: true,
|
||||||
|
inputType: "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "name",
|
key: "name",
|
||||||
label: "Name"
|
label: "Name",
|
||||||
|
title: true,
|
||||||
|
inputType: "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "isCompany",
|
key: "isCompany",
|
||||||
label: "Typ"
|
label: "Typ",
|
||||||
|
component: isCompany,
|
||||||
|
inputType: "bool"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "notes",
|
key: "notes",
|
||||||
label: "Notizen"
|
label: "Notizen",
|
||||||
|
inputType: "textarea"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "active",
|
key: "active",
|
||||||
label: "Aktiv",
|
label: "Aktiv",
|
||||||
component: active
|
component: active,
|
||||||
|
inputType: "bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "infoData.streetNumber",
|
||||||
|
label: "Straße + Hausnummer",
|
||||||
|
inputType: "text",
|
||||||
|
disabledInTable: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "infoData.special",
|
||||||
|
label: "Adresszusatz",
|
||||||
|
inputType: "text",
|
||||||
|
disabledInTable: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "infoData.zip",
|
||||||
|
label: "Postleitzahl",
|
||||||
|
inputType: "number",
|
||||||
|
disabledInTable: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "infoData.city",
|
||||||
|
label: "Stadt",
|
||||||
|
inputType: "text",
|
||||||
|
disabledInTable: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "infoData.country",
|
||||||
|
label: "Land",
|
||||||
|
inputType: "select",
|
||||||
|
selectDataType: "countrys",
|
||||||
|
selectOptionAttribute: "name",
|
||||||
|
selectValueAttribute: "name",
|
||||||
|
disabledInTable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "address",
|
key: "address",
|
||||||
label: "Adresse",
|
label: "Adresse",
|
||||||
}
|
component: address
|
||||||
]
|
},
|
||||||
|
{
|
||||||
|
key: "infoData.tel",
|
||||||
|
label: "Telefon",
|
||||||
|
inputType: "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "infoData.email",
|
||||||
|
label: "E-Mail",
|
||||||
|
inputType: "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "infoData.web",
|
||||||
|
label: "Web",
|
||||||
|
inputType: "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "infoData.ustid",
|
||||||
|
label: "USt-Id",
|
||||||
|
inputType: "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "profiles",
|
||||||
|
label: "Berechtigte Benutzer",
|
||||||
|
inputType: "select",
|
||||||
|
selectDataType: "profiles",
|
||||||
|
selectOptionAttribute: "fullName",
|
||||||
|
selectSearchAttributes: ['fullName'],
|
||||||
|
selectMultiple: true
|
||||||
|
},
|
||||||
|
],
|
||||||
|
showTabs: [{label: 'Informationen'},{label: 'Dokumente'},{label: 'Projekte'},{label: 'Objekte'},{label: 'Verträge'}]
|
||||||
},
|
},
|
||||||
contacts: {
|
contacts: {
|
||||||
label: "Kontakte",
|
label: "Kontakte",
|
||||||
@@ -116,21 +196,103 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
contracts: {
|
contracts: {
|
||||||
label: "Verträge",
|
label: "Verträge",
|
||||||
labelSingle: "Vertrag",
|
labelSingle: "Vertrag",
|
||||||
|
isStandardEntity: true,
|
||||||
redirect:true,
|
redirect:true,
|
||||||
filters:[],
|
filters:[],
|
||||||
|
supabaseSelectWithInformation: "*, customer(*), documents(*)",
|
||||||
templateColumns: [
|
templateColumns: [
|
||||||
{
|
{
|
||||||
key: "name",
|
key: "name",
|
||||||
label: "Name"
|
label: "Name",
|
||||||
|
title: true,
|
||||||
|
inputType: "text"
|
||||||
|
},{
|
||||||
|
key: "active",
|
||||||
|
label: "Aktiv",
|
||||||
|
component: active,
|
||||||
|
inputType: "bool"
|
||||||
|
},{
|
||||||
|
key: "recurring",
|
||||||
|
label: "Wiederkehrend",
|
||||||
|
component: recurring,
|
||||||
|
inputType: "bool"
|
||||||
},{
|
},{
|
||||||
key: 'customer',
|
key: 'customer',
|
||||||
label: "Kunde",
|
label: "Kunde",
|
||||||
component: customer
|
component: customer,
|
||||||
|
inputType: "select",
|
||||||
|
selectDataType: "customers",
|
||||||
|
selectOptionAttribute: "name",
|
||||||
|
selectSearchAttributes: ['name'],
|
||||||
|
},{
|
||||||
|
key: 'contact',
|
||||||
|
label: "Ansprechpartner",
|
||||||
|
component: contact,
|
||||||
|
inputType: "select",
|
||||||
|
selectDataType: "contacts",
|
||||||
|
selectDataTypeFilter: function (i,item) {
|
||||||
|
return i.customer === item.customer
|
||||||
|
},
|
||||||
|
selectOptionAttribute: "fullName",
|
||||||
|
selectSearchAttributes: ['fullName'],
|
||||||
|
},{
|
||||||
|
key: 'duration',
|
||||||
|
label: "mindest Vertragslaufzeit",
|
||||||
|
inputType: "select",
|
||||||
|
selectManualOptions: ['12 Monate','24 Monate','36 Monate','48 Monate']
|
||||||
|
},{
|
||||||
|
key: 'invoiceDispatch',
|
||||||
|
label: "Rechnungsversand",
|
||||||
|
inputType: "select",
|
||||||
|
selectManualOptions: ['E-Mail','Post']
|
||||||
|
},{
|
||||||
|
key: 'paymentType',
|
||||||
|
label: "Zahlungsart",
|
||||||
|
inputType: "select",
|
||||||
|
selectManualOptions: ['Einzug','Überweisung']
|
||||||
|
},{
|
||||||
|
key: 'startDate',
|
||||||
|
label: "Vertragsstart",
|
||||||
|
inputType: "date",
|
||||||
|
},{
|
||||||
|
key: 'endDate',
|
||||||
|
label: "Vertragsende",
|
||||||
|
inputType: "date",
|
||||||
|
},{
|
||||||
|
key: 'signDate',
|
||||||
|
label: "Unterschrieben am",
|
||||||
|
inputType: "date",
|
||||||
|
},{
|
||||||
|
key: 'sepaDate',
|
||||||
|
label: "SEPA Datum",
|
||||||
|
inputType: "date",
|
||||||
|
},{
|
||||||
|
key: 'sepaRef',
|
||||||
|
label: "Mandatsreferenz",
|
||||||
|
inputType: "text",
|
||||||
|
},{
|
||||||
|
key: 'bankingIban',
|
||||||
|
label: "IBAN",
|
||||||
|
inputType: "text",
|
||||||
|
},{
|
||||||
|
key: 'bankingOwner',
|
||||||
|
label: "Inhaber",
|
||||||
|
inputType: "text",
|
||||||
|
},{
|
||||||
|
key: 'bankingName',
|
||||||
|
label: "Bank",
|
||||||
|
inputType: "text",
|
||||||
|
},{
|
||||||
|
key: 'bankinBIC',
|
||||||
|
label: "BIC",
|
||||||
|
inputType: "text",
|
||||||
},{
|
},{
|
||||||
key: "notes",
|
key: "notes",
|
||||||
label: "Notizen"
|
label: "Notizen",
|
||||||
|
inputType: "textarea"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
showTabs: [{label: 'Informationen'},{label: 'Dokumente'}]
|
||||||
},
|
},
|
||||||
absencerequests: {
|
absencerequests: {
|
||||||
label: "Abwesenheitsanträge",
|
label: "Abwesenheitsanträge",
|
||||||
@@ -140,20 +302,43 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
plants: {
|
plants: {
|
||||||
label: "Objekte",
|
label: "Objekte",
|
||||||
labelSingle: "Objekt",
|
labelSingle: "Objekt",
|
||||||
|
isStandardEntity: true,
|
||||||
redirect:true,
|
redirect:true,
|
||||||
historyItemHolder: "plant",
|
historyItemHolder: "plant",
|
||||||
|
supabaseSelectWithInformation: "*, customer(id,name)",
|
||||||
filters: [],
|
filters: [],
|
||||||
templateColumns: [
|
templateColumns: [
|
||||||
{
|
{
|
||||||
key: "name",
|
key: "name",
|
||||||
label: "Name"
|
label: "Name",
|
||||||
|
inputType: "text",
|
||||||
|
title: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "customer",
|
key: "customer",
|
||||||
label: "Kunde",
|
label: "Kunde",
|
||||||
component: customer
|
component: customer,
|
||||||
}
|
inputType: "select",
|
||||||
]
|
selectDataType: "customers",
|
||||||
|
selectOptionAttribute: "name",
|
||||||
|
selectSearchAttributes: ['name'],
|
||||||
|
},{
|
||||||
|
key: "description",
|
||||||
|
label: "Beschreibung",
|
||||||
|
inputType:"editor",
|
||||||
|
component: description
|
||||||
|
},
|
||||||
|
],
|
||||||
|
showTabs: [
|
||||||
|
{
|
||||||
|
label: "Informationen"
|
||||||
|
},{
|
||||||
|
label: "Projekte"
|
||||||
|
},{
|
||||||
|
label: "Aufgaben"
|
||||||
|
},{
|
||||||
|
label: "Dokumente"
|
||||||
|
}]
|
||||||
},
|
},
|
||||||
products: {
|
products: {
|
||||||
label: "Artikel",
|
label: "Artikel",
|
||||||
@@ -196,9 +381,12 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
projects: {
|
projects: {
|
||||||
label: "Projekte",
|
label: "Projekte",
|
||||||
labelSingle: "Projekt",
|
labelSingle: "Projekt",
|
||||||
|
isStandardEntity: true,
|
||||||
redirect:true,
|
redirect:true,
|
||||||
historyItemHolder: "project",
|
historyItemHolder: "project",
|
||||||
numberRangeHolder: "projectNumber",
|
numberRangeHolder: "projectNumber",
|
||||||
|
supabaseSelectWithInformation: "*, customer(name), plant(name), projecttype(name, id), tasks(*), documents(*)",
|
||||||
|
supabaseSortColumn: "projectNumber",
|
||||||
filters: [
|
filters: [
|
||||||
{
|
{
|
||||||
name: "Abgeschlossen",
|
name: "Abgeschlossen",
|
||||||
@@ -221,80 +409,273 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
{
|
{
|
||||||
key: "projecttype",
|
key: "projecttype",
|
||||||
label: "Typ",
|
label: "Typ",
|
||||||
component: projecttype
|
component: projecttype,
|
||||||
|
inputType: "select",
|
||||||
|
selectDataType: "projecttypes",
|
||||||
|
selectOptionAttribute: "name",
|
||||||
|
selectSearchAttributes: ['name'],
|
||||||
},{
|
},{
|
||||||
key: "phase",
|
key: "phase",
|
||||||
label: "Phase"
|
label: "Phase"
|
||||||
},{
|
},{
|
||||||
key: "name",
|
key: "name",
|
||||||
label: "Name"
|
label: "Name",
|
||||||
|
title: true,
|
||||||
|
inputType: "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "customer",
|
key: "customer",
|
||||||
label: "Kunde",
|
label: "Kunde",
|
||||||
component: customer
|
component: customer,
|
||||||
|
inputType: "select",
|
||||||
|
selectDataType: "customers",
|
||||||
|
selectOptionAttribute: "name",
|
||||||
|
selectSearchAttributes: ['name'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "notes",
|
key: "notes",
|
||||||
label: "Notizen",
|
label: "Notizen",
|
||||||
|
inputType: "textarea"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "plant",
|
key: "plant",
|
||||||
label: "Objekt",
|
label: "Objekt",
|
||||||
component: plant
|
component: plant,
|
||||||
|
inputType: "select",
|
||||||
|
selectDataType: "plants",
|
||||||
|
selectOptionAttribute: "name",
|
||||||
|
selectSearchAttributes: ['name'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "profiles",
|
key: "profiles",
|
||||||
label: "Benutzer"
|
label: "Berechtigte Benutzer",
|
||||||
}]
|
inputType: "select",
|
||||||
|
selectDataType: "profiles",
|
||||||
|
selectOptionAttribute: "fullName",
|
||||||
|
selectSearchAttributes: ['fullName'],
|
||||||
|
selectMultiple: true
|
||||||
|
},],
|
||||||
|
showTabs: [
|
||||||
|
{
|
||||||
|
key: "information",
|
||||||
|
label: "Informationen"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "phases",
|
||||||
|
label: "Phasen"
|
||||||
|
},{
|
||||||
|
key: "tasks",
|
||||||
|
label: "Aufgaben"
|
||||||
|
},{
|
||||||
|
key: "documents",
|
||||||
|
label: "Dokumente"
|
||||||
|
}/*,{
|
||||||
|
key: "timetracking",
|
||||||
|
label: "Zeiterfassung"
|
||||||
|
},{
|
||||||
|
key: "events",
|
||||||
|
label: "Termine"
|
||||||
|
},{
|
||||||
|
key: "material",
|
||||||
|
label: "Material"
|
||||||
|
}*/]
|
||||||
},
|
},
|
||||||
vehicles: {
|
vehicles: {
|
||||||
label: "Fahrzeuge",
|
label: "Fahrzeuge",
|
||||||
labelSingle: "Fahrzeug",
|
labelSingle: "Fahrzeug",
|
||||||
|
isStandardEntity: true,
|
||||||
redirect:true,
|
redirect:true,
|
||||||
historyItemHolder: "vehicle",
|
historyItemHolder: "vehicle",
|
||||||
|
supabaseSelectWithInformation: "*, checks(*), documents(*)",
|
||||||
filters:[],
|
filters:[],
|
||||||
templateColumns:[
|
templateColumns:[
|
||||||
{
|
{
|
||||||
key: 'active',
|
key: 'active',
|
||||||
label: "Aktiv",
|
label: "Aktiv",
|
||||||
component: active
|
component: active,
|
||||||
|
inputType: "bool"
|
||||||
},{
|
},{
|
||||||
key: 'licensePlate',
|
key: 'licensePlate',
|
||||||
label: "Kennzeichen"
|
label: "Kennzeichen",
|
||||||
|
inputType: "text",
|
||||||
|
title: true
|
||||||
},{
|
},{
|
||||||
key: 'vin',
|
key: 'vin',
|
||||||
label: "Identifikationnummer"
|
label: "Identifikationnummer",
|
||||||
|
inputType: "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "type",
|
key: "type",
|
||||||
label: "Typ",
|
label: "Typ",
|
||||||
|
inputType: "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "driver",
|
||||||
|
label: "Fahrer",
|
||||||
|
inputType: "select",
|
||||||
|
selectDataType: "profiles",
|
||||||
|
selectOptionAttribute: "fullName"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "tankSize",
|
||||||
|
label: "Tankvolumen",
|
||||||
|
unit: "L",
|
||||||
|
inputType: "number"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "buildYear",
|
||||||
|
label: "Baujahr",
|
||||||
|
inputType: "number"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "towingCapacity",
|
||||||
|
label: "Anhängelast",
|
||||||
|
unit: "kG",
|
||||||
|
inputType: "number"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "color",
|
||||||
|
label: "Farbe",
|
||||||
|
inputType: "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "powerInKW",
|
||||||
|
label: "Leistung",
|
||||||
|
unit: "kW",
|
||||||
|
inputType: "number"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "profiles",
|
||||||
|
label: "Berechtigte Benutzer",
|
||||||
|
inputType: "select",
|
||||||
|
selectDataType: "profiles",
|
||||||
|
selectOptionAttribute: "fullName",
|
||||||
|
selectSearchAttributes: ['fullName'],
|
||||||
|
selectMultiple: true
|
||||||
|
},
|
||||||
|
],
|
||||||
|
showTabs: [
|
||||||
|
{
|
||||||
|
label: 'Informationen',
|
||||||
|
}, {
|
||||||
|
label: 'Dokumente',
|
||||||
|
}, {
|
||||||
|
label: 'Überprüfungen',
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
vendors: {
|
vendors: {
|
||||||
label: "Lieferanten",
|
label: "Lieferanten",
|
||||||
labelSingle: "Lieferant",
|
labelSingle: "Lieferant",
|
||||||
|
isStandardEntity: true,
|
||||||
redirect:true,
|
redirect:true,
|
||||||
numberRangeHolder: "vendorNumber",
|
numberRangeHolder: "vendorNumber",
|
||||||
historyItemHolder: "vendor",
|
historyItemHolder: "vendor",
|
||||||
filters: [],
|
supabaseSortColumn: "vendorNumber",
|
||||||
|
supabaseSelectWithInformation: "*, contacts(*)",
|
||||||
|
filters: [{
|
||||||
|
name: "SEPA nicht erteilt",
|
||||||
|
"filterFunction": function (row) {
|
||||||
|
return !row.hasSEPA
|
||||||
|
}
|
||||||
|
}],
|
||||||
templateColumns: [
|
templateColumns: [
|
||||||
{
|
{
|
||||||
key: 'vendorNumber',
|
key: 'vendorNumber',
|
||||||
label: "Lieferantennummer",
|
label: "Lieferantennummer",
|
||||||
|
inputType: "text",
|
||||||
|
inputIsNumberRange: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "name",
|
key: "name",
|
||||||
label: "Name"
|
label: "Name",
|
||||||
|
title: true,
|
||||||
|
inputType: "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "infoData.streetNumber",
|
||||||
|
label: "Straße + Hausnummer",
|
||||||
|
inputType: "text",
|
||||||
|
disabledInTable: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "infoData.special",
|
||||||
|
label: "Adresszusatz",
|
||||||
|
inputType: "text",
|
||||||
|
disabledInTable: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "infoData.zip",
|
||||||
|
label: "Postleitzahl",
|
||||||
|
inputType: "number",
|
||||||
|
disabledInTable: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "infoData.city",
|
||||||
|
label: "Stadt",
|
||||||
|
inputType: "text",
|
||||||
|
disabledInTable: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "infoData.country",
|
||||||
|
label: "Land",
|
||||||
|
inputType: "select",
|
||||||
|
selectDataType: "countrys",
|
||||||
|
selectOptionAttribute: "name",
|
||||||
|
selectValueAttribute: "name",
|
||||||
|
disabledInTable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "address",
|
key: "address",
|
||||||
label: "Adresse"
|
label: "Adresse",
|
||||||
|
component: address
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "infoData.tel",
|
||||||
|
label: "Telefon",
|
||||||
|
inputType: "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "infoData.email",
|
||||||
|
label: "E-Mail",
|
||||||
|
inputType: "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "infoData.web",
|
||||||
|
label: "Web",
|
||||||
|
inputType: "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "infoData.ustid",
|
||||||
|
label: "USt-Id",
|
||||||
|
inputType: "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "hasSEPA",
|
||||||
|
label: "SEPA Mandat erteilt",
|
||||||
|
inputType: "bool",
|
||||||
|
component: sepa
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "notes",
|
key: "notes",
|
||||||
label: "Notizen"
|
label: "Notizen",
|
||||||
|
inputType: "textarea"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "profiles",
|
||||||
|
label: "Berechtigte Benutzer",
|
||||||
|
inputType: "select",
|
||||||
|
selectDataType: "profiles",
|
||||||
|
selectOptionAttribute: "fullName",
|
||||||
|
selectSearchAttributes: ['fullName'],
|
||||||
|
selectMultiple: true
|
||||||
|
},
|
||||||
|
],
|
||||||
|
showTabs: [
|
||||||
|
{
|
||||||
|
label: 'Informationen',
|
||||||
|
}, {
|
||||||
|
label: 'Dokumente',
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -798,8 +1179,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
name = "Kategorie"
|
name = "Kategorie"
|
||||||
} else if(key === "profile") {
|
} else if(key === "profile") {
|
||||||
name = "Mitarbeiter"
|
name = "Mitarbeiter"
|
||||||
if(prop.data.o) oldVal = profiles.value.find(i => i.id === prop.data.o).fullName
|
if(prop.data.o) oldVal = profileStore.profiles.find(i => i.id === prop.data.o).fullName
|
||||||
if(prop.data.n) newVal = profiles.value.find(i => i.id === prop.data.n).fullName
|
if(prop.data.n) newVal = profileStore.profiles.find(i => i.id === prop.data.n).fullName
|
||||||
} else if(key === "plant") {
|
} else if(key === "plant") {
|
||||||
name = "Objekt"
|
name = "Objekt"
|
||||||
if(prop.data.o) oldVal = plants.value.find(i => i.id === prop.data.o).name
|
if(prop.data.o) oldVal = plants.value.find(i => i.id === prop.data.o).name
|
||||||
@@ -822,8 +1203,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
name = "Leistung"
|
name = "Leistung"
|
||||||
} else if(key === "driver") {
|
} else if(key === "driver") {
|
||||||
name = "Fahrer"
|
name = "Fahrer"
|
||||||
if(prop.data.o) oldVal = profiles.value.find(i => i.id === prop.data.o).fullName
|
if(prop.data.o) oldVal = profileStore.profiles.find(i => i.id === prop.data.o).fullName
|
||||||
if(prop.data.n) newVal = profiles.value.find(i => i.id === prop.data.n).fullName
|
if(prop.data.n) newVal = profileStore.profiles.find(i => i.id === prop.data.n).fullName
|
||||||
} else if(key === "projecttype") {
|
} else if(key === "projecttype") {
|
||||||
name = "Projekttyp"
|
name = "Projekttyp"
|
||||||
|
|
||||||
@@ -856,7 +1237,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
|
|
||||||
let historyItem = {
|
let historyItem = {
|
||||||
text: text,
|
text: text,
|
||||||
createdBy: activeProfile.value.id,
|
createdBy: profileStore.activeProfile.id,
|
||||||
oldVal: prop.data.o,
|
oldVal: prop.data.o,
|
||||||
newVal: prop.data.n,
|
newVal: prop.data.n,
|
||||||
tenant: profileStore.currentTenant
|
tenant: profileStore.currentTenant
|
||||||
@@ -971,7 +1352,13 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
|
|
||||||
|
|
||||||
toast.add({title: `${dataTypes[dataType].labelSingle} hinzugefügt`})
|
toast.add({title: `${dataTypes[dataType].labelSingle} hinzugefügt`})
|
||||||
if(dataTypes[dataType].redirect) await router.push(`/${dataType}/show/${supabaseData[0].id}`)
|
if(dataTypes[dataType].redirect) {
|
||||||
|
if(dataTypes[dataType].isStandardEntity) {
|
||||||
|
await router.push(dataTypes[dataType].redirectToList ? `/standardEntity/${dataType}` : `/standardEntity/${dataType}/show/${data.id}`)
|
||||||
|
} else {
|
||||||
|
await router.push(dataTypes[dataType].redirectToList ? `/${dataType}` : `/${dataType}/show/${data.id}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
return supabaseData
|
return supabaseData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1022,9 +1409,15 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
toast.add({title: `Fehler beim Speichern`, color: 'rose'})
|
toast.add({title: `Fehler beim Speichern`, color: 'rose'})
|
||||||
} else if(supabaseData) {
|
} else if(supabaseData) {
|
||||||
//await eval(dataType + '.value[' + dataType + '.value.findIndex(i => i.id === ' + JSON.stringify(data.id) + ')] = ' + JSON.stringify(supabaseData[0]))
|
//await eval(dataType + '.value[' + dataType + '.value.findIndex(i => i.id === ' + JSON.stringify(data.id) + ')] = ' + JSON.stringify(supabaseData[0]))
|
||||||
if(dataType === 'profiles') await fetchProfiles()
|
//if(dataType === 'profiles') await fetchProfiles()
|
||||||
toast.add({title: `${dataTypes[dataType].labelSingle} gespeichert`})
|
toast.add({title: `${dataTypes[dataType].labelSingle} gespeichert`})
|
||||||
if(dataTypes[dataType].redirect) await router.push(dataTypes[dataType].redirectToList ? `/${dataType}` : `/${dataType}/show/${data.id}`)
|
if(dataTypes[dataType].redirect) {
|
||||||
|
if(dataTypes[dataType].isStandardEntity) {
|
||||||
|
await router.push(dataTypes[dataType].redirectToList ? `/standardEntity/${dataType}` : `/standardEntity/${dataType}/show/${data.id}`)
|
||||||
|
} else {
|
||||||
|
await router.push(dataTypes[dataType].redirectToList ? `/${dataType}` : `/${dataType}/show/${data.id}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
return supabaseData
|
return supabaseData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1441,19 +1834,19 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const getEventTypes = computed(() => {
|
const getEventTypes = computed(() => {
|
||||||
return ownTenant.value.calendarConfig.eventTypes
|
return profileStore.ownTenant.calendarConfig.eventTypes
|
||||||
})
|
})
|
||||||
|
|
||||||
const getTimeTypes = computed(() => {
|
const getTimeTypes = computed(() => {
|
||||||
return ownTenant.value.timeConfig.timeTypes
|
return profileStore.ownTenant.timeConfig.timeTypes
|
||||||
})
|
})
|
||||||
|
|
||||||
const getDocumentTags = computed(() => {
|
const getDocumentTags = computed(() => {
|
||||||
return ownTenant.value.tags.documents
|
return profileStore.ownTenant.tags.documents
|
||||||
})
|
})
|
||||||
|
|
||||||
const getMeasures = computed(() => {
|
const getMeasures = computed(() => {
|
||||||
return ownTenant.value.measures
|
return profileStore.ownTenant.measures
|
||||||
})
|
})
|
||||||
|
|
||||||
const getResources = computed(() => {
|
const getResources = computed(() => {
|
||||||
@@ -1511,7 +1904,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
const getEvents = computed(() => {
|
const getEvents = computed(() => {
|
||||||
return [
|
return [
|
||||||
...events.value.map(event => {
|
...events.value.map(event => {
|
||||||
let eventColor = ownTenant.value.calendarConfig.eventTypes.find(type => type.label === event.type).color
|
let eventColor = profileStore.ownTenant.calendarConfig.eventTypes.find(type => type.label === event.type).color
|
||||||
|
|
||||||
let title = ""
|
let title = ""
|
||||||
if(event.title) {
|
if(event.title) {
|
||||||
@@ -1548,7 +1941,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
console.log(event)
|
console.log(event)
|
||||||
event.resources.forEach(resource => {
|
event.resources.forEach(resource => {
|
||||||
console.log(resource)
|
console.log(resource)
|
||||||
let eventColor = ownTenant.value.calendarConfig.eventTypes.find(type => type.label === event.type).color
|
let eventColor = profileStore.ownTenant.calendarConfig.eventTypes.find(type => type.label === event.type).color
|
||||||
|
|
||||||
let title = ""
|
let title = ""
|
||||||
if(event.title) {
|
if(event.title) {
|
||||||
@@ -1580,7 +1973,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
/*...events.value.map(event => {
|
/*...events.value.map(event => {
|
||||||
|
|
||||||
|
|
||||||
let eventColor = ownTenant.value.calendarConfig.eventTypes.find(type => type.label === event.type).color
|
let eventColor = profileStore.ownTenant.calendarConfig.eventTypes.find(type => type.label === event.type).color
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...event,
|
...event,
|
||||||
|
|||||||
Reference in New Issue
Block a user