Commit 5edef104dcd194a2782aa38d31a26c79a9ad5e75
1 parent
ba6a29bc
Exists in
master
[Redmine Atendimento #4431]Padronização lista contratos
Showing
8 changed files
with
268 additions
and
206 deletions
Show diff stats
cit-contratos-web/src/main/java/br/com/centralit/listener/StartupListenerContratos.java
| ... | ... | @@ -1042,8 +1042,8 @@ public class StartupListenerContratos extends UtilStartup implements Application |
| 1042 | 1042 | internacionalizacaoList.add(new Internacionalizacao("VALIDACAO.MAXIMO_POSSIVEL_RESPOSTA", "Você pode adicionar no máximo 10 possíveis respostas!", dominio, modulo)); |
| 1043 | 1043 | internacionalizacaoList.add(new Internacionalizacao("VALIDACAO.MINIMO_POSSIVEIS_RESPOSTAS", "Você deve adicionar pelo menos duas possíveis respostas!", dominio, modulo)); |
| 1044 | 1044 | internacionalizacaoList.add(new Internacionalizacao("VALIDACAO.NECESSIDADE_NAO_PREENCHIDA", "Você deve informar a descrição da necessidade elencada para adicionar a mesma!", dominio, modulo)); |
| 1045 | - internacionalizacaoList.add(new Internacionalizacao("VALIDACAO.QUESTAO_NAO_PREENCHIDA", "Você deve preencher todos os dados da questão para adicionar a mesma!", dominio, modulo)); | |
| 1046 | - internacionalizacaoList.add(new Internacionalizacao("VALIDACAO.SEM_POSSIVEL_RESPOSTA", "Você deve digitar uma possível resposta!", dominio, modulo)); | |
| 1045 | + internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.VALIDACAO.QUESTAO_NAO_PREENCHIDA", "Você deve preencher todos os dados da questão para adicionar a mesma!", dominio, modulo)); | |
| 1046 | + internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.VALIDACAO.SEM_POSSIVEL_RESPOSTA", "Você deve digitar uma possível resposta!", dominio, modulo)); | |
| 1047 | 1047 | internacionalizacaoList.add(new Internacionalizacao("LIBERACAO_PAGAMENTO.MSG.SELECIONE_OS", "Adicione uma ordem de fornecimento de bens e serviços.", dominio, modulo)); |
| 1048 | 1048 | internacionalizacaoList.add(new Internacionalizacao("LIBERACAO_PAGAMENTO.MSG.INFORME_VALOR_EMPENHO", "Informe o valor liberado para pagamento do empenho.", dominio, modulo)); |
| 1049 | 1049 | } | ... | ... |
cit-contratos-web/src/main/webapp/assets/js/angular/custom/controller/ContratoController.js
| ... | ... | @@ -172,7 +172,9 @@ citApp.controller('ContratoController', ['$scope', '$filter', 'FileUploader', 'C |
| 172 | 172 | if (edit) { |
| 173 | 173 | $scope.hasAlteracaoEnvolvido = false; |
| 174 | 174 | } |
| 175 | - | |
| 175 | + $scope.atualizarListaSizeSelect(); | |
| 176 | + $scope.atualizarListaSizeSelectItemContrato(); | |
| 177 | + $scope.atualizarListaSizeSelectEnvolvido(); | |
| 176 | 178 | $scope.edit = edit; |
| 177 | 179 | $scope.setCurrentStep(0); |
| 178 | 180 | $scope.setLoading(false); | ... | ... |
cit-contratos-web/src/main/webapp/assets/js/angular/custom/controller/CronogramaExecucaoController.js
| 1 | 1 | 'use strict'; |
| 2 | -citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$timeout', '$filter', 'FileUploader', | |
| 2 | +citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$timeout', '$filter', 'FileUploader', | |
| 3 | 3 | 'CronogramaExecucaoRepository', 'ContratoRepository', 'ContratoItemRepository', 'CronogramaExecucaoItemRepository', |
| 4 | - function CronogramaExecucaoController($scope, $translate, $timeout, $filter, FileUploader, | |
| 4 | + function CronogramaExecucaoController($scope, $translate, $timeout, $filter, FileUploader, | |
| 5 | 5 | CronogramaExecucaoRepository, ContratoRepository, ContratoItemRepository, CronogramaExecucaoItemRepository) { |
| 6 | - | |
| 6 | + | |
| 7 | 7 | $scope.cronogramaExecucao = { |
| 8 | 8 | itensCronogramaExecucao : [] |
| 9 | 9 | }; |
| 10 | - | |
| 10 | + | |
| 11 | 11 | $scope.itemCronogramaExecucao = { |
| 12 | 12 | parcelas : [] |
| 13 | 13 | }; |
| 14 | 14 | |
| 15 | 15 | $scope.parcelaItem = {}; |
| 16 | 16 | $scope.contratoItem = {}; |
| 17 | - | |
| 17 | + | |
| 18 | 18 | $scope.radioValueList = [{descricao : $translate.instant('LABEL.SIM'), valor : true}, |
| 19 | 19 | {descricao : $translate.instant('LABEL.NAO'), valor : false}]; |
| 20 | 20 | |
| ... | ... | @@ -35,22 +35,23 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 35 | 35 | |
| 36 | 36 | $scope.edit = true; |
| 37 | 37 | $scope.pgEdit = true; |
| 38 | + $scope.atualizarListaSizeSelect(); | |
| 38 | 39 | $timeout(function(){ |
| 39 | 40 | limparCronogramaExecucaoForm(); |
| 40 | 41 | }); |
| 41 | 42 | }; |
| 42 | - | |
| 43 | + | |
| 43 | 44 | $scope.resetFormItens = function() { |
| 44 | 45 | limparItemCronogramaExecucao(); |
| 45 | 46 | $scope.parcelaItem = {}; |
| 46 | 47 | $scope.contratoItem = {}; |
| 47 | 48 | }; |
| 48 | - | |
| 49 | + | |
| 49 | 50 | function limparCronogramaExecucaoForm() { |
| 50 | 51 | $scope.cronogramaExecucaoForm.$submitted = false; |
| 51 | 52 | $scope.cronogramaExecucaoForm.$setPristine(); |
| 52 | 53 | } |
| 53 | - | |
| 54 | + | |
| 54 | 55 | // Atualiza pagina de pesquisa |
| 55 | 56 | $scope.atualizaPaginaPesquisa = function () { |
| 56 | 57 | angular.element('#searchCronogramaExecucao').scope().fetchResult(); |
| ... | ... | @@ -59,7 +60,7 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 59 | 60 | // Consulta entidade e mostra no formulario |
| 60 | 61 | $scope.getCronogramaExecucao = function(cronogramaExecucao, edit) { |
| 61 | 62 | $scope.setLoadingGet(true); |
| 62 | - | |
| 63 | + | |
| 63 | 64 | CronogramaExecucaoRepository.get(cronogramaExecucao.id).then(function(result) { |
| 64 | 65 | $scope.cronogramaExecucao = result.originalElement; |
| 65 | 66 | |
| ... | ... | @@ -70,7 +71,7 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 70 | 71 | } else { |
| 71 | 72 | $scope.edit = false; |
| 72 | 73 | } |
| 73 | - | |
| 74 | + $scope.atualizarListaSizeSelect(); | |
| 74 | 75 | $scope.pgEdit = edit; |
| 75 | 76 | $scope.setLoading(false); |
| 76 | 77 | }); |
| ... | ... | @@ -106,9 +107,9 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 106 | 107 | |
| 107 | 108 | if ($scope.cronogramaExecucao.contrato) { |
| 108 | 109 | $scope.editItemCronograma = true; |
| 109 | - | |
| 110 | + | |
| 110 | 111 | limparItemCronogramaExecucao(); |
| 111 | - | |
| 112 | + | |
| 112 | 113 | $timeout(function() { |
| 113 | 114 | $scope.$openModal('modal-itens-cronograma.html', 'lg'); |
| 114 | 115 | }); |
| ... | ... | @@ -122,25 +123,25 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 122 | 123 | parcelas : [] |
| 123 | 124 | }; |
| 124 | 125 | }; |
| 125 | - | |
| 126 | + | |
| 126 | 127 | // MODAL QUE CONFIRMA REMOÇÃO DO CRONOGRAMA DE EXECUÇÃO |
| 127 | 128 | $scope.remove = function(cronogramaExecucao) { |
| 128 | - $scope.$openModalConfirm({ | |
| 129 | - message: $translate.instant('CONTRATOS.MSG.CONFIRMA_EXCLUSAO_CRONOGRAMA'), | |
| 129 | + $scope.$openModalConfirm({ | |
| 130 | + message: $translate.instant('CONTRATOS.MSG.CONFIRMA_EXCLUSAO_CRONOGRAMA'), | |
| 130 | 131 | callback: function () { |
| 131 | 132 | CronogramaExecucaoRepository.remove(cronogramaExecucao).then(function() { |
| 132 | 133 | $scope.limparCronogramaExecucao(); |
| 133 | - | |
| 134 | + | |
| 134 | 135 | $scope.$modalConfirmInstance.dismiss('cancel'); |
| 135 | 136 | $scope.showAlert("success", $translate.instant('CONTRATOS.MSG.SUCESSO_EXCLUSAO_CRONOGRAMA')); |
| 136 | 137 | angular.element('#searchCronogramaExecucao').scope().fetchResult(); |
| 137 | - | |
| 138 | + | |
| 138 | 139 | $scope.resetForm(); |
| 139 | 140 | }); |
| 140 | 141 | } |
| 141 | 142 | }); |
| 142 | 143 | }; |
| 143 | - | |
| 144 | + | |
| 144 | 145 | // SALVA O CRONOGRAMA DE EXECUÇÃO |
| 145 | 146 | $scope.saveOrUpdate = function(){ |
| 146 | 147 | $scope.cronogramaExecucaoForm.$submitted = true; |
| ... | ... | @@ -170,12 +171,12 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 170 | 171 | CronogramaExecucaoRepository.save($scope.cronogramaExecucao).then(function(result) { |
| 171 | 172 | $scope.cronogramaExecucao = result.originalElement; |
| 172 | 173 | $scope.showAlert("success", $translate.instant('CONTRATOS.MSG.SUCESSO_SALVAR_CRONOGRAMA')); |
| 173 | - | |
| 174 | + | |
| 174 | 175 | // depois de salvar a baixa ja tendo uma referencia do id da baixa, esse metodo ira salvar os documentos se existir |
| 175 | 176 | salvarListaDocumentos(cronogramaExecucaoTemp); |
| 176 | 177 | |
| 177 | 178 | $scope.cronogramaExecucaoForm.$submitted = false; |
| 178 | - $scope.$showPageSearchWorkspace($scope.workspace); | |
| 179 | + $scope.$showPageSearchWorkspace($scope.workspace); | |
| 179 | 180 | $scope.atualizaPaginaPesquisa(); |
| 180 | 181 | }); |
| 181 | 182 | $scope.setLoading(false); |
| ... | ... | @@ -219,7 +220,7 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 219 | 220 | $scope.uploader.uploadAll(); |
| 220 | 221 | } |
| 221 | 222 | }; |
| 222 | - | |
| 223 | + | |
| 223 | 224 | // Limpa o formulario preenchido |
| 224 | 225 | $scope.limparCronogramaExecucao = function(){ |
| 225 | 226 | $scope.cronogramaExecucao = { |
| ... | ... | @@ -233,8 +234,9 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 233 | 234 | item.$checked = value; |
| 234 | 235 | item.$index = key; |
| 235 | 236 | }); |
| 237 | + $scope.atualizarListaSizeSelect(); | |
| 236 | 238 | }; |
| 237 | - | |
| 239 | + | |
| 238 | 240 | // Abre modal perguntando se deseja excluir e exclui os elementos selecionados na lista de acoes caso confirmado |
| 239 | 241 | $scope.excluirItensCronogramaSelecionados = function(){ |
| 240 | 242 | var lista = recuperarItensSelecionadas(); |
| ... | ... | @@ -242,13 +244,13 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 242 | 244 | $scope.$openModalConfirm({ |
| 243 | 245 | message: $translate.instant('MSG.DESEJA_EXCLUIR_ITENS'), |
| 244 | 246 | callback: function () { |
| 245 | - | |
| 247 | + | |
| 246 | 248 | angular.forEach($scope.cronogramaExecucao.itensCronogramaExecucao, function (item, idx) { |
| 247 | 249 | if (item.$checked) { |
| 248 | 250 | $scope.cronogramaExecucao.itensCronogramaExecucao.splice(idx, 1); |
| 249 | 251 | } |
| 250 | 252 | }); |
| 251 | - | |
| 253 | + $scope.atualizarListaSizeSelect(); | |
| 252 | 254 | $scope.$modalConfirmInstance.dismiss('cancel'); |
| 253 | 255 | } |
| 254 | 256 | }); |
| ... | ... | @@ -279,13 +281,13 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 279 | 281 | }); |
| 280 | 282 | $scope.itemCronogramaExecucao.$index = clone(lista[0].$index); |
| 281 | 283 | $scope.contratoItem = clone(lista[0].contratoItem); |
| 282 | - | |
| 284 | + | |
| 283 | 285 | $timeout(function() { |
| 284 | 286 | $scope.$openModal('modal-itens-cronograma.html', 'lg'); |
| 285 | 287 | }); |
| 286 | 288 | |
| 287 | 289 | }; |
| 288 | - | |
| 290 | + | |
| 289 | 291 | //Recupera todas as acoes selecionadas na lista |
| 290 | 292 | var recuperarItensSelecionadas = function(){ |
| 291 | 293 | var lista = []; |
| ... | ... | @@ -303,7 +305,7 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 303 | 305 | |
| 304 | 306 | $scope.setDadosContratoItem = function (contratoItem) { |
| 305 | 307 | $scope.contratoItem = contratoItem; |
| 306 | - | |
| 308 | + | |
| 307 | 309 | $scope.parcelaItem.quantidade = contratoItem.quantidade; |
| 308 | 310 | $scope.parcelaItem.valorUnitario = contratoItem.valorUnitarioItem; |
| 309 | 311 | }; |
| ... | ... | @@ -316,7 +318,7 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 316 | 318 | $scope.parcelaItem.quantidade = $scope.contratoItem.quantidade; |
| 317 | 319 | } |
| 318 | 320 | }; |
| 319 | - | |
| 321 | + | |
| 320 | 322 | function limparParcelasItemCronogramaExecucao() { |
| 321 | 323 | $scope.itemCronogramaExecucao.parcelas = []; |
| 322 | 324 | }; |
| ... | ... | @@ -326,10 +328,10 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 326 | 328 | var index = angular.copy($scope.itemCronogramaExecucao.$index); |
| 327 | 329 | limparItemCronogramaExecucao(); |
| 328 | 330 | $scope.parcelaItem = {}; |
| 329 | - | |
| 331 | + | |
| 330 | 332 | $scope.itemCronogramaExecucao.parcelas = parcelas; |
| 331 | 333 | $scope.itemCronogramaExecucao.$index = index; |
| 332 | - | |
| 334 | + | |
| 333 | 335 | formDialogItemCronogramaExecucao.$submitted = false; |
| 334 | 336 | formDialogItemCronogramaExecucao.$setPristine(); |
| 335 | 337 | } |
| ... | ... | @@ -338,11 +340,11 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 338 | 340 | formDialogItemCronogramaExecucao.$submitted = true; |
| 339 | 341 | |
| 340 | 342 | if (formDialogItemCronogramaExecucao.$valid) { |
| 341 | - | |
| 343 | + | |
| 342 | 344 | if ($scope.parcelaItem.$index != undefined && $scope.parcelaItem.$index != null) { |
| 343 | 345 | $scope.itemCronogramaExecucao.parcelas[$scope.parcelaItem.$index] = angular.copy($scope.parcelaItem); |
| 344 | 346 | } else { |
| 345 | - | |
| 347 | + | |
| 346 | 348 | if ($scope.itemCronogramaExecucao.pagamentoParcelado === true && $scope.itemCronogramaExecucao.numeroParcelas) { |
| 347 | 349 | var numeroParcelas = Number($scope.itemCronogramaExecucao.numeroParcelas); |
| 348 | 350 | for (var i=0; i < numeroParcelas; i++) { |
| ... | ... | @@ -368,13 +370,13 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 368 | 370 | } else { |
| 369 | 371 | $scope.showAlert('error', $translate.instant('VALIDACAO.ALERTA_OBRIGATORIOS'), " ", false); |
| 370 | 372 | } |
| 371 | - | |
| 373 | + | |
| 372 | 374 | }; |
| 373 | 375 | |
| 374 | 376 | function adicionarParcelaItemLista(sequencia) { |
| 375 | 377 | |
| 376 | 378 | $scope.parcelaItem.valorTotalParcela = 0.0; |
| 377 | - $scope.parcelaItem.valorTotalParcela = ($scope.parcelaItem.quantidade * $scope.parcelaItem.valorUnitario); | |
| 379 | + $scope.parcelaItem.valorTotalParcela = ($scope.parcelaItem.quantidade * $scope.parcelaItem.valorUnitario); | |
| 378 | 380 | |
| 379 | 381 | $scope.parcelaItem.sequencia = sequencia; |
| 380 | 382 | $scope.parcelaItem.dataEntrega = $filter('date')(clone($scope.parcelaItem.dataEntrega), "dd/MM/yyyy"); |
| ... | ... | @@ -386,12 +388,12 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 386 | 388 | var quantidade = $scope.itemCronogramaExecucao.parcelas[index].quantidade; |
| 387 | 389 | var valorUnitario = $scope.itemCronogramaExecucao.parcelas[index].valorUnitario; |
| 388 | 390 | $scope.itemCronogramaExecucao.parcelas[index].valorTotalParcela = (quantidade * valorUnitario); |
| 389 | - | |
| 391 | + | |
| 390 | 392 | calcularValorTotalItemDialog(); |
| 391 | 393 | }; |
| 392 | 394 | |
| 393 | 395 | $scope.editarParcelaItemCronogramaExecucao = function () { |
| 394 | - | |
| 396 | + | |
| 395 | 397 | var lista = recuperarItensSelecionadas(); |
| 396 | 398 | |
| 397 | 399 | if (lista.length > 0) { |
| ... | ... | @@ -401,13 +403,13 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 401 | 403 | $scope.itemCronogramaExecucao.contratoItem = $scope.contratoItem; |
| 402 | 404 | $scope.itemCronogramaExecucao.pagamentoParcelado = $scope.itemCronogramaExecucao.parcelas > 1; |
| 403 | 405 | } |
| 404 | - | |
| 406 | + | |
| 405 | 407 | $scope.itemCronogramaExecucao.numeroParcelas = $scope.itemCronogramaExecucao.parcelas.length; |
| 406 | - | |
| 408 | + | |
| 407 | 409 | var parcelaChecked = $scope.itemCronogramaExecucao.parcelas.filter(function(parcela) { |
| 408 | 410 | return parcela.$checked === true; |
| 409 | 411 | }); |
| 410 | - | |
| 412 | + | |
| 411 | 413 | $scope.parcelaItem = clone(parcelaChecked[0]); |
| 412 | 414 | $scope.parcelaItem.dataEntrega = $filter('date')($scope.parcelaItem.dataEntrega, "dd/MM/yyyy"); |
| 413 | 415 | }; |
| ... | ... | @@ -439,14 +441,14 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 439 | 441 | $scope.addItemCronogramaExecucao = function(formDialogItemCronogramaExecucao, continuar) { |
| 440 | 442 | |
| 441 | 443 | var itemCronogramaExecucao = angular.copy($scope.itemCronogramaExecucao); |
| 442 | - | |
| 444 | + | |
| 443 | 445 | if (itemCronogramaExecucao.parcelas.length > 0) { |
| 444 | 446 | |
| 445 | 447 | var hasInconsistencia = false; |
| 446 | 448 | var textParcelasComEntregaForaVigencia = ""; |
| 447 | - | |
| 449 | + | |
| 448 | 450 | angular.forEach(itemCronogramaExecucao.parcelas, function(parcela) { |
| 449 | - | |
| 451 | + | |
| 450 | 452 | var hasErrorVigenciaInicial = isPeriodoValido(parcela.dataEntrega, $scope.cronogramaExecucao.contrato.dataVigenciaInicial); |
| 451 | 453 | var hasErrorVigenciaFinal = !isPeriodoValido(parcela.dataEntrega, $scope.cronogramaExecucao.contrato.dataUltimaVigenciaFinal); |
| 452 | 454 | if (hasErrorVigenciaInicial || hasErrorVigenciaFinal) { |
| ... | ... | @@ -482,13 +484,14 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 482 | 484 | |
| 483 | 485 | $scope.$modalInstance.dismiss('cancel'); |
| 484 | 486 | } |
| 487 | + $scope.atualizarListaSizeSelect(); | |
| 485 | 488 | } |
| 486 | 489 | } else { |
| 487 | 490 | $scope.showAlert('error', $translate.instant('CONTRATOS.VALIDACAO.NECESSARIO_ITEM_CRONOGRAMA'), " ", false); |
| 488 | 491 | } |
| 489 | 492 | }; |
| 490 | 493 | |
| 491 | - | |
| 494 | + | |
| 492 | 495 | // ####################################################################################################################### \\ |
| 493 | 496 | // ##################### DAQUI PARA BAIXO SAO TODOS OS METODOS RELACIONADOS À WATCH DE CAMPOS DA TELA #################### \\ |
| 494 | 497 | // ####################################################################################################################### \\ |
| ... | ... | @@ -504,7 +507,7 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 504 | 507 | $scope.itemCronogramaExecucao.valorTotalItem += (parcela.valorUnitario * parcela.quantidade); |
| 505 | 508 | }); |
| 506 | 509 | }; |
| 507 | - | |
| 510 | + | |
| 508 | 511 | // watch para calcular valor total dos itens do cronograma |
| 509 | 512 | $scope.$watchCollection('cronogramaExecucao.itensCronogramaExecucao', function() { |
| 510 | 513 | $scope.cronogramaExecucao.valorTotal = 0.0; |
| ... | ... | @@ -513,4 +516,12 @@ citApp.controller('CronogramaExecucaoController', ['$scope', '$translate', '$tim |
| 513 | 516 | }); |
| 514 | 517 | }); |
| 515 | 518 | |
| 519 | + $scope.atualizarListaSizeSelect = function() { | |
| 520 | + if(!$scope.listaSize){ | |
| 521 | + $scope.listaSize = 0; | |
| 522 | + }; | |
| 523 | + var lista = recuperarItensSelecionadas(); | |
| 524 | + $scope.listaSize = lista.length; | |
| 525 | + }; | |
| 526 | + | |
| 516 | 527 | }]); |
| 517 | 528 | \ No newline at end of file | ... | ... |
cit-contratos-web/src/main/webapp/assets/js/angular/custom/controller/OrdemFornecimentoController.js
| ... | ... | @@ -7,28 +7,28 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 7 | 7 | |
| 8 | 8 | $scope.edit = true; |
| 9 | 9 | $scope.ordemFornecimento = {}; |
| 10 | - | |
| 10 | + | |
| 11 | 11 | $scope.uploader = new FileUploader({ |
| 12 | 12 | autoUpload: false, |
| 13 | 13 | queueLimit: 1, |
| 14 | 14 | url: '/cit-tabelas-corp-web/rest/anexo/uploadAnexo?idDocumento=' |
| 15 | 15 | }); |
| 16 | - | |
| 16 | + | |
| 17 | 17 | DominioRepository.findAllDominio('tipoSituacaoOrdemFornecimento').then(function(result) { |
| 18 | 18 | $scope.listaSituacaoOrdemFornecimentos = result; |
| 19 | 19 | }); |
| 20 | - | |
| 20 | + | |
| 21 | 21 | $scope.findContrato = function(value) { |
| 22 | 22 | return ContratoRepository.findContrato(value, $scope.usuarioLogado.organizacao.id).then(function(result) { |
| 23 | 23 | return result; |
| 24 | 24 | }); |
| 25 | 25 | }; |
| 26 | - | |
| 26 | + | |
| 27 | 27 | // limpa o formulario |
| 28 | 28 | $scope.resetForm = function() { |
| 29 | 29 | $scope.edit = true; |
| 30 | 30 | $scope.ordemFornecimento = {}; |
| 31 | - | |
| 31 | + $scope.atualizarListaSizeSelect(); | |
| 32 | 32 | $timeout(function() { |
| 33 | 33 | $scope.ordemFornecimentoForm.$submitted = false; |
| 34 | 34 | }); |
| ... | ... | @@ -41,13 +41,13 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 41 | 41 | OrdemFornecimentoRepository.get(idOrdemFornecimento).then(function(result) { |
| 42 | 42 | |
| 43 | 43 | $scope.ordemFornecimento = result.originalElement; |
| 44 | - | |
| 44 | + $scope.atualizarListaSizeSelect(); | |
| 45 | 45 | $scope.edit = edit; |
| 46 | 46 | |
| 47 | 47 | $scope.setLoading(false); |
| 48 | 48 | }); |
| 49 | 49 | }; |
| 50 | - | |
| 50 | + | |
| 51 | 51 | // recupera os itens selecionados |
| 52 | 52 | $scope.getItensChecked = function() { |
| 53 | 53 | var itensChecked = []; |
| ... | ... | @@ -62,13 +62,13 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 62 | 62 | |
| 63 | 63 | return itensChecked; |
| 64 | 64 | }; |
| 65 | - | |
| 65 | + | |
| 66 | 66 | $scope.openModalItensBensServicos = function() { |
| 67 | 67 | |
| 68 | 68 | $scope.editItem = true; |
| 69 | 69 | |
| 70 | 70 | $scope.item = {}; |
| 71 | - | |
| 71 | + | |
| 72 | 72 | if ($scope.ordemFornecimento.contrato) { |
| 73 | 73 | ContratoItemRepository.findAllByContrato($scope.ordemFornecimento.contrato.id).then(function(result) { |
| 74 | 74 | $scope.itensContrato = result; |
| ... | ... | @@ -82,7 +82,7 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 82 | 82 | $scope.$openModal('modal-itens-bens-servicos.html', 'lg'); |
| 83 | 83 | }); |
| 84 | 84 | }; |
| 85 | - | |
| 85 | + | |
| 86 | 86 | $scope.abrirItensBensServicos = function(edit) { |
| 87 | 87 | |
| 88 | 88 | $scope.editItem = edit; |
| ... | ... | @@ -90,7 +90,7 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 90 | 90 | $scope.item = null; |
| 91 | 91 | // recupera a EstudoTecnico selecionada |
| 92 | 92 | var itensSelecionados = $scope.getItensChecked(); |
| 93 | - | |
| 93 | + | |
| 94 | 94 | if (itensSelecionados.length > 1) { |
| 95 | 95 | $scope.showAlert('warning', edit? $translate.instant('MSG.SELECIONE_APENAS_UM_ITEM_PARA_EDICAO') : $translate.instant('MSG.SELECIONE_APENAS_UM_ITEM_PARA_VISUALIZACAO')); |
| 96 | 96 | return; |
| ... | ... | @@ -100,13 +100,13 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 100 | 100 | $scope.showAlert('warning', edit? $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_EDICAO') : $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_VISUALIZACAO')); |
| 101 | 101 | return; |
| 102 | 102 | } |
| 103 | - | |
| 103 | + | |
| 104 | 104 | ContratoItemRepository.findAllByContrato($scope.ordemFornecimento.contrato.id).then(function(result) { |
| 105 | 105 | $scope.itensContrato = result; |
| 106 | 106 | }); |
| 107 | - | |
| 107 | + | |
| 108 | 108 | $scope.item = itensSelecionados[0]; |
| 109 | - | |
| 109 | + | |
| 110 | 110 | $scope.item.dataInicioPrevisto = $filter('date')( $scope.item.dataInicioPrevisto, "dd/MM/yyyy");; |
| 111 | 111 | $scope.item.dataTerminoPrevisto = $filter('date')( $scope.item.dataTerminoPrevisto, "dd/MM/yyyy");; |
| 112 | 112 | |
| ... | ... | @@ -114,7 +114,7 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 114 | 114 | $scope.$openModal('modal-itens-bens-servicos.html', 'lg'); |
| 115 | 115 | }); |
| 116 | 116 | }; |
| 117 | - | |
| 117 | + | |
| 118 | 118 | // ADICIONAR item |
| 119 | 119 | $scope.salvaItem = function(formDialogItem) { |
| 120 | 120 | |
| ... | ... | @@ -122,25 +122,25 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 122 | 122 | |
| 123 | 123 | //verifica se o formulario está valido para salvar |
| 124 | 124 | if (formDialogItem.$valid) { |
| 125 | - | |
| 125 | + | |
| 126 | 126 | if(!isPeriodoValido($scope.item.dataInicioPrevisto, $scope.item.dataTerminoPrevisto)) { |
| 127 | 127 | $scope.showAlert('warning', $translate.instant('VALIDACAO.DATA_INICIO_PREVISTO_MAIOR_DATA_TERMINO_PREVISTO_CONTRATO')); |
| 128 | 128 | return; |
| 129 | 129 | } |
| 130 | - | |
| 130 | + | |
| 131 | 131 | if(!isPeriodoValido($scope.ordemFornecimento.contrato.dataVigenciaInicial, $scope.item.dataInicioPrevisto) || |
| 132 | 132 | !isPeriodoValido($scope.item.dataTerminoPrevisto, $scope.ordemFornecimento.contrato.dataUltimaVigenciaFinal)) { |
| 133 | 133 | $scope.showAlert('warning', $translate.instant('VALIDACAO.PERIODO_INICIO_TERMINO_DENTRO_VIGENCIA_CONTRATO')); |
| 134 | 134 | return; |
| 135 | 135 | } |
| 136 | - | |
| 136 | + | |
| 137 | 137 | if ($scope.item.quantidade == 0) { |
| 138 | 138 | $scope.showAlert('warning', $translate.instant('VALIDACAO.QUANTIDADE_MAIOR_ZERO')); |
| 139 | 139 | return; |
| 140 | 140 | } |
| 141 | - | |
| 141 | + | |
| 142 | 142 | var qntParc = $scope.item.quantidade; |
| 143 | - | |
| 143 | + | |
| 144 | 144 | if ($scope.ordemFornecimento.itensBensServicos) { |
| 145 | 145 | for (var i = 0; i < $scope.ordemFornecimento.itensBensServicos.length; i++) { |
| 146 | 146 | if (!$scope.ordemFornecimento.itensBensServicos[i].$checked && $scope.ordemFornecimento.itensBensServicos[i].itemBemServico.id == $scope.item.itemBemServico.id) { |
| ... | ... | @@ -148,23 +148,23 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | - | |
| 151 | + | |
| 152 | 152 | if (qntParc > $scope.item.itemBemServico.quantidade) { |
| 153 | - | |
| 153 | + | |
| 154 | 154 | var qntRestante = parseFloat($scope.item.itemBemServico.quantidade) - (parseFloat(qntParc) - parseFloat($scope.item.quantidade)); |
| 155 | - | |
| 155 | + | |
| 156 | 156 | if (qntRestante < 0) { |
| 157 | 157 | qntRestante = 0; |
| 158 | 158 | } |
| 159 | - | |
| 159 | + | |
| 160 | 160 | $scope.showAlert('warning', $translate.instant('VALIDACAO.QUANTIDADE_INSERIDA_ITEM_MAIOR_QUANTIDADE_CONTRATO') + qntRestante); |
| 161 | 161 | return; |
| 162 | 162 | } |
| 163 | - | |
| 163 | + | |
| 164 | 164 | if ($scope.item.itemBemServico.originalElement) { |
| 165 | 165 | $scope.item.itemBemServico = $scope.item.itemBemServico.originalElement; |
| 166 | 166 | } |
| 167 | - | |
| 167 | + | |
| 168 | 168 | if ($scope.ordemFornecimento.itensBensServicos) { |
| 169 | 169 | if ($scope.item.$checked) { |
| 170 | 170 | for (var i = 0; i < $scope.ordemFornecimento.itensBensServicos.length; i++) { |
| ... | ... | @@ -180,26 +180,26 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 180 | 180 | $scope.item.$index = 1; |
| 181 | 181 | $scope.ordemFornecimento.itensBensServicos = [$scope.item]; |
| 182 | 182 | } |
| 183 | - | |
| 183 | + | |
| 184 | 184 | var qnt = 0; |
| 185 | 185 | var total = 0; |
| 186 | - | |
| 186 | + | |
| 187 | 187 | for (var i = 0; i < $scope.ordemFornecimento.itensBensServicos.length; i++) { |
| 188 | 188 | var item = $scope.ordemFornecimento.itensBensServicos[i]; |
| 189 | 189 | qnt = parseFloat(qnt) + parseFloat(item.quantidade); |
| 190 | 190 | total = parseFloat(total) + parseFloat(item.valorTotalItem); |
| 191 | 191 | } |
| 192 | - | |
| 192 | + | |
| 193 | 193 | $scope.quantidadeTotal = qnt; |
| 194 | 194 | $scope.totalGeral = total; |
| 195 | - | |
| 195 | + $scope.atualizarListaSizeSelect(); | |
| 196 | 196 | $scope.$modalInstance.dismiss('cancel'); |
| 197 | 197 | } else { |
| 198 | 198 | //Mensagem de erro de campos obrigatorios não preenchidos |
| 199 | 199 | $scope.showAlert('error', $translate.instant('VALIDACAO.ALERTA_OBRIGATORIOS'), " ", false); |
| 200 | 200 | } |
| 201 | 201 | }; |
| 202 | - | |
| 202 | + | |
| 203 | 203 | $scope.removerItensBensServicos = function() { |
| 204 | 204 | // recupera a EstudoTecnico selecionada |
| 205 | 205 | var itensSelecionados = $scope.getItensChecked(); |
| ... | ... | @@ -210,7 +210,7 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 210 | 210 | callback: function() { |
| 211 | 211 | |
| 212 | 212 | $scope.$modalConfirmInstance.dismiss('cancel'); |
| 213 | - | |
| 213 | + | |
| 214 | 214 | var itens = []; |
| 215 | 215 | for (var i = 0; i < $scope.ordemFornecimento.itensBensServicos.length; i++) { |
| 216 | 216 | if (!$scope.ordemFornecimento.itensBensServicos[i].$checked) { |
| ... | ... | @@ -218,6 +218,7 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 218 | 218 | } |
| 219 | 219 | } |
| 220 | 220 | $scope.ordemFornecimento.itensBensServicos = itens; |
| 221 | + $scope.atualizarListaSizeSelect(); | |
| 221 | 222 | $scope.showAlert("success", $translate.instant('MSG.REGISTRO_EXCLUIDO')); |
| 222 | 223 | } |
| 223 | 224 | }); |
| ... | ... | @@ -225,20 +226,20 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 225 | 226 | $scope.showAlert('warning', $translate.instant('MSG.SELECIONE_AO_MENOS_UM_ITEM_PARA_SER_REMOVIDO')); |
| 226 | 227 | } |
| 227 | 228 | }; |
| 228 | - | |
| 229 | + | |
| 229 | 230 | //Salva a ordem de fornecimento |
| 230 | 231 | $scope.saveOrUpdate = function() { |
| 231 | 232 | // atributo para visualizar os itens obrigatorios na tela |
| 232 | 233 | $scope.ordemFornecimentoForm.$submitted = true; |
| 233 | - | |
| 234 | + | |
| 234 | 235 | // verifica formulario valido |
| 235 | 236 | if ($scope.ordemFornecimentoForm.$valid) { |
| 236 | - | |
| 237 | + | |
| 237 | 238 | if (!$scope.ordemFornecimento.itensBensServicos || $scope.ordemFornecimento.itensBensServicos.length == 0) { |
| 238 | 239 | $scope.showAlert('error', $translate.instant('VALIDACAO.ALERTA_OBRIGATORIOS'), " ", false); |
| 239 | 240 | return; |
| 240 | 241 | } |
| 241 | - | |
| 242 | + | |
| 242 | 243 | if ($scope.ordemFornecimento.dominioSituacao && $scope.ordemFornecimento.dominioSituacao.originalElement) { |
| 243 | 244 | $scope.ordemFornecimento.dominioSituacao = $scope.ordemFornecimento.dominioSituacao.originalElement; |
| 244 | 245 | } |
| ... | ... | @@ -276,7 +277,7 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 276 | 277 | $scope.showAlert('error', $translate.instant('VALIDACAO.ALERTA_OBRIGATORIOS')); |
| 277 | 278 | } |
| 278 | 279 | }; |
| 279 | - | |
| 280 | + | |
| 280 | 281 | // metodo utilizado para percorrer a lista de documentos persistidos e verificar com a lista de documentos temporarios para verificacao de qual anexo pertence a qual documento |
| 281 | 282 | var salvarListaDocumentos = function(ordemFornecimentoTemp) { |
| 282 | 283 | |
| ... | ... | @@ -310,7 +311,7 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 310 | 311 | $scope.uploader.uploadAll(); |
| 311 | 312 | } |
| 312 | 313 | }; |
| 313 | - | |
| 314 | + | |
| 314 | 315 | //Watch para buscar o gestor do contrato |
| 315 | 316 | $scope.$watch('ordemFornecimento.contrato', function() { |
| 316 | 317 | if ($scope.ordemFornecimento.contrato && ($scope.ordemFornecimento.contrato.id)) { |
| ... | ... | @@ -321,12 +322,12 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 321 | 322 | $scope.contratoGestor = null; |
| 322 | 323 | } |
| 323 | 324 | }); |
| 324 | - | |
| 325 | + | |
| 325 | 326 | //Watch para atualizar valores do item |
| 326 | 327 | $scope.$watch('item.itemBemServico', function() { |
| 327 | 328 | if ($scope.item && $scope.item.itemBemServico && $scope.item.itemBemServico.originalElement) { |
| 328 | 329 | if ($scope.item.itemBemServico) { |
| 329 | - | |
| 330 | + | |
| 330 | 331 | var qnt = 0; |
| 331 | 332 | if ($scope.ordemFornecimento.itensBensServicos) { |
| 332 | 333 | for (var i = 0; i < $scope.ordemFornecimento.itensBensServicos.length; i++) { |
| ... | ... | @@ -336,7 +337,7 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 336 | 337 | } |
| 337 | 338 | } |
| 338 | 339 | } |
| 339 | - | |
| 340 | + | |
| 340 | 341 | $scope.item.quantidade = parseFloat($scope.item.itemBemServico.quantidade) - parseFloat(qnt); |
| 341 | 342 | $scope.item.valorUnitarioItem = $scope.item.itemBemServico.valorUnitarioItem; |
| 342 | 343 | $scope.item.valorTotalItem = $scope.item.quantidade * $scope.item.valorUnitarioItem; |
| ... | ... | @@ -347,7 +348,7 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 347 | 348 | } |
| 348 | 349 | } |
| 349 | 350 | }); |
| 350 | - | |
| 351 | + | |
| 351 | 352 | //Watch para atualizar o valor total do item |
| 352 | 353 | $scope.$watch('item.quantidade', function() { |
| 353 | 354 | if ($scope.item) { |
| ... | ... | @@ -358,7 +359,7 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 358 | 359 | } |
| 359 | 360 | } |
| 360 | 361 | }); |
| 361 | - | |
| 362 | + | |
| 362 | 363 | //Watch para atualizar o valor total do item |
| 363 | 364 | $scope.$watch('ordemFornecimento.itensBensServicos', function() { |
| 364 | 365 | if ($scope.ordemFornecimento.itensBensServicos && $scope.ordemFornecimento.itensBensServicos.length > 0) { |
| ... | ... | @@ -376,7 +377,7 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 376 | 377 | $scope.totalGeral = 0; |
| 377 | 378 | } |
| 378 | 379 | }); |
| 379 | - | |
| 380 | + | |
| 380 | 381 | //INICIO DE METODOS REFERENTES AOS RELATORIOS |
| 381 | 382 | |
| 382 | 383 | $scope.gerarRelatorioOrdemFornecimento = function() { |
| ... | ... | @@ -384,4 +385,20 @@ citApp.controller('OrdemFornecimentoController', ['$scope', 'OrdemFornecimentoRe |
| 384 | 385 | $scope.visualizarRelatorio($scope.url, $translate.instant("LABEL.TITULO_ORDEM_FORNECIMENTO")); |
| 385 | 386 | }; |
| 386 | 387 | |
| 388 | + $scope.checkAll = function(value) { | |
| 389 | + angular.forEach($scope.ordemFornecimento.itensBensServicos, function (item, key) { | |
| 390 | + item.$checked = value; | |
| 391 | + item.$index = key; | |
| 392 | + }); | |
| 393 | + $scope.atualizarListaSizeSelect(); | |
| 394 | + }; | |
| 395 | + | |
| 396 | + $scope.atualizarListaSizeSelect = function() { | |
| 397 | + if(!$scope.listaSize){ | |
| 398 | + $scope.listaSize = 0; | |
| 399 | + }; | |
| 400 | + var lista = $scope.getItensChecked(); | |
| 401 | + $scope.listaSize = lista.length; | |
| 402 | + }; | |
| 403 | + | |
| 387 | 404 | }]); |
| 388 | 405 | \ No newline at end of file | ... | ... |
cit-contratos-web/src/main/webapp/assets/js/angular/custom/controller/QuestionarioController.js
| ... | ... | @@ -8,25 +8,25 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 8 | 8 | dominioTipoQuestionario : {codigo : 1}, |
| 9 | 9 | questoes : [] |
| 10 | 10 | }; |
| 11 | - | |
| 11 | + | |
| 12 | 12 | $scope.questionarioPergunta = { |
| 13 | 13 | respostasEscolha : [] |
| 14 | 14 | }; |
| 15 | - | |
| 15 | + | |
| 16 | 16 | $scope.possivelResposta = {}; |
| 17 | 17 | |
| 18 | 18 | $scope.isBloquear = false; |
| 19 | 19 | |
| 20 | 20 | $scope.isDesbloquear = false; |
| 21 | - | |
| 21 | + | |
| 22 | 22 | DominioRepository.findAllDominio('tipoRespostaQuestao').then(function(result) { |
| 23 | 23 | $scope.dominiosTipoResposta = result; |
| 24 | 24 | }); |
| 25 | - | |
| 25 | + | |
| 26 | 26 | DominioRepository.findAllDominio('tipoQuestionario').then(function(result) { |
| 27 | 27 | $scope.dominiosTipoQuestionario = result; |
| 28 | 28 | }); |
| 29 | - | |
| 29 | + | |
| 30 | 30 | // Limpa formulário para novo cadastro |
| 31 | 31 | $scope.resetForm = function() { |
| 32 | 32 | $scope.limparQuestionario(); |
| ... | ... | @@ -35,17 +35,18 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 35 | 35 | $scope.pgEdit = true; |
| 36 | 36 | $scope.isBloquear = false; |
| 37 | 37 | $scope.isDesbloquear = $scope.isBloquear; |
| 38 | + $scope.atualizarListaSizeSelect(); | |
| 38 | 39 | $timeout(function(){ |
| 39 | 40 | $scope.questionarioForm.$submitted = false; |
| 40 | 41 | $scope.questionarioForm.$setPristine(); |
| 41 | 42 | }); |
| 42 | 43 | }; |
| 43 | - | |
| 44 | + | |
| 44 | 45 | // Atualiza pagina de pesquisa |
| 45 | 46 | $scope.atualizaPaginaPesquisa = function () { |
| 46 | 47 | angular.element('#searchQuestionario').scope().fetchResult(); |
| 47 | 48 | }; |
| 48 | - | |
| 49 | + | |
| 49 | 50 | $scope.addPossivelResposta = function() { |
| 50 | 51 | var resposta = $scope.possivelResposta.resposta; |
| 51 | 52 | if ($scope.questionarioPergunta.respostasEscolha.length > 10) { |
| ... | ... | @@ -59,7 +60,7 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 59 | 60 | $scope.possivelResposta = {}; |
| 60 | 61 | } |
| 61 | 62 | }; |
| 62 | - | |
| 63 | + | |
| 63 | 64 | $scope.addQuestao = function() { |
| 64 | 65 | var questao = angular.copy($scope.questionarioPergunta); |
| 65 | 66 | if (!questao.questao || !questao.dominioTipoResposta) { |
| ... | ... | @@ -87,9 +88,10 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 87 | 88 | $scope.questionario.questoes.push(questao); |
| 88 | 89 | } |
| 89 | 90 | $scope.limparPergunta(); |
| 91 | + $scope.atualizarListaSizeSelect(); | |
| 90 | 92 | } |
| 91 | 93 | }; |
| 92 | - | |
| 94 | + | |
| 93 | 95 | $scope.mudaTipoResposta = function() { |
| 94 | 96 | $timeout(function(){ |
| 95 | 97 | angular.forEach($scope.dominiosTipoResposta, function (item) { |
| ... | ... | @@ -99,24 +101,24 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 99 | 101 | }); |
| 100 | 102 | }); |
| 101 | 103 | }; |
| 102 | - | |
| 104 | + | |
| 103 | 105 | // Bloqueia o questionario |
| 104 | 106 | $scope.confirmarBloqueioQuestionario = function(){ |
| 105 | - | |
| 107 | + | |
| 106 | 108 | if(!$scope.questionario.dataBloqueio){ |
| 107 | - | |
| 109 | + | |
| 108 | 110 | $scope.showAlert('error', $translate.instant('MSG.MG011')); |
| 109 | 111 | }else{ |
| 110 | - | |
| 112 | + | |
| 111 | 113 | try{ |
| 112 | - | |
| 114 | + | |
| 113 | 115 | $scope.setLoadingSalva(true); |
| 114 | - | |
| 116 | + | |
| 115 | 117 | QuestionarioRepository.save($scope.questionario).then(function(result){ |
| 116 | 118 | $scope.setLoadingSalva(false); |
| 117 | - | |
| 119 | + | |
| 118 | 120 | $scope.questionario = result.originalElement; |
| 119 | - | |
| 121 | + | |
| 120 | 122 | $scope.isBloquear = false; |
| 121 | 123 | $scope.isDesbloquear = !$scope.isBloquear; |
| 122 | 124 | $scope.edit = false; |
| ... | ... | @@ -124,56 +126,56 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 124 | 126 | }); |
| 125 | 127 | }catch(exception){ |
| 126 | 128 | $scope.setLoadingSalva(false); |
| 127 | - } | |
| 129 | + } | |
| 128 | 130 | } |
| 129 | 131 | }; |
| 130 | 132 | |
| 131 | - // Desbloqueia o questionario | |
| 133 | + // Desbloqueia o questionario | |
| 132 | 134 | $scope.desbloquear = function() { |
| 133 | 135 | $scope.setLoadingSalva(true); |
| 134 | - | |
| 136 | + | |
| 135 | 137 | $scope.questionario.dataBloqueio = null; |
| 136 | - | |
| 138 | + | |
| 137 | 139 | QuestionarioRepository.save($scope.questionario).then(function(result){ |
| 138 | 140 | $scope.setLoadingSalva(false); |
| 139 | - | |
| 141 | + | |
| 140 | 142 | $scope.questionario = result.originalElement; |
| 141 | - | |
| 143 | + | |
| 142 | 144 | $scope.edit = true; |
| 143 | 145 | $scope.isBloquear = true; |
| 144 | 146 | $scope.isDesbloquear = !$scope.isBloquear; |
| 145 | 147 | $scope.showAlert("success", $translate.instant('MSG.SUCESSO_DESBLOQUEIO_QUESTIONARIO')); |
| 146 | 148 | }); |
| 147 | 149 | }; |
| 148 | - | |
| 150 | + | |
| 149 | 151 | // MODAL QUE CONFIRMA REMOVER DO Questionário |
| 150 | 152 | $scope.remove = function(questionario){ |
| 151 | - $scope.$openModalConfirm({ | |
| 152 | - message: $translate.instant('MSG.CONFIRMA_EXCLUIR_QUESTIONARIO'), | |
| 153 | + $scope.$openModalConfirm({ | |
| 154 | + message: $translate.instant('MSG.CONFIRMA_EXCLUIR_QUESTIONARIO'), | |
| 153 | 155 | callback: function () { |
| 154 | 156 | QuestionarioRepository.remove(questionario).then(function() { |
| 155 | 157 | $scope.limparQuestionario(); |
| 156 | - | |
| 158 | + | |
| 157 | 159 | $scope.$modalConfirmInstance.dismiss('cancel'); |
| 158 | 160 | $scope.showAlert("success", $translate.instant('MSG.SUCESSO_EXCLUSAO_QUESTIONARIO')); |
| 159 | 161 | angular.element('#searchQuestionario').scope().fetchResult(); |
| 160 | - | |
| 162 | + | |
| 161 | 163 | $scope.resetForm(); |
| 162 | 164 | }); |
| 163 | 165 | } |
| 164 | 166 | }); |
| 165 | 167 | }; |
| 166 | - | |
| 168 | + | |
| 167 | 169 | // SALVA O QUESTIONARIO |
| 168 | 170 | $scope.saveOrUpdate = function(){ |
| 169 | 171 | $scope.questionarioForm.$submitted = true; |
| 170 | - | |
| 172 | + | |
| 171 | 173 | try{ |
| 172 | 174 | //verifica se o formulario está valido para salvar |
| 173 | 175 | if($scope.questionarioForm.$valid){ |
| 174 | - | |
| 176 | + | |
| 175 | 177 | $scope.setLoadingSalva(true); |
| 176 | - | |
| 178 | + | |
| 177 | 179 | QuestionarioRepository.save($scope.questionario).then(function(result) { |
| 178 | 180 | $scope.questionario = result.originalElement; |
| 179 | 181 | $scope.isBloquear = !$scope.questionario.dataBloqueio; |
| ... | ... | @@ -191,7 +193,7 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 191 | 193 | $scope.setLoadingSalva(false); |
| 192 | 194 | } |
| 193 | 195 | }; |
| 194 | - | |
| 196 | + | |
| 195 | 197 | // Limpa a pergunta preenchida |
| 196 | 198 | $scope.limparPergunta = function(){ |
| 197 | 199 | if ($scope.editTipoResposta) { |
| ... | ... | @@ -199,10 +201,10 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 199 | 201 | respostasEscolha : [] |
| 200 | 202 | }; |
| 201 | 203 | } else { |
| 202 | - delete $scope.questionarioPergunta.questao; | |
| 204 | + delete $scope.questionarioPergunta.questao; | |
| 203 | 205 | } |
| 204 | 206 | }; |
| 205 | - | |
| 207 | + | |
| 206 | 208 | // Limpa o formulario preenchido |
| 207 | 209 | $scope.limparQuestionario = function(){ |
| 208 | 210 | $scope.questionario = { |
| ... | ... | @@ -218,19 +220,20 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 218 | 220 | |
| 219 | 221 | QuestionarioRepository.get($scope.$parent.idObejct).then(function(result) { |
| 220 | 222 | $scope.questionario = result.originalElement; |
| 221 | - | |
| 223 | + $scope.atualizarListaSizeSelect(); | |
| 222 | 224 | $scope.setLoading(false); |
| 223 | 225 | }); |
| 224 | 226 | } |
| 225 | - | |
| 227 | + | |
| 226 | 228 | // Seleciona todos as questoes na lista |
| 227 | 229 | $scope.checkAll = function(value) { |
| 228 | 230 | angular.forEach($scope.questionario.questoes, function (item, key) { |
| 229 | 231 | item.$selected = value; |
| 230 | 232 | item.$index = key; |
| 231 | 233 | }); |
| 234 | + $scope.atualizarListaSizeSelect(); | |
| 232 | 235 | }; |
| 233 | - | |
| 236 | + | |
| 234 | 237 | // Seleciona todos as respostas na lista |
| 235 | 238 | $scope.checkAllRespostas = function(value) { |
| 236 | 239 | angular.forEach($scope.questionarioPergunta.respostasEscolha, function (item, key) { |
| ... | ... | @@ -238,7 +241,7 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 238 | 241 | item.$index = key; |
| 239 | 242 | }); |
| 240 | 243 | }; |
| 241 | - | |
| 244 | + | |
| 242 | 245 | // Abre modal perguntando se deseja excluir e exclui os elementos selecionados na lista de questões caso confirmado |
| 243 | 246 | $scope.prepararExcluirQuestoesSelecionados = function(){ |
| 244 | 247 | var lista = recuperarQuestoesSelecionadas(); |
| ... | ... | @@ -256,6 +259,7 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 256 | 259 | } |
| 257 | 260 | }); |
| 258 | 261 | }); |
| 262 | + $scope.atualizarListaSizeSelect(); | |
| 259 | 263 | $scope.$modalConfirmInstance.dismiss('cancel'); |
| 260 | 264 | } |
| 261 | 265 | }); |
| ... | ... | @@ -264,7 +268,7 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 264 | 268 | return ; |
| 265 | 269 | } |
| 266 | 270 | }; |
| 267 | - | |
| 271 | + | |
| 268 | 272 | $scope.prepararExcluirRespostasSelecionadas = function() { |
| 269 | 273 | var lista = recuperarRespostasSelecionadas(); |
| 270 | 274 | if(lista.length > 0){ |
| ... | ... | @@ -289,7 +293,7 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 289 | 293 | return ; |
| 290 | 294 | } |
| 291 | 295 | }; |
| 292 | - | |
| 296 | + | |
| 293 | 297 | $scope.editQuestao = function() { |
| 294 | 298 | var lista = recuperarQuestoesSelecionadas(); |
| 295 | 299 | if (lista.length === 0) { |
| ... | ... | @@ -302,7 +306,7 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 302 | 306 | } |
| 303 | 307 | $scope.questionarioPergunta = lista[0]; |
| 304 | 308 | }; |
| 305 | - | |
| 309 | + | |
| 306 | 310 | //Recupera todas as questões selecionadas na lista |
| 307 | 311 | var recuperarQuestoesSelecionadas = function(){ |
| 308 | 312 | var lista = []; |
| ... | ... | @@ -313,7 +317,7 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 313 | 317 | }); |
| 314 | 318 | return lista; |
| 315 | 319 | }; |
| 316 | - | |
| 320 | + | |
| 317 | 321 | //Recupera todas as possiveis respostas selecionadas na lista |
| 318 | 322 | var recuperarRespostasSelecionadas = function(){ |
| 319 | 323 | var lista = []; |
| ... | ... | @@ -324,14 +328,14 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 324 | 328 | }); |
| 325 | 329 | return lista; |
| 326 | 330 | }; |
| 327 | - | |
| 331 | + | |
| 328 | 332 | // Consulta entidade e mostra no formulario |
| 329 | 333 | $scope.getQuestionario = function(questionario, edit){ |
| 330 | 334 | $scope.setLoadingGet(true); |
| 331 | - | |
| 335 | + | |
| 332 | 336 | QuestionarioRepository.get(questionario.id).then(function(result) { |
| 333 | 337 | $scope.questionario = result.originalElement; |
| 334 | - | |
| 338 | + | |
| 335 | 339 | if($scope.questionario.dataBloqueio === null || $scope.questionario.dataBloqueio === undefined){ |
| 336 | 340 | $scope.isBloquear = true; |
| 337 | 341 | $scope.isDesbloquear = !$scope.isBloquear; |
| ... | ... | @@ -343,12 +347,12 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 343 | 347 | $scope.edit = false; |
| 344 | 348 | $scope.editTipoResposta = false; |
| 345 | 349 | } |
| 346 | - | |
| 350 | + $scope.atualizarListaSizeSelect(); | |
| 347 | 351 | $scope.pgEdit = edit; |
| 348 | 352 | $scope.setLoading(false); |
| 349 | 353 | }); |
| 350 | 354 | }; |
| 351 | - | |
| 355 | + | |
| 352 | 356 | //Watch para calcular valor unitario |
| 353 | 357 | $scope.$watch('questionario.dominioTipoQuestionario', function() { |
| 354 | 358 | $timeout(function() { |
| ... | ... | @@ -359,7 +363,7 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 359 | 363 | $scope.showAlert('warning', $translate.instant('MSG.CADASTRO_CHECKLIST_ANALISE_SOLUCAO')); |
| 360 | 364 | } |
| 361 | 365 | }); |
| 362 | - | |
| 366 | + | |
| 363 | 367 | $scope.questionarioPergunta.dominioTipoResposta = {codigo : 4}; |
| 364 | 368 | $scope.editTipoResposta = false; |
| 365 | 369 | $scope.questionarioPergunta.respostasEscolha = [{resposta : $translate.instant('LABEL.SIM')}, |
| ... | ... | @@ -379,6 +383,15 @@ citApp.controller('QuestionarioController', ['$scope', 'QuestionarioRepository', |
| 379 | 383 | } |
| 380 | 384 | }); |
| 381 | 385 | }); |
| 386 | + | |
| 387 | + $scope.atualizarListaSizeSelect = function() { | |
| 388 | + if(!$scope.listaSize){ | |
| 389 | + $scope.listaSize = 0; | |
| 390 | + }; | |
| 391 | + var lista = recuperarQuestoesSelecionadas(); | |
| 392 | + $scope.listaSize = lista.length; | |
| 393 | + }; | |
| 394 | + | |
| 382 | 395 | }]); |
| 383 | 396 | |
| 384 | 397 | ... | ... |
cit-contratos-web/src/main/webapp/html/cronogramaExecucao/cronogramaExecucaoEdit.html
| ... | ... | @@ -127,31 +127,38 @@ |
| 127 | 127 | <div class="row margin-top"> |
| 128 | 128 | <div class="col-sm-12"> |
| 129 | 129 | <div class="panel panel-default"> |
| 130 | - <div class="panel-heading clearfix"> | |
| 131 | - <button title="{{$translate.instant('LABEL.ADICIONAR')}}" alt="{{$translate.instant('LABEL.ADICIONAR')}}" class="btn btn-clear" ng-show="edit" ng-click="openModalItensCronograma();" type="button" | |
| 132 | - ng-disabled="cronogramaExecucao.id"> | |
| 133 | - <i class="fa fa-plus-circle yellow-dark"></i> | |
| 134 | - <translate>LABEL.ADICIONAR</translate> </a> | |
| 135 | - </button> | |
| 136 | - | |
| 137 | - <button title="{{$translate.instant('LABEL.VISUALIZAR')}}" alt="{{$translate.instant('LABEL.VISUALIZAR')}}" class="btn btn-clear" type="button" ng-show="cronogramaExecucao.itensCronogramaExecucao.length > 0" | |
| 138 | - ng-click="editItemCronogramaExecucao(false)"> | |
| 139 | - <i class="fa fa-search blue"></i> | |
| 140 | - <translate>LABEL.VISUALIZAR</translate> | |
| 141 | - </button> | |
| 142 | - | |
| 143 | - <button title="{{$translate.instant('LABEL.EDITAR')}}" alt="{{$translate.instant('LABEL.EDITAR')}}" class="btn btn-clear" ng-show="edit && cronogramaExecucao.itensCronogramaExecucao.length > 0" | |
| 144 | - ng-click="editItemCronogramaExecucao(true)"> | |
| 145 | - <i class="fa fa-pencil blue"></i> | |
| 146 | - <translate>LABEL.EDITAR</translate> | |
| 147 | - </button> | |
| 148 | - | |
| 149 | - <button title="{{$translate.instant('LABEL.REMOVER')}}" alt="{{$translate.instant('LABEL.REMOVER')}}" class="btn btn-clear" type="button" ng-show="edit && cronogramaExecucao.itensCronogramaExecucao.length > 0" | |
| 150 | - ng-click="excluirItensCronogramaSelecionados()" ng-disabled="cronogramaExecucao.id"> | |
| 151 | - <i class="fa fa-times red"></i> | |
| 152 | - <translate>LABEL.REMOVER</translate> | |
| 153 | - </button> | |
| 130 | + <div class="panel-heading clearfix col-sm-12 text-left"> | |
| 131 | + | |
| 132 | + <div class="col-sm-1" tooltip="{{ !edit ? $translate.instant('PORTAL.MSG.ADICIONAR_NAO_PERMITIDO_ACAO_VISUALIZAR') : '' }}"> | |
| 133 | + <button title="{{$translate.instant('LABEL.ADICIONAR')}}" alt="{{$translate.instant('LABEL.ADICIONAR')}}" class="btn btn-clear" ng-disabled="!edit" ng-click="openModalItensCronograma();" type="button" | |
| 134 | + ng-disabled="cronogramaExecucao.id"> | |
| 135 | + <i class="fa fa-plus-circle yellow-dark"></i> | |
| 136 | + <translate>LABEL.ADICIONAR</translate> </a> | |
| 137 | + </button> | |
| 138 | + </div> | |
| 139 | + <div class="col-sm-1" tooltip="{{ listaSize == 0 ? $translate.instant('PORTAL.MSG.VISUALIZAR_SELECIONE_ITEM') : listaSize > 1 ? $translate.instant('PORTAL.MSG.VISUALIZAR_DISABLED_SELECIONADOS') : '' }}"> | |
| 140 | + <button title="{{$translate.instant('LABEL.VISUALIZAR')}}" alt="{{$translate.instant('LABEL.VISUALIZAR')}}" class="btn btn-clear" type="button" ng-disabled="listaSize != 1" | |
| 141 | + ng-click="editItemCronogramaExecucao(false)"> | |
| 142 | + <i class="fa fa-search blue"></i> | |
| 143 | + <translate>LABEL.VISUALIZAR</translate> | |
| 144 | + </button> | |
| 145 | + </div> | |
| 146 | + <div class="col-sm-1" tooltip="{{ listaSize == 0 && edit ? $translate.instant('PORTAL.MSG.EDITAR_SELECIONE_ITEM') : listaSize > 1 ? $translate.instant('PORTAL.MSG.EDITAR_DISABLED_SELECIONADOS') : !edit ? $translate.instant('PORTAL.MSG.EDITAR_NAO_PERMITIDO_ACAO_VISUALIZAR') : '' }}"> | |
| 147 | + <button title="{{$translate.instant('LABEL.EDITAR')}}" alt="{{$translate.instant('LABEL.EDITAR')}}" class="btn btn-clear" ng-disabled="listaSize != 1 || !edit" | |
| 148 | + ng-click="editItemCronogramaExecucao(true)"> | |
| 149 | + <i class="fa fa-pencil blue"></i> | |
| 150 | + <translate>LABEL.EDITAR</translate> | |
| 151 | + </button> | |
| 152 | + </div> | |
| 153 | + <div class="col-sm-1" tooltip="{{ listaSize == 0 && edit ? $translate.instant('PORTAL.MSG.EXCLUIR_SELECIONE_ITEM') : !edit ? $translate.instant('PORTAL.MSG.EXCLUIR_NAO_PERMITIDO_ACAO_VISUALIZAR') : '' }}"> | |
| 154 | + <button title="{{$translate.instant('LABEL.REMOVER')}}" alt="{{$translate.instant('LABEL.REMOVER')}}" class="btn btn-clear" type="button" ng-disabled="listaSize == 0 || !edit || cronogramaExecucao.id" | |
| 155 | + ng-click="excluirItensCronogramaSelecionados()"> | |
| 156 | + <i class="fa fa-times red"></i> | |
| 157 | + <translate>LABEL.REMOVER</translate> | |
| 158 | + </button> | |
| 159 | + </div> | |
| 154 | 160 | </div> |
| 161 | + | |
| 155 | 162 | <table class="table table-striped table-bordered table-hover"> |
| 156 | 163 | <thead> |
| 157 | 164 | <tr> |
| ... | ... | @@ -172,7 +179,7 @@ |
| 172 | 179 | <tbody> |
| 173 | 180 | <tr ng-repeat="item in cronogramaExecucao.itensCronogramaExecucao" ng-show="cronogramaExecucao.itensCronogramaExecucao.length > 0"> |
| 174 | 181 | <td class="text-center"> |
| 175 | - <input type="checkbox" ng-click="item.$index = $index" ng-checked="item.$checked" ng-model="item.$checked" /> | |
| 182 | + <input type="checkbox" ng-click="item.$index = $index; atualizarListaSizeSelect()" ng-checked="item.$checked" ng-model="item.$checked" /> | |
| 176 | 183 | </td> |
| 177 | 184 | <td class="text-justify"> |
| 178 | 185 | {{ item.contratoItem.estudoTecnicoBemServicoSolucao.nomeBemServicoSolucao }} | ... | ... |
cit-contratos-web/src/main/webapp/html/ordemFornecimento/ordemFornecimentoEdit.html
| ... | ... | @@ -132,36 +132,43 @@ |
| 132 | 132 | <div class="row margin-top"> |
| 133 | 133 | <div class="col-sm-12"> |
| 134 | 134 | <div class="panel panel-default"> |
| 135 | - <div class="panel-heading clearfix"> | |
| 136 | - <button title="{{$translate.instant('LABEL.ADICIONAR')}}" alt="{{$translate.instant('LABEL.ADICIONAR')}}" class="btn btn-clear" type="button" ng-show="edit && !ordemFornecimento.id" | |
| 137 | - ng-click="openModalItensBensServicos();"> | |
| 138 | - <i class="fa fa-plus-circle yellow-dark"></i> | |
| 139 | - <translate>LABEL.ADICIONAR</translate> | |
| 140 | - </button> | |
| 141 | - | |
| 142 | - <button title="{{$translate.instant('LABEL.VISUALIZAR')}}" alt="{{$translate.instant('LABEL.VISUALIZAR')}}" class="btn btn-clear" type="button" | |
| 143 | - ng-click="abrirItensBensServicos(false)"> | |
| 144 | - <i class="fa fa-search blue"></i> | |
| 145 | - <translate>LABEL.VISUALIZAR</translate> | |
| 146 | - </button> | |
| 147 | - | |
| 148 | - <button title="{{$translate.instant('LABEL.EDITAR')}}" alt="{{$translate.instant('LABEL.EDITAR')}}" ng-show="edit" class="btn btn-clear" type="button" | |
| 149 | - ng-click="abrirItensBensServicos(true)"> | |
| 150 | - <i class="fa fa-pencil blue"></i> | |
| 151 | - <translate>LABEL.EDITAR</translate> | |
| 152 | - </button> | |
| 153 | - | |
| 154 | - <button title="{{$translate.instant('LABEL.REMOVER')}}" alt="{{$translate.instant('LABEL.REMOVER')}}" ng-show="edit && !ordemFornecimento.id" class="btn btn-clear" type="button" | |
| 155 | - ng-click="removerItensBensServicos()"> | |
| 156 | - <i class="fa fa-times red"></i> | |
| 157 | - <translate>LABEL.REMOVER</translate> | |
| 158 | - </button> | |
| 135 | + <div class="panel-heading clearfix col-sm-12 text-left"> | |
| 136 | + | |
| 137 | + <div class="col-sm-1" tooltip="{{ !edit ? $translate.instant('PORTAL.MSG.ADICIONAR_NAO_PERMITIDO_ACAO_VISUALIZAR') : '' }}"> | |
| 138 | + <button title="{{$translate.instant('LABEL.ADICIONAR')}}" alt="{{$translate.instant('LABEL.ADICIONAR')}}" class="btn btn-clear" type="button" ng-disabled="!edit" | |
| 139 | + ng-click="openModalItensBensServicos();"> | |
| 140 | + <i class="fa fa-plus-circle yellow-dark"></i> | |
| 141 | + <translate>LABEL.ADICIONAR</translate> | |
| 142 | + </button> | |
| 143 | + </div> | |
| 144 | + <div class="col-sm-1" tooltip="{{ listaSize == 0 ? $translate.instant('PORTAL.MSG.VISUALIZAR_SELECIONE_ITEM') : listaSize > 1 ? $translate.instant('PORTAL.MSG.VISUALIZAR_DISABLED_SELECIONADOS') : '' }}"> | |
| 145 | + <button title="{{$translate.instant('LABEL.VISUALIZAR')}}" alt="{{$translate.instant('LABEL.VISUALIZAR')}}" class="btn btn-clear" type="button" ng-disabled="listaSize != 1" | |
| 146 | + ng-click="abrirItensBensServicos(false)"> | |
| 147 | + <i class="fa fa-search blue"></i> | |
| 148 | + <translate>LABEL.VISUALIZAR</translate> | |
| 149 | + </button> | |
| 150 | + </div> | |
| 151 | + <div class="col-sm-1" tooltip="{{ listaSize == 0 && edit ? $translate.instant('PORTAL.MSG.EDITAR_SELECIONE_ITEM') : listaSize > 1 ? $translate.instant('PORTAL.MSG.EDITAR_DISABLED_SELECIONADOS') : !edit ? $translate.instant('PORTAL.MSG.EDITAR_NAO_PERMITIDO_ACAO_VISUALIZAR') : '' }}"> | |
| 152 | + <button title="{{$translate.instant('LABEL.EDITAR')}}" alt="{{$translate.instant('LABEL.EDITAR')}}" ng-disabled="listaSize != 1 || !edit" class="btn btn-clear" type="button" | |
| 153 | + ng-click="abrirItensBensServicos(true)"> | |
| 154 | + <i class="fa fa-pencil blue"></i> | |
| 155 | + <translate>LABEL.EDITAR</translate> | |
| 156 | + </button> | |
| 157 | + </div> | |
| 158 | + <div class="col-sm-1" tooltip="{{ listaSize == 0 && edit ? $translate.instant('PORTAL.MSG.EXCLUIR_SELECIONE_ITEM') : !edit ? $translate.instant('PORTAL.MSG.EXCLUIR_NAO_PERMITIDO_ACAO_VISUALIZAR') : '' }}"> | |
| 159 | + <button title="{{$translate.instant('LABEL.REMOVER')}}" alt="{{$translate.instant('LABEL.REMOVER')}}" ng-disabled="listaSize == 0 || !edit || ordemFornecimento.id" class="btn btn-clear" type="button" | |
| 160 | + ng-click="removerItensBensServicos()"> | |
| 161 | + <i class="fa fa-times red"></i> | |
| 162 | + <translate>LABEL.REMOVER</translate> | |
| 163 | + </button> | |
| 164 | + </div> | |
| 159 | 165 | </div><!-- .panel-heading --> |
| 166 | + | |
| 160 | 167 | <table class="table table-bordered table-striped"> |
| 161 | 168 | <thead> |
| 162 | 169 | <tr> |
| 163 | 170 | <th class="text-center" width="20px"> |
| 164 | - <input type="checkbox" ng-model="selectedAllItens" ng-click="checkAllItens(selectedAllItens);" ng-show="edit"/> | |
| 171 | + <input type="checkbox" ng-model="selectedAllItens" ng-click="checkAll(selectedAllItens);" ng-show="edit"/> | |
| 165 | 172 | </th> |
| 166 | 173 | <th width="3%" class="text-center"></th> |
| 167 | 174 | <th width="30%" class="text-center"><translate>LABEL.NOME_ITEM</translate></th> |
| ... | ... | @@ -178,7 +185,7 @@ |
| 178 | 185 | </tr> |
| 179 | 186 | <tr ng-repeat="item in ordemFornecimento.itensBensServicos"> |
| 180 | 187 | <td class="text-center"> |
| 181 | - <input type="checkbox" name="itemChecked" ng-model="item.$checked" /> | |
| 188 | + <input type="checkbox" name="itemChecked" ng-model="item.$checked" ng-click="atualizarListaSizeSelect()"/> | |
| 182 | 189 | </td> |
| 183 | 190 | <td>{{ $index + 1 }}</td> |
| 184 | 191 | <td title="{{item.itemBemServico.estudoTecnicoBemServicoSolucao.nomeBemServicoSolucao}}">{{ splitText(item.itemBemServico.estudoTecnicoBemServicoSolucao.nomeBemServicoSolucao, 70) }}</td> | ... | ... |
cit-contratos-web/src/main/webapp/html/questionario/questionarioEdit.html
| ... | ... | @@ -178,21 +178,26 @@ |
| 178 | 178 | </legend> |
| 179 | 179 | <div class="col-sm-12"> |
| 180 | 180 | <div class="panel panel-default"> |
| 181 | - <div class="panel-heading clearfix"> | |
| 182 | - <button title="{{$translate.instant('LABEL.ADICIONAR')}}" alt="{{$translate.instant('LABEL.ADICIONAR')}}" class="btn btn-clear" ng-show="edit" ng-click="addQuestao()" type="button"> | |
| 183 | - <i class="fa fa-plus-circle yellow-dark"></i> | |
| 184 | - <translate>LABEL.ADICIONAR</translate> </a> | |
| 185 | - </button> | |
| 186 | - | |
| 187 | - <button title="{{$translate.instant('LABEL.EDITAR')}}" alt="{{$translate.instant('LABEL.EDITAR')}}" class="btn btn-clear" ng-show="edit" ng-click="editQuestao()"> | |
| 188 | - <i class="fa fa-pencil blue"></i> | |
| 189 | - <translate>LABEL.EDITAR</translate> | |
| 190 | - </button> | |
| 181 | + <div class="panel-heading clearfix col-sm-12 text-left"> | |
| 191 | 182 | |
| 192 | - <button title="{{$translate.instant('LABEL.REMOVER')}}" alt="{{$translate.instant('LABEL.REMOVER')}}" class="btn btn-clear" type="button" ng-click="prepararExcluirQuestoesSelecionados()" ng-show="edit"> | |
| 193 | - <i class="fa fa-times red"></i> | |
| 194 | - <translate>LABEL.REMOVER</translate> | |
| 195 | - </button> | |
| 183 | + <div class="col-sm-1" tooltip="{{ !edit ? $translate.instant('PORTAL.MSG.ADICIONAR_NAO_PERMITIDO_ACAO_VISUALIZAR') : '' }}"> | |
| 184 | + <button title="{{$translate.instant('LABEL.ADICIONAR')}}" alt="{{$translate.instant('LABEL.ADICIONAR')}}" class="btn btn-clear" ng-disabled="!edit" ng-click="addQuestao()" type="button"> | |
| 185 | + <i class="fa fa-plus-circle yellow-dark"></i> | |
| 186 | + <translate>LABEL.ADICIONAR</translate> </a> | |
| 187 | + </button> | |
| 188 | + </div> | |
| 189 | + <div class="col-sm-1" tooltip="{{ listaSize == 0 && edit ? $translate.instant('PORTAL.MSG.EDITAR_SELECIONE_ITEM') : listaSize > 1 ? $translate.instant('PORTAL.MSG.EDITAR_DISABLED_SELECIONADOS') : !edit ? $translate.instant('PORTAL.MSG.EDITAR_NAO_PERMITIDO_ACAO_VISUALIZAR') : '' }}"> | |
| 190 | + <button title="{{$translate.instant('LABEL.EDITAR')}}" alt="{{$translate.instant('LABEL.EDITAR')}}" class="btn btn-clear" ng-disabled="listaSize != 1 || !edit" ng-click="editQuestao()"> | |
| 191 | + <i class="fa fa-pencil blue"></i> | |
| 192 | + <translate>LABEL.EDITAR</translate> | |
| 193 | + </button> | |
| 194 | + </div> | |
| 195 | + <div class="col-sm-1" tooltip="{{ listaSize == 0 && edit ? $translate.instant('PORTAL.MSG.EXCLUIR_SELECIONE_ITEM') : !edit ? $translate.instant('PORTAL.MSG.EXCLUIR_NAO_PERMITIDO_ACAO_VISUALIZAR') : '' }}"> | |
| 196 | + <button title="{{$translate.instant('LABEL.REMOVER')}}" alt="{{$translate.instant('LABEL.REMOVER')}}" class="btn btn-clear" type="button" ng-click="prepararExcluirQuestoesSelecionados()" ng-disabled="listaSize == 0 || !edit"> | |
| 197 | + <i class="fa fa-times red"></i> | |
| 198 | + <translate>LABEL.REMOVER</translate> | |
| 199 | + </button> | |
| 200 | + </div> | |
| 196 | 201 | |
| 197 | 202 | </div><!-- .panel-heading --> |
| 198 | 203 | |
| ... | ... | @@ -216,7 +221,7 @@ |
| 216 | 221 | <tbody> |
| 217 | 222 | <tr ng-repeat="questao in questionario.questoes" ng-show="questionario.questoes.length > 0"> |
| 218 | 223 | <td class="text-center" ng-show="edit"> |
| 219 | - <input type="checkbox" ng-click="questao.$index = $index" ng-checked="questao.$selected" ng-model="questao.$selected" /> | |
| 224 | + <input type="checkbox" ng-click="questao.$index = $index; atualizarListaSizeSelect()" ng-checked="questao.$selected" ng-model="questao.$selected" /> | |
| 220 | 225 | </td> |
| 221 | 226 | <td> |
| 222 | 227 | {{ questao.questao }} | ... | ... |