JeanBenitez 2 лет назад
Родитель
Сommit
5feaea03dd

+ 1 - 1
sistema-mantenimiento-front/src/app/app-routing.module.ts

@@ -105,6 +105,7 @@ import { SymptomComponent } from './components/failure-analysis/symptom/symptom.
 import { FailureChartComponent } from './components/failure-analysis/failure/failure-chart/failure-chart.component';
 import { CatalogFailureComponent } from './components/failure-analysis/catalog-failure/catalog-failure.component';
 import { CatalogMeasuresComponent } from './components/failure-analysis/catalog-measures/catalog-measures.component';
+
 import { PersonalManagementComponent } from './components/personal-management/personal-management.component';
 import { SubcontratistComponent } from './components/personal-management/subcontratist/subcontratist.component';
 import { EmployeeComponent } from './components/personal-management/employee/employee.component';
@@ -280,7 +281,6 @@ const routes: Routes = [
         { path: 'GPRS/intervention', component: InterventionComponent },
         { path: 'GPRS/intervention/contract-form/:id/:enable', component: ContractFormComponent },
         { path: 'GPRS/work-team', component: WorkTeamComponent },
-
       // Fin Gestion de Personal de Mantenimiento
     ],
   },

+ 2 - 0
sistema-mantenimiento-front/src/app/app.module.ts

@@ -297,6 +297,8 @@ import { MeasuresFormComponent } from './components/failure-analysis/catalog-mea
 import { NgxMatTimepickerModule } from 'ngx-mat-timepicker';
 import { TimePickerComponent } from './components/resources/dialogs/time-picker/time-picker.component';
 import { CalendarEventsComponent } from './components/preventive-maintenance/work-orders/calendar-events/calendar-events.component';
+
+
 import { PersonalManagementComponent } from './components/personal-management/personal-management.component';
 import { SubcontratistComponent } from './components/personal-management/subcontratist/subcontratist.component';
 import { EmployeeComponent } from './components/personal-management/employee/employee.component';

+ 8 - 11
sistema-mantenimiento-front/src/app/components/personal-management/work-team/work-team-form/work-team-form.component.html

@@ -1,7 +1,7 @@
 <h2 mat-dialog-title *ngIf="dialogData.action == 'REG'" style="text-align: center;">Registrar Equipo de Trabajo</h2>
 <h2 mat-dialog-title *ngIf="dialogData.action == 'UPD'" style="text-align: center;">Modificación Equipo de Trabajo</h2>
 <h2 mat-dialog-title *ngIf="dialogData.action == 'DET'" style="text-align: center;">Detalles Equipo de Trabajo</h2>
-<mat-dialog-content class="mat-typography">
+<mat-dialog-content style="padding: 0 24px 0 24px !important;">
   <div class="is-loading" *ngIf="isLoading">
     <mat-spinner></mat-spinner>
     <h1>Cargando...</h1>
@@ -12,23 +12,20 @@
         10px;">
         <mat-label>Nombre del Equipo</mat-label>
         <input formControlName="name" matInput placeholder="Equipo de reparación" style="width: 100%!important;" maxlength="100" [readonly]="enable == '1' ? false : true">
-        <mat-error>El Campo Nombre del Equipo es
-          Obligatorio</mat-error>
+        <mat-error>El Campo Nombre del Equipo es Obligatorio</mat-error>
       </mat-form-field>
     </p>
     <p>
       <mat-form-field appearance="outline" style="width: 100%;">
         <mat-label>Especialidad</mat-label>
         <input formControlName="speciality" matInput placeholder="Soldar equipos pesados" maxlength="100" [readonly]="enable == '1' ? false : true">
-        <mat-error>El Campo Especialidad es
-          Obligatorio</mat-error>
+        <mat-error>El Campo Especialidad es Obligatorio</mat-error>
       </mat-form-field>
     </p>
   </div>
-  <div align="end">
-    <button mat-button mat-dialog-close color="warn" style="margin-right: 10px;">Cerrar</button>
-    <button *ngIf="dialogData.action != 'DET'" mat-button color="primary" class="override-no-shadow"
-      (click)="this.alert(dialogData.action)"
-      [disabled]="formGroup.invalid">{{dialogData.action == "REG" ? "Registrar" : "Guardar"}}</button>
-  </div>
 </mat-dialog-content>
+<mat-dialog-actions align="end">
+  <button mat-button mat-dialog-close color="warn" style="margin-right: 10px;">Cerrar</button>
+  <button *ngIf="dialogData.action != 'DET'" mat-button color="primary" class="override-no-shadow"
+    (click)="this.alert(dialogData.action)" [disabled]="formGroup.invalid">{{dialogData.action == "REG" ? "Registrar" : "Guardar"}}</button>
+</mat-dialog-actions>

+ 5 - 14
sistema-mantenimiento-front/src/app/components/personal-management/work-team/work-team.component.html

@@ -10,25 +10,16 @@
     <mat-card class="override-card override-elevation-z8">
         <section class="override-section">
             <nav class="override-nav">
