Korrigiert Kassenbuch Navbar Struktur
Die Kassenbuch-Listenansicht rendert die DashboardNavbar nun wie andere Listenseiten direkt oben. Die Detailansicht nutzt dieselbe Struktur und hält den Inhalt im PanelContent.
This commit is contained in:
@@ -239,28 +239,28 @@ onMounted(loadData)
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<UDashboardPanelContent>
|
<UDashboardNavbar :title="selectedCashbook ? selectedCashbook.name : 'Kassenbuch'">
|
||||||
<UDashboardNavbar :title="selectedCashbook ? selectedCashbook.name : 'Kassenbuch'">
|
<template #left>
|
||||||
<template #left>
|
<UButton icon="i-heroicons-arrow-left" variant="ghost" color="neutral" @click="router.push('/accounting/cashbooks')">
|
||||||
<UButton icon="i-heroicons-arrow-left" variant="ghost" color="neutral" @click="router.push('/accounting/cashbooks')">
|
Kassenbücher
|
||||||
Kassenbücher
|
</UButton>
|
||||||
</UButton>
|
</template>
|
||||||
</template>
|
<template #right>
|
||||||
<template #right>
|
<div v-if="selectedCashbook" class="flex flex-wrap items-center justify-end gap-2">
|
||||||
<div v-if="selectedCashbook" class="flex flex-wrap items-center justify-end gap-2">
|
<UBadge color="neutral" variant="subtle">
|
||||||
<UBadge color="neutral" variant="subtle">
|
{{ selectedCashbook.name }}
|
||||||
{{ selectedCashbook.name }}
|
</UBadge>
|
||||||
</UBadge>
|
<UBadge color="neutral" variant="subtle">
|
||||||
<UBadge color="neutral" variant="subtle">
|
Konto {{ selectedCashbook.datevNumber }}
|
||||||
Konto {{ selectedCashbook.datevNumber }}
|
</UBadge>
|
||||||
</UBadge>
|
<UBadge :color="currentBalance < 0 ? 'error' : 'success'" variant="subtle">
|
||||||
<UBadge :color="currentBalance < 0 ? 'error' : 'success'" variant="subtle">
|
Bestand {{ displayCurrency(currentBalance) }}
|
||||||
Bestand {{ displayCurrency(currentBalance) }}
|
</UBadge>
|
||||||
</UBadge>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
</template>
|
</UDashboardNavbar>
|
||||||
</UDashboardNavbar>
|
|
||||||
|
|
||||||
|
<UDashboardPanelContent>
|
||||||
<div v-if="loading" class="py-10 text-center text-gray-500">Lade Kassenbuch...</div>
|
<div v-if="loading" class="py-10 text-center text-gray-500">Lade Kassenbuch...</div>
|
||||||
<div v-else-if="selectedCashbook" class="space-y-6">
|
<div v-else-if="selectedCashbook" class="space-y-6">
|
||||||
<UCard>
|
<UCard>
|
||||||
|
|||||||
@@ -85,81 +85,79 @@ onMounted(loadCashbooks)
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<UDashboardPanelContent>
|
<UDashboardNavbar title="Kassenbücher" :badge="filteredRows.length">
|
||||||
<UDashboardNavbar title="Kassenbücher" :badge="filteredRows.length">
|
<template #right>
|
||||||
<template #right>
|
<UInput
|
||||||
<UInput
|
id="searchinput"
|
||||||
id="searchinput"
|
v-model="searchString"
|
||||||
v-model="searchString"
|
icon="i-heroicons-magnifying-glass"
|
||||||
icon="i-heroicons-magnifying-glass"
|
autocomplete="off"
|
||||||
autocomplete="off"
|
placeholder="Suche..."
|
||||||
placeholder="Suche..."
|
class="hidden lg:block"
|
||||||
class="hidden lg:block"
|
@keydown.esc="$event.target.blur()"
|
||||||
@keydown.esc="$event.target.blur()"
|
@change="tempStore.modifySearchString('cashbooks', searchString)"
|
||||||
@change="tempStore.modifySearchString('cashbooks', searchString)"
|
/>
|
||||||
/>
|
<UButton
|
||||||
<UButton
|
v-if="searchString.length > 0"
|
||||||
v-if="searchString.length > 0"
|
icon="i-heroicons-x-mark"
|
||||||
icon="i-heroicons-x-mark"
|
variant="outline"
|
||||||
variant="outline"
|
color="error"
|
||||||
color="error"
|
@click="clearSearchString"
|
||||||
@click="clearSearchString"
|
/>
|
||||||
/>
|
<UButton icon="i-heroicons-plus" @click="createCashbookModalOpen = true">
|
||||||
<UButton icon="i-heroicons-plus" @click="createCashbookModalOpen = true">
|
Barkasse
|
||||||
Barkasse
|
</UButton>
|
||||||
</UButton>
|
</template>
|
||||||
</template>
|
</UDashboardNavbar>
|
||||||
</UDashboardNavbar>
|
|
||||||
|
|
||||||
<UTable
|
<UTable
|
||||||
:data="filteredRows"
|
:data="filteredRows"
|
||||||
:columns="normalizeTableColumns(templateColumns)"
|
:columns="normalizeTableColumns(templateColumns)"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
class="w-full"
|
class="w-full"
|
||||||
:ui="{ divide: 'divide-gray-200 dark:divide-gray-800' }"
|
:ui="{ divide: 'divide-gray-200 dark:divide-gray-800' }"
|
||||||
:on-select="(row) => router.push(`/accounting/cashbooks/${row.original?.id || row.id}`)"
|
:on-select="(row) => router.push(`/accounting/cashbooks/${row.original?.id || row.id}`)"
|
||||||
:empty="{ icon: 'i-heroicons-banknotes', label: 'Keine Kassenbücher angelegt' }"
|
:empty="{ icon: 'i-heroicons-banknotes', label: 'Keine Kassenbücher angelegt' }"
|
||||||
>
|
>
|
||||||
<template #datevNumber-cell="{ row }">
|
<template #datevNumber-cell="{ row }">
|
||||||
<span class="font-mono">{{ row.original.datevNumber }}</span>
|
<span class="font-mono">{{ row.original.datevNumber }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #balance-cell="{ row }">
|
<template #balance-cell="{ row }">
|
||||||
{{ displayCurrency(row.original.balance) }}
|
{{ displayCurrency(row.original.balance) }}
|
||||||
</template>
|
</template>
|
||||||
<template #syncedAt-cell="{ row }">
|
<template #syncedAt-cell="{ row }">
|
||||||
{{ row.original.createdAt ? new Date(row.original.createdAt).toLocaleDateString("de-DE") : "-" }}
|
{{ row.original.createdAt ? new Date(row.original.createdAt).toLocaleDateString("de-DE") : "-" }}
|
||||||
</template>
|
</template>
|
||||||
</UTable>
|
</UTable>
|
||||||
|
|
||||||
<UModal v-model:open="createCashbookModalOpen">
|
<UModal v-model:open="createCashbookModalOpen">
|
||||||
<template #content>
|
<template #content>
|
||||||
<UCard>
|
<UCard>
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="text-lg font-semibold">Barkasse anlegen</div>
|
<div class="text-lg font-semibold">Barkasse anlegen</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<UForm :state="newCashbook" class="space-y-4" @submit.prevent="createCashbook">
|
<UForm :state="newCashbook" class="space-y-4" @submit.prevent="createCashbook">
|
||||||
<UFormField label="Bezeichnung">
|
<UFormField label="Bezeichnung">
|
||||||
<UInput v-model="newCashbook.name" placeholder="z. B. Hauptkasse" />
|
<UInput v-model="newCashbook.name" placeholder="z. B. Hauptkasse" />
|
||||||
</UFormField>
|
</UFormField>
|
||||||
<UFormField label="Kontennummer">
|
<UFormField label="Kontennummer">
|
||||||
<UInput v-model="newCashbook.datevNumber" placeholder="1000" />
|
<UInput v-model="newCashbook.datevNumber" placeholder="1000" />
|
||||||
</UFormField>
|
</UFormField>
|
||||||
<UFormField label="Anfangsbestand">
|
<UFormField label="Anfangsbestand">
|
||||||
<UInput v-model="newCashbook.openingBalance" type="number" step="0.01" />
|
<UInput v-model="newCashbook.openingBalance" type="number" step="0.01" />
|
||||||
</UFormField>
|
</UFormField>
|
||||||
|
|
||||||
<div class="flex justify-end gap-3 pt-2">
|
<div class="flex justify-end gap-3 pt-2">
|
||||||
<UButton color="gray" variant="soft" @click="createCashbookModalOpen = false">
|
<UButton color="gray" variant="soft" @click="createCashbookModalOpen = false">
|
||||||
Abbrechen
|
Abbrechen
|
||||||
</UButton>
|
</UButton>
|
||||||
<UButton type="submit" color="primary" :loading="savingCashbook">
|
<UButton type="submit" color="primary" :loading="savingCashbook">
|
||||||
Barkasse anlegen
|
Barkasse anlegen
|
||||||
</UButton>
|
</UButton>
|
||||||
</div>
|
</div>
|
||||||
</UForm>
|
</UForm>
|
||||||
</UCard>
|
</UCard>
|
||||||
</template>
|
</template>
|
||||||
</UModal>
|
</UModal>
|
||||||
</UDashboardPanelContent>
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user