Organizando y comenzando con interfaces
This commit is contained in:
21
resources/views/components/flash.blade.php
Normal file
21
resources/views/components/flash.blade.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<div>
|
||||
<script>
|
||||
document.addEventListener('alpine:initialized', () => {
|
||||
const toast = @js(session()->get('toast', null));
|
||||
|
||||
if (!toast) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (toast.type === 'success') {
|
||||
$interaction('toast').success(toast.title ?? 'Éxito', toast.message).send();
|
||||
} else if (toast.type === 'error') {
|
||||
$interaction('toast').error(toast.title ?? 'Error', toast.message).send();
|
||||
} else if (toast.type === 'warning') {
|
||||
$interaction('toast').warning(toast.title ?? 'Advertencia', toast.message).send();
|
||||
} else if (toast.type === 'info') {
|
||||
$interaction('toast').info(toast.title ?? 'Información', toast.message).send();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
@@ -8,20 +8,26 @@
|
||||
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Domine:wght@400..700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Karla:ital,wght@0,200..800;1,200..800&family=Nunito:ital,wght@0,200..1000;1,200..1000&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
|
||||
<tallstackui:script />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Domine:wght@400..700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Karla:ital,wght@0,200..800;1,200..800&family=Nunito:ital,wght@0,200..1000;1,200..1000&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
|
||||
rel="stylesheet">
|
||||
<tallstackui:script/>
|
||||
@livewireStyles
|
||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||
</head>
|
||||
|
||||
<body class="flex flex-col min-h-screen">
|
||||
<x-navbar />
|
||||
<div class="flex-1 bg-secondary-50 overflow-x-auto">
|
||||
<main class="container mx-auto p-4 ">
|
||||
{{ $slot }}
|
||||
</main>
|
||||
</div>
|
||||
@livewireScripts
|
||||
<x-dialog/>
|
||||
<x-toast/>
|
||||
<x-flash/>
|
||||
|
||||
<x-navbar/>
|
||||
<div class="flex-1 bg-secondary-50 overflow-x-auto">
|
||||
<main class="container mx-auto px-4 py-8">
|
||||
{{ $slot }}
|
||||
</main>
|
||||
</div>
|
||||
@livewireScripts
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
3
resources/views/components/title.blade.php
Normal file
3
resources/views/components/title.blade.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<div>
|
||||
<h1 class="text-4xl mb-8 underline decoration-primary decoration-3">{{$slot}}</h1>
|
||||
</div>
|
||||
@@ -1,3 +1,8 @@
|
||||
<x-layout>
|
||||
<h1 class="text-4xl font-medium">Bienvenido</h1>
|
||||
<h1 class="text-4xl font-medium">Bienvenido</h1>
|
||||
<h1 class="text-4xl font-medium">Bienvenido</h1>
|
||||
<h1 class="text-4xl font-medium">Bienvenido</h1>
|
||||
<h1 class="text-4xl font-medium">Bienvenido</h1>
|
||||
<h1 class="text-4xl font-medium">Bienvenido</h1>
|
||||
</x-layout>
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<div>
|
||||
<form wire:submit.prevent="save" class="grid lg:grid-cols-[repeat(4,minmax(0,2fr))_1fr] gap-2 mb-4 items-end">
|
||||
<x-select.styled label="Tipo Documento" :options="$this->tipos" wire:model="tipo" id="tipo" required
|
||||
searchable invalidate/>
|
||||
<x-input label="Nº Documento" wire:model="numero" invalidate/>
|
||||
<x-input label="Descripción" wire:model="descripcion" invalidate/>
|
||||
<x-input label="Total" wire:model="valor" invalidate/>
|
||||
|
||||
<x-button type="submit">
|
||||
@if($this->currentEgreso)
|
||||
Guardar
|
||||
@else
|
||||
Agregar
|
||||
@endif
|
||||
</x-button>
|
||||
|
||||
|
||||
<p class="text-sm font-medium text-red-500">
|
||||
@error('tipo'){{$message}}@enderror
|
||||
</p>
|
||||
<p class="text-sm font-medium text-red-500">
|
||||
@error('numero'){{$message}}@enderror
|
||||
</p>
|
||||
<p class="text-sm font-medium text-red-500">
|
||||
@error('descripcion'){{$message}}@enderror
|
||||
</p>
|
||||
<p class="text-sm font-medium text-red-500">
|
||||
@error('valor'){{$message}}@enderror
|
||||
</p>
|
||||
|
||||
</form>
|
||||
<x-table striped :headers="$this->headers" :rows="$this->rows">
|
||||
@interact('column_action', $row)
|
||||
<x-button.circle icon="edit" wire:click="edit('{{$row->id}}')" :key="uniqid()"/>
|
||||
<x-button.circle icon="trash" color="red" wire:click="confirmDelete('{{$row->id}}')" :key="uniqid()"/>
|
||||
@endinteract
|
||||
</x-table>
|
||||
|
||||
<div class="mt-4">
|
||||
<p class="text-xl">Egresos Totales: <span class="font-bold">{{$this->totalEgresos}}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,51 @@
|
||||
<div>
|
||||
<form wire:submit.prevent="save" class="grid lg:grid-cols-[repeat(4,minmax(0,2fr))_1fr] gap-2 mb-4 items-end">
|
||||
<x-select.styled label="Tipo Documento" :options="$this->tipos" wire:model="tipo" required searchable
|
||||
invalidate/>
|
||||
<x-input type="number" label="Documento Inicial" wire:model="ingreso_inicial" min="0" invalidate/>
|
||||
<x-input type="number" label="Documento Final" wire:model="ingreso_final" min="0" invalidate/>
|
||||
<x-input type="number" label="Total" wire:model="total" min="0" invalidate/>
|
||||
|
||||
<x-button type="submit">
|
||||
@if($this->currentIngreso)
|
||||
Guardar
|
||||
@else
|
||||
Agregar
|
||||
@endif
|
||||
</x-button>
|
||||
|
||||
|
||||
<p class="text-sm font-medium text-red-500">
|
||||
@error('tipo'){{$message}}@enderror
|
||||
</p>
|
||||
<p class="text-sm font-medium text-red-500">
|
||||
@error('ingreso_inicial'){{$message}}@enderror
|
||||
</p>
|
||||
<p class="text-sm font-medium text-red-500">
|
||||
@error('ingreso_final'){{$message}}@enderror
|
||||
</p>
|
||||
<p class="text-sm font-medium text-red-500">
|
||||
@error('total'){{$message}}@enderror
|
||||
</p>
|
||||
|
||||
</form>
|
||||
<x-table striped :headers="$this->headers" :rows="$this->rows">
|
||||
@interact('column_ingreso_inicial', $row)
|
||||
{{\Illuminate\Support\Number::format($row->ingreso_inicial)}}
|
||||
@endinteract
|
||||
@interact('column_ingreso_final', $row)
|
||||
{{\Illuminate\Support\Number::format($row->ingreso_final)}}
|
||||
@endinteract
|
||||
@interact('column_total', $row)
|
||||
{{\Illuminate\Support\Number::currency($row->total)}}
|
||||
@endinteract
|
||||
@interact('column_action', $row)
|
||||
<x-button.circle icon="edit" wire:click="edit('{{$row->id}}')" :key="uniqid()"/>
|
||||
<x-button.circle icon="trash" color="red" wire:click="confirmDelete('{{$row->id}}')" :key="uniqid()"/>
|
||||
@endinteract
|
||||
</x-table>
|
||||
|
||||
<div class="mt-4">
|
||||
<p class="text-xl">Ingresos Totales: <span class="font-bold">{{$this->totalIngresos}}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
47
resources/views/livewire/cajas/edit.blade.php
Normal file
47
resources/views/livewire/cajas/edit.blade.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<div>
|
||||
<div class="flex gap-2 justify-between items-baseline">
|
||||
<x-title>
|
||||
{{$this->turno ? "Editar caja" : "Registrar Caja"}}
|
||||
</x-title>
|
||||
|
||||
<x-button icon="arrow-left" color="secondary" href="{{route('cajas.index')}}">
|
||||
Volver
|
||||
</x-button>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-8 mb-4">
|
||||
<div>
|
||||
<x-label>Fecha</x-label>
|
||||
<p class="font-bold text-secondary">{{$turno->fecha->format('d-m-Y')}}</p>
|
||||
</div>
|
||||
<div>
|
||||
<x-label>Fecha</x-label>
|
||||
<p class="font-bold text-secondary">{{$turno->numero_caja}}</p>
|
||||
</div>
|
||||
<div>
|
||||
<x-label>Turno</x-label>
|
||||
<p class="font-bold text-secondary">{{$turno->numero_turno}}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-tab wire:model="tab">
|
||||
<x-tab.items tab="Ingresos">
|
||||
<x-slot:left>
|
||||
<x-icon name="plus" class="w-4 h-4"/>
|
||||
</x-slot:left>
|
||||
<livewire:cajas.components.ingresos-component :turno="$turno"/>
|
||||
</x-tab.items>
|
||||
<x-tab.items tab="Egresos">
|
||||
<x-slot:left>
|
||||
<x-icon name="minus" class="w-4 h-4"/>
|
||||
</x-slot:left>
|
||||
<livewire:cajas.components.egresos-component :turno="$turno"/>
|
||||
</x-tab.items>
|
||||
<x-tab.items tab="Arqueo">
|
||||
<x-slot:left>
|
||||
<x-icon name="plus-minus" class="w-4 h-4"/>
|
||||
</x-slot:left>
|
||||
Arqueo
|
||||
</x-tab.items>
|
||||
</x-tab>
|
||||
</div>
|
||||
@@ -1,3 +1,29 @@
|
||||
<div>
|
||||
<p> Knowing others is intelligence; knowing yourself is true wisdom. </p>
|
||||
</div>
|
||||
<x-title>Cajas</x-title>
|
||||
|
||||
<div class="flex gap-2 justify-between items-end">
|
||||
<x-date label="Fecha" helpers/>
|
||||
<x-button wire:click="createTurno" icon="plus">Registrar Caja</x-button>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<x-table striped :headers="$this->headers" :rows="$this->rows" paginate :$sort>
|
||||
@interact('column_action', $row)
|
||||
<x-button.circle icon="edit" :href="route('cajas.edit', $row->id)" :key="uniqid()"/>
|
||||
<x-button.circle icon="trash" color="red" wire:click="confirmDelete('{{$row->id}}')" :key="uniqid()"/>
|
||||
@endinteract
|
||||
</x-table>
|
||||
</div>
|
||||
|
||||
<x-modal title="Registrar Caja" wire center blur>
|
||||
<div class="flex flex-col gap-2">
|
||||
<x-date label="Fecha" wire:model="fecha" format="DD-MM-YYYY"/>
|
||||
<x-input type="number" label="Caja" wire:model="caja"/>
|
||||
<x-input type="number" label="Turno" wire:model="turno"/>
|
||||
</div>
|
||||
<x-slot:footer>
|
||||
<x-button color="secondary" icon="arrow-left" wire:click="closeTurnoModal">Volver</x-button>
|
||||
<x-button icon="plus" wire:click="storeTurno">Registrar Caja</x-button>
|
||||
</x-slot:footer>
|
||||
</x-modal>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user