Added Contract to Document Assign
This commit is contained in:
@@ -50,6 +50,21 @@ setupPage()
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<UDashboardNavbar :title="currentItem ? currentItem.name : (mode === 'create' ? 'Vertrag erstellen' : 'Vertrag bearbeiten')">
|
<UDashboardNavbar :title="currentItem ? currentItem.name : (mode === 'create' ? 'Vertrag erstellen' : 'Vertrag bearbeiten')">
|
||||||
|
<template #left>
|
||||||
|
<UButton
|
||||||
|
icon="i-heroicons-chevron-left"
|
||||||
|
variant="outline"
|
||||||
|
@click="router.push(`/contracts`)"
|
||||||
|
>
|
||||||
|
Verträge
|
||||||
|
</UButton>
|
||||||
|
</template>
|
||||||
|
<template #center>
|
||||||
|
<h1
|
||||||
|
v-if="currentItem"
|
||||||
|
:class="['text-xl','font-medium', ... currentItem.active ? ['text-primary'] : ['text-rose-500']]"
|
||||||
|
>{{currentItem ? `Vertrag: ${currentItem.name}` : (mode === 'create' ? 'Vertrag erstellen' : 'Vertrag bearbeiten')}}</h1>
|
||||||
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
<UButton
|
<UButton
|
||||||
v-if="mode === 'edit'"
|
v-if="mode === 'edit'"
|
||||||
@@ -81,52 +96,53 @@ setupPage()
|
|||||||
</UDashboardNavbar>
|
</UDashboardNavbar>
|
||||||
<UTabs
|
<UTabs
|
||||||
v-if="currentItem && mode === 'show'"
|
v-if="currentItem && mode === 'show'"
|
||||||
:items="[{label: 'Informationen'}, {label: 'Logbuch'}, {label: 'Dokumente'}]"
|
:items="[{label: 'Informationen'}, {label: 'Dokumente'}]"
|
||||||
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">
|
||||||
<Toolbar>
|
<UCard>
|
||||||
<UButton
|
<div class="text-wrap">
|
||||||
v-if="mode === 'show' && currentItem.id"
|
<p>Kundennummer: <nuxt-link :to="`/customers/show/${currentItem.customer}`">{{dataStore.getCustomerById(currentItem.customer).name}}</nuxt-link></p>
|
||||||
@click="editCustomer"
|
Beschreibung:<br>
|
||||||
>
|
{{currentItem.description}}<br>
|
||||||
Bearbeiten
|
</div>
|
||||||
</UButton>
|
</UCard>
|
||||||
</Toolbar>
|
|
||||||
|
|
||||||
<UBadge
|
|
||||||
v-if="currentItem.active"
|
|
||||||
>
|
|
||||||
Vertrag aktiv
|
|
||||||
</UBadge>
|
|
||||||
<UBadge
|
|
||||||
v-else
|
|
||||||
color="red"
|
|
||||||
>
|
|
||||||
Vertrag gesperrt
|
|
||||||
</UBadge>
|
|
||||||
|
|
||||||
<div class="text-wrap">
|
|
||||||
<p>Kundennummer: <nuxt-link :to="`/customers/show/${currentItem.customer}`">{{dataStore.getCustomerById(currentItem.customer).name}}</nuxt-link></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<UDivider
|
|
||||||
class="my-2"
|
|
||||||
/>
|
|
||||||
|
|
||||||
Beschreibung:<br>
|
|
||||||
{{currentItem.description}}<br>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="item.label === 'Logbuch'">
|
<div class="w-1/2">
|
||||||
<HistoryDisplay
|
<UCard class="h-full">
|
||||||
type="contract"
|
<HistoryDisplay
|
||||||
v-if="currentItem"
|
type="contract"
|
||||||
:element-id="currentItem.id"
|
v-if="currentItem"
|
||||||
/>
|
:element-id="currentItem.id"
|
||||||
|
:render-headline="true"
|
||||||
|
/>
|
||||||
|
</UCard>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="item.label === 'Dokumente'">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <UBadge
|
||||||
|
v-if="currentItem.active"
|
||||||
|
>
|
||||||
|
Vertrag aktiv
|
||||||
|
</UBadge>
|
||||||
|
<UBadge
|
||||||
|
v-else
|
||||||
|
color="red"
|
||||||
|
>
|
||||||
|
Vertrag gesperrt
|
||||||
|
</UBadge>-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div v-else-if="item.label === 'Dokumente'">
|
||||||
|
<UCard class="mt-5">
|
||||||
<Toolbar>
|
<Toolbar>
|
||||||
<DocumentUpload
|
<DocumentUpload
|
||||||
type="contract"
|
type="contract"
|
||||||
@@ -136,8 +152,11 @@ setupPage()
|
|||||||
<DocumentList
|
<DocumentList
|
||||||
:documents="dataStore.getDocumentsByContractId(currentItem.id)"
|
:documents="dataStore.getDocumentsByContractId(currentItem.id)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</UCard>
|
||||||
</UCard>
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</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" >
|
||||||
|
|||||||
Reference in New Issue
Block a user