Bladeren bron

modificacion al formulario de busqueda de solicitudes por el momento el response se muestra en un log

EmilianoOrtiz 4 weken geleden
bovenliggende
commit
65d9827274

+ 12 - 40
src/app/components/process-management/multicriteria-searches/multicriteria-searches.component.html

@@ -137,49 +137,21 @@
             </div>
             <div class="container_table">
               <table mat-table matSort [dataSource]="dataSourceNotificate" class="animated fadeIn" [style.display]="isLoadingNotificate ? 'none' : 'revert'">
-                <ng-container matColumnDef="ID_NOTIFICACION">
-                  <th mat-header-cell *matHeaderCellDef mat-sort-header> {{ interService.get('no_notificacion') }} </th>
-                  <td mat-cell *matCellDef="let element"> #{{ element.ID_NOTIFICACION }} </td>
+                <ng-container matColumnDef="MENSAJE">
+                  <th mat-header-cell *matHeaderCellDef mat-sort-header> {{ interService.get('mensaje') }} </th>
+                  <td mat-cell *matCellDef="let element"> {{ element.MENSAJE }} </td>
                 </ng-container>
-                <ng-container matColumnDef="ID_EJECUCION_TAREA">
-                  <th mat-header-cell *matHeaderCellDef mat-sort-header> {{ interService.get('numero_ejecucion_tarea') }} </th>
-                  <td mat-cell *matCellDef="let element"> #{{ element.ID_EJECUCION_TAREA }} </td>
-                </ng-container>
-                <ng-container matColumnDef="USUARIO_NOTIFICACION">
-                  <th mat-header-cell *matHeaderCellDef mat-sort-header> {{ interService.get('usuario_notificado') }} </th>
-                  <td mat-cell *matCellDef="let element"> {{ element.USUARIO_NOTIFICACION }} </td>
-                </ng-container>
-                <ng-container matColumnDef="TIPO_NOTIFICACION">
-                  <th mat-header-cell *matHeaderCellDef mat-sort-header> {{ interService.get('tipo_notificacion') }} </th>
-                  <td mat-cell *matCellDef="let element"> {{ element.TIPO_NOTIFICACION }} </td>
+                <ng-container matColumnDef="AUDIENCIA">
+                  <th mat-header-cell *matHeaderCellDef mat-sort-header> {{ interService.get('audiencia') }} </th>
+                  <td mat-cell *matCellDef="let element"> {{ element.AUDIENCIA }} </td>
                 </ng-container>
-                <ng-container matColumnDef="ESTADO">
-                  <th mat-header-cell *matHeaderCellDef mat-sort-header> {{ interService.get('estado') }} </th>
-                  <td mat-cell *matCellDef="let element"> 
-                    <mat-chip [class]="resourcesService.setChipList(element.ESTADO)" selected> {{ element.ESTADO }} </mat-chip>
-                  </td>
-                </ng-container>
-                <ng-container matColumnDef="USUARIO_MODIFICA">
-                  <th mat-header-cell *matHeaderCellDef mat-sort-header> {{ interService.get('usuario_modificacion') }} </th>
-                  <td mat-cell *matCellDef="let element"> {{ element.USUARIO_MODIFICA }} </td>
-                </ng-container>
-                <ng-container matColumnDef="FECHA_MODIFICA">
-                  <th mat-header-cell *matHeaderCellDef mat-sort-header> {{ interService.get('fecha_actualizacion') }} </th>
-                  <td mat-cell *matCellDef="let element"> {{ element.FECHA_MODIFICA }} </td>
+                <ng-container matColumnDef="ALCANCE">
+                  <th mat-header-cell *matHeaderCellDef mat-sort-header> {{ interService.get('alcance') }} </th>
+                  <td mat-cell *matCellDef="let element"> {{ element.ALCANCE }} </td>
                 </ng-container>
-                <ng-container matColumnDef="ACCIONES">
-                  <th mat-header-cell *matHeaderCellDef mat-sort-header> {{ interService.get('acciones') }} </th>
-                  <td mat-cell *matCellDef="let element">
-                    <button 
-                    mat-mini-fab 
-                    color="primary"
-                    class="override_no_shadow ml-4" 
-                    (click)="viewDetailsNotificate(element)"
-                    [matTooltip]="interService.get('ver_detalles_solicitud')"  
-                    [disabled]="isLoadingForm">
-                      <mat-icon>info</mat-icon>
-                    </button>
-                  </td>
+                <ng-container matColumnDef="FECHA_ENVIO">
+                  <th mat-header-cell *matHeaderCellDef mat-sort-header> {{ interService.get('fecha_envio') }} </th>
+                  <td mat-cell *matCellDef="let element"> {{ element.FECHA_ENVIO }} </td>
                 </ng-container>
 
                 <tr mat-header-row *matHeaderRowDef="displayedColumnsNotificate"></tr>

