浏览代码

Modificación de interfaces en analisis de fallas

JeanBenitez 2 年之前
父节点
当前提交
2640c790e5

+ 13 - 49
sistema-mantenimiento-front/src/app/components/failure-analysis/failure/failure.component.html

@@ -47,23 +47,24 @@
       <div class="override-table">
         <!-- TABLA -->
         <table mat-table [dataSource]="dataSource" matSort class="animated fadeIn" *ngIf="!isLoading">
-          <ng-container matColumnDef="NUMERO_FALLA">
+          <ng-container matColumnDef="FALL_NUFA">
             <th mat-header-cell *matHeaderCellDef mat-sort-header>Código de Falla</th>
             <td mat-cell *matCellDef="let element">{{ element.FALL_NUFA }}</td>
           </ng-container>
-          <ng-container matColumnDef="CODIGO_EQUIPAMIENTO">
+          <!-- <ng-container matColumnDef="FALL_COEQ">
             <th mat-header-cell *matHeaderCellDef mat-sort-header>Equipamiento</th>
             <td mat-cell *matCellDef="let element">{{ element.FALL_COEQ }}</td>
-          </ng-container>
-          <ng-container matColumnDef="FALLA">
+          </ng-container> -->
+          <ng-container matColumnDef="LIFA_NOFA">
             <th mat-header-cell *matHeaderCellDef mat-sort-header>Falla</th>
             <td mat-cell *matCellDef="let element">{{ element.LIFA_NOFA }}</td>
           </ng-container>
-          <ng-container matColumnDef="CAUSA">
+          <!--
+          <ng-container matColumnDef="FALL_CAUS">
             <th mat-header-cell *matHeaderCellDef mat-sort-header>Causa</th>
             <td mat-cell *matCellDef="let element">{{ element.FALL_CAUS }}</td>
           </ng-container>
-          <ng-container matColumnDef="CLASIFICACION">
+          <ng-container matColumnDef="FALL_CLAS">
             <th mat-header-cell *matHeaderCellDef mat-sort-header>Clásificación</th>
             <td mat-cell *matCellDef="let element">
               <b *ngIf="element.FALL_CLAS === 'Bajo'" class="green_primary_font">{{ element.FALL_CLAS }}</b>
@@ -72,23 +73,19 @@
               <b *ngIf="element.FALL_CLAS === 'Crítico'" class="red_dark_font">{{ element.FALL_CLAS }}</b>
             </td>
           </ng-container>
-          <ng-container matColumnDef="FECHA_EMISION">
+          <ng-container matColumnDef="FALL_FEFA">
             <th mat-header-cell *matHeaderCellDef mat-sort-header>Fecha de Emisión</th>
             <td mat-cell *matCellDef="let element">{{ resourcesService.formatOnlyDate(element.FALL_FEFA) }}</td>
           </ng-container>
-          <!-- <ng-container matColumnDef="LIMITE_VALOR">
-            <th mat-header-cell *matHeaderCellDef mat-sort-header>Valor Límite Permitido</th>
-            <td mat-cell *matCellDef="let element">{{ element.FALL_LIVA }} {{ element.LIME_ACRO }}</td>
-          </ng-container> -->
-          <ng-container matColumnDef="USUARIO_REGISTRA">
+          <ng-container matColumnDef="FALL_USRE">
             <th mat-header-cell *matHeaderCellDef mat-sort-header>Usuario Modificación</th>
             <td mat-cell *matCellDef="let element">{{ resourcesService.selectUser(element.FALL_USRE, element.FALL_USMO) }}</td>
           </ng-container>
-          <ng-container matColumnDef="FECHA_REGISTRA">
+          <ng-container matColumnDef="FALL_FERE">
             <th mat-header-cell *matHeaderCellDef mat-sort-header>Fecha Modificación</th>
             <td mat-cell *matCellDef="let element">{{ resourcesService.formatDate(element.FALL_FERE, element.FALL_FEMO) }}</td>
           </ng-container>
-          <ng-container matColumnDef="ESTADO">
+          <ng-container matColumnDef="FALL_ESTA">
             <th mat-header-cell *matHeaderCellDef mat-sort-header>Estado</th>
             <td mat-cell *matCellDef="let element">
               <mat-chip-listbox>
@@ -98,20 +95,9 @@
             </td>
           </ng-container>
 
-          <ng-container matColumnDef="ACCIONES">
+          <ng-container matColumnDef="ACTIONS">
             <th mat-header-cell *matHeaderCellDef>Acciones</th>
             <td mat-cell *matCellDef="let element">
-              <!-- <button mat-mini-fab color="accent" *ngIf="btnSmall" [disabled]="element.SINT_ESTA == 'Inactivo' || isLoadingForm" [matMenuTriggerFor]="menu" #menuTrigger class="override-no-shadow">
-                <mat-icon>settings</mat-icon>
-              </button>
-              <mat-menu #menu="matMenu">
-                <button mat-menu-item (click)="openDialog('UPD', element)">
-                  <mat-icon>edit</mat-icon> Editar Falla
-                </button>
-                <button mat-menu-item (click)="openDialog('DEL', element)">
-                  <mat-icon>delete</mat-icon> Eliminar Falla
-                </button>
-              </mat-menu> -->
               <button
                 mat-mini-fab
                 color="primary"
