Added Automatic HistoryItems to Events,Customers,Vendors

This commit is contained in:
2024-04-08 15:41:28 +02:00
parent 3a0f3f75b4
commit 44a0e10a94
5 changed files with 282 additions and 15 deletions

View File

@@ -19,6 +19,7 @@ const mode = ref(route.params.mode || "show")
const itemInfo = ref({
infoData: {}
})
const oldItemInfo = ref({})
//Functions
const setupPage = () => {
@@ -27,6 +28,8 @@ const setupPage = () => {
}
if (mode.value === "edit") itemInfo.value = currentItem.value
if(currentItem.value.id) oldItemInfo.value = JSON.parse(JSON.stringify(currentItem.value))
}
const editItem = async () => {
@@ -49,7 +52,7 @@ setupPage()
<template #right>
<UButton
v-if="mode === 'edit'"
@click="dataStore.updateItem('vendors',itemInfo)"
@click="dataStore.updateItem('vendors',itemInfo,oldItemInfo)"
>
Speichern
</UButton>