瀏覽代碼

Modificaciones de fechas de reportes y historial

JeanBenitez 3 年之前
父節點
當前提交
140113b9ce

+ 4 - 21
vacaciones/src/app/components/mes/mesmhs/mesmhs-form/mesmhs-form.component.html

@@ -45,23 +45,6 @@
           </mat-form-field>
         </mat-grid-tile>
 
-<!-- 
-        <mat-grid-tile colspan="6">
-          <mat-form-field appearance="legacy">
-            <mat-label>Días disponibles antes de las vacaciones</mat-label>
-            <input matInput formControlName="diasdispantes" />
-            <mat-icon matSuffix>event_available</mat-icon>
-          </mat-form-field>
-        </mat-grid-tile>
-
-        <mat-grid-tile colspan="6">
-          <mat-form-field appearance="legacy">
-            <mat-label>Días disponibles después de las vacaciones</mat-label>
-            <input matInput formControlName="diasdispdesp" />
-            <mat-icon matSuffix>event_available</mat-icon>
-          </mat-form-field>
-        </mat-grid-tile>
- -->
         <mat-grid-tile colspan="12" *ngIf="estatus!.value != 'Aprobado'">
           <mat-form-field appearance="legacy">
             <mat-label>Motivo</mat-label>
@@ -89,12 +72,12 @@
         <th mat-header-cell *matHeaderCellDef style="text-align: center;"> Días después </th>
         <td mat-cell *matCellDef="let element" style="text-align: center;"> {{element.DIASDISPDESP}} </td>
       </ng-container>
-    
-    
+
+
       <tr mat-header-row *matHeaderRowDef="['periodo', 'antes', 'despues']"></tr>
       <tr mat-row *matRowDef="let row; columns: ['periodo', 'antes', 'despues'];"></tr>
     </table>
-  
+
 
     <div class="centre" style="padding-top: 20px">
       <button mat-raised-button class="mr-2" color="warn" [mat-dialog-close]="false">
@@ -102,4 +85,4 @@
       </button>
     </div>
   </div>
-</div>
+</div>

+ 12 - 9
vacaciones/src/app/components/mes/mesmhs/mesmhs-form/mesmhs-form.component.ts

