Dev branch

This commit is contained in:
Simon Pocrnjič
2025-11-02 12:31:01 +01:00
parent 5f879c9436
commit 63e0958b66
241 changed files with 17686 additions and 7327 deletions
@@ -1,6 +1,9 @@
<script setup>
import DialogModal from "@/Components/DialogModal.vue";
import CreateDialog from "@/Components/Dialogs/CreateDialog.vue";
import CurrencyInput from "@/Components/CurrencyInput.vue";
import { Label } from "@/Components/ui/label";
import { Input } from "@/Components/ui/input";
import DatePicker from "@/Components/DatePicker.vue";
const props = defineProps({
show: { type: Boolean, default: false },
@@ -14,12 +17,17 @@ const onSubmit = () => emit("submit");
</script>
<template>
<DialogModal :show="show" @close="onClose">
<template #title>Dodaj plačilo</template>
<template #content>
<div class="space-y-3">
<div>
<label class="block text-sm text-gray-700 mb-1">Znesek</label>
<CreateDialog
:show="show"
title="Dodaj plačilo"
confirm-text="Shrani"
:processing="form.processing"
@close="onClose"
@confirm="onSubmit"
>
<div class="space-y-4">
<div class="space-y-2">
<Label for="paymentAmount">Znesek</Label>
<CurrencyInput
id="paymentAmount"
v-model="form.amount"
@@ -27,64 +35,48 @@ const onSubmit = () => emit("submit");
placeholder="0,00"
class="w-full"
/>
<div v-if="form.errors?.amount" class="text-sm text-red-600 mt-0.5">
<p v-if="form.errors?.amount" class="text-sm text-red-600">
{{ form.errors.amount }}
</div>
</p>
</div>
<div class="flex gap-2">
<div class="flex-1">
<label class="block text-sm text-gray-700 mb-1">Valuta</label>
<input
<div class="grid grid-cols-2 gap-4">
<div class="space-y-2">
<Label for="paymentCurrency">Valuta</Label>
<Input
id="paymentCurrency"
type="text"
v-model="form.currency"
class="w-full rounded border-gray-300"
maxlength="3"
placeholder="EUR"
/>
<div v-if="form.errors?.currency" class="text-sm text-red-600 mt-0.5">
<p v-if="form.errors?.currency" class="text-sm text-red-600">
{{ form.errors.currency }}
</div>
</p>
</div>
<div class="flex-1">
<label class="block text-sm text-gray-700 mb-1">Datum</label>
<input
type="date"
<div class="space-y-2">
<Label for="paymentDate">Datum</Label>
<DatePicker
id="paymentDate"
v-model="form.paid_at"
class="w-full rounded border-gray-300"
format="dd.MM.yyyy"
:error="form.errors?.paid_at"
/>
<div v-if="form.errors?.paid_at" class="text-sm text-red-600 mt-0.5">
{{ form.errors.paid_at }}
</div>
</div>
</div>
<div>
<label class="block text-sm text-gray-700 mb-1">Sklic</label>
<input
<div class="space-y-2">
<Label for="paymentReference">Sklic</Label>
<Input
id="paymentReference"
type="text"
v-model="form.reference"
class="w-full rounded border-gray-300"
placeholder="Sklic"
/>
<div v-if="form.errors?.reference" class="text-sm text-red-600 mt-0.5">
<p v-if="form.errors?.reference" class="text-sm text-red-600">
{{ form.errors.reference }}
</div>
</p>
</div>
</div>
</template>
<template #footer>
<button
type="button"
class="px-4 py-2 rounded bg-gray-200 hover:bg-gray-300"
@click="onClose"
>
Prekliči
</button>
<button
type="button"
class="px-4 py-2 rounded bg-indigo-600 text-white hover:bg-indigo-700"
:disabled="form.processing"
@click="onSubmit"
>
Shrani
</button>
</template>
</DialogModal>
</CreateDialog>
</template>