liberar cuenta

This commit is contained in:
Felipe
2023-11-20 18:08:07 -05:00
parent f7607fe43d
commit e3f3956b84
2 changed files with 42 additions and 8 deletions
+41 -7
View File
@@ -34,6 +34,7 @@ class ShowPlanes extends Component
public $renovar = false; public $renovar = false;
public $serviciosModal = false; public $serviciosModal = false;
public $modTarifas = false; public $modTarifas = false;
public $ver = false;
public $roles_modTarifas; public $roles_modTarifas;
public $pantallas_modTarifas; public $pantallas_modTarifas;
@@ -79,6 +80,7 @@ class ShowPlanes extends Component
public $password_renovar; public $password_renovar;
public $fecha_inicial_renovar; public $fecha_inicial_renovar;
public $fecha_final_renovar; public $fecha_final_renovar;
public $fecha_final_renovar_old;
public $servicio; public $servicio;
@@ -203,9 +205,40 @@ class ShowPlanes extends Component
$this->estado = $renovarCuenta->estado; $this->estado = $renovarCuenta->estado;
} }
public function saveRenovar() public function saveRenovar()
{
$this->alert('warning', '¿Desea también desvincular todos los usuarios de esta cuenta?', [
'position' => 'center',
'timer' => '10000',
'toast' => false,
'text' => 'Esta seguro',
'showConfirmButton' => true,
'onConfirmed' => 'siRenovar',
'showDenyButton' => false,
'onDenied' => 'noRenovar',
'showCancelButton' => true,
'onDismissed' => 'noRenovar',
'cancelButtonText' => 'No, solo renovar',
'confirmButtonText' => 'Si, liberar cuenta',
]);
}
public function siRenovar()
{ {
$id = $this->id_cuentaVer; $id = $this->id_cuentaVer;
Historial_cuenta::where('cuenta_id', $id)->delete();
$this->alert('success', 'Cuenta renovada y liberada correctamente!', [
'position' => 'top'
]);
$this->renovar = false;
$this->ver = false;
}
public function noRenovar()
{
$id = $this->id_cuentaVer;
Cuentas::where('id', $id)->update([ Cuentas::where('id', $id)->update([
'correo' => $this->usuario_renovar, 'correo' => $this->usuario_renovar,
@@ -220,6 +253,14 @@ class ShowPlanes extends Component
]); ]);
$this->renovar = false; $this->renovar = false;
$this->ver = false;
}
public function getListeners()
{
return [
'confirmed', 'siRenovar', 'noRenovar'
];
} }
/* ------------- CREAR ------------- */ /* ------------- CREAR ------------- */
@@ -353,13 +394,6 @@ class ShowPlanes extends Component
]); ]);
} }
public function getListeners()
{
return [
'confirmed'
];
}
public function confirmed() public function confirmed()
{ {
Cuentas::where('id', $this->delete_cuenta)->delete(); Cuentas::where('id', $this->delete_cuenta)->delete();
@@ -4,7 +4,7 @@
newCuenta: @entangle('newCuenta'), newCuenta: @entangle('newCuenta'),
modTarifas: @entangle('modTarifas'), modTarifas: @entangle('modTarifas'),
serviciosModal: @entangle('serviciosModal'), serviciosModal: @entangle('serviciosModal'),
ver: false, ver: @entangle('ver'),
renovar: @entangle('renovar'), renovar: @entangle('renovar'),
addUser: @entangle('addUser'), addUser: @entangle('addUser'),
editarTarifaRol: @entangle('editarTarifaRol'), editarTarifaRol: @entangle('editarTarifaRol'),