Files
WebApp/src/app/governance/components/risk-batches-panel/risk-batches-panel.html
T
2026-11-21 04:24:19 -06:00

68 lines
2.8 KiB
HTML

<div class="batches">
<div class="batches__toolbar">
<mat-button-toggle-group hideSingleSelectionIndicator [value]="domain()" (change)="setDomain($event.value)" aria-label="Dominio">
@for (option of domains; track option.id) {
<mat-button-toggle [value]="option.id">{{ option.label }}</mat-button-toggle>
}
</mat-button-toggle-group>
<span class="batches__spacer"></span>
<button mat-icon-button type="button" (click)="reload()" aria-label="Recargar" matTooltip="Recargar">
<mat-icon aria-hidden="true">refresh</mat-icon>
</button>
</div>
@if (loading()) {
<mat-progress-bar mode="indeterminate"></mat-progress-bar>
}
@if (loadError(); as error) {
<p class="batches__alert" role="alert"><mat-icon aria-hidden="true">error</mat-icon>{{ error }}</p>
}
<table mat-table [dataSource]="batches()" class="batches__table">
<ng-container matColumnDef="modelo">
<th mat-header-cell *matHeaderCellDef>Modelo</th>
<td mat-cell *matCellDef="let b">{{ b.modelo_nombre }}:{{ b.modelo_version }}</td>
</ng-container>
<ng-container matColumnDef="evaluado_en">
<th mat-header-cell *matHeaderCellDef>Calculado</th>
<td mat-cell *matCellDef="let b">{{ b.evaluado_en | date: 'short' }}</td>
</ng-container>
<ng-container matColumnDef="n_evaluaciones">
<th mat-header-cell *matHeaderCellDef>Pacientes</th>
<td mat-cell *matCellDef="let b">{{ b.n_evaluaciones }}</td>
</ng-container>
<ng-container matColumnDef="motivo">
<th mat-header-cell *matHeaderCellDef>Motivo</th>
<td mat-cell *matCellDef="let b">
<mat-form-field appearance="outline" subscriptSizing="dynamic" class="batches__reason">
<input matInput [formControl]="reasonFor(b)" placeholder="Motivo de la confirmación o anulación" />
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="acciones">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let b">
<button mat-button type="button" color="primary" [disabled]="!reasonFor(b).value.trim() || deciding() === b.lote_id"
(click)="confirm(b)">
<mat-icon aria-hidden="true">check_circle</mat-icon>Confirmar
</button>
<button mat-button type="button" color="warn" [disabled]="!reasonFor(b).value.trim() || deciding() === b.lote_id"
(click)="void(b)">
<mat-icon aria-hidden="true">block</mat-icon>Anular
</button>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
</table>
@if (!loading() && batches().length === 0) {
<p class="batches__empty"><mat-icon aria-hidden="true">task_alt</mat-icon>No hay lotes de riesgo pendientes de revisión.</p>
}
</div>