diff --git a/cit-contratos-web/src/main/webapp/assets/js/angular/custom/controller/TermoReferenciaController.js b/cit-contratos-web/src/main/webapp/assets/js/angular/custom/controller/TermoReferenciaController.js index adaec71..8ff2d89 100644 --- a/cit-contratos-web/src/main/webapp/assets/js/angular/custom/controller/TermoReferenciaController.js +++ b/cit-contratos-web/src/main/webapp/assets/js/angular/custom/controller/TermoReferenciaController.js @@ -235,7 +235,7 @@ citApp.controller('TermoReferenciaController', ['$scope', $scope.editPenalidade = false; $scope.editSancao = false; $scope.step = 0; - + $timeout(function(){ $scope.termoReferenciaForm.$submitted = false; $scope.termoReferenciaForm.equipeContratacaoForm.$submitted = false; @@ -274,7 +274,7 @@ citApp.controller('TermoReferenciaController', ['$scope', }; $scope.openModalDetalhamentoSolucao = function() { - + $scope.edicao = false; $scope.termoReferenciaDetalhamentoSolucao = {}; $scope.editDetalhamento = true; // $scope.atualizaListaEtBensServicos(); @@ -363,13 +363,15 @@ citApp.controller('TermoReferenciaController', ['$scope', } $scope.setLoadingSalva(true); var isDuplicado = false; - angular.forEach($scope.termoReferencia.detalhamentosSolucoes, function (item, idx) { - if (item.bemServicoSolucao.id === detalhe.bemServicoSolucao.id) { - isDuplicado = true; - $scope.showAlert('error', $translate.instant('CONTRATOS.VALIDACAO.BENS_E_SERVICOS_JA_ADD'), " ", false); - return; - } - }); + if(!$scope.edicao){ + angular.forEach($scope.termoReferencia.detalhamentosSolucoes, function (item, idx) { + if (item.bemServicoSolucao.id === detalhe.bemServicoSolucao.id) { + isDuplicado = true; + $scope.showAlert('error', $translate.instant('CONTRATOS.VALIDACAO.BENS_E_SERVICOS_JA_ADD'), " ", false); + return; + } + }); + } if (!isDuplicado) { @@ -724,7 +726,7 @@ citApp.controller('TermoReferenciaController', ['$scope', $scope.abrirDetalhamentoSolucao = function(edit) { $scope.termoReferenciaDetalhamentoSolucao = clone($scope.getDetalhamentoSolucaoChecked()); - + $scope.edicao = true; $scope.editDetalhamento = edit; if(!edit && !$scope.termoReferenciaDetalhamentoSolucao) {//DetalhamentoSolucao -- libgit2 0.21.2