From aebfe7dac65f043745a5b385517dc3f4f025e8f1 Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Tue, 4 Feb 2025 12:45:11 +0100 Subject: [PATCH] Added Events to Projects Added Events to EntityShow.vue --- components/EntityShow.vue | 68 +++++++++++++++++++++++++++++++-------- stores/data.js | 4 ++- 2 files changed, 58 insertions(+), 14 deletions(-) diff --git a/components/EntityShow.vue b/components/EntityShow.vue index 26f570a..0d68aaa 100644 --- a/components/EntityShow.vue +++ b/components/EntityShow.vue @@ -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 = () => { + Angebot + Auftragsbestätigung + Lieferschein + Abschlagsrechnung + Rechnung @@ -473,7 +489,7 @@ const getAvailableQueryStringData = () => {