Forráskód Böngészése

Modificación en el calendaio de solicitud de vacaciones

JeanBenitez 2 éve
szülő
commit
34bf767629

+ 3 - 1
vacaciones/src/app/components/mes/mesmpr/mesmpr.component.ts

@@ -86,6 +86,8 @@ export class MESMPRComponent implements OnInit {
             (element: any) =>
               element.CADUCADO === 'No' && element.DETALLES.length > 0
           );
+          console.log(verPeriodos);
+          
           this.obtenerPeriodos(verPeriodos);
           this.obtenerCasos(res.response);
           this.loading = false;
@@ -121,7 +123,7 @@ export class MESMPRComponent implements OnInit {
       if (periodo.DETALLES.length > 0) {
         aux_periodos.push(periodo);
       }
-    });
+    });    
     this.periodos = aux_periodos;
   }
 

+ 10 - 15
vacaciones/src/app/components/mes/mesmsv/mesmsv.component.ts

@@ -201,8 +201,6 @@ export class MESMSVComponent implements OnInit {
       } else {
         this.disabledFechas = false;
         this.dias_vacacionales?.enable();
-
-
       }
     } else if (!this.otro_usuario?.value) {
       this.disabledFechas = false;
@@ -212,8 +210,6 @@ export class MESMSVComponent implements OnInit {
       this.dias_vacacionales?.disable();
     }
 
-
-
     let idpolitica: any = [];
 
     if (this.otro_usuario?.value) {
@@ -253,10 +249,6 @@ export class MESMSVComponent implements OnInit {
           );
         }
       }
-
-
-
-
     } else {
       idpolitica = this._encService.desencriptar(this.usuario_session.POLITICA);
       await lastValueFrom(
@@ -366,15 +358,16 @@ export class MESMSVComponent implements OnInit {
 
     let dateToString = cellDate?.toString();
     let lastPosition = this.dates_disable[this.dates_disable.length - 1];
+    
     cellDate = new Date(dateToString!);
-
+    
     let index = 0;
     for await (let item of this.dates_disable) {
       if (
         cellDate.getDate() == this.dates_disable[index].getDate() &&
-        cellDate.getMonth() == this.dates_disable[index].getMonth() &&
-        cellDate.getFullYear() == lastPosition.getFullYear()
-      ) {
+        cellDate.getMonth() == this.dates_disable[index].getMonth() 
+        && cellDate.getFullYear() == this.dates_disable[index].getFullYear() 
+      ) {        
         collection[cellDate.getDate() - 1].style.color = 'white';
         collection[cellDate.getDate() - 1].style.background = 'orange';
         return 'example-custom-date-class';
@@ -529,7 +522,8 @@ export class MESMSVComponent implements OnInit {
           this.dias_feriados.forEach((element) => {
             if (
               element.DIA == fecha1.getDate() &&
-              element.MES - 1 == fecha1.getMonth()
+              element.MES - 1 == fecha1.getMonth() &&
+              element.ANIO == fecha1.getFullYear()
             ) {
               if (dia_semana_recorrida == 6 || dia_semana_recorrida == 0) {
               } else cont--;
@@ -560,7 +554,8 @@ export class MESMSVComponent implements OnInit {
       this.dias_feriados.forEach((element) => {
         if (
           element.DIA == fecha1.getDate() &&
-          element.MES - 1 == fecha1.getMonth()
+          element.MES - 1 == fecha1.getMonth() &&
+          element.ANIO == fecha1.getFullYear()
         ) {
           if (dias_semana[0] != 'Si' && fecha1.getDay() == 0) diasFeriados++;
           if (dias_semana[1] != 'Si' && fecha1.getDay() == 4) diasFeriados++;
@@ -626,7 +621,7 @@ export class MESMSVComponent implements OnInit {
         this.dias_feriados = response.response;
         this.dates_disable = response.response.map((object: any) => {
           return new Date(object.ANIO, object.MES - 1, object.DIA);
-        });
+        });        
       },
       (error: HttpErrorResponse) => {
         if (!error.ok)

+ 2 - 1
vacaciones/src/environments/environment.ts

@@ -9,7 +9,8 @@ export const environment = {
 export const public_key = "WrBEGoJnMnMhC/2hiaYypcmPwP9Z4p4/bNex0T/WUWA=";
 export const secret_key = "CEIBkv7QG1WoAoBO7Ny5cqzyJ5yCUwBMhnFYUBbCeTk=";
 
-export const API_URI = "https://sirh.ittec.mx/v1/public/api";
+export const API_URI = "https://sirh.ittec.mx/v1/public/api"; //PR
+// export const API_URI = "https://qasirh.ittec.mx/v1/public/api"; // QA