Added HistoryItems to Spaces

Changed Loading of HistoryItems to directly Supabase
Minor Changes in inventoryitems
This commit is contained in:
2024-08-23 17:39:42 +02:00
parent b71814369d
commit 4127c6d4fb
3 changed files with 76 additions and 9 deletions

View File

@@ -55,7 +55,7 @@ setupPage()
<h1
v-if="itemInfo"
:class="['text-xl','font-medium']"
>{{itemInfo ? `Inventarartikel: ${itemInfo.name}` : (mode === 'create' ? 'Kunde erstellen' : 'Kunde bearbeiten')}}</h1>
>{{itemInfo.id ? `Inventarartikel: ${itemInfo.name}` : (mode === 'create' ? 'Inventarartikel erstellen' : 'Inventarartikel bearbeiten')}}</h1>
</template>
<template #right>
<UButton
@@ -65,11 +65,23 @@ setupPage()
Speichern
</UButton>
<UButton
v-else-if="mode === 'create'"
v-if="mode === 'create'"
@click="dataStore.createNewItem('inventoryitems',itemInfo)"
>
Erstellen
</UButton>
<UButton
v-if="mode === 'create'"
class="ml-2"
@click="dataStore.createNewItem('inventoryitems',itemInfo);
itemInfo = {
name: null,
description: null,
quantity: 0
}"
>
Erstellen + Neu
</UButton>
<UButton
@click="cancelEditorCreate"
color="red"
@@ -96,6 +108,10 @@ setupPage()
<div class="w-1/2 mr-5">
<UCard>
<table class="w-full">
<tr>
<td>Name: </td>
<td>{{itemInfo.name}}</td>
</tr>
<tr v-if="itemInfo.currentSpace">
<td>Lagerplatz: </td>
<td>{{dataStore.getSpaceById(itemInfo.currentSpace).spaceNumber}} - {{dataStore.getSpaceById(itemInfo.currentSpace).description}}</td>
@@ -193,11 +209,12 @@ setupPage()
</UFormGroup>
<UFormGroup
label="Menge:"
help="Für Einzelartikel Menge gleich 0"
:help="itemInfo.serialNumber ? 'Menge deaktiviert durch Eingabe der Seriennummer' : 'Für Einzelartikel Menge gleich 0'"
>
<UInput
type="number"
v-model="itemInfo.quantity"
:disabled="itemInfo.serialNumber"
/>
</UFormGroup>
</div>