Commit 65472df2d23ac1fc09188dbbfaca684d8abeca88
1 parent
95ffb565
Exists in
master
[Redmine Atendimento #4457]Correção edição item termo referencia
Showing
1 changed file
with
12 additions
and
10 deletions
Show diff stats
cit-contratos-web/src/main/webapp/assets/js/angular/custom/controller/TermoReferenciaController.js
@@ -235,7 +235,7 @@ citApp.controller('TermoReferenciaController', ['$scope', | @@ -235,7 +235,7 @@ citApp.controller('TermoReferenciaController', ['$scope', | ||
235 | $scope.editPenalidade = false; | 235 | $scope.editPenalidade = false; |
236 | $scope.editSancao = false; | 236 | $scope.editSancao = false; |
237 | $scope.step = 0; | 237 | $scope.step = 0; |
238 | - | 238 | + |
239 | $timeout(function(){ | 239 | $timeout(function(){ |
240 | $scope.termoReferenciaForm.$submitted = false; | 240 | $scope.termoReferenciaForm.$submitted = false; |
241 | $scope.termoReferenciaForm.equipeContratacaoForm.$submitted = false; | 241 | $scope.termoReferenciaForm.equipeContratacaoForm.$submitted = false; |
@@ -274,7 +274,7 @@ citApp.controller('TermoReferenciaController', ['$scope', | @@ -274,7 +274,7 @@ citApp.controller('TermoReferenciaController', ['$scope', | ||
274 | }; | 274 | }; |
275 | 275 | ||
276 | $scope.openModalDetalhamentoSolucao = function() { | 276 | $scope.openModalDetalhamentoSolucao = function() { |
277 | - | 277 | + $scope.edicao = false; |
278 | $scope.termoReferenciaDetalhamentoSolucao = {}; | 278 | $scope.termoReferenciaDetalhamentoSolucao = {}; |
279 | $scope.editDetalhamento = true; | 279 | $scope.editDetalhamento = true; |
280 | // $scope.atualizaListaEtBensServicos(); | 280 | // $scope.atualizaListaEtBensServicos(); |
@@ -363,13 +363,15 @@ citApp.controller('TermoReferenciaController', ['$scope', | @@ -363,13 +363,15 @@ citApp.controller('TermoReferenciaController', ['$scope', | ||
363 | } | 363 | } |
364 | $scope.setLoadingSalva(true); | 364 | $scope.setLoadingSalva(true); |
365 | var isDuplicado = false; | 365 | var isDuplicado = false; |
366 | - angular.forEach($scope.termoReferencia.detalhamentosSolucoes, function (item, idx) { | ||
367 | - if (item.bemServicoSolucao.id === detalhe.bemServicoSolucao.id) { | ||
368 | - isDuplicado = true; | ||
369 | - $scope.showAlert('error', $translate.instant('CONTRATOS.VALIDACAO.BENS_E_SERVICOS_JA_ADD'), " ", false); | ||
370 | - return; | ||
371 | - } | ||
372 | - }); | 366 | + if(!$scope.edicao){ |
367 | + angular.forEach($scope.termoReferencia.detalhamentosSolucoes, function (item, idx) { | ||
368 | + if (item.bemServicoSolucao.id === detalhe.bemServicoSolucao.id) { | ||
369 | + isDuplicado = true; | ||
370 | + $scope.showAlert('error', $translate.instant('CONTRATOS.VALIDACAO.BENS_E_SERVICOS_JA_ADD'), " ", false); | ||
371 | + return; | ||
372 | + } | ||
373 | + }); | ||
374 | + } | ||
373 | 375 | ||
374 | if (!isDuplicado) { | 376 | if (!isDuplicado) { |
375 | 377 | ||
@@ -724,7 +726,7 @@ citApp.controller('TermoReferenciaController', ['$scope', | @@ -724,7 +726,7 @@ citApp.controller('TermoReferenciaController', ['$scope', | ||
724 | $scope.abrirDetalhamentoSolucao = function(edit) { | 726 | $scope.abrirDetalhamentoSolucao = function(edit) { |
725 | 727 | ||
726 | $scope.termoReferenciaDetalhamentoSolucao = clone($scope.getDetalhamentoSolucaoChecked()); | 728 | $scope.termoReferenciaDetalhamentoSolucao = clone($scope.getDetalhamentoSolucaoChecked()); |
727 | - | 729 | + $scope.edicao = true; |
728 | $scope.editDetalhamento = edit; | 730 | $scope.editDetalhamento = edit; |
729 | 731 | ||
730 | if(!edit && !$scope.termoReferenciaDetalhamentoSolucao) {//DetalhamentoSolucao | 732 | if(!edit && !$scope.termoReferenciaDetalhamentoSolucao) {//DetalhamentoSolucao |