Added Events to Projects
Added Events to EntityShow.vue
This commit is contained in:
@@ -123,25 +123,41 @@ const invoiceDeliveryNotes = () => {
|
||||
router.push(`/createDocument/edit?type=invoices&linkedDocuments=[${props.item.createddocuments.filter(i => i.type === "deliveryNotes").map(i => i.id)}]`)
|
||||
}
|
||||
|
||||
const getAvailableQueryStringData = () => {
|
||||
const getAvailableQueryStringData = (keys) => {
|
||||
let returnString =""
|
||||
|
||||
function addParam (key,value) {
|
||||
if(returnString.length === 0) {
|
||||
returnString += `${key}=${value}`
|
||||
} else {
|
||||
returnString += `&${key}=${value}`
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(props.item.customer) {
|
||||
returnString += `&customer=${props.item.customer.id}`
|
||||
addParam("customer", props.item.customer.id)
|
||||
} else if(type === "customers") {
|
||||
returnString += `&customer=${props.item.id}`
|
||||
addParam("customer", props.item.id)
|
||||
}
|
||||
|
||||
if(props.item.project) {
|
||||
returnString += `&project=${props.item.project.id}`
|
||||
addParam("project", props.item.project.id)
|
||||
} else if(type === "projects") {
|
||||
returnString += `&project=${props.item.id}`
|
||||
addParam("project", props.item.id)
|
||||
}
|
||||
|
||||
if(props.item.plant) {
|
||||
returnString += `&plant=${props.item.plant.id}`
|
||||
addParam("plant", props.item.plant.id)
|
||||
} else if(type === "plants") {
|
||||
returnString += `&plant=${props.item.id}`
|
||||
addParam("plant", props.item.id)
|
||||
}
|
||||
|
||||
if(keys) {
|
||||
Object.keys(keys).forEach(key => {
|
||||
addParam(key, keys[key])
|
||||
})
|
||||
}
|
||||
|
||||
return returnString
|
||||
@@ -439,27 +455,27 @@ const getAvailableQueryStringData = () => {
|
||||
|
||||
<Toolbar>
|
||||
<UButton
|
||||
@click="router.push(`/createDocument/edit/?type=quotes${getAvailableQueryStringData()}`)"
|
||||
@click="router.push(`/createDocument/edit/?${getAvailableQueryStringData({type: 'quotes'})}`)"
|
||||
>
|
||||
+ Angebot
|
||||
</UButton>
|
||||
<UButton
|
||||
@click="router.push(`/createDocument/edit/?type=confirmationOrders${getAvailableQueryStringData()}`)"
|
||||
@click="router.push(`/createDocument/edit/?${getAvailableQueryStringData({type: 'confirmationOrders'})}`)"
|
||||
>
|
||||
+ Auftragsbestätigung
|
||||
</UButton>
|
||||
<UButton
|
||||
@click="router.push(`/createDocument/edit/?type=deliveryNotes${getAvailableQueryStringData()}`)"
|
||||
@click="router.push(`/createDocument/edit/?${getAvailableQueryStringData({type: 'deliveryNotes'})}`)"
|
||||
>
|
||||
+ Lieferschein
|
||||
</UButton>
|
||||
<UButton
|
||||
@click="router.push(`/createDocument/edit/?type=advanceInvoices${getAvailableQueryStringData()}`)"
|
||||
@click="router.push(`/createDocument/edit/?${getAvailableQueryStringData({type: 'advanceInvoices'})}`)"
|
||||
>
|
||||
+ Abschlagsrechnung
|
||||
</UButton>
|
||||
<UButton
|
||||
@click="router.push(`/createDocument/edit/?type=invoices${getAvailableQueryStringData()}`)"
|
||||
@click="router.push(`/createDocument/edit/?${getAvailableQueryStringData({type: 'invoices'})}`)"
|
||||
>
|
||||
+ Rechnung
|
||||
</UButton>
|
||||
@@ -473,7 +489,7 @@ const getAvailableQueryStringData = () => {
|
||||
|
||||
<UTable
|
||||
:rows="props.item.createddocuments"
|
||||
:columns="[{key:'state',label: 'Status'},{key:'type',label: 'Typ'},{key:'documentNumber',label: 'Nummer'},{key:'documentDate',label: 'Datum'}]"
|
||||
:columns="[{key:'state',label: 'Status'},{key:'type',label: 'Typ'},{key:'documentNumber',label: 'Nummer'},{key:'documentDate',label: 'Datum'},{key:'description',label: 'Beschreibung'}]"
|
||||
@select="(i) => router.push(i.state === 'Entwurf' ? `/createDocument/edit/${i.id}`:`/createDocument/show/${i.id}`)"
|
||||
>
|
||||
<template #documentDate-data="{row}">
|
||||
@@ -486,6 +502,32 @@ const getAvailableQueryStringData = () => {
|
||||
|
||||
</UCard>
|
||||
</div>
|
||||
<div v-else-if="tab.label === 'Termine'">
|
||||
<UCard class="mt-5">
|
||||
|
||||
<Toolbar>
|
||||
<UButton
|
||||
@click="router.push(`/standardEntity/events/create/?${getAvailableQueryStringData()}`)"
|
||||
>
|
||||
+ Termin
|
||||
</UButton>
|
||||
</Toolbar>
|
||||
|
||||
<UTable
|
||||
:rows="props.item.events"
|
||||
@select="(i) => router.push(`/standardEntity/events/show/${i.id}`)"
|
||||
:columns="[{key:'name',label: 'Name'},{key:'eventtype',label: 'Typ'},{key:'startDate',label: 'Start'},{key:'endDate',label: 'Ende'},{key:'notes',label: 'Notizen'}]"
|
||||
>
|
||||
<template #startDate-data="{row}">
|
||||
{{dayjs(row.documentDate).format("DD.MM.YY HH:mm")}}
|
||||
</template>
|
||||
<template #endDate-data="{row}">
|
||||
{{dayjs(row.documentDate).format("DD.MM.YY HH:mm")}}
|
||||
</template>
|
||||
</UTable>
|
||||
|
||||
</UCard>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user