Added Document Linking
Minor Changes in Document Creation
This commit is contained in:
@@ -71,6 +71,20 @@ const setupPage = async () => {
|
||||
|
||||
setContactPersonData()
|
||||
|
||||
if(route.query.linkedDocument) {
|
||||
itemInfo.value.linkedDocument = route.query.linkedDocument
|
||||
|
||||
let linkedDocument = await useSupabaseSelectSingle("createddocuments",itemInfo.value.linkedDocument)
|
||||
|
||||
itemInfo.value.rows = linkedDocument.rows
|
||||
itemInfo.value.customer = linkedDocument.customer
|
||||
itemInfo.value.project = linkedDocument.project
|
||||
itemInfo.value.contact = linkedDocument.contact
|
||||
|
||||
setCustomerData()
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(route.query.project) itemInfo.value.project = Number(route.query.project)
|
||||
if(route.query.contact) itemInfo.value.contact = Number(route.query.contact)
|
||||
@@ -91,13 +105,15 @@ const setDocumentTypeConfig = () => {
|
||||
} else if(itemInfo.value.type === "deliveryNotes") {
|
||||
itemInfo.value.documentNumberTitle = "Lieferscheinnummer"
|
||||
itemInfo.value.title = `Lieferschein-Nr. ${itemInfo.value.documentNumber ? itemInfo.value.documentNumber : "XXXX"}`
|
||||
} else if(itemInfo.value.type === "confirmationOrder") {
|
||||
} else if(itemInfo.value.type === "confirmationOrders") {
|
||||
itemInfo.value.documentNumberTitle = "Auftragsbestätigungsnr."
|
||||
itemInfo.value.title = `Auftragsbestätigung-Nr. ${itemInfo.value.documentNumber ? itemInfo.value.documentNumber : "XXXX"}`
|
||||
}
|
||||
|
||||
itemInfo.value.startText = dataStore.getTextTemplatesByDocumentType(itemInfo.value.type).find(i => i.default && i.pos === "startText").text
|
||||
itemInfo.value.endText = dataStore.getTextTemplatesByDocumentType(itemInfo.value.type).find(i => i.default && i.pos === "endText").text
|
||||
if(!itemInfo.value.startText) itemInfo.value.startText = dataStore.getTextTemplatesByDocumentType(itemInfo.value.type).find(i => i.default && i.pos === "startText").text
|
||||
if(!itemInfo.value.endText) itemInfo.value.endText = dataStore.getTextTemplatesByDocumentType(itemInfo.value.type).find(i => i.default && i.pos === "endText").text
|
||||
|
||||
|
||||
|
||||
|
||||
itemInfo.value.letterhead = letterheads.value[0].id
|
||||
|
||||
@@ -42,6 +42,11 @@ setupPage()
|
||||
:to="dataStore.documents.find(i => i.createdDocument === itemInfo.id) ? dataStore.documents.find(i => i.createdDocument === itemInfo.id).url : ''"
|
||||
target="_blank"
|
||||
>In neuen Tab anzeigen</UButton>
|
||||
<UButton
|
||||
@click="router.push(`/createDocument/edit/?linkedDocument=${itemInfo.id}`)"
|
||||
>
|
||||
Übernehmen
|
||||
</UButton>
|
||||
</template>
|
||||
</UDashboardToolbar>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user