This commit is contained in:
2025-09-13 17:32:21 +02:00
parent e60c0df77b
commit 18b63272b7

View File

@@ -38,13 +38,13 @@ const itemInfo = ref({
dateOfPerformance: null,
paymentDays: auth.activeTenantData.standardPaymentDays,
customSurchargePercentage: 0,
createdBy: profileStore.activeProfile.id,
createdBy: auth.user.id,
title: null,
description: null,
startText: null,
endText: null,
rows: [],
contactPerson: profileStore.activeProfile.id,
contactPerson: auth.user.id,
contactPersonName: null,
contactTel: null,
contactEMail: null,
@@ -1370,8 +1370,14 @@ const saveDocument = async (state, resetup = false) => {
if (resetup) await setupPage()
}
const selectedTab = ref(0)
const closeDocument = async () => {
if(selectedTab.value === 0) {
await generateDocument()
selectedTab.value = 1
} else {
loaded.value = false
await saveDocument("Gebucht")
@@ -1413,6 +1419,10 @@ const closeDocument = async () => {
await useFiles().uploadFiles(fileData, [file])
await router.push(`/createDocument/show/${itemInfo.value.id}`)
}
}
@@ -1538,7 +1548,7 @@ const setRowData = async (row, service = {sellingPriceComposed: {}}, product = {
@click="closeDocument"
v-if="itemInfo.id && itemInfo.type !== 'serialInvoices'"
>
Fertigstellen
{{selectedTab === 0 ? "Vorschau zeigen" : "Fertigstellen"}}
</UButton>
<UButton
icon="i-mdi-content-save"
@@ -1550,7 +1560,7 @@ const setRowData = async (row, service = {sellingPriceComposed: {}}, product = {
</template>
</UDashboardNavbar>
<UDashboardPanelContent>
<UTabs class="p-5" :items="tabItems" @change="onChangeTab" v-if="loaded">
<UTabs class="p-5" :items="tabItems" @change="onChangeTab" v-if="loaded" v-model="selectedTab">
<template #item="{item}">
<div v-if="item.label === 'Editor'">