|
|
@@ -7,7 +7,8 @@
|
|
|
</h1>
|
|
|
|
|
|
<!-- Contenedor principal que se ocultará durante la validación -->
|
|
|
-<div *ngIf="!isValidating">
|
|
|
+@if (!isValidating) {
|
|
|
+<div>
|
|
|
<div class="uploader">
|
|
|
<h2
|
|
|
mat-dialog-title
|
|
|
@@ -39,8 +40,8 @@
|
|
|
(dragleave)="onDragLeave($event)"
|
|
|
(drop)="onDrop($event)"
|
|
|
(click)="openFileUploader()"
|
|
|
- *ngIf="!isUploading"
|
|
|
>
|
|
|
+ @if (!isUploading) {
|
|
|
<div class="drag-drop-content">
|
|
|
<mat-icon
|
|
|
class="upload-icon"
|
|
|
@@ -51,14 +52,9 @@
|
|
|
{{ hasZipFile && hasExcelFile ? "refresh" : "folder_copy" }}
|
|
|
</mat-icon>
|
|
|
|
|
|
- <p
|
|
|
- class="drag-drop-text"
|
|
|
- *ngIf="
|
|
|
- (!hasExcelFile || !hasZipFile) &&
|
|
|
- !isOperationInProgress &&
|
|
|
- !hasValidationResults
|
|
|
- "
|
|
|
- >
|
|
|
+ @if ((!hasExcelFile || !hasZipFile) && !isOperationInProgress &&
|
|
|
+ !hasValidationResults) {
|
|
|
+ <p class="drag-drop-text">
|
|
|
<strong>Haga clic aquí o arrastre aquí los archivos requeridos</strong
|
|
|
><br />
|
|
|
<span
|
|
|
@@ -66,63 +62,55 @@
|
|
|
(máximo {{ MAX_ZIP_SIZE_MB }}MB)</span
|
|
|
>
|
|
|
</p>
|
|
|
-
|
|
|
- <p
|
|
|
- class="drag-drop-text"
|
|
|
- *ngIf="
|
|
|
- hasExcelFile &&
|
|
|
- hasZipFile &&
|
|
|
- !isOperationInProgress &&
|
|
|
- !hasValidationResults
|
|
|
- "
|
|
|
- >
|
|
|
+ } @if (hasExcelFile && hasZipFile && !isOperationInProgress &&
|
|
|
+ !hasValidationResults) {
|
|
|
+ <p class="drag-drop-text">
|
|
|
<strong>Haga clic aquí o arrastre nuevos archivos</strong><br />
|
|
|
<span>Para reemplazar los archivos actuales</span>
|
|
|
</p>
|
|
|
+ }
|
|
|
|
|
|
<!-- Mensaje cuando está deshabilitado por validación -->
|
|
|
- <p
|
|
|
- class="drag-drop-text"
|
|
|
- *ngIf="hasValidationResults"
|
|
|
- style="opacity: 0.7"
|
|
|
- >
|
|
|
+ @if (hasValidationResults) {
|
|
|
+ <p class="drag-drop-text" style="opacity: 0.7">
|
|
|
<strong>Área de carga deshabilitada</strong><br />
|
|
|
<span>Los archivos ya han sido validados. </span>
|
|
|
</p>
|
|
|
+ }
|
|
|
|
|
|
<!-- Mensaje cuando está en progreso -->
|
|
|
- <p
|
|
|
- class="drag-drop-text"
|
|
|
- *ngIf="isOperationInProgress && !hasValidationResults"
|
|
|
- style="opacity: 0.7"
|
|
|
- >
|
|
|
+ @if (isOperationInProgress && !hasValidationResults) {
|
|
|
+ <p class="drag-drop-text" style="opacity: 0.7">
|
|
|
<strong>Operación en progreso...</strong><br />
|
|
|
<span>Espere a que termine la operación actual</span>
|
|
|
</p>
|
|
|
+ }
|
|
|
</div>
|
|
|
+ }
|
|
|
</div>
|
|
|
|
|
|
- <div *ngIf="isUploading" class="upload-progress drag-drop-area uploading">
|
|
|
+ @if (isUploading) {
|
|
|
+ <div class="upload-progress drag-drop-area uploading">
|
|
|
<mat-spinner diameter="30"></mat-spinner>
|
|
|
<p style="margin-top: 10px">
|
|
|
Subiendo archivo {{ currentFileType === "excel" ? "Excel" : "ZIP" }}...
|
|
|
</p>
|
|
|
</div>
|
|
|
+ }
|
|
|
</div>
|
|
|
|
|
|
<div mat-dialog-content class="prevent-select">
|
|
|
+ @if (isLoading) {
|
|
|
<div
|
|
|
class="is-loading animated fadeIn fast"
|
|
|
- *ngIf="isLoading"
|
|
|
style="text-align: center; padding: 20px"
|
|
|
>
|
|
|
<mat-spinner></mat-spinner>
|
|
|
<h3 style="margin-top: 10px">Procesando archivos...</h3>
|
|
|
</div>
|
|
|
-
|
|
|
+ } @if (hasError) {
|
|
|
<div
|
|
|
class="has-error animated fadeIn fast"
|
|
|
- *ngIf="hasError"
|
|
|
style="text-align: center; padding: 20px"
|
|
|
>
|
|
|
<mat-icon
|
|
|
@@ -132,8 +120,8 @@
|
|
|
>
|
|
|
<h3 style="font-weight: bold; font-style: italic">{{ errorMessage }}</h3>
|
|
|
</div>
|
|
|
-
|
|
|
- <div *ngIf="hasAnyFile && !isLoading" class="files-container">
|
|
|
+ } @if (hasAnyFile && !isLoading) {
|
|
|
+ <div class="files-container">
|
|
|
<h3 style="margin: 20px 0; display: flex; align-items: center">
|
|
|
<mat-icon style="margin-right: 8px; color: #2e7d32"
|
|
|
>description</mat-icon
|
|
|
@@ -245,9 +233,8 @@
|
|
|
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
|
|
|
</table>
|
|
|
</div>
|
|
|
-
|
|
|
+ } @if (!hasAnyFile && !isLoading && !isUploading) {
|
|
|
<div
|
|
|
- *ngIf="!hasAnyFile && !isLoading && !isUploading"
|
|
|
class="no-files-message"
|
|
|
style="height: 120px; text-align: center; padding: 20px"
|
|
|
>
|
|
|
@@ -261,9 +248,8 @@
|
|
|
Use el área de arriba para cargar su archivo Excel (.xlsx o .xls) y ZIP
|
|
|
</p>
|
|
|
</div>
|
|
|
-
|
|
|
+ } @if (hasValidationResults) {
|
|
|
<div
|
|
|
- *ngIf="hasValidationResults"
|
|
|
class="validation-results"
|
|
|
style="margin-top: 20px; padding: 15px; border-radius: 8px"
|
|
|
[ngClass]="validationClass"
|
|
|
@@ -276,7 +262,8 @@
|
|
|
{{ validationSummary }}
|
|
|
</p>
|
|
|
|
|
|
- <div *ngIf="!validationResult?.valid" style="margin-top: 10px">
|
|
|
+ @if (!validationResult?.valid) {
|
|
|
+ <div style="margin-top: 10px">
|
|
|
<button
|
|
|
mat-button
|
|
|
color="primary"
|
|
|
@@ -289,9 +276,8 @@
|
|
|
Ver detalles completos
|
|
|
</button>
|
|
|
</div>
|
|
|
-
|
|
|
+ } @if (validationResult?.valid) {
|
|
|
<div
|
|
|
- *ngIf="validationResult?.valid"
|
|
|
style="
|
|
|
margin-top: 10px;
|
|
|
padding: 10px;
|
|
|
@@ -308,70 +294,78 @@
|
|
|
archivos.
|
|
|
</p>
|
|
|
</div>
|
|
|
+ }
|
|
|
</div>
|
|
|
+ }
|
|
|
</div>
|
|
|
</div>
|
|
|
+}
|
|
|
|
|
|
<!-- Gif de validación (solo se muestra durante la validación) -->
|
|
|
-<div class="validation-overlay" *ngIf="isValidating" [@fadeInOut]>
|
|
|
- <img
|
|
|
- src="/assets/img/validating.gif"
|
|
|
- alt="Validando..."
|
|
|
- (load)="onGifLoad()"
|
|
|
- (error)="onGifError()"
|
|
|
- />
|
|
|
+@if (isValidating) {
|
|
|
+ <div class="validation-overlay" [@fadeInOut]>
|
|
|
+ <img
|
|
|
+ src="/assets/img/validating.gif"
|
|
|
+ alt="Validando..."
|
|
|
+ (load)="onGifLoad()"
|
|
|
+ (error)="onGifError()"
|
|
|
+ />
|
|
|
|
|
|
- <div class="validation-content">
|
|
|
- <div mat-dialog-title class="validation-text">
|
|
|
- {{ validationStep || "Validando archivos..." }}
|
|
|
- </div>
|
|
|
+ <div class="validation-content">
|
|
|
+ <div mat-dialog-title class="validation-text">
|
|
|
+ {{ validationStep || "Validando archivos..." }}
|
|
|
+ </div>
|
|
|
|
|
|
- <mat-spinner diameter="40" color="primary" *ngIf="!gifLoaded">
|
|
|
- </mat-spinner>
|
|
|
+ @if (!gifLoaded) {
|
|
|
+ <mat-spinner diameter="40" color="primary"> </mat-spinner>
|
|
|
+ }
|
|
|
+ </div>
|
|
|
</div>
|
|
|
-</div>
|
|
|
+}
|
|
|
|
|
|
<!-- Dialog actions -->
|
|
|
<mat-dialog-actions
|
|
|
- align="end"
|
|
|
- style="padding: 16px; border-top: 1px solid #eee"
|
|
|
->
|
|
|
- <button
|
|
|
- mat-button
|
|
|
- (click)="cancelar()"
|
|
|
- style="margin-right: 8px"
|
|
|
- [disabled]="
|
|
|
- isLoading || isUploading || isValidating || hasValidationResults
|
|
|
- "
|
|
|
+ align="end"
|
|
|
+ style="padding: 16px; border-top: 1px solid #eee"
|
|
|
>
|
|
|
- <mat-icon>close</mat-icon>
|
|
|
- Cancelar
|
|
|
- </button>
|
|
|
+ <button
|
|
|
+ mat-button
|
|
|
+ (click)="cancelar()"
|
|
|
+ style="margin-right: 8px"
|
|
|
+ [disabled]="
|
|
|
+ isLoading || isUploading || isValidating || hasValidationResults
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <mat-icon>close</mat-icon>
|
|
|
+ Cancelar
|
|
|
+ </button>
|
|
|
|
|
|
- <!-- Botón de validar (solo si no hay resultados de validación) -->
|
|
|
- <button
|
|
|
- mat-raised-button
|
|
|
- color="primary"
|
|
|
- class="blue_send_background white_font"
|
|
|
- (click)="validateAndProcessDocuments()"
|
|
|
- style="margin-right: 8px"
|
|
|
- *ngIf="!hasValidationResults"
|
|
|
- [disabled]="!canValidate || isLoading || isUploading"
|
|
|
- >
|
|
|
- <mat-icon>{{ isValidating ? "hourglass_empty" : "verified" }}</mat-icon>
|
|
|
- {{ isValidating ? "Validando..." : "Validar archivos" }}
|
|
|
- </button>
|
|
|
+ <!-- Botón de validar (solo si no hay resultados de validación) -->
|
|
|
+ @if (!hasValidationResults) {
|
|
|
+ <button
|
|
|
+ mat-raised-button
|
|
|
+ color="primary"
|
|
|
+ class="blue_send_background white_font"
|
|
|
+ (click)="validateAndProcessDocuments()"
|
|
|
+ style="margin-right: 8px"
|
|
|
+ [disabled]="!canValidate || isLoading || isUploading"
|
|
|
+ >
|
|
|
+ <mat-icon>{{ isValidating ? "hourglass_empty" : "verified" }}</mat-icon>
|
|
|
+ {{ isValidating ? "Validando..." : "Validar archivos" }}
|
|
|
+ </button>
|
|
|
+ }
|
|
|
|
|
|
- <!-- Botón de Aceptar (solo si ya se validaron los documentos) -->
|
|
|
- <button
|
|
|
- mat-raised-button
|
|
|
- color="primary"
|
|
|
- class="blue_send_background white_font"
|
|
|
- (click)="dialogRef.close({ success: true })"
|
|
|
- *ngIf="hasValidationResults"
|
|
|
- [disabled]="isLoading || isUploading || isValidating"
|
|
|
- >
|
|
|
- <mat-icon>check_circle</mat-icon>
|
|
|
- Aceptar
|
|
|
- </button>
|
|
|
+ <!-- Botón de Aceptar (solo si ya se validaron los documentos) -->
|
|
|
+ @if (hasValidationResults) {
|
|
|
+ <button
|
|
|
+ mat-raised-button
|
|
|
+ color="primary"
|
|
|
+ class="blue_send_background white_font"
|
|
|
+ (click)="dialogRef.close({ success: true })"
|
|
|
+ [disabled]="isLoading || isUploading || isValidating"
|
|
|
+ >
|
|
|
+ <mat-icon>check_circle</mat-icon>
|
|
|
+ Aceptar
|
|
|
+ </button>
|
|
|
+ }
|
|
|
</mat-dialog-actions>
|