Added ArchiveButton.vue
This commit is contained in:
74
components/ArchiveButton.vue
Normal file
74
components/ArchiveButton.vue
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<script setup>
|
||||||
|
const emit = defineEmits(['confirmed'])
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
color: {
|
||||||
|
type: String,
|
||||||
|
required:false
|
||||||
|
},
|
||||||
|
variant: {
|
||||||
|
type: String,
|
||||||
|
required:false
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
required:false
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
const {color,variant, type} = props
|
||||||
|
|
||||||
|
const dataStore = useDataStore()
|
||||||
|
const dataType = dataStore.dataTypes[type]
|
||||||
|
|
||||||
|
const showModal = ref(false)
|
||||||
|
|
||||||
|
const emitConfirm = () => {
|
||||||
|
showModal.value = false
|
||||||
|
emit('confirmed')
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<UButton
|
||||||
|
:color="color"
|
||||||
|
:variant="variant"
|
||||||
|
@click="showModal = true"
|
||||||
|
>
|
||||||
|
Archivieren
|
||||||
|
</UButton>
|
||||||
|
<UModal v-model="showModal">
|
||||||
|
<UCard>
|
||||||
|
<template #header>
|
||||||
|
<span class="text-md font-bold">Archivieren bestätigen</span>
|
||||||
|
</template>
|
||||||
|
Möchten Sie diese/-s/-n {{dataType.labelSingle}} wirklich archivieren?
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<div class="text-right">
|
||||||
|
<UButtonGroup>
|
||||||
|
<UButton
|
||||||
|
variant="outline"
|
||||||
|
@click="showModal = false"
|
||||||
|
>
|
||||||
|
Abbrechen
|
||||||
|
</UButton>
|
||||||
|
<UButton
|
||||||
|
@click="emitConfirm"
|
||||||
|
class="ml-2"
|
||||||
|
color="rose"
|
||||||
|
>
|
||||||
|
Archivieren
|
||||||
|
</UButton>
|
||||||
|
</UButtonGroup>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</UCard>
|
||||||
|
</UModal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -188,19 +188,12 @@ const moveFile = async () => {
|
|||||||
</div>
|
</div>
|
||||||
<div class="w-2/3 p-5">
|
<div class="w-2/3 p-5">
|
||||||
<UButtonGroup>
|
<UButtonGroup>
|
||||||
<ButtonWithConfirm
|
<ArchiveButton
|
||||||
color="rose"
|
color="rose"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
|
type="files"
|
||||||
@confirmed="archiveDocument"
|
@confirmed="archiveDocument"
|
||||||
>
|
/>
|
||||||
<template #button>
|
|
||||||
Archivieren
|
|
||||||
</template>
|
|
||||||
<template #header>
|
|
||||||
<span class="text-md text-black font-bold">Archivieren bestätigen</span>
|
|
||||||
</template>
|
|
||||||
Möchten Sie die Datei wirklich archivieren?
|
|
||||||
</ButtonWithConfirm>
|
|
||||||
|
|
||||||
<UButton
|
<UButton
|
||||||
:to="props.documentData.url"
|
:to="props.documentData.url"
|
||||||
|
|||||||
@@ -254,20 +254,13 @@ const updateItem = async () => {
|
|||||||
>{{item.id ? `${dataType.labelSingle} bearbeiten` : `${dataType.labelSingle} erstellen` }}</h1>
|
>{{item.id ? `${dataType.labelSingle} bearbeiten` : `${dataType.labelSingle} erstellen` }}</h1>
|
||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
<ButtonWithConfirm
|
<ArchiveButton
|
||||||
v-if="platform !== 'mobile'"
|
|
||||||
color="rose"
|
color="rose"
|
||||||
|
v-if="platform !== 'mobile'"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
@confirmed="dataStore.updateItem(type,{...item,archived: true}, oldItem)"
|
:type="type"
|
||||||
>
|
@confirmed="useEntities(type).archive(item.id)"
|
||||||
<template #button>
|
/>
|
||||||
Archivieren
|
|
||||||
</template>
|
|
||||||
<template #header>
|
|
||||||
<span class="text-md text-black dark:text-white font-bold">Archivieren bestätigen</span>
|
|
||||||
</template>
|
|
||||||
Möchten Sie das {{dataType.labelSingle}} {{item[dataType.templateColumns.find(i => i.title).key]}} wirklich archivieren?
|
|
||||||
</ButtonWithConfirm>
|
|
||||||
<UButton
|
<UButton
|
||||||
v-if="item.id"
|
v-if="item.id"
|
||||||
@click="updateItem"
|
@click="updateItem"
|
||||||
|
|||||||
@@ -254,19 +254,12 @@ const archiveStatement = async () => {
|
|||||||
</UBadge>
|
</UBadge>
|
||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
<ButtonWithConfirm
|
<ArchiveButton
|
||||||
color="rose"
|
color="rose"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
|
type="bankstatements"
|
||||||
@confirmed="archiveStatement"
|
@confirmed="archiveStatement"
|
||||||
>
|
/>
|
||||||
<template #button>
|
|
||||||
Archivieren
|
|
||||||
</template>
|
|
||||||
<template #header>
|
|
||||||
<span class="text-md text-black font-bold">Archivieren bestätigen</span>
|
|
||||||
</template>
|
|
||||||
Möchten Sie die Kontobewegung wirklich archivieren?
|
|
||||||
</ButtonWithConfirm>
|
|
||||||
</template>
|
</template>
|
||||||
</UDashboardNavbar>
|
</UDashboardNavbar>
|
||||||
|
|
||||||
|
|||||||
@@ -1523,21 +1523,14 @@ const setRowData = async (row, service = {sellingPriceComposed: {}}, product = {
|
|||||||
</UButton>
|
</UButton>
|
||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
<ButtonWithConfirm
|
<ArchiveButton
|
||||||
v-if="itemInfo.state === 'Entwurf' || itemInfo.type === 'serialInvoices'"
|
|
||||||
color="rose"
|
color="rose"
|
||||||
|
type="createddocuments"
|
||||||
|
v-if="itemInfo.state === 'Entwurf' || itemInfo.type === 'serialInvoices'"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
@confirmed="useEntities('createddocuments').update(itemInfo.id,{archived: true}),
|
@confirmed="useEntities('createddocuments').update(itemInfo.id,{archived: true}),
|
||||||
router.push('/')"
|
router.push('/')"
|
||||||
>
|
/>
|
||||||
<template #button>
|
|
||||||
Archivieren
|
|
||||||
</template>
|
|
||||||
<template #header>
|
|
||||||
<span class="text-md dark:text-whitetext-black font-bold">Archivieren bestätigen</span>
|
|
||||||
</template>
|
|
||||||
Möchten Sie diesen Ausgangsbeleg wirklich archivieren?
|
|
||||||
</ButtonWithConfirm>
|
|
||||||
<UButton
|
<UButton
|
||||||
icon="i-mdi-content-save"
|
icon="i-mdi-content-save"
|
||||||
@click="saveDocument('Entwurf',true)"
|
@click="saveDocument('Entwurf',true)"
|
||||||
|
|||||||
@@ -170,19 +170,12 @@ const findIncomingInvoiceErrors = computed(() => {
|
|||||||
<template>
|
<template>
|
||||||
<UDashboardNavbar :title="'Eingangsbeleg erstellen'">
|
<UDashboardNavbar :title="'Eingangsbeleg erstellen'">
|
||||||
<template #right>
|
<template #right>
|
||||||
<ButtonWithConfirm
|
<ArchiveButton
|
||||||
color="rose"
|
color="rose"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
|
type="incominginvoices"
|
||||||
@confirmed="useEntities('incominginvoices').archive(route.params.id)"
|
@confirmed="useEntities('incominginvoices').archive(route.params.id)"
|
||||||
>
|
/>
|
||||||
<template #button>
|
|
||||||
Archivieren
|
|
||||||
</template>
|
|
||||||
<template #header>
|
|
||||||
<span class="text-md text-black font-bold">Archivieren bestätigen</span>
|
|
||||||
</template>
|
|
||||||
Möchten Sie den Eingangsbeleg wirklich archivieren?
|
|
||||||
</ButtonWithConfirm>
|
|
||||||
<UButton
|
<UButton
|
||||||
@click="updateIncomingInvoice(false)"
|
@click="updateIncomingInvoice(false)"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user