Changes
This commit is contained in:
@@ -8,6 +8,9 @@ const props = defineProps({
|
|||||||
elementId: {
|
elementId: {
|
||||||
required: true,
|
required: true,
|
||||||
type: String
|
type: String
|
||||||
|
},
|
||||||
|
renderHeadline: {
|
||||||
|
type: Boolean
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const { metaSymbol } = useShortcuts()
|
const { metaSymbol } = useShortcuts()
|
||||||
@@ -45,6 +48,8 @@ const historyItems = computed(() => {
|
|||||||
items = dataStore.historyItems.filter(i => i.product === elementId)
|
items = dataStore.historyItems.filter(i => i.product === elementId)
|
||||||
} else if(type === "profile") {
|
} else if(type === "profile") {
|
||||||
items = dataStore.historyItems.filter(i => i.profile === elementId)
|
items = dataStore.historyItems.filter(i => i.profile === elementId)
|
||||||
|
} else if(type === "absencerequest") {
|
||||||
|
items = dataStore.historyItems.filter(i => i.absenceRequest === elementId)
|
||||||
}
|
}
|
||||||
|
|
||||||
return items
|
return items
|
||||||
@@ -80,6 +85,8 @@ const addHistoryItem = async () => {
|
|||||||
addHistoryItemData.value.product = elementId
|
addHistoryItemData.value.product = elementId
|
||||||
} else if(type === "profile") {
|
} else if(type === "profile") {
|
||||||
addHistoryItemData.value.profile = elementId
|
addHistoryItemData.value.profile = elementId
|
||||||
|
} else if(type === "absencerequest") {
|
||||||
|
addHistoryItemData.value.absenceRequest = elementId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -137,13 +144,27 @@ const renderText = (text) => {
|
|||||||
</template>
|
</template>
|
||||||
</UCard>
|
</UCard>
|
||||||
</UModal>
|
</UModal>
|
||||||
<Toolbar>
|
<Toolbar
|
||||||
|
v-if="!renderHeadline"
|
||||||
|
>
|
||||||
<UButton
|
<UButton
|
||||||
@click="showAddHistoryItemModal = true"
|
@click="showAddHistoryItemModal = true"
|
||||||
>
|
>
|
||||||
+ Eintrag
|
+ Eintrag
|
||||||
</UButton>
|
</UButton>
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
|
<div v-else>
|
||||||
|
<div :class="`flex justify-between`">
|
||||||
|
<p class="text-2xl">Logbuch</p>
|
||||||
|
<UButton
|
||||||
|
@click="showAddHistoryItemModal = true"
|
||||||
|
>
|
||||||
|
+ Eintrag
|
||||||
|
</UButton>
|
||||||
|
</div>
|
||||||
|
<UDivider class="mt-3"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-if="historyItems.length > 0"
|
v-if="historyItems.length > 0"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
import HistoryDisplay from "~/components/HistoryDisplay.vue";
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: "auth"
|
middleware: "auth"
|
||||||
@@ -49,9 +50,9 @@ const editItem = async () => {
|
|||||||
|
|
||||||
const cancelEditorCreate = () => {
|
const cancelEditorCreate = () => {
|
||||||
if(currentItem.value) {
|
if(currentItem.value) {
|
||||||
router.push(`/tasks/show/${currentItem.value.id}`)
|
router.push(`/absenceRequests/show/${currentItem.value.id}`)
|
||||||
} else {
|
} else {
|
||||||
router.push(`/tasks/`)
|
router.push(`/absenceRequests/`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setupPage()
|
setupPage()
|
||||||
@@ -62,13 +63,13 @@ setupPage()
|
|||||||
<template #right>
|
<template #right>
|
||||||
<UButton
|
<UButton
|
||||||
v-if="mode === 'edit'"
|
v-if="mode === 'edit'"
|
||||||
@click="dataStore.updateItem('tasks',itemInfo)"
|
@click="dataStore.updateItem('absencerequests',itemInfo)"
|
||||||
>
|
>
|
||||||
Speichern
|
Speichern
|
||||||
</UButton>
|
</UButton>
|
||||||
<UButton
|
<UButton
|
||||||
v-else-if="mode === 'create'"
|
v-else-if="mode === 'create'"
|
||||||
@click="dataStore.createNewItem('tasks',itemInfo)"
|
@click="dataStore.createNewItem('absencerequests',itemInfo)"
|
||||||
>
|
>
|
||||||
Erstellen
|
Erstellen
|
||||||
</UButton>
|
</UButton>
|
||||||
@@ -103,7 +104,7 @@ setupPage()
|
|||||||
</template>
|
</template>
|
||||||
</UDashboardNavbar>
|
</UDashboardNavbar>
|
||||||
<UTabs
|
<UTabs
|
||||||
:items="[{label: 'Informationen'}]"
|
:items="[{label: 'Informationen'}, {label: 'Logbuch'}]"
|
||||||
v-if="currentItem && mode == 'show'"
|
v-if="currentItem && mode == 'show'"
|
||||||
class="p-5"
|
class="p-5"
|
||||||
>
|
>
|
||||||
@@ -118,6 +119,13 @@ setupPage()
|
|||||||
<p>Notizen: {{currentItem.notes}}</p>
|
<p>Notizen: {{currentItem.notes}}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else-if="item.label === 'Logbuch'">
|
||||||
|
<HistoryDisplay
|
||||||
|
type="absencerequest"
|
||||||
|
v-if="currentItem"
|
||||||
|
:element-id="currentItem.id"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</UCard>
|
</UCard>
|
||||||
</template>
|
</template>
|
||||||
</UTabs>
|
</UTabs>
|
||||||
@@ -159,7 +167,11 @@ setupPage()
|
|||||||
|
|
||||||
<UFormGroup label="Start:">
|
<UFormGroup label="Start:">
|
||||||
<UPopover :popper="{ placement: 'bottom-start' }">
|
<UPopover :popper="{ placement: 'bottom-start' }">
|
||||||
<UButton icon="i-heroicons-calendar-days-20-solid" :label="itemInfo.start ? dayjs(itemInfo.start).format('DD.MM.YYYY') : 'Datum auswählen'" />
|
<UButton
|
||||||
|
icon="i-heroicons-calendar-days-20-solid"
|
||||||
|
:label="itemInfo.start ? dayjs(itemInfo.start).format('DD.MM.YYYY') : 'Datum auswählen'"
|
||||||
|
variant="outline"
|
||||||
|
/>
|
||||||
|
|
||||||
<template #panel="{ close }">
|
<template #panel="{ close }">
|
||||||
<LazyDatePicker v-model="itemInfo.start" @close="close" />
|
<LazyDatePicker v-model="itemInfo.start" @close="close" />
|
||||||
@@ -169,7 +181,11 @@ setupPage()
|
|||||||
|
|
||||||
<UFormGroup label="Ende:">
|
<UFormGroup label="Ende:">
|
||||||
<UPopover :popper="{ placement: 'bottom-start' }">
|
<UPopover :popper="{ placement: 'bottom-start' }">
|
||||||
<UButton icon="i-heroicons-calendar-days-20-solid" :label="itemInfo.end ? dayjs(itemInfo.end).format('DD.MM.YYYY') : 'Datum auswählen'" />
|
<UButton
|
||||||
|
variant="outline"
|
||||||
|
icon="i-heroicons-calendar-days-20-solid"
|
||||||
|
:label="itemInfo.end ? dayjs(itemInfo.end).format('DD.MM.YYYY') : 'Datum auswählen'"
|
||||||
|
/>
|
||||||
|
|
||||||
<template #panel="{ close }">
|
<template #panel="{ close }">
|
||||||
<LazyDatePicker v-model="itemInfo.end" @close="close" />
|
<LazyDatePicker v-model="itemInfo.end" @close="close" />
|
||||||
|
|||||||
@@ -61,23 +61,6 @@ const convertResourceIds = () => {
|
|||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const createEvent = async () => {
|
|
||||||
const {data,error} = await supabase
|
|
||||||
.from("events")
|
|
||||||
.insert([newEventData.value])
|
|
||||||
.select()
|
|
||||||
|
|
||||||
if(error) {
|
|
||||||
console.log(error)
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log("OK")
|
|
||||||
showNewEventModal.value = false
|
|
||||||
newEventData.value = {}
|
|
||||||
dataStore.fetchEvents()
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//Calendar Config
|
//Calendar Config
|
||||||
const calendarOptionsGrid = reactive({
|
const calendarOptionsGrid = reactive({
|
||||||
@@ -96,23 +79,19 @@ const calendarOptionsGrid = reactive({
|
|||||||
weekNumbers: true,
|
weekNumbers: true,
|
||||||
select: function(info) {
|
select: function(info) {
|
||||||
console.log(info)
|
console.log(info)
|
||||||
/*newEventData.value.resourceId = info.resource.id
|
|
||||||
if(info.resource.extendedProps){
|
|
||||||
newEventData.value.resourceType = info.resource.extendedProps.type
|
|
||||||
}*/
|
|
||||||
|
|
||||||
newEventData.value.start = info.startStr
|
|
||||||
newEventData.value.end = info.endStr
|
|
||||||
//showNewEventModal.value = true
|
|
||||||
|
|
||||||
router.push(`/events/edit/?start=${info.startStr}&end=${info.endStr}&source=grid`)
|
router.push(`/events/edit/?start=${info.startStr}&end=${info.endStr}&source=grid`)
|
||||||
|
|
||||||
},
|
},
|
||||||
eventClick: function (info){
|
eventClick: function (info){
|
||||||
console.log(info)
|
console.log(info)
|
||||||
router.push(`/events/show/${info.event.id}`)
|
if(info.event.title.startsWith("Abw.:")){
|
||||||
//selectedEvent.value = info.event
|
router.push(`/absencerequests/show/${info.event.id}`)
|
||||||
//showEventModal.value = true
|
} else {
|
||||||
|
router.push(`/events/show/${info.event.id}`)
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -130,28 +109,14 @@ const calendarOptionsTimeline = reactive({
|
|||||||
initialEvents: dataStore.getEventsByResource,
|
initialEvents: dataStore.getEventsByResource,
|
||||||
selectable: true,
|
selectable: true,
|
||||||
select: function (info) {
|
select: function (info) {
|
||||||
/*let resourceObj = {}
|
|
||||||
|
|
||||||
resourceObj.id = info.resource.id
|
|
||||||
if(info.resource.extendedProps){
|
|
||||||
resourceObj.type = info.resource.extendedProps.type
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(resourceObj)*/
|
|
||||||
|
|
||||||
selectedResources.value = [info.resource.id]
|
|
||||||
newEventData.value.start = info.startStr
|
|
||||||
newEventData.value.end = info.endStr
|
|
||||||
console.log(newEventData.value)
|
|
||||||
convertResourceIds()
|
|
||||||
//showNewEventModal.value = true
|
|
||||||
|
|
||||||
router.push(`/events/edit/?start=${info.startStr}&end=${info.endStr}&resources=${JSON.stringify([info.resource.id])}&source=timeline`)
|
router.push(`/events/edit/?start=${info.startStr}&end=${info.endStr}&resources=${JSON.stringify([info.resource.id])}&source=timeline`)
|
||||||
},
|
},
|
||||||
eventClick: function (info){
|
eventClick: function (info){
|
||||||
router.push(`/events/show/${info.event.id}`)
|
if(info.event.title.startsWith("Abw.:")){
|
||||||
//selectedEvent.value = info.event
|
router.push(`/absencerequests/show/${info.event.id}`)
|
||||||
//showEventModal.value = true
|
} else {
|
||||||
|
router.push(`/events/show/${info.event.id}`)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
resourceGroupField: "type",
|
resourceGroupField: "type",
|
||||||
resourceOrder: "-type",
|
resourceOrder: "-type",
|
||||||
@@ -184,125 +149,12 @@ const calendarOptionsTimeline = reactive({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<!-- NEW EVENT MODAL -->
|
|
||||||
<UModal
|
|
||||||
v-model="showNewEventModal"
|
|
||||||
>
|
|
||||||
<UCard>
|
|
||||||
<template #header>
|
|
||||||
Neuen Termin erstellen
|
|
||||||
</template>
|
|
||||||
<UFormGroup
|
|
||||||
label="Resource:"
|
|
||||||
>
|
|
||||||
<USelectMenu
|
|
||||||
v-model="selectedResources"
|
|
||||||
:options="resources"
|
|
||||||
option-attribute="title"
|
|
||||||
value-attribute="id"
|
|
||||||
multiple
|
|
||||||
@change="convertResourceIds"
|
|
||||||
>
|
|
||||||
<template #label>
|
|
||||||
<span v-if="selectedResources.length == 0">Keine Ressourcen ausgewählt</span>
|
|
||||||
<span v-else >{{ selectedResources.length }} ausgewählt</span>
|
|
||||||
</template>
|
|
||||||
</USelectMenu>
|
|
||||||
</UFormGroup>
|
|
||||||
<UFormGroup
|
|
||||||
label="Titel:"
|
|
||||||
>
|
|
||||||
<UInput
|
|
||||||
v-model="newEventData.title"
|
|
||||||
/>
|
|
||||||
</UFormGroup>
|
|
||||||
<UFormGroup
|
|
||||||
label="Projekt:"
|
|
||||||
>
|
|
||||||
<USelectMenu
|
|
||||||
v-model="newEventData.project"
|
|
||||||
:options="dataStore.projects"
|
|
||||||
option-attribute="name"
|
|
||||||
value-attribute="id"
|
|
||||||
searchable
|
|
||||||
searchable-placeholder="Suche..."
|
|
||||||
:search-attributes="['name']"
|
|
||||||
>
|
|
||||||
<template #label>
|
|
||||||
{{dataStore.getProjectById(newEventData.project) ? dataStore.getProjectById(newEventData.project).name : "Kein Projekt ausgewählt"}}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</USelectMenu>
|
|
||||||
</UFormGroup>
|
|
||||||
<UFormGroup
|
|
||||||
label="Typ:"
|
|
||||||
>
|
|
||||||
<USelectMenu
|
|
||||||
v-model="newEventData.type"
|
|
||||||
:options="eventTypes"
|
|
||||||
option-attribute="label"
|
|
||||||
value-attribute="label"
|
|
||||||
>
|
|
||||||
|
|
||||||
</USelectMenu>
|
|
||||||
</UFormGroup>
|
|
||||||
<UFormGroup
|
|
||||||
label="Start:"
|
|
||||||
>
|
|
||||||
<UInput
|
|
||||||
v-model="newEventData.start"
|
|
||||||
/>
|
|
||||||
</UFormGroup>
|
|
||||||
<UFormGroup
|
|
||||||
label="Ende:"
|
|
||||||
>
|
|
||||||
<UInput
|
|
||||||
v-model="newEventData.end"
|
|
||||||
/>
|
|
||||||
</UFormGroup>
|
|
||||||
|
|
||||||
<template #footer>
|
|
||||||
<UButton
|
|
||||||
@click="createEvent"
|
|
||||||
>
|
|
||||||
Erstellen
|
|
||||||
</UButton>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</UCard>
|
|
||||||
</UModal>
|
|
||||||
|
|
||||||
<!--SHOW EVENT MODAL -->
|
|
||||||
<UModal
|
|
||||||
v-model="showEventModal"
|
|
||||||
>
|
|
||||||
<UCard>
|
|
||||||
<template #header>
|
|
||||||
{{selectedEvent.title}}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
Start: {{dayjs(selectedEvent.startStr).format("DD.MM.YYYY HH:mm")}}<br>
|
|
||||||
Ende: {{dayjs(selectedEvent.endStr).format("DD.MM.YYYY HH:mm")}}
|
|
||||||
|
|
||||||
<DevOnly>
|
|
||||||
<UDivider class="my-3"/>
|
|
||||||
{{selectedEvent}}
|
|
||||||
</DevOnly>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</UCard>
|
|
||||||
|
|
||||||
|
|
||||||
</UModal>
|
|
||||||
|
|
||||||
<UDashboardNavbar :title="currentItem ? currentItem.name : ''">
|
<UDashboardNavbar :title="currentItem ? currentItem.name : ''">
|
||||||
<template #right>
|
<template #right>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</UDashboardNavbar>
|
</UDashboardNavbar>
|
||||||
|
|
||||||
|
|
||||||
<div v-if="mode === 'grid'" class="p-5">
|
<div v-if="mode === 'grid'" class="p-5">
|
||||||
<FullCalendar
|
<FullCalendar
|
||||||
:options="calendarOptionsGrid"
|
:options="calendarOptionsGrid"
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ setupPage()
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<UDashboardNavbar :title="currentItem ? currentItem.name : (mode === 'create' ? 'Kunde erstellen' : 'Kunde bearbeiten')">
|
<UDashboardNavbar :title="currentItem ? `Kunde: ${currentItem.name}` : (mode === 'create' ? 'Kunde erstellen' : 'Kunde bearbeiten')">
|
||||||
<template #right>
|
<template #right>
|
||||||
<UButton
|
<UButton
|
||||||
v-if="mode === 'edit'"
|
v-if="mode === 'edit'"
|
||||||
@@ -83,120 +83,141 @@ setupPage()
|
|||||||
<UBadge
|
<UBadge
|
||||||
v-if="currentItem.active"
|
v-if="currentItem.active"
|
||||||
>
|
>
|
||||||
Kunde aktiv
|
Aktiv
|
||||||
</UBadge>
|
</UBadge>
|
||||||
<UBadge
|
<UBadge
|
||||||
v-else
|
v-else
|
||||||
color="red"
|
color="red"
|
||||||
>
|
>
|
||||||
Kunde gesperrt
|
Gesperrt
|
||||||
</UBadge>
|
</UBadge>
|
||||||
</template>
|
</template>
|
||||||
</UDashboardNavbar>
|
</UDashboardNavbar>
|
||||||
|
|
||||||
<UTabs
|
<UTabs
|
||||||
v-if="currentItem && mode == 'show'"
|
v-if="currentItem && mode == 'show'"
|
||||||
:items="[{label: 'Informationen'}, {label: 'Logbuch'}, {label: 'Projekte'},{label: 'Objekte'},{label: 'Verträge'}, {label: 'Ansprechpartner'}]"
|
:items="[{label: 'Informationen'}, /*{label: 'Logbuch'},*/ {label: 'Projekte'},{label: 'Objekte'},{label: 'Verträge'}, {label: 'Ansprechpartner'}]"
|
||||||
class="p-5"
|
class="p-5"
|
||||||
>
|
>
|
||||||
<template #item="{item}">
|
<template #item="{item}">
|
||||||
<UCard class="mt-5">
|
<div v-if="item.label === 'Informationen'" class="flex mt-5">
|
||||||
<div v-if="item.label === 'Informationen'">
|
<div class="w-1/2 mr-5">
|
||||||
|
<UCard >
|
||||||
|
<div class="text-wrap">
|
||||||
|
<p>Kundennummer: {{currentItem.customerNumber}}</p>
|
||||||
|
<p>Typ: {{currentItem.isCompany ? 'Firma' : 'Privatperson'}}</p>
|
||||||
|
<p v-if="currentItem.infoData.street">Straße + Hausnummer: {{currentItem.infoData.street}}</p>
|
||||||
|
<p v-if="currentItem.infoData.zip && currentItem.infoData.city">PLZ + Ort: {{currentItem.infoData.zip}} {{currentItem.infoData.city}}</p>
|
||||||
|
<p v-if="currentItem.infoData.tel">Telefon: {{currentItem.infoData.tel}}</p>
|
||||||
|
<p v-if="currentItem.infoData.email">E-Mail: {{currentItem.infoData.email}}</p>
|
||||||
|
<p v-if="currentItem.infoData.web">Web: {{currentItem.infoData.web}}</p>
|
||||||
|
<p v-if="currentItem.infoData.ustid">USt-Id: {{currentItem.infoData.ustid}}</p>
|
||||||
|
<p>Notizen:<br> {{currentItem.notes}}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</UCard>
|
||||||
|
<UCard class="mt-5">
|
||||||
|
<Toolbar>
|
||||||
|
<UButton
|
||||||
|
@click="router.push(`/contacts/create?customer=${currentItem.id}`)"
|
||||||
|
>
|
||||||
|
+ Ansprechpartner
|
||||||
|
</UButton>
|
||||||
|
</Toolbar>
|
||||||
|
<UTable
|
||||||
|
:rows="dataStore.getContactsByCustomerId(currentItem.id)"
|
||||||
|
@select="(row) => router.push(`/contacts/show/${row.id}`)"
|
||||||
|
:columns="[{label: 'Anrede', key: 'salutation'},{label: 'Name', key: 'fullName'},{label: 'Rolle', key: 'role'}]"
|
||||||
|
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine zugehörigen Ansprechpartner' }"
|
||||||
|
|
||||||
<div class="text-wrap">
|
|
||||||
<p>Kundennummer: {{currentItem.customerNumber}}</p>
|
|
||||||
<p v-if="currentItem.infoData.street">Straße + Hausnummer: {{currentItem.infoData.street}}<br></p>
|
|
||||||
<p v-if="currentItem.infoData.zip && currentItem.infoData.city">PLZ + Ort: {{currentItem.infoData.zip}} {{currentItem.infoData.city}}<br></p>
|
|
||||||
<p v-if="currentItem.infoData.tel">Telefon: {{currentItem.infoData.tel}}<br></p>
|
|
||||||
<p v-if="currentItem.infoData.email">E-Mail: {{currentItem.infoData.email}}<br></p>
|
|
||||||
<p v-if="currentItem.infoData.web">Web: {{currentItem.infoData.web}}<br></p>
|
|
||||||
<p v-if="currentItem.infoData.ustid">USt-Id: {{currentItem.infoData.ustid}}<br></p>
|
|
||||||
<p>Notizen: {{currentItem.notes}}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div v-else-if="item.label === 'Logbuch'">
|
|
||||||
<HistoryDisplay
|
|
||||||
type="customer"
|
|
||||||
v-if="currentItem"
|
|
||||||
:element-id="currentItem.id"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div v-else-if="item.label === 'Projekte'">
|
|
||||||
<Toolbar>
|
|
||||||
<UButton
|
|
||||||
@click="router.push(`/projects/create?customer=${currentItem.id}`)"
|
|
||||||
>
|
>
|
||||||
+ Projekt
|
|
||||||
</UButton>
|
|
||||||
</Toolbar>
|
|
||||||
<UTable
|
|
||||||
:rows="dataStore.getProjectsByCustomerId(currentItem.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' }"
|
|
||||||
|
|
||||||
>
|
</UTable>
|
||||||
|
</UCard>
|
||||||
</UTable>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="item.label === 'Objekte'">
|
<div class="w-1/2">
|
||||||
<Toolbar>
|
<UCard class="h-full">
|
||||||
<UButton
|
<HistoryDisplay
|
||||||
@click="router.push(`/plants/create?customer=${currentItem.id}`)"
|
type="customer"
|
||||||
>
|
v-if="currentItem"
|
||||||
+ Objekt
|
:element-id="currentItem.id"
|
||||||
</UButton>
|
:render-headline="true"
|
||||||
</Toolbar>
|
/>
|
||||||
<UTable
|
</UCard>
|
||||||
:rows="dataStore.getPlantsByCustomerId(currentItem.id)"
|
|
||||||
@select="(row) => router.push(`/plants/show/${row.id}`)"
|
|
||||||
:columns="[{label: 'Name', key: 'name'}]"
|
|
||||||
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine zugehörigen Objekte' }"
|
|
||||||
|
|
||||||
>
|
|
||||||
|
|
||||||
</UTable>
|
|
||||||
</div>
|
|
||||||
<div v-else-if="item.label === 'Verträge'">
|
|
||||||
<Toolbar>
|
|
||||||
<UButton
|
|
||||||
@click="router.push(`/contracts/create?customer=${currentItem.id}`)"
|
|
||||||
>
|
|
||||||
+ Objekt
|
|
||||||
</UButton>
|
|
||||||
</Toolbar>
|
|
||||||
<UTable
|
|
||||||
:rows="dataStore.getContractsByCustomerId(currentItem.id)"
|
|
||||||
@select="(row) => router.push(`/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>
|
|
||||||
</div>
|
|
||||||
<div v-else-if="item.label === 'Ansprechpartner'">
|
|
||||||
<Toolbar>
|
|
||||||
<UButton
|
|
||||||
@click="router.push(`/contacts/create?customer=${currentItem.id}`)"
|
|
||||||
>
|
|
||||||
+ Ansprechpartner
|
|
||||||
</UButton>
|
|
||||||
</Toolbar>
|
|
||||||
<UTable
|
|
||||||
:rows="dataStore.getContactsByCustomerId(currentItem.id)"
|
|
||||||
@select="(row) => router.push(`/contacts/show/${row.id}`)"
|
|
||||||
:columns="[{label: 'Anrede', key: 'salutation'},{label: 'Name', key: 'fullName'},{label: 'Rolle', key: 'role'}]"
|
|
||||||
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine zugehörigen Ansprechpartner' }"
|
|
||||||
|
|
||||||
>
|
|
||||||
|
|
||||||
</UTable>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</UCard>
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<UCard class="mt-5" v-else>
|
||||||
|
<div v-if="item.label === 'Informationen'" class="flex">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div v-else-if="item.label === 'Projekte'">
|
||||||
|
<Toolbar>
|
||||||
|
<UButton
|
||||||
|
@click="router.push(`/projects/create?customer=${currentItem.id}`)"
|
||||||
|
>
|
||||||
|
+ Projekt
|
||||||
|
</UButton>
|
||||||
|
</Toolbar>
|
||||||
|
<UTable
|
||||||
|
:rows="dataStore.getProjectsByCustomerId(currentItem.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 v-else-if="item.label === 'Objekte'">
|
||||||
|
<Toolbar>
|
||||||
|
<UButton
|
||||||
|
@click="router.push(`/plants/create?customer=${currentItem.id}`)"
|
||||||
|
>
|
||||||
|
+ Objekt
|
||||||
|
</UButton>
|
||||||
|
</Toolbar>
|
||||||
|
<UTable
|
||||||
|
:rows="dataStore.getPlantsByCustomerId(currentItem.id)"
|
||||||
|
@select="(row) => router.push(`/plants/show/${row.id}`)"
|
||||||
|
:columns="[{label: 'Name', key: 'name'}]"
|
||||||
|
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine zugehörigen Objekte' }"
|
||||||
|
|
||||||
|
>
|
||||||
|
|
||||||
|
</UTable>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="item.label === 'Verträge'">
|
||||||
|
<Toolbar>
|
||||||
|
<UButton
|
||||||
|
@click="router.push(`/contracts/create?customer=${currentItem.id}`)"
|
||||||
|
>
|
||||||
|
+ Objekt
|
||||||
|
</UButton>
|
||||||
|
</Toolbar>
|
||||||
|
<UTable
|
||||||
|
:rows="dataStore.getContractsByCustomerId(currentItem.id)"
|
||||||
|
@select="(row) => router.push(`/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>
|
||||||
|
</div>
|
||||||
|
</UCard>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</UTabs>
|
</UTabs>
|
||||||
<UForm v-else-if="mode === 'edit' || mode === 'create'" class="p-5">
|
<UForm v-else-if="mode === 'edit' || mode === 'create'" class="p-5">
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
<span v-else class="text-rose-500">Gesperrt</span>
|
<span v-else class="text-rose-500">Gesperrt</span>
|
||||||
</template>
|
</template>
|
||||||
<template #address-data="{row}">
|
<template #address-data="{row}">
|
||||||
{{row.infoData.street ? `${row.infoData.street}, ` : ''}}{{row.infoData.special ? `${row.infoData.special},` : ''}} {{(row.infoData.zip || row.infoData.city) ? `${row.infoData.zip} ${row.infoData.city}, ` : ''}} {{row.infoData.country}}
|
{{row.infoData.street ? `${row.infoData.street}, ` : ''}}{{row.infoData.special ? `${row.infoData.special},` : ''}} {{row.infoData.zip ? row.infoData.zip : ""}}{{row.infoData.city ? `${row.infoData.city}, ` : ''}} {{row.infoData.country}}
|
||||||
</template>
|
</template>
|
||||||
</UTable>
|
</UTable>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
82
spaces/pages/vendors/[mode]/[[id]].vue
vendored
82
spaces/pages/vendors/[mode]/[[id]].vue
vendored
@@ -46,7 +46,7 @@ setupPage()
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<UDashboardNavbar :title="currentItem ? currentItem.name : (mode === 'create' ? 'Lieferant erstellen' : 'Lieferant bearbeiten')">
|
<UDashboardNavbar :title="currentItem ? `Lieferant: ${currentItem.name}` : (mode === 'create' ? 'Lieferant erstellen' : 'Lieferant bearbeiten')">
|
||||||
<template #right>
|
<template #right>
|
||||||
<UButton
|
<UButton
|
||||||
v-if="mode === 'edit'"
|
v-if="mode === 'edit'"
|
||||||
@@ -77,51 +77,57 @@ setupPage()
|
|||||||
</template>
|
</template>
|
||||||
</UDashboardNavbar>
|
</UDashboardNavbar>
|
||||||
<UTabs
|
<UTabs
|
||||||
:items="[{label: 'Informationen'},{label: 'Logbuch'},{label: 'Ansprechpartner'},{label: 'Dokumente'}]"
|
:items="[{label: 'Informationen'},{label: 'Dokumente'}]"
|
||||||
v-if="currentItem && mode == 'show'"
|
v-if="currentItem && mode == 'show'"
|
||||||
class="p-5"
|
class="p-5"
|
||||||
>
|
>
|
||||||
<template #item="{item}">
|
<template #item="{item}">
|
||||||
<UCard class="mt-5">
|
<div v-if="item.label === 'Informationen'" class="mt-5 flex">
|
||||||
<div v-if="item.label === 'Informationen'">
|
<div class="w-1/2 mr-5">
|
||||||
|
<UCard>
|
||||||
|
<div v-if="currentItem.infoData" class="text-wrap">
|
||||||
|
<p v-if="currentItem.infoData.street">Straße + Hausnummer: {{currentItem.infoData.street}}</p>
|
||||||
|
<p v-if="currentItem.infoData.zip && currentItem.infoData.city">PLZ + Ort: {{currentItem.infoData.zip}} {{currentItem.infoData.city}}</p>
|
||||||
|
<p v-if="currentItem.infoData.tel">Telefon: {{currentItem.infoData.tel}}</p>
|
||||||
|
<p v-if="currentItem.infoData.email">E-Mail: {{currentItem.infoData.email}}</p>
|
||||||
|
<p v-if="currentItem.infoData.web">Web: {{currentItem.infoData.web}}</p>
|
||||||
|
<p v-if="currentItem.infoData.ustid">USt-Id: {{currentItem.infoData.ustid}}</p>
|
||||||
|
</div>
|
||||||
|
</UCard>
|
||||||
|
<UCard class="mt-5">
|
||||||
|
<Toolbar>
|
||||||
|
<UButton
|
||||||
|
@click="router.push(`/contacts/create?vendor=${currentItem.id}`)"
|
||||||
|
>
|
||||||
|
+ Ansprechpartner
|
||||||
|
</UButton>
|
||||||
|
</Toolbar>
|
||||||
|
<UTable
|
||||||
|
:rows="dataStore.getContactsByVendorId(currentItem.id)"
|
||||||
|
@select="(row) => router.push(`/contacts/show/${row.id}`)"
|
||||||
|
:columns="[{label: 'Anrede', key: 'salutation'},{label: 'Name', key: 'fullName'},{label: 'Rolle', key: 'role'}]"
|
||||||
|
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine zugehörigen Ansprechpartner' }"
|
||||||
|
|
||||||
|
|
||||||
<div v-if="currentItem.infoData" class="text-wrap">
|
|
||||||
<p v-if="currentItem.infoData.street">Straße + Hausnummer: {{currentItem.infoData.street}}</p>
|
|
||||||
<p v-if="currentItem.infoData.zip && currentItem.infoData.city">PLZ + Ort: {{currentItem.infoData.zip}} {{currentItem.infoData.city}}</p>
|
|
||||||
<p v-if="currentItem.infoData.tel">Telefon: {{currentItem.infoData.tel}}</p>
|
|
||||||
<p v-if="currentItem.infoData.email">E-Mail: {{currentItem.infoData.email}}</p>
|
|
||||||
<p v-if="currentItem.infoData.web">Web: {{currentItem.infoData.web}}</p>
|
|
||||||
<p v-if="currentItem.infoData.ustid">USt-Id: {{currentItem.infoData.ustid}}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div v-else-if="item.label === 'Logbuch'">
|
|
||||||
<HistoryDisplay
|
|
||||||
type="vendor"
|
|
||||||
v-if="currentItem"
|
|
||||||
:element-id="currentItem.id"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div v-else-if="item.label === 'Ansprechpartner'">
|
|
||||||
<Toolbar>
|
|
||||||
<UButton
|
|
||||||
@click="router.push(`/contacts/create?vendor=${currentItem.id}`)"
|
|
||||||
>
|
>
|
||||||
+ Ansprechpartner
|
|
||||||
</UButton>
|
|
||||||
</Toolbar>
|
|
||||||
<UTable
|
|
||||||
:rows="dataStore.getContactsByVendorId(currentItem.id)"
|
|
||||||
@select="(row) => router.push(`/contacts/show/${row.id}`)"
|
|
||||||
:columns="[{label: 'Anrede', key: 'salutation'},{label: 'Name', key: 'fullName'},{label: 'Rolle', key: 'role'}]"
|
|
||||||
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine zugehörigen Ansprechpartner' }"
|
|
||||||
|
|
||||||
>
|
|
||||||
|
|
||||||
</UTable>
|
|
||||||
|
|
||||||
|
</UTable>
|
||||||
|
</UCard>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="item.label === 'Dokumente'">
|
<div class="w-1/2">
|
||||||
|
<UCard class="h-full">
|
||||||
|
<HistoryDisplay
|
||||||
|
type="vendor"
|
||||||
|
v-if="currentItem"
|
||||||
|
:element-id="currentItem.id"
|
||||||
|
:render-headline="true"
|
||||||
|
/>
|
||||||
|
</UCard>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<UCard class="mt-5" v-else>
|
||||||
|
<div v-if="item.label === 'Dokumente'">
|
||||||
<InputGroup>
|
<InputGroup>
|
||||||
<DocumentUpload
|
<DocumentUpload
|
||||||
type="vendor"
|
type="vendor"
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
labelSingle: "Vertrag",
|
labelSingle: "Vertrag",
|
||||||
redirect:true
|
redirect:true
|
||||||
},
|
},
|
||||||
absenceRequests: {
|
absencerequests: {
|
||||||
label: "Abwesenheitsanträge",
|
label: "Abwesenheitsanträge",
|
||||||
labelSingle: "Abwesenheitsantrag",
|
labelSingle: "Abwesenheitsantrag",
|
||||||
redirect:true
|
redirect:true
|
||||||
@@ -174,7 +174,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
const historyItems = ref([])
|
const historyItems = ref([])
|
||||||
const numberRanges = ref([])
|
const numberRanges = ref([])
|
||||||
const notifications = ref([])
|
const notifications = ref([])
|
||||||
const absenceRequests = ref([])
|
const absencerequests = ref([])
|
||||||
const accounts = ref([])
|
const accounts = ref([])
|
||||||
const taxTypes = ref([])
|
const taxTypes = ref([])
|
||||||
const plants = ref([])
|
const plants = ref([])
|
||||||
@@ -369,7 +369,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
historyItems.value = []
|
historyItems.value = []
|
||||||
numberRanges.value = []
|
numberRanges.value = []
|
||||||
notifications.value = []
|
notifications.value = []
|
||||||
absenceRequests.value = []
|
absencerequests.value = []
|
||||||
accounts.value = []
|
accounts.value = []
|
||||||
taxTypes.value = []
|
taxTypes.value = []
|
||||||
plants.value = []
|
plants.value = []
|
||||||
@@ -647,7 +647,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
notifications.value = (await supabase.from("notifications").select().eq('tenant', currentTenant.value).order("created_at", {ascending: false})).data
|
notifications.value = (await supabase.from("notifications").select().eq('tenant', currentTenant.value).order("created_at", {ascending: false})).data
|
||||||
}
|
}
|
||||||
async function fetchAbsenceRequests () {
|
async function fetchAbsenceRequests () {
|
||||||
absenceRequests.value = (await supabase.from("absencerequests").select().eq('tenant', currentTenant.value)).data
|
absencerequests.value = (await supabase.from("absencerequests").select().eq('tenant', currentTenant.value)).data
|
||||||
}
|
}
|
||||||
async function fetchAccounts () {
|
async function fetchAccounts () {
|
||||||
accounts.value = (await supabase.from("accounts").select()).data
|
accounts.value = (await supabase.from("accounts").select()).data
|
||||||
@@ -957,14 +957,15 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
backgroundColor: "black"
|
backgroundColor: "black"
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
...absenceRequests.value.map(absence => {
|
...absencerequests.value.map(absence => {
|
||||||
return {
|
return {
|
||||||
|
id: absence.id,
|
||||||
resourceId: absence.user,
|
resourceId: absence.user,
|
||||||
resourceType: "person",
|
resourceType: "person",
|
||||||
title: absence.reason,
|
title: `Abw.: ${absence.reason}`,
|
||||||
start: dayjs(absence.start).toDate(),
|
start: dayjs(absence.start).toDate(),
|
||||||
end: dayjs(absence.end).add(1,'day').toDate(),
|
end: dayjs(absence.end).add(1,'day').toDate(),
|
||||||
allDay: true
|
allDay: true,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
@@ -1017,11 +1018,12 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
backgroundColor: "black"
|
backgroundColor: "black"
|
||||||
}
|
}
|
||||||
}),*/
|
}),*/
|
||||||
...absenceRequests.value.map(absence => {
|
...absencerequests.value.map(absence => {
|
||||||
return {
|
return {
|
||||||
|
id: absence.id,
|
||||||
resourceId: absence.user,
|
resourceId: absence.user,
|
||||||
resourceType: "person",
|
resourceType: "person",
|
||||||
title: absence.reason,
|
title: `Abw.: ${absence.reason}`,
|
||||||
start: dayjs(absence.start).toDate(),
|
start: dayjs(absence.start).toDate(),
|
||||||
end: dayjs(absence.end).add(1,'day').toDate(),
|
end: dayjs(absence.end).add(1,'day').toDate(),
|
||||||
allDay: true
|
allDay: true
|
||||||
@@ -1094,7 +1096,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const getAbsenceRequestById = computed(() => (itemId) => {
|
const getAbsenceRequestById = computed(() => (itemId) => {
|
||||||
return absenceRequests.value.find(item => item.id === itemId)
|
return absencerequests.value.find(item => item.id === itemId)
|
||||||
})
|
})
|
||||||
|
|
||||||
const getProfileById = computed(() => (itemId) => {
|
const getProfileById = computed(() => (itemId) => {
|
||||||
@@ -1183,7 +1185,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
historyItems,
|
historyItems,
|
||||||
numberRanges,
|
numberRanges,
|
||||||
notifications,
|
notifications,
|
||||||
absenceRequests,
|
absencerequests,
|
||||||
accounts,
|
accounts,
|
||||||
taxTypes,
|
taxTypes,
|
||||||
plants,
|
plants,
|
||||||
|
|||||||
Reference in New Issue
Block a user