Commit 667b7376d0ac143112210923d88c5c13dd6536e6
1 parent
16dfde2e
Exists in
master
Correções atendimento requisição de consumo
Showing
4 changed files
with
34 additions
and
14 deletions
Show diff stats
cit-almoxarifado-api/src/main/java/br/com/centralit/api/model/AtendimentoRequisicaoConsumoItem.java
| ... | ... | @@ -61,7 +61,7 @@ import com.fasterxml.jackson.annotation.JsonView; |
| 61 | 61 | @AuditTable(value = "alm_rc_atenditem_aud") |
| 62 | 62 | @Entity |
| 63 | 63 | @Table(name = "alm_rc_atendimentoitem") |
| 64 | -@JsonIgnoreProperties({ "$info", "$verInfo", "$quantidade", "$locaisEstoque", "$hasError", "$somaQtdAtendida" }) | |
| 64 | +@JsonIgnoreProperties({ "$info", "$verInfo", "$quantidade", "$locaisEstoque", "$hasError", "$somaQtdAtendida", "$hasErrorQtdAtendidaMaiorQtdRequisitada"}) | |
| 65 | 65 | public class AtendimentoRequisicaoConsumoItem extends PersistentObjectAuditOrganizacao { |
| 66 | 66 | |
| 67 | 67 | /** Atributo serialVersionUID. */ | ... | ... |
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/controller/AtendimentoRequisicaoConsumoController.js
| ... | ... | @@ -462,7 +462,6 @@ citApp.controller( 'AtendimentoRequisicaoConsumoController', |
| 462 | 462 | }; |
| 463 | 463 | |
| 464 | 464 | $scope.validarQuantidadesAtendidas = function(){ |
| 465 | - $scope.setLoading(true); | |
| 466 | 465 | $scope.atendimentoRequisicaoConsumo.atendimentos = []; |
| 467 | 466 | angular.copy($scope.atendimentos, $scope.atendimentoRequisicaoConsumo.atendimentos); |
| 468 | 467 | |
| ... | ... | @@ -482,11 +481,8 @@ citApp.controller( 'AtendimentoRequisicaoConsumoController', |
| 482 | 481 | }); |
| 483 | 482 | }); |
| 484 | 483 | }); |
| 485 | - $scope.showAlert("error", result.mensagemErro, " ", false); | |
| 486 | - $scope.setLoading(false); | |
| 487 | 484 | } |
| 488 | 485 | |
| 489 | - $scope.setLoading(false); | |
| 490 | 486 | }); |
| 491 | 487 | } |
| 492 | 488 | |
| ... | ... | @@ -497,8 +493,7 @@ citApp.controller( 'AtendimentoRequisicaoConsumoController', |
| 497 | 493 | }); |
| 498 | 494 | |
| 499 | 495 | if(atendimentoItem.$somaQtdAtendida > atendimentoItem.requisicaoConsumoItem.quantidade){ |
| 500 | - atendimentoItem.$hasError = true; | |
| 501 | - $scope.showAlert("error", $translate.instant('ALMOXARIFADO.VALIDACAO.QUANTIDADE_ATENDIDA_MAIOR_REQUISITADA'), " ", false); | |
| 496 | + atendimentoItem.$hasErrorQtdAtendidaMaiorQtdRequisitada = true; | |
| 502 | 497 | } |
| 503 | 498 | } |
| 504 | 499 | |
| ... | ... | @@ -512,6 +507,7 @@ citApp.controller( 'AtendimentoRequisicaoConsumoController', |
| 512 | 507 | atendimento.atendimentoRequisicaoConsumoItems.forEach(function(atendimentoItem){ |
| 513 | 508 | atendimentoItem.atendimentoRequisicaoConsumoItemEnderecos.forEach(function(itemEndereco){ |
| 514 | 509 | atendimentoItem.$hasError = false; |
| 510 | + atendimentoItem.$hasErrorQtdAtendidaMaiorQtdRequisitada = false; | |
| 515 | 511 | itemEndereco.$hasError = false; |
| 516 | 512 | }); |
| 517 | 513 | }); |
| ... | ... | @@ -666,6 +662,7 @@ citApp.controller( 'AtendimentoRequisicaoConsumoController', |
| 666 | 662 | $scope.listaEnderecosSelect = angular.copy(enderecosItem); |
| 667 | 663 | } |
| 668 | 664 | |
| 665 | + $scope.listaEnderecosTemp = angular.copy(enderecosAdicionados); | |
| 669 | 666 | $scope.listaEnderecosAdicionados = enderecosAdicionados; |
| 670 | 667 | $scope.$openModal('modal-atendimento-item-enderecos.html', 'md'); |
| 671 | 668 | } |
| ... | ... | @@ -714,5 +711,11 @@ citApp.controller( 'AtendimentoRequisicaoConsumoController', |
| 714 | 711 | $scope.showAlert('error', mensagemErro, " ", false); |
| 715 | 712 | } |
| 716 | 713 | } |
| 714 | + | |
| 715 | + $scope.cancelarEdicaoModalEnderecos = function(){ | |
| 716 | + limparLinhasComErro(); | |
| 717 | + $scope.atendimentoItemEmEdicao.atendimentoRequisicaoConsumoItemEnderecos = $scope.listaEnderecosTemp; | |
| 718 | + $scope.$modalInstance.dismiss('cancel'); | |
| 719 | + } | |
| 717 | 720 | |
| 718 | 721 | }]); | ... | ... |
cit-almoxarifado-web/src/main/webapp/html/atendimentoRequisicaoConsumo/atendimentoRequisicaoConsumoEdit.html
| ... | ... | @@ -80,14 +80,14 @@ |
| 80 | 80 | </h2> |
| 81 | 81 | <div class="widget-toolbar"> |
| 82 | 82 | <a href="#void" ng-click="widgetAtendimentoCollapsed = !widgetAtendimentoCollapsed"> |
| 83 | - <i class="fa" ng-class="{'fa-chevron-up': widgetAtendimentoCollapsed, 'fa-chevron-down': !widgetAtendimentoCollapsed}"></i> | |
| 83 | + <i class="fa" ng-class="{'fa-chevron-up': atendimentos.length == 1 ? !widgetAtendimentoCollapsed : widgetAtendimentoCollapsed, 'fa-chevron-down': atendimentos.length == 1 ? widgetAtendimentoCollapsed : !widgetAtendimentoCollapsed}"></i> | |
| 84 | 84 | </a> |
| 85 | - <a href="#void" style="margin-left: 3px" ng-click="removerRequisicaoDoAtendimento($index)" ng-show="edit"> | |
| 85 | + <a href="#void" style="margin-left: 3px" ng-click="removerRequisicaoDoAtendimento($index)" ng-show="edit && atendimentos.length > 1"> | |
| 86 | 86 | <i class="fa fa-trash-o bigger-130 red" tooltip="{{$translate.instant('ALMOXARIFADO.MSG.REMOVER_REQUISICAO_ATENDIMENTO')}}"></i> |
| 87 | 87 | </a> |
| 88 | 88 | </div> |
| 89 | 89 | </div> |
| 90 | - <div collapse="!widgetAtendimentoCollapsed" class="widget-body"> | |
| 90 | + <div collapse="atendimentos.length == 1 ? widgetAtendimentoCollapsed : !widgetAtendimentoCollapsed" class="widget-body"> | |
| 91 | 91 | <div class="widget-main clearfix"> |
| 92 | 92 | <div class="row"> |
| 93 | 93 | <div class="col-md-3"> |
| ... | ... | @@ -139,8 +139,8 @@ |
| 139 | 139 | </thead> |
| 140 | 140 | <tbody> |
| 141 | 141 | <tr ng-repeat-start="atendimentoRequisicaoConsumoItem in atendimento.atendimentoRequisicaoConsumoItems" |
| 142 | - ng-class="atendimentoRequisicaoConsumoItem.$hasError ? 'danger' : ''" ng-hide="atendimentoRequisicaoConsumoItem.requisicaoConsumoItem.quantidade == atendimentoRequisicaoConsumoItem.requisicaoConsumoItem.quantidadeAtendida && !exibirCompletos && edit" | |
| 143 | - tooltip="{{atendimentoRequisicaoConsumoItem.$hasError ? $translate.instant('ALMOXARIFADO.VALIDACAO.SOMA_ITENS_ATENDER_MAIOR_ESTOQUE_TOOLTIP') : ''}}"> | |
| 142 | + ng-class="atendimentoRequisicaoConsumoItem.$hasError || atendimentoRequisicaoConsumoItem.$hasErrorQtdAtendidaMaiorQtdRequisitada ? 'danger' : ''" ng-hide="atendimentoRequisicaoConsumoItem.requisicaoConsumoItem.quantidade == atendimentoRequisicaoConsumoItem.requisicaoConsumoItem.quantidadeAtendida && !exibirCompletos && edit" | |
| 143 | + tooltip="{{atendimentoRequisicaoConsumoItem.$hasErrorQtdAtendidaMaiorQtdRequisitada ? $translate.instant('ALMOXARIFADO.VALIDACAO.QUANTIDADE_ATENDIDA_MAIOR_REQUISITADA') : (atendimentoRequisicaoConsumoItem.$hasError ? $translate.instant('ALMOXARIFADO.VALIDACAO.SOMA_ITENS_ATENDER_MAIOR_ESTOQUE_TOOLTIP') : '')}}"> | |
| 144 | 144 | |
| 145 | 145 | <td class="text-center" ng-show="edit"> |
| 146 | 146 | <button type="button" ng-click="atendimentoRequisicaoConsumoItem.$verInfo = !atendimentoRequisicaoConsumoItem.$verInfo"> | ... | ... |
cit-almoxarifado-web/src/main/webapp/html/atendimentoRequisicaoConsumo/dialog_atendimento_item_enderecos.html
| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | |
| 9 | 9 | <button title="{{$translate.instant('LABEL.CANCELAR')}}" |
| 10 | 10 | alt="{{$translate.instant('LABEL.CANCELAR')}}" |
| 11 | - ng-click="$dismiss('cancel');" class="btn btn-clear" type="button"> | |
| 11 | + ng-click="cancelarEdicaoModalEnderecos()" class="btn btn-clear" type="button"> | |
| 12 | 12 | <i class="fa fa-times red"></i> |
| 13 | 13 | <translate>LABEL.CANCELAR</translate> |
| 14 | 14 | </button> |
| ... | ... | @@ -16,6 +16,22 @@ |
| 16 | 16 | |
| 17 | 17 | <div class="modal-body"> |
| 18 | 18 | <legend style="font-size: 20px"> |
| 19 | + <translate>LABEL.MATERIAL</translate> | |
| 20 | + </legend> | |
| 21 | + | |
| 22 | + <div class="row"> | |
| 23 | + <div class="col-md-12"> | |
| 24 | + <input class="form-control" type="text" ng-disabled="true" ng-model="atendimentoItemEmEdicao.material.codigoEDescricao"> | |
| 25 | + </div> | |
| 26 | + </div> | |
| 27 | + | |
| 28 | + <div class="row"> | |
| 29 | + <div class="col-md-12"> | |
| 30 | + | |
| 31 | + </div> | |
| 32 | + </div> | |
| 33 | + | |
| 34 | + <legend style="font-size: 20px"> | |
| 19 | 35 | <translate>ALMOXARIFADO.LABEL.ENDERECOS_ESTOQUE</translate> |
| 20 | 36 | </legend> |
| 21 | 37 | |
| ... | ... | @@ -49,7 +65,8 @@ |
| 49 | 65 | </tr> |
| 50 | 66 | </thead> |
| 51 | 67 | <tbody ng-repeat="atendimentoRequisicaoConsumoItemEndereco in listaEnderecosAdicionados"> |
| 52 | - <tr ng-class="atendimentoRequisicaoConsumoItemEndereco.$hasError ? 'danger' : ''"> | |
| 68 | + <tr ng-class="atendimentoRequisicaoConsumoItemEndereco.$hasError || atendimentoRequisicaoConsumoItemEndereco.$hasErrorQtdAtendidaMaiorQtdRequisitada ? 'danger' : ''" | |
| 69 | + tooltip="{{atendimentoItemEmEdicao.$hasErrorQtdAtendidaMaiorQtdRequisitada ? $translate.instant('ALMOXARIFADO.VALIDACAO.QUANTIDADE_ATENDIDA_MAIOR_REQUISITADA') : (atendimentoRequisicaoConsumoItemEndereco.$hasError ? $translate.instant('ALMOXARIFADO.VALIDACAO.SOMA_ITENS_ATENDER_MAIOR_ESTOQUE_TOOLTIP') : '')}}"> | |
| 53 | 70 | <td class="text-center"><input type="checkbox" ng-checked="atendimentoRequisicaoConsumoItemEndereco.$checkedChBox" ng-model="atendimentoRequisicaoConsumoItemEndereco.$checkedChBox" /></td> |
| 54 | 71 | <td class="text-center">{{atendimentoRequisicaoConsumoItemEndereco.materialLocalEstoque.endereco.descricao}}</td> |
| 55 | 72 | <td class="text-center">{{atendimentoRequisicaoConsumoItemEndereco.materialLocalEstoque.quantidade}}</td> | ... | ... |