Changes in Tags and Updating

This commit is contained in:
2024-07-21 22:34:10 +02:00
parent 510ce73ecd
commit dc480f38b6
2 changed files with 18 additions and 11 deletions

View File

@@ -31,10 +31,12 @@ const openDocument = async () => {
}
const updateDocument = async () => {
console.log("Update")
const {url, ...objData} = documentData
delete objData.url
const {data,error} = await supabase
.from("documents")
.update(objData)
@@ -46,7 +48,7 @@ const updateDocument = async () => {
} else {
toast.add({title: "Dokument aktualisiert"})
dataStore.fetchDocuments()
openShowModal.value = false
//openShowModal.value = false
}
}
@@ -178,13 +180,17 @@ const updateDocumentAssignment = async () => {
>
<UCard class="flex flex-col flex-1" :ui="{ body: { base: 'flex-1' }, ring: '', divide: 'divide-y divide-gray-100 dark:divide-gray-800' }">
<template #header>
<div class="flex items-center gap-2">
<UBadge
v-for="tag in documentData.tags"
>
{{tag}}
</UBadge>
<div class="flex flex-row justify-between">
<div class="flex items-center gap-2">
<UBadge
v-for="tag in documentData.tags"
>
{{tag}}
</UBadge>
</div>
<UButton color="gray" variant="ghost" icon="i-heroicons-x-mark-20-solid" class="-my-1" @click="openShowModal = false" />
</div>
</template>
<UContainer class="h-full" :ui="{padding: 'px-1 sm:px-1 lg:px-1'}">
@@ -210,12 +216,12 @@ const updateDocumentAssignment = async () => {
>
Archivieren
</UButton>
<UButton
<!-- <UButton
v-if="documentData.tags.includes('Eingangsrechnung')"
@click="createVendorInvoice"
>
Eingangsrechnung erstellen
</UButton>
</UButton>-->
</UButtonGroup>
<br>
<a
@@ -229,7 +235,7 @@ const updateDocumentAssignment = async () => {
<USelectMenu
:options="tags"
v-model="documentData.tags"
@close="updateDocument"
@change="updateDocument"
multiple
>
<template #label>

View File

@@ -28,7 +28,8 @@ const selectedTags = ref("Eingang")
const documents = ref([])
const setupPage = async () => {
documents.value = await useSupabaseSelectDocuments("*, project(id,name), customer(id,name), contract(id,name), vendor(id,name), plant(id,name), vehicle(id,licensePlate), product(id,name), profile(id,fullName) ")
//documents.value = await useSupabaseSelectDocuments("*, project(id,name), customer(id,name), contract(id,name), vendor(id,name), plant(id,name), vehicle(id,licensePlate), product(id,name), profile(id,fullName) ")
documents.value = await useSupabaseSelectDocuments("*")
}