liberar cuenta
This commit is contained in:
@@ -34,6 +34,7 @@ class ShowPlanes extends Component
|
||||
public $renovar = false;
|
||||
public $serviciosModal = false;
|
||||
public $modTarifas = false;
|
||||
public $ver = false;
|
||||
|
||||
public $roles_modTarifas;
|
||||
public $pantallas_modTarifas;
|
||||
@@ -79,6 +80,7 @@ class ShowPlanes extends Component
|
||||
public $password_renovar;
|
||||
public $fecha_inicial_renovar;
|
||||
public $fecha_final_renovar;
|
||||
public $fecha_final_renovar_old;
|
||||
|
||||
public $servicio;
|
||||
|
||||
@@ -203,9 +205,40 @@ class ShowPlanes extends Component
|
||||
$this->estado = $renovarCuenta->estado;
|
||||
}
|
||||
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;
|
||||
|
||||
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([
|
||||
'correo' => $this->usuario_renovar,
|
||||
@@ -220,6 +253,14 @@ class ShowPlanes extends Component
|
||||
]);
|
||||
|
||||
$this->renovar = false;
|
||||
$this->ver = false;
|
||||
}
|
||||
|
||||
public function getListeners()
|
||||
{
|
||||
return [
|
||||
'confirmed', 'siRenovar', 'noRenovar'
|
||||
];
|
||||
}
|
||||
|
||||
/* ------------- CREAR ------------- */
|
||||
@@ -353,13 +394,6 @@ class ShowPlanes extends Component
|
||||
]);
|
||||
}
|
||||
|
||||
public function getListeners()
|
||||
{
|
||||
return [
|
||||
'confirmed'
|
||||
];
|
||||
}
|
||||
|
||||
public function confirmed()
|
||||
{
|
||||
Cuentas::where('id', $this->delete_cuenta)->delete();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
newCuenta: @entangle('newCuenta'),
|
||||
modTarifas: @entangle('modTarifas'),
|
||||
serviciosModal: @entangle('serviciosModal'),
|
||||
ver: false,
|
||||
ver: @entangle('ver'),
|
||||
renovar: @entangle('renovar'),
|
||||
addUser: @entangle('addUser'),
|
||||
editarTarifaRol: @entangle('editarTarifaRol'),
|
||||
|
||||
Reference in New Issue
Block a user