@seniorsistemas/yms-integration 1.18.2 → 1.18.3-dedd666f-1a6a-40f2-b527-cd463044cb54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1808,7 +1808,7 @@ var VisitanteFormComponent = /** @class */ (function () {
1808
1808
  if (!this.formGroup.valid) {
1809
1809
  return this.validateAllFormFields(this.formGroup);
1810
1810
  }
1811
- var visitante = this.formGroup.value;
1811
+ var visitante = this.formGroup.getRawValue();
1812
1812
  visitante.id = this.id;
1813
1813
  this.close(visitante);
1814
1814
  };
@@ -1856,6 +1856,7 @@ var VisitanteComponent = /** @class */ (function () {
1856
1856
  this.visitorsChange = new EventEmitter();
1857
1857
  this.hasChange = new EventEmitter();
1858
1858
  this.ngUnsubscribe = new Subject();
1859
+ this.visitorFound = false;
1859
1860
  this.unsubscribe$ = new Subject();
1860
1861
  this._integrationCallback = integrationCallback;
1861
1862
  }
@@ -1987,6 +1988,17 @@ var VisitanteComponent = /** @class */ (function () {
1987
1988
  .subscribe(function (visitante) { return _this.adicionaVisitanteParaSalvar(visitante); });
1988
1989
  };
1989
1990
  VisitanteComponent.prototype.adicionaVisitanteParaSalvar = function (visitante) {
1991
+ var _this = this;
1992
+ this.visitanteGridData.forEach(function (visitor) {
1993
+ if (visitor.document === visitante.document) {
1994
+ visitor.contact = visitante.contact;
1995
+ visitor.name = visitante.name;
1996
+ _this.visitorFound = true;
1997
+ }
1998
+ });
1999
+ if (this.visitorFound) {
2000
+ return;
2001
+ }
1990
2002
  this.visitanteGridLoading = true;
1991
2003
  visitante.documentType = this.getDocumentType();
1992
2004
  if (visitante.visitorSituation === undefined) {
@@ -6457,6 +6469,12 @@ var DevolucaoFormComponent = /** @class */ (function () {
6457
6469
  _this.hasChangeService.hasChange(_this.agenda.id);
6458
6470
  }
6459
6471
  });
6472
+ var statusAgenda = ["AGUARDANDO_CONFIRMACAO_SOLICITANTE", "AGENDADO", "AGUARDANDO_CONFIRMACAO", "REJEITADO_POR_VALIDACAO"];
6473
+ if (this.agenda && !statusAgenda.includes(this.agenda.status) || !this.permissions.editar) {
6474
+ this.formGroup.disable();
6475
+ this.disableButtonSave = true;
6476
+ }
6477
+ this.createdByErpDisableForm();
6460
6478
  };
6461
6479
  DevolucaoFormComponent.prototype.ngOnInit = function () {
6462
6480
  var _this = this;
@@ -6484,12 +6502,6 @@ var DevolucaoFormComponent = /** @class */ (function () {
6484
6502
  this.setTransportadora(this.agenda.externalTenant.cnpj);
6485
6503
  }
6486
6504
  this.totalEixosComposicao = this.agenda && this.agenda.veiculo ? this.agenda.veiculo.eixos || 0 : 0;
6487
- var statusAgenda = ["AGUARDANDO_CONFIRMACAO_SOLICITANTE", "AGENDADO", "AGUARDANDO_CONFIRMACAO", "REJEITADO_POR_VALIDACAO"];
6488
- if (this.agenda && !statusAgenda.includes(this.agenda.status) || !this.permissions.editar) {
6489
- this.formGroup.disable();
6490
- this.disableButtonSave = true;
6491
- }
6492
- this.createdByErpDisableForm();
6493
6505
  this.erpProcessService.current.subscribe(function (message) { return _this.erpProcessData = message; });
6494
6506
  this.erpFormConfigService.current.subscribe(function (message) { return _this.enableRevalidation = message; });
6495
6507
  this.route.data.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function (data) { return _this.onRouteDataChange(data); });