@@ -121,30 +107,8 @@
                 (click)="viewChart(element)">
                 <mat-icon>bar_chart</mat-icon>
               </button>
-
-              <div *ngIf="!btnSmall">
-
-                <!-- <button
-                  mat-mini-fab
-                  color="primary"
-                  class="override-no-shadow mr-4"
-                  [disabled]="element.FALL_ESTA == 'Inactivo' || isLoadingForm"
-                  matTooltip="Editar Falla"
-                  (click)="openDialog('UPD', element)">
-                  <mat-icon>edit</mat-icon>
-                </button>
-                <button
-                  mat-mini-fab
-                  color="warn"
-                  class="override-no-shadow mr-4"
-                  [disabled]="element.FALL_ESTA == 'Inactivo' || isLoadingForm"
-                  matTooltip="Eliminar Falla"
-                  (click)="openDialog('DEL', element)">
-                  <mat-icon>delete</mat-icon>
-                </button> -->
-              </div>
             </td>
-          </ng-container>
+          </ng-container> -->
 
           <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
           <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>

+ 12 - 1
sistema-mantenimiento-front/src/app/components/failure-analysis/failure/failure.component.ts

@@ -45,7 +45,18 @@ export class FailureComponent implements OnInit, AfterViewInit {
 
     this.txtBuscador = '';
 
-    this.displayedColumns = ['NUMERO_FALLA','CODIGO_EQUIPAMIENTO','FALLA','CAUSA','CLASIFICACION','FECHA_EMISION',/* 'LIMITE_VALOR', */'USUARIO_REGISTRA','FECHA_REGISTRA','ESTADO','ACCIONES']
+    this.displayedColumns = [
+      'FALL_NUFA',
+      // 'FALL_COEQ',
+      'LIFA_NOFA'
+      // 'FALL_CAUS',
+      // 'FALL_CLAS',
+      // 'FALL_FEFA',
+      // 'FALL_USRE',
+      // 'FALL_FERE',
+      // 'FALL_ESTA',
+      // 'ACTIONS',
+    ]
     this.dataSource = new MatTableDataSource<GetFailure>();
   }
 

+ 10 - 9
sistema-mantenimiento-front/src/app/components/failure-analysis/symptom/symptom.component.html

@@ -47,19 +47,19 @@
       <div class="override-table">
         <!-- TABLA -->
         <table mat-table [dataSource]="dataSource" matSort class="animated fadeIn" *ngIf="!isLoading">
-          <ng-container matColumnDef="CODIGO_EQUIPAMIENTO">
+          <ng-container matColumnDef="SINT_COEQ">
             <th mat-header-cell *matHeaderCellDef mat-sort-header>Equipamiento</th>
             <td mat-cell *matCellDef="let element">{{ element.SINT_COEQ }}</td>
           </ng-container>
-          <ng-container matColumnDef="FALLA">
+          <ng-container matColumnDef="LIFA_NOFA">
             <th mat-header-cell *matHeaderCellDef mat-sort-header>Falla</th>
             <td mat-cell *matCellDef="let element">{{ element.LIFA_NOFA }}</td>
           </ng-container>
-          <ng-container matColumnDef="CAUSA">
+          <ng-container matColumnDef="SINT_CAUS">
             <th mat-header-cell *matHeaderCellDef mat-sort-header>Causa</th>
             <td mat-cell *matCellDef="let element">{{ element.SINT_CAUS }}</td>
           </ng-container>
-          <ng-container matColumnDef="CLASIFICACION">
+          <ng-container matColumnDef="SINT_CLAS">
             <th mat-header-cell *matHeaderCellDef mat-sort-header>Clásificación</th>
             <td mat-cell *matCellDef="let element">
               <b *ngIf="element.SINT_CLAS === 'Bajo'" class="green_primary_font">{{ element.SINT_CLAS }}</b>
@@ -68,19 +68,19 @@
               <b *ngIf="element.SINT_CLAS === 'Crítico'" class="red_dark_font">{{ element.SINT_CLAS }}</b>
             </td>
           </ng-container>
-          <ng-container matColumnDef="LIMITE_VALOR">
+          <ng-container matColumnDef="SINT_LIVA">
             <th mat-header-cell *matHeaderCellDef mat-sort-header>Valor Límite Permitido</th>
             <td mat-cell *matCellDef="let element">{{ element.SINT_LIVA }} {{ element.LIME_ACRO }}</td>
           </ng-container>
-          <ng-container matColumnDef="USUARIO_REGISTRA">
+          <ng-container matColumnDef="SINT_USRE">
             <th mat-header-cell *matHeaderCellDef mat-sort-header>Usuario Modificación</th>
             <td mat-cell *matCellDef="let element">{{ resourcesService.selectUser(element.SINT_USRE, element.SINT_USMO) }}</td>
           </ng-container>