@@ -22,12 +22,12 @@ export class MESMHSFORMComponent implements OnInit {
   constructor(
     public dialogRef: MatDialogRef<any>,
     @Inject(MAT_DIALOG_DATA) public data: any,
-  ) {    
+  ) {
     this.formGroup = this.createFormGroup();
   }
 
   private createFormGroup() {
-    
+
     return new FormGroup({
       id_usuario: new FormControl({
         value: this.data.item.IDUSUARIO,
@@ -42,11 +42,11 @@ export class MESMHSFORMComponent implements OnInit {
         disabled: true,
       }),
       fecha_inicial: new FormControl({
-        value: this.formato(this.data.item.FECHAINICIAL),
+        value: this.formatoFin(this.data.item.FECHAINICIAL),
         disabled: true,
       }),
       fecha_final: new FormControl({
-        value: this.formato(this.data.item.FECHAFINAL),
+        value: this.formatoFin(this.data.item.FECHAFINAL),
         disabled: true,
       }),
       estatus: new FormControl({
@@ -87,19 +87,22 @@ export class MESMHSFORMComponent implements OnInit {
     item.map((element:any) => {
       let fechaPeriodo = element.PERIODO.split('|');
       arrPeriodoVacacional.push({
-        PERIODO: 'De '+this.formato(fechaPeriodo[0])+' a '+this.formato(fechaPeriodo[1]),
+        PERIODO: 'De '+this.formatoInicio(fechaPeriodo[0])+' a '+this.formatoFin(fechaPeriodo[1]),
         DIASDISPANTES:element.DIASDISPANTES,
         DIASDISPDESP:element.DIASDISPDESP
       });
     });
-    
-    
+
+
     return arrPeriodoVacacional;
   }
 
-  private formato(fecha: string) {
+  private formatoInicio(fecha: string) {
+    let fechaAux = fecha.split('-');
+    return `${fechaAux[2]}-${fechaAux[1]}-${ parseInt(fechaAux[0]) + 1}`;
+  }
+  private formatoFin(fecha: string) {
     let fechaAux = fecha.split('-');
-
     return `${fechaAux[2]}-${fechaAux[1]}-${fechaAux[0]}`;
   }
   ngOnInit(): void {}

+ 11 - 11
vacaciones/src/app/components/mes/mesmpr/mesmpr.component.html

@@ -30,13 +30,13 @@
       </div>
     </mat-grid-tile>
 
-    <!-- Fila 2 | Días Tomados | Días disponibles (Dato) -->
+    <!-- Fila 2 | Días disfrutados | Días disponibles (Dato) -->
     <mat-grid-tile colspan="12">
       <h1 class="display-4 text-secondary">
         {{ diasDisponiblesAnterior }}
       </h1>
       <div class="mr-5" class="position-right" style="margin-right: 1%; width: 180px; ">
-        <mat-card-title class="display-text">Días tomados</mat-card-title>
+        <mat-card-title class="display-text">Días disfrutados</mat-card-title>
         <span class="display-text-small text-secondary"><b>{{ diasTomadosAnterior }}</b></span>
       </div>
     </mat-grid-tile>
@@ -62,7 +62,7 @@
                 <div class="panel-flex">
                   <span><b> Fecha inicio: </b>{{ formatoFecha(detallePeriodo.fecha_inicio) }}</span>
                   <span><b> Fecha fin: </b>{{ formatoFecha(detallePeriodo.fecha_fin) }}</span>
-                  <span><b> Días tomados: </b>{{ detallePeriodo.dias_tomados }}</span>
+                  <span><b> Días disfrutados: </b>{{ detallePeriodo.dias_tomados }}</span>
                 </div>
               </div>
             </div>
@@ -99,20 +99,20 @@
         <span class="display-text-small text-secondary"><b>{{ diasPeriodoActual }}</b></span>
       </div>
     </mat-grid-tile>
-    <!-- Fila 2 | Días Tomados | Días disponibles (Dato) -->
+    <!-- Fila 2 | Días disfrutados | Días disponibles (Dato) -->
     <mat-grid-tile colspan="12">
       <h1 class="display-4 text-secondary">
         {{ diasDisponiblesActual }}
       </h1>
       <div class="mr-5" class="position-right" style="top: 10px !important; margin-right: 1%; width: 180px">
-        <mat-card-title class="display-text">Días tomados</mat-card-title>
+        <mat-card-title class="display-text">Días disfrutados</mat-card-title>
         <span class="display-text-small text-secondary"><b> {{ diasTomadosActual }} </b></span>
       </div>
     </mat-grid-tile>
   </mat-grid-list>
 
   <div align="right" style="right: 0; display: flex; align-items: center">
-    
+
     <div style="width: 100%; margin-left: 150px;">
       <mat-accordion class="headers-align" style="width: 100%; margin-top: 1%;" *ngIf="!casoAnterior">
         <mat-expansion-panel class="expansion-panel" style="margin-top: 20px;" [disabled]="diasTomadosValid.length === 0">
@@ -133,7 +133,7 @@
                 <div class="panel-flex">
                   <span><b> Fecha inicio: </b>{{ formatoFecha(detallePeriodo.fecha_inicio) }}</span>
                   <span><b> Fecha fin: </b>{{ formatoFecha(detallePeriodo.fecha_fin) }}</span>
-                  <span><b> Días tomados: </b>{{ detallePeriodo.dias_tomados }}</span>
+                  <span><b> Días disfrutados: </b>{{ detallePeriodo.dias_tomados }}</span>
                 </div>
               </div>
             </div>
@@ -170,13 +170,13 @@
         <span class="display-text-small text-secondary"><b>{{ diasPeriodoEAYG }}</b></span>
       </div>
     </mat-grid-tile>
-    <!-- Fila 2 | Días Tomados | Días disponibles (Dato) -->
+    <!-- Fila 2 | Días disfrutados | Días disponibles (Dato) -->
     <mat-grid-tile colspan="12">
       <h1 class="display-4 text-secondary">
         {{ diasDisponiblesEAYG }}
       </h1>
       <div class="mr-5" class="position-right" style="top: 10px !important; margin-right: 1%; width: 180px">
-        <mat-card-title class="display-text">Días tomados</mat-card-title>
+        <mat-card-title class="display-text">Días disfrutados</mat-card-title>
         <span class="display-text-small text-secondary"><b> {{ diasTomadosEAYG }} </b></span>
       </div>
     </mat-grid-tile>
@@ -201,7 +201,7 @@
                 <div class="panel-flex">
                   <span><b> Fecha inicio: </b>{{ formatoFecha(detallePeriodo.fecha_inicio) }}</span>
                   <span><b> Fecha fin: </b>{{ formatoFecha(detallePeriodo.fecha_fin) }}</span>
-                  <span><b> Días tomados: </b>{{ detallePeriodo.dias_tomados }}</span>
+                  <span><b> Días disfrutados: </b>{{ detallePeriodo.dias_tomados }}</span>
                 </div>
               </div>
             </div>
@@ -220,4 +220,4 @@
 
 <div *ngIf="caso0 && !loading" class="centre">
   <h2>Aún no existen periodos vacaciones para este usuario</h2>
-</div>
+</div>

+ 6 - 1
vacaciones/src/app/components/mes/mesmre/mesmre.component.ts

@@ -840,18 +840,23 @@ export class MESMREComponent implements AfterViewInit {
     }
   }
 
+  formatoFechaInicio(fecha: string): string {
+    let split = fecha.split('-');
+    return `${split[2]}-${split[1]}-${ parseInt(split[0]) + 1}`;
+  }
   formatoFecha(fecha: string): string {
     let split = fecha.split('-');
     return `${split[2]}-${split[1]}-${split[0]}`;
   }
 
+
   formatoFechaPeriodo(item: any) {
     let arrPeriodoVacacional = [];
     let fechaPeriodo = item.split('|');
 
     arrPeriodoVacacional.push(
       'De ' +
-        this.formatoFecha(fechaPeriodo[0]) +
+        this.formatoFechaInicio(fechaPeriodo[0]) +
         ' a ' +
         this.formatoFecha(fechaPeriodo[1])
     );