Creando modal propio
This commit is contained in:
@@ -10,6 +10,7 @@ use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Livewire\Attributes\Computed;
|
||||
use Livewire\Attributes\On;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
use Log;
|
||||
@@ -21,8 +22,6 @@ class Index extends Component
|
||||
|
||||
public $searchFecha = null;
|
||||
|
||||
public $modal = false;
|
||||
|
||||
public $fecha = null;
|
||||
|
||||
public $caja = null;
|
||||
@@ -36,7 +35,6 @@ class Index extends Component
|
||||
|
||||
public function createTurno(): void
|
||||
{
|
||||
$this->modal = true;
|
||||
$this->fecha = now()->format('Y-m-d');
|
||||
$this->caja = 1;
|
||||
|
||||
@@ -45,6 +43,8 @@ class Index extends Component
|
||||
} else {
|
||||
$this->turno = 1;
|
||||
}
|
||||
|
||||
$this->dispatch('show-modal', "turno");
|
||||
}
|
||||
|
||||
public function storeTurno(): void
|
||||
@@ -87,14 +87,16 @@ class Index extends Component
|
||||
$this->redirectRoute('cajas.edit', $turno, navigate: true);
|
||||
}
|
||||
|
||||
#[On('close-modal-turno')]
|
||||
public function closeTurnoModal(): void
|
||||
{
|
||||
$this->modal = false;
|
||||
Log::info("Cerrando modal");
|
||||
$this->fecha = null;
|
||||
$this->caja = null;
|
||||
$this->turno = null;
|
||||
|
||||
$this->clearValidation();
|
||||
$this->dispatch('hide-modal', 'turno');
|
||||
}
|
||||
|
||||
public function confirmDelete($id): void
|
||||
|
||||
Reference in New Issue
Block a user