@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.
@@ -1868,7 +1868,7 @@
1868
1868
  if (!this.formGroup.valid) {
1869
1869
  return this.validateAllFormFields(this.formGroup);
1870
1870
  }
1871
- var visitante = this.formGroup.value;
1871
+ var visitante = this.formGroup.getRawValue();
1872
1872
  visitante.id = this.id;
1873
1873
  this.close(visitante);
1874
1874
  };
@@ -1916,6 +1916,7 @@
1916
1916
  this.visitorsChange = new core.EventEmitter();
1917
1917
  this.hasChange = new core.EventEmitter();
1918
1918
  this.ngUnsubscribe = new rxjs.Subject();
1919
+ this.visitorFound = false;
1919
1920
  this.unsubscribe$ = new rxjs.Subject();
1920
1921
  this._integrationCallback = integrationCallback;
1921
1922
  }
@@ -2047,6 +2048,17 @@
2047
2048
  .subscribe(function (visitante) { return _this.adicionaVisitanteParaSalvar(visitante); });
2048
2049
  };
2049
2050
  VisitanteComponent.prototype.adicionaVisitanteParaSalvar = function (visitante) {
2051
+ var _this = this;
2052
+ this.visitanteGridData.forEach(function (visitor) {
2053
+ if (visitor.document === visitante.document) {
2054
+ visitor.contact = visitante.contact;
2055
+ visitor.name = visitante.name;
2056
+ _this.visitorFound = true;
2057
+ }
2058
+ });
2059
+ if (this.visitorFound) {
2060
+ return;
2061
+ }
2050
2062
  this.visitanteGridLoading = true;
2051
2063
  visitante.documentType = this.getDocumentType();
2052
2064
  if (visitante.visitorSituation === undefined) {
@@ -6517,6 +6529,12 @@
6517
6529
  _this.hasChangeService.hasChange(_this.agenda.id);
6518
6530
  }
6519
6531
  });
6532
+ var statusAgenda = ["AGUARDANDO_CONFIRMACAO_SOLICITANTE", "AGENDADO", "AGUARDANDO_CONFIRMACAO", "REJEITADO_POR_VALIDACAO"];
6533
+ if (this.agenda && !statusAgenda.includes(this.agenda.status) || !this.permissions.editar) {
6534
+ this.formGroup.disable();
6535
+ this.disableButtonSave = true;
6536
+ }
6537
+ this.createdByErpDisableForm();
6520
6538
  };
6521
6539
  DevolucaoFormComponent.prototype.ngOnInit = function () {
6522
6540
  var _this = this;
@@ -6544,12 +6562,6 @@
6544
6562
  this.setTransportadora(this.agenda.externalTenant.cnpj);
6545
6563
  }
6546
6564
  this.totalEixosComposicao = this.agenda && this.agenda.veiculo ? this.agenda.veiculo.eixos || 0 : 0;
6547
- var statusAgenda = ["AGUARDANDO_CONFIRMACAO_SOLICITANTE", "AGENDADO", "AGUARDANDO_CONFIRMACAO", "REJEITADO_POR_VALIDACAO"];
6548
- if (this.agenda && !statusAgenda.includes(this.agenda.status) || !this.permissions.editar) {
6549
- this.formGroup.disable();
6550
- this.disableButtonSave = true;
6551
- }
6552
- this.createdByErpDisableForm();
6553
6565
  this.erpProcessService.current.subscribe(function (message) { return _this.erpProcessData = message; });
6554
6566
  this.erpFormConfigService.current.subscribe(function (message) { return _this.enableRevalidation = message; });
6555
6567
  this.route.data.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (data) { return _this.onRouteDataChange(data); });