-          <ng-container matColumnDef="FECHA_REGISTRA">
+          <ng-container matColumnDef="SINT_FERE">
             <th mat-header-cell *matHeaderCellDef mat-sort-header>Fecha Modificación</th>
             <td mat-cell *matCellDef="let element">{{ resourcesService.formatDate(element.SINT_FERE, element.SINT_FEMO) }}</td>
           </ng-container>
-          <ng-container matColumnDef="ESTADO">
+          <ng-container matColumnDef="SINT_ESTA">
             <th mat-header-cell *matHeaderCellDef mat-sort-header>Estado</th>
             <td mat-cell *matCellDef="let element">
               <mat-chip-listbox>
@@ -90,7 +90,7 @@
             </td>
           </ng-container>
 
-          <ng-container matColumnDef="ACCIONES">
+          <ng-container matColumnDef="ACTIONS">
             <th mat-header-cell *matHeaderCellDef>Acciones</th>
             <td mat-cell *matCellDef="let element">
               <button mat-mini-fab color="accent" *ngIf="btnSmall" [disabled]="element.SINT_ESTA == 'Inactivo' || isLoadingForm" [matMenuTriggerFor]="menu" #menuTrigger class="override-no-shadow">
@@ -152,3 +152,4 @@
     <mat-paginator [pageSizeOptions]="[10, 50, 100]" class="override-paginator"></mat-paginator>
   </mat-card>
 </main>
+

+ 24 - 4
sistema-mantenimiento-front/src/app/components/failure-analysis/symptom/symptom.component.ts

@@ -1,6 +1,8 @@
 import { HttpErrorResponse } from '@angular/common/http';
-import { Component, OnInit } from '@angular/core';
+import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';
 import { MatDialog } from '@angular/material/dialog';
+import { MatPaginator } from '@angular/material/paginator';
+import { MatSort } from '@angular/material/sort';
 import { MatTableDataSource } from '@angular/material/table';
 import { lastValueFrom } from 'rxjs';
 import { GetSymptom, ResponseDataGet } from 'src/app/interfaces/ANFA/symptom.interface';
@@ -15,7 +17,7 @@ import { SymptomFormComponent } from './symptom-form/symptom-form.component';
   templateUrl: './symptom.component.html',
   styleUrls: ['./symptom.component.css']
 })
-export class SymptomComponent implements OnInit {
+export class SymptomComponent implements OnInit, AfterViewInit {
 
   public isLoading: boolean;
   public isLoadingForm: boolean;
@@ -26,6 +28,9 @@ export class SymptomComponent implements OnInit {
   public displayedColumns: Array<string>;
   public dataSource: MatTableDataSource<GetSymptom>;
 
+  @ViewChild(MatPaginator) paginator!: MatPaginator;
+  @ViewChild(MatSort) sort!: MatSort;
+
   constructor(
     private _symptomService: SymptomService,
     public resourcesService: ResourcesService,
@@ -37,7 +42,17 @@ export class SymptomComponent implements OnInit {
 
     this.txtBuscador = '';
 
-    this.displayedColumns = ['CODIGO_EQUIPAMIENTO','FALLA','CAUSA','CLASIFICACION','LIMITE_VALOR','USUARIO_REGISTRA','FECHA_REGISTRA','ESTADO','ACCIONES']
+    this.displayedColumns = [
+      'SINT_COEQ',
+      'LIFA_NOFA',
+      'SINT_CAUS',
+      'SINT_CLAS',
+      'SINT_LIVA',
+      'SINT_USRE',
+      'SINT_FERE',
+      'SINT_ESTA',
+      'ACTIONS'
+    ]
     this.dataSource = new MatTableDataSource<GetSymptom>();
   }
 
@@ -45,11 +60,16 @@ export class SymptomComponent implements OnInit {
     this.getSymptoms();
   }
 
+  ngAfterViewInit(): void {
+    this.dataSource.paginator = this.paginator;
+    this.dataSource.sort = this.sort;
+  }
+
   public async getSymptoms() {
     this.isLoading = true;
     await lastValueFrom(this._symptomService.getSymptom()).then(
       (responseData: ResponseDataGet) => {
-        this.dataSource = new MatTableDataSource<GetSymptom>(responseData.response);
+        this.dataSource.data = responseData.response;
       }, (error: HttpErrorResponse) => this.resourcesService.checkErrors(error)
     );
     this.isLoading = false;

+ 1 - 1
sistema-mantenimiento-front/src/app/components/forms-management/module-management/module-management-form/module-management-form.component.ts

@@ -30,7 +30,7 @@ export class ModuleManagementFormComponent implements OnInit {
     @Inject(MAT_DIALOG_DATA) public dialogData: DialogModule
   ) {
     this.isLoading = false;
-    this.numberForm = '0000000001';
+    this.numberForm = '0000000006';
     this.titleForm = '';
     this.arrFields = [];
     this.getDynamicForm();