-                <mat-card-title class="mat-card-title centre">Lista de
-                    Equipos de Trabajo</mat-card-title>
+                <mat-card-title class="mat-card-title centre">Lista de Equipos de Trabajo</mat-card-title>
                 <div class="override-actions">
                     <mat-form-field appearance="outline" class="w-300p mr-8">
                         <mat-label>Buscador</mat-label>
-                        <input matInput [(ngModel)]="txtBuscador"
-                            (keyup)="applyFilter($event,'INP')"
-                            placeholder="Ingrese la palabra a buscar" />
+                        <input matInput [(ngModel)]="txtBuscador" (keyup)="applyFilter($event,'INP')" placeholder="Ingrese la palabra a buscar" />
                         <mat-icon *ngIf="txtBuscador.length === 0" matSuffix>search</mat-icon>
-                        <mat-icon *ngIf="txtBuscador.length> 0"
-                            class="clickable" matTooltip="Eliminar filtro"
-                            (click)="applyFilter('', 'EST')" matSuffix>close</mat-icon>
+                        <mat-icon *ngIf="txtBuscador.length> 0" class="clickable" matTooltip="Eliminar filtro" (click)="applyFilter('', 'EST')" matSuffix>close</mat-icon>
                     </mat-form-field>
                     <div class="override-buttons">
-                        <button mat-raised-button color="primary"
-                            matTooltip="Registrar Equipo"
-                            [disabled]="isLoadingForm" *ngIf="!btnSmall"
-                            class="override-no-shadow mr-10"
-                            (click)="openDialog('REG')">
+                        <button mat-raised-button color="primary" matTooltip="Registrar Equipo" [disabled]="isLoadingForm" *ngIf="!btnSmall" class="override-no-shadow mr-10" (click)="openDialog('REG')">
                             <mat-icon>add</mat-icon> Nuevo
                         </button>
                         <button mat-mini-fab color="primary"
@@ -158,4 +149,4 @@
             class="override-paginator"></mat-paginator>
     </mat-card>
 
-</main>
+</main>

+ 11 - 11
sistema-mantenimiento-front/src/app/services/personal-management/employee.service.ts

@@ -14,26 +14,26 @@ export class EmployeeService {
   }
 
   public getConsultOfEmployees() {
-    return this._httpRequestService.getQuery(`${this._url}/consult/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/consult`).pipe(
       map((data: any) => data))
   }
   public getAvaibleUsers() {
-    return this._httpRequestService.getQuery(`${this._url}/user-avaible/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/user-avaible`).pipe(
       map((data: any) => data))
   }
 
   public getDocumentsByEmployee(employeeId: string) {
-    return this._httpRequestService.getQuery(`${this._url}/documents/${employeeId}/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/documents/${employeeId}`).pipe(
       map((data: any) => data))
   }
 
     public getLastDocumentsByEmployee(employeeId: string) {
-    return this._httpRequestService.getQuery(`${this._url}/last-documents/${employeeId}/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/last-documents/${employeeId}`).pipe(
       map((data: any) => data))
   }
 
   public getInterventionsByEmployee(employeeId: string) {
-    return this._httpRequestService.getQuery(`${this._url}/orders/${employeeId}/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/orders/${employeeId}`).pipe(
       map((data: any) => data))
   }
 
@@ -53,22 +53,22 @@ export class EmployeeService {
   }
 
   public getEmployeeById(employeeId: string) {
-    return this._httpRequestService.getQuery(`${this._url}/${employeeId}/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/${employeeId}`).pipe(
       map((data: any) => data))
   }
 
   public getAllEmployees() {
-    return this._httpRequestService.getQuery(`${this._url}/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}`).pipe(
       map((data: any) => data))
   }
 
   public getContractsOfEveryEmployee() {
-    return this._httpRequestService.getQuery(`${this._url}/contracts/employees/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/contracts/employees`).pipe(
       map((data: any) => data))
   }
 
   public getDetailsOfContractsByEmployee(employeeId: string) {
-    return this._httpRequestService.getQuery(`${this._url}/contracts/history/${employeeId}/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/contracts/history/${employeeId}`).pipe(
       map((data: any) => data))
   }
 
@@ -81,5 +81,5 @@ public DownoloadEmployeeInfoOnPdf(response: DownoloadEmployeeInfo){
   return this._httpRequestService.postQuery(`${this._url}/downoload-details-pdf`, response)
   .pipe(map((data: any) => data));
 }
-  
-}
+
+}

+ 5 - 5
sistema-mantenimiento-front/src/app/services/personal-management/intervention.service.ts

@@ -14,22 +14,22 @@ export class InterventionService {
   }
 
   public getConsultOfInterventions() {
-    return this._httpRequestService.getQuery(`${this._url}/consult/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/consult`).pipe(
       map((data: any) => data));
   }
 
   public getDetailsOfInterventionsById(interventionId: number) {
-    return this._httpRequestService.getQuery(`${this._url}/detail/${interventionId}/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/detail/${interventionId}`).pipe(
       map((data: any) => data));
   }
 
   public getConsultOfContracts() {
-    return this._httpRequestService.getQuery(`${this._url}/contract/consult/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/contract/consult`).pipe(
       map((data: any) => data));
   }
 
   public getContractById(contractId: string) {
-    return this._httpRequestService.getQuery(`${this._url}/contract/${contractId}/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/contract/${contractId}`).pipe(
       map((data: any) => data));
   }
 
