Added Automatic HistoryItems to Events,Customers,Vendors
This commit is contained in:
5
pages/vendors/[mode]/[[id]].vue
vendored
5
pages/vendors/[mode]/[[id]].vue
vendored
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user