+ 5 - 17
src/app/components/process-management/multicriteria-searches/multicriteria-searches.component.ts

@@ -62,14 +62,10 @@ export class MulticriteriaSearchesComponent implements AfterViewInit {
 
     this.dataSourceNotificate = new MatTableDataSource<any>();
     this.displayedColumnsNotificate = [
-      'ID_NOTIFICACION',
-      'ID_EJECUCION_TAREA',
-      'USUARIO_NOTIFICACION',
-      'TIPO_NOTIFICACION',
-      'ESTADO',
-      'USUARIO_MODIFICA',
-      'FECHA_MODIFICA',
-      'ACCIONES',
+      'MENSAJE',
+      'AUDIENCIA',
+      'ALCANCE',
+      'FECHA_ENVIO',
     ];
   }
 
@@ -128,13 +124,5 @@ export class MulticriteriaSearchesComponent implements AfterViewInit {
       });
   }
 
-  public async viewDetailsNotificate(filterNotificate: FilterNotificate) {
-    const ID_NOTIFICATE: string = filterNotificate.ID_NOTIFICACION.toString();
-    const ENC_NOTIFICATE: string = await this._encService.encrypt(
-      ID_NOTIFICATE
-    );
-    this._router.navigate([
-      `/sam/GEPR/GFTR/BUMU/details-notificate/${ENC_NOTIFICATE}`,
-    ]);
-  }
+
 }

+ 30 - 87
src/app/components/process-management/multicriteria-searches/search-request/search-request.component.html

