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)}]`)
|
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 =""
|
let returnString =""
|
||||||
|
|
||||||
|
function addParam (key,value) {
|
||||||
|
if(returnString.length === 0) {
|
||||||
|
returnString += `${key}=${value}`
|
||||||
|
} else {
|
||||||
|
returnString += `&${key}=${value}`
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(props.item.customer) {
|
if(props.item.customer) {
|
||||||
returnString += `&customer=${props.item.customer.id}`
|
addParam("customer", props.item.customer.id)
|
||||||
} else if(type === "customers") {
|
} else if(type === "customers") {
|
||||||
returnString += `&customer=${props.item.id}`
|
addParam("customer", props.item.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(props.item.project) {
|
if(props.item.project) {
|
||||||
returnString += `&project=${props.item.project.id}`
|
addParam("project", props.item.project.id)
|
||||||
} else if(type === "projects") {
|
} else if(type === "projects") {
|
||||||
returnString += `&project=${props.item.id}`
|
addParam("project", props.item.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(props.item.plant) {
|
if(props.item.plant) {
|
||||||
returnString += `&plant=${props.item.plant.id}`
|
addParam("plant", props.item.plant.id)
|
||||||
} else if(type === "plants") {
|
} 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
|
return returnString
|
||||||
@@ -439,27 +455,27 @@ const getAvailableQueryStringData = () => {
|
|||||||
|
|
||||||
<Toolbar>
|
<Toolbar>
|
||||||
<UButton
|
<UButton
|
||||||
@click="router.push(`/createDocument/edit/?type=quotes${getAvailableQueryStringData()}`)"
|
@click="router.push(`/createDocument/edit/?${getAvailableQueryStringData({type: 'quotes'})}`)"
|
||||||
>
|
>
|
||||||
+ Angebot
|
+ Angebot
|
||||||
</UButton>
|
</UButton>
|
||||||
<UButton
|
<UButton
|
||||||
@click="router.push(`/createDocument/edit/?type=confirmationOrders${getAvailableQueryStringData()}`)"
|
@click="router.push(`/createDocument/edit/?${getAvailableQueryStringData({type: 'confirmationOrders'})}`)"
|
||||||
>
|
>
|
||||||
+ Auftragsbestätigung
|
+ Auftragsbestätigung
|
||||||
</UButton>
|
</UButton>
|
||||||
<UButton
|
<UButton
|
||||||
@click="router.push(`/createDocument/edit/?type=deliveryNotes${getAvailableQueryStringData()}`)"
|
@click="router.push(`/createDocument/edit/?${getAvailableQueryStringData({type: 'deliveryNotes'})}`)"
|
||||||
>
|
>
|
||||||
+ Lieferschein
|
+ Lieferschein
|
||||||
</UButton>
|
</UButton>
|
||||||
<UButton
|
<UButton
|
||||||
@click="router.push(`/createDocument/edit/?type=advanceInvoices${getAvailableQueryStringData()}`)"
|
@click="router.push(`/createDocument/edit/?${getAvailableQueryStringData({type: 'advanceInvoices'})}`)"
|
||||||
>
|
>
|
||||||
+ Abschlagsrechnung
|
+ Abschlagsrechnung
|
||||||
</UButton>
|
</UButton>
|
||||||
<UButton
|
<UButton
|
||||||
@click="router.push(`/createDocument/edit/?type=invoices${getAvailableQueryStringData()}`)"
|
@click="router.push(`/createDocument/edit/?${getAvailableQueryStringData({type: 'invoices'})}`)"
|
||||||
>
|
>
|
||||||
+ Rechnung
|
+ Rechnung
|
||||||
</UButton>
|
</UButton>
|
||||||
@@ -473,7 +489,7 @@ const getAvailableQueryStringData = () => {
|
|||||||
|
|
||||||
<UTable
|
<UTable
|
||||||
:rows="props.item.createddocuments"
|
: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}`)"
|
@select="(i) => router.push(i.state === 'Entwurf' ? `/createDocument/edit/${i.id}`:`/createDocument/show/${i.id}`)"
|
||||||
>
|
>
|
||||||
<template #documentDate-data="{row}">
|
<template #documentDate-data="{row}">
|
||||||
@@ -486,6 +502,32 @@ const getAvailableQueryStringData = () => {
|
|||||||
|
|
||||||
</UCard>
|
</UCard>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -762,7 +762,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
redirect:true,
|
redirect:true,
|
||||||
historyItemHolder: "project",
|
historyItemHolder: "project",
|
||||||
numberRangeHolder: "projectNumber",
|
numberRangeHolder: "projectNumber",
|
||||||
supabaseSelectWithInformation: "*, customer(id,name), plant(id,name), projecttype(name, id), tasks(*), files(*), createddocuments(*)",
|
supabaseSelectWithInformation: "*, customer(id,name), plant(id,name), projecttype(name, id), tasks(*), files(*), createddocuments(*), events(*)",
|
||||||
supabaseSortColumn: "projectNumber",
|
supabaseSortColumn: "projectNumber",
|
||||||
filters: [
|
filters: [
|
||||||
{
|
{
|
||||||
@@ -869,6 +869,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
label: "Dateien"
|
label: "Dateien"
|
||||||
},{
|
},{
|
||||||
label: "Ausgangsbelege"
|
label: "Ausgangsbelege"
|
||||||
|
},{
|
||||||
|
label: "Termine"
|
||||||
}/*,{
|
}/*,{
|
||||||
key: "timetracking",
|
key: "timetracking",
|
||||||
label: "Zeiterfassung"
|
label: "Zeiterfassung"
|
||||||
|
|||||||
Reference in New Issue
Block a user