@@ -39,7 +39,7 @@ export class InterventionService {
   }
 
   public getAllContracts() {
-    return this._httpRequestService.getQuery(`${this._url}/contract/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/contract`).pipe(
       map((data: any) => data));
   }
 

+ 8 - 8
sistema-mantenimiento-front/src/app/services/personal-management/subcontratist.service.ts

@@ -14,7 +14,7 @@ export class SubcontratistService {
   }
 
   public getConsultOfSubcontratists() {
-    return this._httpRequestService.getQuery(`${this._url}/consult/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/consult`).pipe(
       map((data: any) => data));
   }
 
@@ -29,7 +29,7 @@ export class SubcontratistService {
   }
 
   public getSubcontratistById(subcontratistId: string) {
-    return this._httpRequestService.getQuery(`${this._url}/subcontratist/${subcontratistId}/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/subcontratist/${subcontratistId}`).pipe(
       map((data: any) => data));
   }
 
@@ -39,27 +39,27 @@ export class SubcontratistService {
   }
 
   public getAllSubcontratists() {
-    return this._httpRequestService.getQuery(`${this._url}/subcontratists/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/subcontratists`).pipe(
       map((data: any) => data));
   }
 
   public getActiveSubcontratists() {
-    return this._httpRequestService.getQuery(`${this._url}/active-subcontratists/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/active-subcontratists`).pipe(
       map((data: any) => data));
   }
 
   public getContractsOfEverySubcontratist() {
-    return this._httpRequestService.getQuery(`${this._url}/contracts/subcontratists/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/contracts/subcontratists`).pipe(
       map((data: any) => data));
   }
 
   public getCountries() {
-    return this._httpRequestService.getQuery(`${this._url}/countries/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/countries`).pipe(
       map((data: any) => data));
   }
 
   public getContractsBySubcontratist(subcontratistId: string) {
-    return this._httpRequestService.getQuery(`${this._url}/contracts/history/${subcontratistId}/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/contracts/history/${subcontratistId}`).pipe(
       map((data: any) => data));
   }
 
@@ -67,7 +67,7 @@ export class SubcontratistService {
     return this._httpRequestService.postQuery(`${this._url}/downoload-info-excel`, response)
       .pipe(map((data: any) => data));
   }
-  
+
   public downoloadSubcontratistContractsInfoOnPdf(response: DownoloadSubcontratistInfo) {
     return this._httpRequestService.postQuery(`${this._url}/downoload-info-pdf`, response)
       .pipe(map((data: any) => data));

+ 4 - 4
sistema-mantenimiento-front/src/app/services/personal-management/work-team.service.ts

@@ -14,22 +14,22 @@ export class WorkTeamService {
   }
 
   public getConsultOfWorkteams() {
-    return this._httpRequestService.getQuery(`${this._url}/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}`).pipe(
       map((data: any) => data));
   }
 
   public getActiveWorkteams() {
-    return this._httpRequestService.getQuery(`${this._url}/active-teams/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/active-teams`).pipe(
       map((data: any) => data));
   }
 
   public getWorkteamById(workteamId: string) {
-    return this._httpRequestService.getQuery(`${this._url}/${workteamId}/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/${workteamId}`).pipe(
       map((data: any) => data));
   }
 
   public getDetailsOfWorkteamById(workteamId: number) {
-    return this._httpRequestService.getQuery(`${this._url}/details/${workteamId}/1`).pipe(
+    return this._httpRequestService.getQuery(`${this._url}/details/${workteamId}`).pipe(
       map((data: any) => data));
   }
 

+ 6 - 10
sistema-mantenimiento-front/src/app/services/resources/http-request.service.ts

@@ -11,36 +11,32 @@ export class HttpRequestService {
 
   private _url:string;
   private _token:string;
+  private _line:string;
 
   constructor(private _http: HttpClient) {
     this._url = `${apiUriMathew}`;
     this._token = `Bearer ${localStorage.getItem('token')}`;
+    this._line = '1';
   }
 
   public getQuery(query: string) {
-    const URL = `${this._url}/${query}/`;
+    const URL = `${this._url}/${query}/${this._line}`;
     return this._http.get(URL, {
-      headers: new HttpHeaders({
-        Authorization: this._token,
-      }),
+      headers: new HttpHeaders({ Authorization: this._token }),
     });
   }
 
   public postQuery(query: string, body: any) {
     const URL = `${this._url}/${query}`;
     return this._http.post(URL, body, {
-      headers: new HttpHeaders({
-        Authorization: this._token,
-      }),
+      headers: new HttpHeaders({ Authorization: this._token }),
     });
   }
 
   public putQuery(query: string, body: any) {
     const URL = `${this._url}/${query}/`;
     return this._http.put(URL, body, {
-      headers: new HttpHeaders({
-        Authorization: this._token,
-      }),
+      headers: new HttpHeaders({ Authorization: this._token }),
     });
   }