|
|
@@ -65,6 +65,8 @@ export class MESMHSFORMDAYSComponent implements OnInit {
|
|
|
private _validationService: ValidationsService,
|
|
|
@Inject(MAT_DIALOG_DATA) public data: any
|
|
|
) {
|
|
|
+ console.log(this.data);
|
|
|
+
|
|
|
this.formGroup = this.createFormGroup();
|
|
|
}
|
|
|
|
|
|
@@ -177,6 +179,9 @@ export class MESMHSFORMDAYSComponent implements OnInit {
|
|
|
}
|
|
|
|
|
|
updateRequest() {
|
|
|
+ let days_auxiliar =
|
|
|
+ this.dias_vacacionales?.value - this.data.item.NUMERODIAS;
|
|
|
+
|
|
|
let solicitud = {
|
|
|
id_solicitud: this.data.item.IDSOLICITUD,
|
|
|
rfc_empresa: this.usuario_session.RFCEMPRESA,
|
|
|
@@ -184,6 +189,7 @@ export class MESMHSFORMDAYSComponent implements OnInit {
|
|
|
fecha_inicio: this.formatDate(this.fecha_inicio?.value),
|
|
|
fecha_final: this.formatDate(this.fecha_final_2?.value),
|
|
|
numero_dias: this.dias_vacacionales?.value,
|
|
|
+ extra_dias: days_auxiliar,
|
|
|
numero_empleado_modifica: this._encService.desencriptar(
|
|
|
this.usuario_session.IDUSUARIO
|
|
|
),
|
|
|
@@ -227,7 +233,7 @@ export class MESMHSFORMDAYSComponent implements OnInit {
|
|
|
dialogRef.afterClosed().subscribe((result) => {
|
|
|
if (result) {
|
|
|
this.updateRequest();
|
|
|
- this.dialog.closeAll();
|
|
|
+ //this.dialog.closeAll();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -501,24 +507,26 @@ export class MESMHSFORMDAYSComponent implements OnInit {
|
|
|
}
|
|
|
);
|
|
|
|
|
|
- this._mcompvService.obtenerPoliticaUsuario(this.data.item.IDPOLITICA).subscribe(
|
|
|
- (response) => {
|
|
|
- this.politica = response.response.DIASDESCANSO;
|
|
|
- let convert = JSON.parse(response.response.DIASDESCANSO);
|
|
|
- this.getDaysPolitician(convert);
|
|
|
- },
|
|
|
- (error) => {
|
|
|
- if (!error.ok) {
|
|
|
- this._validationService.openSnackBar('Ocurrió un error inesperado');
|
|
|
- }
|
|
|
- if (error.error.msg != undefined) {
|
|
|
- this._validationService.openSnackBar(error.error.msg);
|
|
|
- }
|
|
|
- if (error.status == 408) {
|
|
|
- this._validationService.openSnackBar('Conexion lenta');
|
|
|
+ this._mcompvService
|
|
|
+ .obtenerPoliticaUsuario(this.data.item.IDPOLITICA)
|
|
|
+ .subscribe(
|
|
|
+ (response) => {
|
|
|
+ this.politica = response.response.DIASDESCANSO;
|
|
|
+ let convert = JSON.parse(response.response.DIASDESCANSO);
|
|
|
+ this.getDaysPolitician(convert);
|
|
|
+ },
|
|
|
+ (error) => {
|
|
|
+ if (!error.ok) {
|
|
|
+ this._validationService.openSnackBar('Ocurrió un error inesperado');
|
|
|
+ }
|
|
|
+ if (error.error.msg != undefined) {
|
|
|
+ this._validationService.openSnackBar(error.error.msg);
|
|
|
+ }
|
|
|
+ if (error.status == 408) {
|
|
|
+ this._validationService.openSnackBar('Conexion lenta');
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- );
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
getDaysPolitician(convert: any) {
|