@@ -3,119 +3,62 @@
   <app-loading-card [isLoading]="isLoading" [txtLoading]="interService.get('cargando_informacion')"/>
   @if (!isLoading) {
     <form [formGroup]="formGroup" class="override_content_flex">
-      <div class="col-flex-6">
+      <div class="col-flex-12">
         <mat-form-field appearance="outline" class="w-100">
-          <mat-label>{{ interService.get('nombre_flujo_trabajo') }}</mat-label>
-          <input type="text" matInput formControlName="NOMBRE_WORKFLOW" [matAutocomplete]="autoWorkflow">
-          <mat-autocomplete autoActiveFirstOption #autoWorkflow="matAutocomplete">
-            @for (workflow of filteredOptionsWorkflow | async; track workflow) {
-              <mat-option [value]="workflow" (click)="getTaskByWorkflow(workflow)">{{ workflow }}</mat-option>
+          <mat-label>{{ interService.get('usuario_validador') }}</mat-label>
+          <mat-select formControlName="USUARIO_VALIDADOR">
+            @for (user of arrUsers; track user.IDUSUARIO) {
+              <mat-option [value]="user.IDUSUARIO">
+                {{ user.NOMBRE }} {{ user.APEPAT }}{{ user.APEMAT ? ' ' + user.APEMAT : '' }} ({{ user.IDUSUARIO }})
+              </mat-option>
             }
-          </mat-autocomplete>
-          <mat-icon matSuffix>account_tree</mat-icon>
-        </mat-form-field>
-      </div>
-      <div class="col-flex-6">
-        <mat-form-field appearance="outline" class="w-100">
-          <mat-label>{{ interService.get('numero_ejecucion_flujo_trabajo') }}</mat-label>
-          <input matInput type="number" formControlName="NUMERO_EJECUCION_WORKFLOW">
-          <mat-icon matSuffix>schema</mat-icon>
-          @if (formGroup.controls['NUMERO_EJECUCION_WORKFLOW'].hasError('min')) {
-            <mat-error [title]="interService.get('el_campo')+' '+interService.get('numero_ejecucion_flujo_trabajo')+' '+interService.get('no_es_valido')">
-              {{ interService.get('el_campo') }} <b>{{ interService.get('numero_ejecucion_flujo_trabajo') }}</b> {{ interService.get('no_es_valido') }}
-            </mat-error>
-          }
-        </mat-form-field>
-      </div>
-      <div class="col-flex-6">
-        <mat-form-field appearance="outline" class="w-100">
-          <mat-label>{{ interService.get('estado_ejecucion_flujo_trabajo') }}</mat-label>
-          <mat-select formControlName="ESTADO_EJECUCION_WORKFLOW">
-            <mat-option [value]="null">-- Ninguno --</mat-option>
-            <mat-option value="En proceso">En proceso</mat-option>
-            <mat-option value="Terminada">Terminada</mat-option>
-            <mat-option value="Rechazada">Rechazada</mat-option>
           </mat-select>
-          <mat-icon matSuffix>rule</mat-icon>
-        </mat-form-field>
-      </div>
-      <div class="col-flex-6">
-        @if (isLoadingTask) {
-          <div class="mt-26">
-            <mat-progress-bar mode="indeterminate"></mat-progress-bar>
-          </div>
-        }
-        @if (!isLoadingTask) {
-          <mat-form-field appearance="outline" class="w-100">
-            <mat-label>{{ interService.get('nombre_tarea') }}</mat-label>
-            <input type="text" matInput formControlName="NOMBRE_TAREA" [matAutocomplete]="autoTask">
-            <mat-autocomplete autoActiveFirstOption #autoTask="matAutocomplete">
-              @for (task of filteredOptionsTask | async; track task) {
-                <mat-option [value]="task">{{ task }}</mat-option>
-              }
-            </mat-autocomplete>
-            <mat-icon matSuffix>task_alt</mat-icon>
-          </mat-form-field>
-        }
-      </div>
-      <div class="col-flex-6">
-        <mat-form-field appearance="outline" class="w-100">
-          <mat-label>{{ interService.get('numero_ejecucion_tarea') }}</mat-label>
-          <input matInput type="number" formControlName="NUMERO_EJECUCION_TAREA">
-          <mat-icon matSuffix>format_list_numbered</mat-icon>
-          @if (formGroup.controls['NUMERO_EJECUCION_TAREA'].hasError('min')) {
-            <mat-error [title]="interService.get('el_campo')+' '+interService.get('numero_ejecucion_tarea')+' '+interService.get('no_es_valido')">
-              {{ interService.get('el_campo') }} <b>{{ interService.get('numero_ejecucion_tarea') }}</b> {{ interService.get('no_es_valido') }}
-            </mat-error>
-          }
+          <mat-icon matSuffix>person</mat-icon>
         </mat-form-field>
       </div>
-      <div class="col-flex-6">
+      <div class="col-flex-12">
         <mat-form-field appearance="outline" class="w-100">
-          <mat-label>{{ interService.get('estado_ejecucion_tarea') }}</mat-label>
-          <mat-select formControlName="ESTADO_EJECUCION_TAREA">
-            <mat-option [value]="null">-- Ninguno --</mat-option>
-            <mat-option value="En espera">En espera</mat-option>
-            <mat-option value="En proceso">En proceso</mat-option>
-            <mat-option value="Aceptado">Aceptado</mat-option>
-            <mat-option value="Rechazado">Rechazado</mat-option>
+          <mat-label>{{ interService.get('estado') }}</mat-label>
+          <mat-select formControlName="ESTADO">
+            @for (estado of estadosSolicitud; track estado) {
+              <mat-option [value]="estado">{{ estado }}</mat-option>
+            }
           </mat-select>
           <mat-icon matSuffix>rule</mat-icon>
         </mat-form-field>
       </div>
-      <div class="col-flex-6">
-        <mat-form-field appearance="outline" class="w-100">
-          <mat-label>{{ interService.get('nombre_proceso') }}</mat-label>
-          <input type="text" matInput formControlName="NOMBRE_PROCESO" [matAutocomplete]="autoProcessWorkflow">
-          <mat-autocomplete autoActiveFirstOption #autoProcessWorkflow="matAutocomplete">
-            @for (processWorkflow of filteredOptionsProcessWorkflow | async; track processWorkflow) {
-              <mat-option [value]="processWorkflow">{{ processWorkflow }}</mat-option>
-            }
-          </mat-autocomplete>
-          <mat-icon matSuffix>developer_board</mat-icon>
-        </mat-form-field>
-      </div>
-      <div class="col-flex-6">
+      <div class="col-flex-12">
         <mat-form-field appearance="outline" class="w-100">
           <mat-label>{{ interService.get('rango_fecha') }}</mat-label>
           <mat-date-range-input [rangePicker]="picker">
             <input matStartDate formControlName="FECHA_INICIO" [placeholder]="interService.get('fecha_inicial')" readonly>
-            <input matEndDate formControlName="FECHA_FINAL" [placeholder]="interService.get('fecha_final')" readonly>
+            <input matEndDate formControlName="FECHA_FIN" [placeholder]="interService.get('fecha_final')" readonly>
           </mat-date-range-input>
           <mat-datepicker-toggle matIconSuffix [for]="picker"></mat-datepicker-toggle>
           <mat-date-range-picker #picker></mat-date-range-picker>
           @if (formGroup.controls['FECHA_INICIO'].hasError('matDatepickerParse')) {
             <mat-error>{{ interService.get('fecha_inicio_no_valida') }}</mat-error>
           }
-          @if (formGroup.controls['FECHA_FINAL'].hasError('matDatepickerParse')) {
+          @if (formGroup.controls['FECHA_FIN'].hasError('matDatepickerParse')) {
             <mat-error>{{ interService.get('fecha_finalizacion_no_valida') }}</mat-error>
           }
         </mat-form-field>
       </div>
+      <div class="col-flex-12">
+        <mat-form-field appearance="outline" class="w-100">
+          <mat-label>{{ interService.get('fecha_validacion') }}</mat-label>
+          <input matInput [matDatepicker]="pickerValidacion" formControlName="FECHA_VALIDACION" readonly>
+          <mat-datepicker-toggle matIconSuffix [for]="pickerValidacion"></mat-datepicker-toggle>
+          <mat-datepicker #pickerValidacion></mat-datepicker>
+          @if (formGroup.controls['FECHA_VALIDACION'].hasError('matDatepickerParse')) {
+            <mat-error>{{ interService.get('fecha_validacion_no_valida') }}</mat-error>
+          }
+        </mat-form-field>
+      </div>
     </form>
   }
 </mat-dialog-content>
 <mat-dialog-actions align="end">
-  <button mat-button [disabled]="isLoading || isLoadingTask" [mat-dialog-close]="false">{{ interService.get('cerrar') }}</button>
-  <button mat-button [disabled]="isLoading || formGroup.invalid || isLoadingTask" (click)="search()">{{ interService.get('buscar') }}</button>
+  <button mat-button [disabled]="isLoading" [mat-dialog-close]="false">{{ interService.get('cerrar') }}</button>
+  <button mat-button [disabled]="isLoading || formGroup.invalid" (click)="search()">{{ interService.get('buscar') }}</button>
 </mat-dialog-actions>

+ 52 - 236
src/app/components/process-management/multicriteria-searches/search-request/search-request.component.ts

@@ -1,10 +1,12 @@
 import { Component, OnInit } from '@angular/core';
 import { FormControl, FormGroup, Validators } from '@angular/forms';
-import { FilterRequest, GetTaskByWorkflow, GetWorkflows, ProcessWorkflow, RequestSearch, ResponseDataFilterRequest, ResponseDataGetTaskByWorkflow, ResponseDataGetWorkflows, ResponseDataProcessWorkflow } from '../../../../interfaces/process-managementv/workflow-management.interface';
-import { lastValueFrom, map, Observable, startWith } from 'rxjs';
+import { FilterRequest, RequestSearch, ResponseDataFilterRequest } from '../../../../interfaces/process-managementv/workflow-management.interface';
+import { UserResponse, UsersResponse } from '../../../../interfaces/users.interface';
+import { lastValueFrom } from 'rxjs';
 import { ResourcesService } from '../../../../services/resources.service';
 import { InternationalizationService } from '../../../../services/internationalization/internationalization.service';
 import { ProcessManagementService } from '../../../../services/process-management/process-management.service';
+import { UsersProfilesService } from '../../../../services/users-profiles.service';
 import { MatDialogRef } from '@angular/material/dialog';
 import { EncService } from '../../../../services/enc.service';
 import { HttpErrorResponse } from '@angular/common/http';
@@ -18,264 +20,80 @@ import { HttpErrorResponse } from '@angular/common/http';
 export class SearchRequestComponent implements OnInit {
   public formGroup: FormGroup;
   public isLoading: boolean;
-  
-  private arrWorkflow: GetWorkflows[];
-  public arrWorkflowStr: string[];
-  public filteredOptionsWorkflow!: Observable<string[]>;
-  
-  private arrTask: GetTaskByWorkflow[];
-  public arrTaskStr: string[];
-  public filteredOptionsTask!: Observable<string[]>;
-  public isLoadingTask: boolean;
-
-  public arrProcessWorkflow: ProcessWorkflow[];
-  public arrProcessWorkflowStr: string[];
-  public filteredOptionsProcessWorkflow!: Observable<string[]>;
+  public arrUsers: UserResponse[];
+  public estadosSolicitud = ['Pendiente', 'Aprobada', 'Rechazada', 'Validada por timeout'];
   
   constructor(
     public resourcesService: ResourcesService,
     public interService: InternationalizationService,
     private _processManagementService: ProcessManagementService,
+    private _usersProfilesService: UsersProfilesService,
     private _dialogReg: MatDialogRef<false | FilterRequest[]>,
     private _encService: EncService,
   ) {
     this.formGroup = this._createFormGroup();
     this.isLoading = false;
-    this.arrWorkflow = [];
-    this.arrWorkflowStr = [];
-
-    this.arrTask = [];
-    this.arrTaskStr = [];
-    this.isLoadingTask = false;
-
-    this.arrProcessWorkflow = [];
-    this.arrProcessWorkflowStr = [];
+    this.arrUsers = [];
   }
 
   private _createFormGroup(): FormGroup {
     return new FormGroup({
-      NOMBRE_WORKFLOW: new FormControl( null ),
-      NUMERO_EJECUCION_WORKFLOW: new FormControl( null, Validators.min(1) ),
-      ESTADO_EJECUCION_WORKFLOW: new FormControl( null ),
-      NOMBRE_TAREA: new FormControl( { value: null, disabled: true } ),
-      NUMERO_EJECUCION_TAREA: new FormControl( null, Validators.min(1) ),
-      ESTADO_EJECUCION_TAREA: new FormControl( null ),
-      NOMBRE_PROCESO: new FormControl( null ),
+      USUARIO_VALIDADOR: new FormControl(null),
+      ESTADO: new FormControl(null),
       FECHA_INICIO: new FormControl<Date | null>(null),
-      FECHA_FINAL: new FormControl<Date | null>(null),
+      FECHA_FIN: new FormControl<Date | null>(null),
+      FECHA_VALIDACION: new FormControl<Date | null>(null),
     });
   }
   
   async ngOnInit() {
     this.isLoading = true;
-    await this._getWorkflowsActives();
-    await this._getProcessWorkflow();
+    await this._getUsers();
     this.isLoading = false;
-
-
-    this.filteredOptionsWorkflow = this.formGroup.controls['NOMBRE_WORKFLOW'].valueChanges.pipe(
-      startWith(''),
-      map(value => {
-        value = value === null || value === undefined ? '' : value;
-        const filterValue = value.toLowerCase();
-        return this.arrWorkflowStr.filter(option => option.toLowerCase().includes(filterValue));
-      })
-    );
-
-    this.filteredOptionsTask = this.formGroup.controls['NOMBRE_TAREA'].valueChanges.pipe(
-      startWith(''),
-      map(value => {
-        value = value === null || value === undefined ? '' : value;
-        const filterValue = value.toLowerCase();
-        return this.arrTaskStr.filter(option => option.toLowerCase().includes(filterValue));
-      })
-    );
-
-    this.filteredOptionsProcessWorkflow = this.formGroup.controls['NOMBRE_PROCESO'].valueChanges.pipe(
-      startWith(''),
-      map(value => {
-        value = value === null || value === undefined ? '' : value;
-        const filterValue = value.toLowerCase();
-        return this.arrProcessWorkflowStr.filter(option => option.toLowerCase().includes(filterValue));
-      })
-    );
-  }
-
-  private async _getWorkflowsActives() {
-    const user: string = this.resourcesService.getUser();
-    const line: number = this.resourcesService.getLineNumber();
-    await lastValueFrom(this._processManagementService.getWorkflowsActives(user, line)).then(
-      (responseData: ResponseDataGetWorkflows) => {
-        if (!responseData.error) {
-          this.arrWorkflow = responseData.response;
-          this.arrWorkflowStr = responseData.response.map((workflow: GetWorkflows) => `${workflow.NOMBRE_WORKFLOW} (${workflow.ID_WORKFLOW})`);
-        } else {
-          this.resourcesService.openSnackBar(`${responseData.msg}`);
-        }
-      }, async (httpErrorResponse: HttpErrorResponse) => {
-        let response = this.resourcesService.checkErrors(httpErrorResponse)
-        if (response !== null && response.reload) {
-          await this._getWorkflowsActives();
-        }
-      }
-    );
   }
 
-  private async _getProcessWorkflow() {
+  private async _getUsers() {
     const user: string = this.resourcesService.getUser();
     const line: number = this.resourcesService.getLineNumber();
-    await lastValueFrom(this._processManagementService.getProcessWorkflow(user, line)).then(
-      (responseData: ResponseDataProcessWorkflow) => {
+    await lastValueFrom(this._usersProfilesService.getUsers(user, line)).then(
+      async (responseData: UsersResponse) => {
         if (!responseData.error) {
-          this.arrProcessWorkflow = responseData.response;
-          this.arrProcessWorkflowStr = responseData.response.map((processWorkflow: ProcessWorkflow) => `${processWorkflow.NOMBRE_PROCESO} (${processWorkflow.ID_PROCESO})`);
-        } else {
-          this.resourcesService.openSnackBar(`${responseData.msg}`);
-        }
-      }, async (httpErrorResponse: HttpErrorResponse) => {
-        let response = this.resourcesService.checkErrors(httpErrorResponse)
-        if (response !== null && response.reload) {
-          await this._getProcessWorkflow();
-        }
-      }
-    );
-  }
-
-  public async getTaskByWorkflow(workflow: string) {
-    this.isLoadingTask = true;
-    if (!workflow.includes('(') || !workflow.includes(')')) {
-      this.resourcesService.openSnackBar(`Ocurrió un error al obtener el identificador del flujo de trabajo.`);
-      this._dialogReg.close(false);
-      return;
-    }
-    const idWorkflow = workflow.split('(')[1].split(')')[0];
-    const validate: boolean = this.arrWorkflow.every((getWorkflows: GetWorkflows) => getWorkflows.ID_WORKFLOW.toString() == idWorkflow);
-    if (!validate) {
-      this.resourcesService.openSnackBar(`No se pudo encontrar el flujo de trabajo seleccionado.`);
-      this._dialogReg.close(false);
-      return;
-    }
-    const encWorkflow: string = await this._encService.encrypt(idWorkflow.toString());
-    const user: string = this.resourcesService.getUser();
-    const line: number = this.resourcesService.getLineNumber();
-    await lastValueFrom(this._processManagementService.getTaskByWorkflow(encWorkflow, user, line)).then(
-      (responseData: ResponseDataGetTaskByWorkflow) => {
-        if (!responseData.error) {
-          this.arrTask = responseData.response;
-          this.arrTaskStr = responseData.response.map((task: GetTaskByWorkflow) => `${task.NOMBRE_TAREA} (${task.ID_TAREA})`);
-          if (this.arrTaskStr.length > 0) {
-            this.formGroup.controls['NOMBRE_TAREA'].enable();
-          } else {
-            this.formGroup.controls['NOMBRE_TAREA'].disable();
+          for (let index = 0; index < responseData.response.length; index++) {
+            let element = responseData.response[index];
+            element.IDUSUARIO = await this._encService.decrypt(element.IDUSUARIO);
+            responseData.response[index] = element;
           }
+          this.arrUsers = responseData.response;
         } else {
           this.resourcesService.openSnackBar(`${responseData.msg}`);
-          this.formGroup.controls['NOMBRE_TAREA'].disable();
         }
       }, async (httpErrorResponse: HttpErrorResponse) => {
         let response = this.resourcesService.checkErrors(httpErrorResponse)
         if (response !== null && response.reload) {
-          await this.getTaskByWorkflow(workflow);
-        } else {
-          this.formGroup.controls['NOMBRE_TAREA'].disable();
+          await this._getUsers();
         }
       }
     );
-    this.isLoadingTask = false;
   }
 
   public async search() {
-    this.isLoading = true;
-
-    let nombreWorkflow = this.formGroup.controls['NOMBRE_WORKFLOW'].value;
-    if (nombreWorkflow !== null && nombreWorkflow !== undefined && nombreWorkflow !== '') {
-      nombreWorkflow = nombreWorkflow.toString().trim();
-      if ( !nombreWorkflow.includes('(') || !nombreWorkflow.includes(')') ) {
-        this.resourcesService.openSnackBar(`Debe elegir una opción de la lista desplegable en el campo del nombre del workflow`);
-        return;
-      }
-      nombreWorkflow = nombreWorkflow.split('(')[1].split(')')[0];
-    } else {
-      nombreWorkflow = null;
-    }
-    
-
-    let numeroEjecucionWorkflow = this.formGroup.controls['NUMERO_EJECUCION_WORKFLOW'].value;
-    if (numeroEjecucionWorkflow !== null && numeroEjecucionWorkflow !== undefined && numeroEjecucionWorkflow !== '') {
-      numeroEjecucionWorkflow = parseInt(numeroEjecucionWorkflow);
-      if ( numeroEjecucionWorkflow <= 0 ) {
-        this.resourcesService.openSnackBar(`Ocurrió un error con el formato del número de ejecución del flujo de trabajo.`);
-        return;
-      }
-      if (numeroEjecucionWorkflow % 1 !== 0) {
-        this.resourcesService.openSnackBar(`El número de ejecución del flujo de trabajo debe ser un número entero.`);
-        return;
-      }
-    } else {
-      numeroEjecucionWorkflow = null;
-    }
-  
-
-    let estadoEjecucionWorkflow = this.formGroup.controls['ESTADO_EJECUCION_WORKFLOW'].value;
-    if (estadoEjecucionWorkflow !== null && estadoEjecucionWorkflow !== undefined && estadoEjecucionWorkflow !== '') {
-      estadoEjecucionWorkflow = estadoEjecucionWorkflow.toString().trim();
+    let usuarioValidador = this.formGroup.controls['USUARIO_VALIDADOR'].value;
+    if (usuarioValidador !== null && usuarioValidador !== undefined && usuarioValidador !== '') {
+      usuarioValidador = usuarioValidador.toString().trim();
     } else {
-      estadoEjecucionWorkflow = null;
+      usuarioValidador = null;
     }
 
-
-    let nombreTarea = this.formGroup.controls['NOMBRE_TAREA'].value;
-    if (nombreTarea !== null && nombreTarea !== undefined && nombreTarea !== '') {
-      nombreTarea = nombreTarea.toString().trim();
-      if ( !nombreTarea.includes('(') || !nombreTarea.includes(')') ) {
-        this.resourcesService.openSnackBar(`Debe elegir una opción de la lista desplegable en el campo del nombre de la tarea.`);
-        return;
-      }
-      nombreTarea = nombreTarea.split('(')[1].split(')')[0];
+    let estado = this.formGroup.controls['ESTADO'].value;
+    if (estado !== null && estado !== undefined && estado !== '') {
+      estado = estado.toString().trim();
     } else {
-      nombreTarea = null;
+      estado = null;
     }
-    
-
-    let numeroEjecucionTarea = this.formGroup.controls['NUMERO_EJECUCION_TAREA'].value;
-    if (numeroEjecucionTarea !== null && numeroEjecucionTarea !== undefined && numeroEjecucionTarea !== '') {
-      numeroEjecucionTarea = parseInt(numeroEjecucionTarea);
-      if ( numeroEjecucionTarea <= 0 ) {
-        this.resourcesService.openSnackBar(`Ocurrió un error con el formato del número de ejecución de la tarea.`);
-        return;
-      }
-      if (numeroEjecucionTarea % 1 !== 0) {
-        this.resourcesService.openSnackBar(`El número de ejecución de la tarea debe ser un número entero.`);
-        return;
-      }
-    } else {
-      numeroEjecucionTarea = null;
-    }
-    
-
-    let estadoEjecucionTarea = this.formGroup.controls['ESTADO_EJECUCION_TAREA'].value;
-    if (estadoEjecucionTarea !== null && estadoEjecucionTarea !== undefined && estadoEjecucionTarea !== '') {
-      estadoEjecucionTarea = estadoEjecucionTarea.toString().trim();
-    } else {
-      estadoEjecucionTarea = null;
-    }
-    
-
-    let nombreProceso = this.formGroup.controls['NOMBRE_PROCESO'].value;
-    if (nombreProceso !== null && nombreProceso !== undefined && nombreProceso !== '') {
-      nombreProceso = nombreProceso.toString().trim();
-      if ( !nombreProceso.includes('(') || !nombreProceso.includes(')') ) {
-        this.resourcesService.openSnackBar(`Debe elegir una opción de la lista desplegable en el campo del nombre del proceso.`);
-        return;
-      }
-      nombreProceso = nombreProceso.split('(')[1].split(')')[0];
-    } else {
-      nombreProceso = null;
-    }
-
 
     let fechaInicio = this.formGroup.controls['FECHA_INICIO'].value;
-    let fechaFinal = this.formGroup.controls['FECHA_FINAL'].value;
+    let fechaFin = this.formGroup.controls['FECHA_FIN'].value;
+    let fechaValidacion = this.formGroup.controls['FECHA_VALIDACION'].value;
 
     if (fechaInicio !== null && fechaInicio !== undefined && fechaInicio !== '') {
       fechaInicio = new Date(fechaInicio);
@@ -284,32 +102,26 @@ export class SearchRequestComponent implements OnInit {
       fechaInicio = null;
     }
 
-    if (fechaFinal !== null && fechaFinal !== undefined && fechaFinal !== '') {
-      fechaFinal = new Date(fechaFinal);
-      fechaFinal = this.resourcesService.getDateFormatCalendar(fechaFinal);
+    if (fechaFin !== null && fechaFin !== undefined && fechaFin !== '') {
+      fechaFin = new Date(fechaFin);
+      fechaFin = this.resourcesService.getDateFormatCalendar(fechaFin);
     } else {
-      fechaFinal = null;
+      fechaFin = null;
     }
 
-    if (fechaInicio !== null && fechaFinal === null) {
-      this.resourcesService.openSnackBar(`Ocurrió un error al obtener el rango de fechas.`);
-      return;
-    }
-    if (fechaInicio === null && fechaFinal !== null) {
-      this.resourcesService.openSnackBar(`Ocurrió un error al obtener el rango de fechas.`);
-      return;
+    if (fechaValidacion !== null && fechaValidacion !== undefined && fechaValidacion !== '') {
+      fechaValidacion = new Date(fechaValidacion);
+      fechaValidacion = this.resourcesService.getDateFormatCalendar(fechaValidacion);
+    } else {
+      fechaValidacion = null;
     }
 
     const REQUEST_SEARCH: RequestSearch = {
-      'WORKFLOW': nombreWorkflow,
-      'EJECUCION_WORKFLOW': numeroEjecucionWorkflow,
-      'ESTADO_WORKFLOW': estadoEjecucionWorkflow,
-      'TAREA': nombreTarea,
-      'EJECUCION_TAREA': numeroEjecucionTarea,
-      'ESTADO_TAREA': estadoEjecucionTarea,
-      'PROCESO': nombreProceso,
+      'USUARIO_VALIDADOR': usuarioValidador,
+      'ESTADO': estado,
       'FECHA_INICIO': fechaInicio,
-      'FECHA_FINAL': fechaFinal,
+      'FECHA_FIN': fechaFin,
+      'FECHA_VALIDACION': fechaValidacion,
       'USUARIO': this.resourcesService.getUser(),
       'NUMERO_LINEA': this.resourcesService.getLineNumber(),
     }
@@ -317,13 +129,17 @@ export class SearchRequestComponent implements OnInit {
     await lastValueFrom(this._processManagementService.searchRequestWorkflow(REQUEST_SEARCH)).then(
       (responseData: ResponseDataFilterRequest) => {
         if (!responseData.error) {
+          console.log('Response from search solicitudes:', responseData.response);
           this._dialogReg.close(responseData.response);
         } else {
           this.resourcesService.openSnackBar(`${responseData.msg}`);
         }
-      }, (httpErrorResponse: HttpErrorResponse) => this.resourcesService.checkErrors(httpErrorResponse)
+      }, async (httpErrorResponse: HttpErrorResponse) => {
+        let response = this.resourcesService.checkErrors(httpErrorResponse)
+        if (response !== null && response.reload) {
+          await this.search();
+        }
+      }
     );
-
-    this.isLoading = false;
   }
 }

+ 9 - 17
src/app/interfaces/process-managementv/workflow-management.interface.ts

@@ -223,15 +223,11 @@ export interface GetTaskByWorkflow {
 }
 
 export interface RequestSearch {
-  WORKFLOW: number;
-  EJECUCION_WORKFLOW: number;
-  ESTADO_WORKFLOW: string;
-  TAREA: number;
-  EJECUCION_TAREA: number;
-  ESTADO_TAREA: string;
-  PROCESO: number;
-  FECHA_INICIO: string;
-  FECHA_FINAL: string;
+  USUARIO_VALIDADOR: string | null;
+  ESTADO: string | null;
+  FECHA_INICIO: string | null;
+  FECHA_FIN: string | null;
+  FECHA_VALIDACION: string | null;
   USUARIO: string;
   NUMERO_LINEA: number;
 }
@@ -294,14 +290,10 @@ export interface ResponseDataFilterNotificate {
 }
 
 export interface FilterNotificate {
-  ID_NOTIFICACION: string;
-  ID_EJECUCION_TAREA: string;
-  USUARIO_NOTIFICACION: string;
-  TIPO_NOTIFICACION: string;
-  ESTADO: string;
-  MENSAJE_RECHAZO: string;
-  USUARIO_MODIFICA: string;
-  FECHA_MODIFICA: string;
+  MENSAJE: string;
+  AUDIENCIA: string;
+  ALCANCE: string;
+  FECHA_ENVIO: string;
 }
 
 export interface ResponseDataDetailsNotificate {

+ 12 - 0
src/app/services/internationalization/internationalization.service.ts

@@ -154,6 +154,12 @@ export class InternationalizationService {
         no_es_valido: 'no es válido',
         detalles_notificacion: 'Detalles de la notificación',
         numero_secuencia: 'Número de secuencia',
+        mensaje: 'Mensaje',
+        audiencia: 'Audiencia',
+        alcance: 'Alcance',
+        fecha_envio: 'Fecha de envío',
+        fecha_validacion: 'Fecha de validación',
+        fecha_validacion_no_valida: 'Fecha de validación no válida',
 
         reset_configuration: 'Restaurar configuración',
         reset_description_alert:
@@ -362,6 +368,12 @@ export class InternationalizationService {
         no_es_valido: 'it is not valid',
         detalles_notificacion: 'Notification details',
         numero_secuencia: 'Sequence number',
+        mensaje: 'Message',
+        audiencia: 'Audience',
+        alcance: 'Scope',
+        fecha_envio: 'Send date',
+        fecha_validacion: 'Validation date',
+        fecha_validacion_no_valida: 'Invalid validation date',
 
         reset_configuration: 'Restore settings',
         reset_description_alert:

+ 1 - 1
src/app/services/process-management/process-management.service.ts

@@ -216,7 +216,7 @@ export class ProcessManagementService {
     requestSearch: RequestSearch
   ): Observable<ResponseDataFilterRequest> {
     return this._httpRequestService
-      .postQuery(`${this._url}/search-request-workflow`, requestSearch)
+      .postQuery(`${this._url}/search-solicitudes`, requestSearch)
       .pipe(map((data: any) => data));
   }
   public getDetailsExecuteRequest(