Added Title to Document Creation

Added Height Calc for Row Description
This commit is contained in:
2024-08-22 19:48:11 +02:00
parent a349b1eb4f
commit 7457abb173
2 changed files with 62 additions and 15 deletions

View File

@@ -211,6 +211,11 @@ const addPosition = (mode) => {
id: lastId +1,
mode: "pagebreak",
})
} else if(mode === "title") {
itemInfo.value.rows.push({
id: lastId +1,
mode: "title",
})
}
setPosNumbers()
@@ -251,7 +256,7 @@ const documentTotal = computed(() => {
let totalGross = 0
itemInfo.value.rows.forEach(row => {
if(row.mode !== 'pagebreak'){
if(row.mode !== 'pagebreak' && row.mode !== 'title'){
console.log(row)
let rowPrice = Number(Number(row.quantity) * Number(row.price) * (1 - Number(row.discountPercent) /100) ).toFixed(2)
console.log(rowPrice)
@@ -288,7 +293,7 @@ const getDocumentData = () => {
let unit = dataStore.units.find(i => i.id === row.unit)
if(row.mode !== 'pagebreak') {
if(row.mode !== 'pagebreak' && row.mode !== 'title') {
if(row.mode === 'normal') row.text = dataStore.getProductById(row.product).name
if(row.mode === 'service') row.text = dataStore.getServiceById(row.service).name
@@ -922,7 +927,16 @@ setupPage()
<UDivider/>
</td>
<td
v-if="row.mode !== 'pagebreak'"
v-if="row.mode === 'title'"
colspan="9"
>
<UInput
v-model="row.text"
placeholder="Text"
/>
</td>
<td
v-if="row.mode !== 'pagebreak' && row.mode !== 'title'"
>{{row.pos}}</td>
<td
class="w-120"
@@ -980,7 +994,7 @@ setupPage()
</td>
<td
class="w-20"
v-if="row.mode !== 'pagebreak'"
v-if="row.mode !== 'pagebreak' && row.mode !== 'title'"
>
<UInput
v-model="row.quantity"
@@ -991,7 +1005,7 @@ setupPage()
</td>
<td
class="w-40"
v-if="row.mode !== 'pagebreak'"
v-if="row.mode !== 'pagebreak' && row.mode !== 'title'"
>
<USelectMenu
v-model="row.unit"
@@ -1006,7 +1020,7 @@ setupPage()
</td>
<td
class="w-40"
v-if="row.mode !== 'pagebreak'"
v-if="row.mode !== 'pagebreak' && row.mode !== 'title'"
>
<UInput
v-model="row.price"
@@ -1020,7 +1034,7 @@ setupPage()
</td>
<td
class="w-40"
v-if="row.mode !== 'pagebreak'"
v-if="row.mode !== 'pagebreak' && row.mode !== 'title'"
>
<USelectMenu
@@ -1038,7 +1052,7 @@ setupPage()
</td>
<td
class="w-40"
v-if="row.mode !== 'pagebreak'"
v-if="row.mode !== 'pagebreak' && row.mode !== 'title'"
>
<UInput
v-model="row.discountPercent"
@@ -1053,7 +1067,7 @@ setupPage()
</td>
<td
class="w-40"
v-if="row.mode !== 'pagebreak'"
v-if="row.mode !== 'pagebreak' && row.mode !== 'title'"
>
<UButton
icon="i-heroicons-document-text"
@@ -1083,7 +1097,7 @@ setupPage()
</UModal>
</td>
<td
v-if="row.mode !== 'pagebreak'"
v-if="row.mode !== 'pagebreak' && row.mode !== 'title'"
>
<p class="text-right font-bold whitespace-nowrap">{{getRowAmount(row)}} </p>
</td>
@@ -1125,6 +1139,12 @@ setupPage()
>
+ Seitenumbruch
</UButton>
<UButton
@click="addPosition('title')"
class="mt-3"
>
+ Titel
</UButton>
</InputGroup>
<table>