- <mat-toolbar color="primary">{{ tituloVista }} Rol</mat-toolbar>
- <mat-card>
- <form #editForm="ngForm" [formGroup]="formAdd" (ngSubmit)="saveRol()">
- <mat-card-content>
- <div
- class="form-control-container"
- fxLayout="row"
- fxLayoutGap="5%"
- fxLayout.xs="column"
- >
- <mat-form-field fxFlex="33%">
- <mat-label>Sub Sistema</mat-label>
- <mat-select
- name="subsistemaId"
- formControlName="subSistema"
- required
- (selectionChange)="changeSubsistema($event.value)"
- >
- <mat-option>Ninguno</mat-option>
- <mat-option
- *ngFor="let subsistema of subsistemas"
- [value]="subsistema.subsistemaId"
- matTooltip="{{ subsistema.nombre }}"
- >{{ subsistema.nombre }}</mat-option
- >
- </mat-select>
- <mat-error>
- <span *ngIf="formAdd?.controls.subSistema?.errors?.required"
- >El campo es requerido</span
- >
- </mat-error>
- </mat-form-field>
- <mat-form-field fxFlex="33%">
- <mat-label>Aplicación</mat-label>
- <mat-select
- formControlName="aplicacion"
- (selectionChange)="changeAplicacion($event.value)"
- >
- <mat-option>Ninguno</mat-option>
- <mat-option
- *ngFor="let aplicacion of aplicaciones"
- [value]="aplicacion.aplicacionId"
- matTooltip="{{ aplicacion.nombre }}"
- >{{ aplicacion.nombre }}</mat-option
- >
- </mat-select>
- <mat-error>
- <span *ngIf="formAdd?.controls.aplicacion?.errors?.required"
- >El campo es requerido</span
- >
- </mat-error>
- </mat-form-field>
- <mat-form-field fxFlex="30%">
- <mat-label>Opción</mat-label>
- <mat-select name="opcionId" formControlName="opcion" required>
- <mat-option>Ninguno</mat-option>
- <mat-option
- *ngFor="let opcion of opciones"
- [value]="opcion.opcionId"
- >{{ opcion.nombre }}</mat-option
- >
- </mat-select>
- <mat-error>
- <span *ngIf="formAdd?.controls.opcion?.errors?.required"
- >El campo es requerido</span
- >
- </mat-error>
- </mat-form-field>
- </div>
- <div
- class="form-control-container"
- fxLayout="row"
- fxLayoutGap="5%"
- fxLayout.xs="column"
- >
- <mat-form-field fxFlex="30%">
- <mat-label>Tipo Aplicación</mat-label>
- <mat-select
- name="tipoAplicacionId"
- formControlName="tipoAplicacion"
- required
- >
- <mat-option>Ninguno</mat-option>
- <mat-option
- *ngFor="let tipoAplicacion of tipoAplicaciones"
- [value]="tipoAplicacion.clasificadorId"
- >{{ tipoAplicacion.descripcion }}</mat-option
- >
- </mat-select>
- <mat-error>
- <span *ngIf="formAdd?.controls.tipoAplicacion?.errors?.required"
- >El campo es requerido</span
- >
- </mat-error>
- </mat-form-field>
- <mat-form-field fxFlex="30%">
- <mat-label>Tipo Rol</mat-label>
- <mat-select name="tipoRolId" formControlName="tipoRol" required>
- <mat-option>Ninguno</mat-option>
- <mat-option
- *ngFor="let tipoRol of tipoRoles"
- [value]="tipoRol.clasificadorId"
- >{{ tipoRol.descripcion }}</mat-option
- >
- </mat-select>
- <mat-error>
- <span *ngIf="formAdd?.controls.tipoRol?.errors?.required"
- >El campo es requerido</span
- >
- </mat-error>
- </mat-form-field>
- </div>
- <div
- class="form-control-container"
- fxLayout="row"
- fxLayoutGap="5%"
- fxLayout.xs="column"
- >
- <mat-form-field fxFlex="30%">
- <mat-label>Nombre</mat-label>
- <input
- matInput
- type="text"
- name="rol"
- formControlName="nombre"
- required
- maxlength="60"
- oninput="this.value = this.value.toUpperCase()"
- />
- <mat-error>
- <span *ngIf="formAdd?.controls.nombre?.errors?.required"
- >El campo es requerido</span
- >
- <span *ngIf="formAdd?.controls.nombre?.errors?.minlength"
- >Minimo de caracteres es 2</span
- >
- <span *ngIf="formAdd?.controls.nombre?.errors?.maxlength"
- >Maximo de caracteres es 60</span
- >
- </mat-error>
- </mat-form-field>
- <mat-form-field fxFlex="70%">
- <mat-label>Descripción</mat-label>
- <input
- matInput
- type="text"
- type="text"
- name="descripcion"
- formControlName="descripcion"
- required
- maxlength="150"
- oninput="this.value = this.value.toUpperCase()"
- />
- <mat-error>
- <span *ngIf="formAdd?.controls.descripcion?.errors?.required"
- >El campo es requerido</span
- >
- <span *ngIf="formAdd?.controls.descripcion?.errors?.minlength"
- >Minimo de caracteres es 2</span
- >
- <span *ngIf="formAdd?.controls.descripcion?.errors?.maxlength"
- >Maximo de caracteres es 150</span
- >
- </mat-error>
- </mat-form-field>
- </div>
- </mat-card-content>
- <mat-card-actions fxLayout="row" fxLayoutAlign="end center">
- <button
- type="submit"
- mat-raised-button
- color="primary"
- [disabled]="!editForm.form.valid"
- >
- Guardar
- <mat-icon class="white">save</mat-icon>
- </button>
- <button
- type="button"
- mat-raised-button
- color="warn"
- (click)="closeDialog()"
- >
- Cerrar
- <mat-icon class="white">cancel</mat-icon>
- </button>
- </mat-card-actions>
- </form>
- </mat-card>