Added Editing to IncomingInvoices
This commit is contained in:
@@ -52,11 +52,14 @@ const setupPage = async () => {
|
||||
}
|
||||
|
||||
const setState = async (newState) => {
|
||||
if(mode.value === 'show') {
|
||||
await dataStore.updateItem('incominginvoices',{...itemInfo.value, state: newState})
|
||||
} else if(mode.value === 'edit') {
|
||||
await dataStore.updateItem('incominginvoices',{...itemInfo.value, state: newState})
|
||||
}
|
||||
|
||||
let item = itemInfo.value
|
||||
delete item.files
|
||||
item.vendor = item.vendor.id
|
||||
item.state = newState
|
||||
|
||||
await dataStore.updateItem('incominginvoices',item)
|
||||
|
||||
await router.push("/incomingInvoices")
|
||||
}
|
||||
|
||||
@@ -68,6 +71,12 @@ setupPage()
|
||||
<template>
|
||||
<UDashboardNavbar :title="'Eingangsbeleg anzeigen'">
|
||||
<template #right>
|
||||
<UButton
|
||||
@click="router.push(`/incomingInvoices/edit/${itemInfo.id}`)"
|
||||
v-if="itemInfo.state !== 'Gebucht'"
|
||||
>
|
||||
Bearbeiten
|
||||
</UButton>
|
||||
<UButton
|
||||
@click="setState('Gebucht')"
|
||||
v-if="itemInfo.state !== 'Gebucht'"
|
||||
|
||||
Reference in New Issue
Block a user