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,7 +61,7 @@ import com.fasterxml.jackson.annotation.JsonView; | ||
| 61 | @AuditTable(value = "alm_rc_atenditem_aud") | 61 | @AuditTable(value = "alm_rc_atenditem_aud") |
| 62 | @Entity | 62 | @Entity |
| 63 | @Table(name = "alm_rc_atendimentoitem") | 63 | @Table(name = "alm_rc_atendimentoitem") |
| 64 | -@JsonIgnoreProperties({ "$info", "$verInfo", "$quantidade", "$locaisEstoque", "$hasError", "$somaQtdAtendida" }) | 64 | +@JsonIgnoreProperties({ "$info", "$verInfo", "$quantidade", "$locaisEstoque", "$hasError", "$somaQtdAtendida", "$hasErrorQtdAtendidaMaiorQtdRequisitada"}) |
| 65 | public class AtendimentoRequisicaoConsumoItem extends PersistentObjectAuditOrganizacao { | 65 | public class AtendimentoRequisicaoConsumoItem extends PersistentObjectAuditOrganizacao { |
| 66 | 66 | ||
| 67 | /** Atributo serialVersionUID. */ | 67 | /** Atributo serialVersionUID. */ |
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/controller/AtendimentoRequisicaoConsumoController.js
| @@ -462,7 +462,6 @@ citApp.controller( 'AtendimentoRequisicaoConsumoController', | @@ -462,7 +462,6 @@ citApp.controller( 'AtendimentoRequisicaoConsumoController', | ||
| 462 | }; | 462 | }; |
| 463 | 463 | ||
| 464 | $scope.validarQuantidadesAtendidas = function(){ | 464 | $scope.validarQuantidadesAtendidas = function(){ |
| 465 | - $scope.setLoading(true); | ||
| 466 | $scope.atendimentoRequisicaoConsumo.atendimentos = []; | 465 | $scope.atendimentoRequisicaoConsumo.atendimentos = []; |
| 467 | angular.copy($scope.atendimentos, $scope.atendimentoRequisicaoConsumo.atendimentos); | 466 | angular.copy($scope.atendimentos, $scope.atendimentoRequisicaoConsumo.atendimentos); |
| 468 | 467 | ||
| @@ -482,11 +481,8 @@ citApp.controller( 'AtendimentoRequisicaoConsumoController', | @@ -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,8 +493,7 @@ citApp.controller( 'AtendimentoRequisicaoConsumoController', | ||
| 497 | }); | 493 | }); |
| 498 | 494 | ||
| 499 | if(atendimentoItem.$somaQtdAtendida > atendimentoItem.requisicaoConsumoItem.quantidade){ | 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,6 +507,7 @@ citApp.controller( 'AtendimentoRequisicaoConsumoController', | ||
| 512 | atendimento.atendimentoRequisicaoConsumoItems.forEach(function(atendimentoItem){ | 507 | atendimento.atendimentoRequisicaoConsumoItems.forEach(function(atendimentoItem){ |
| 513 | atendimentoItem.atendimentoRequisicaoConsumoItemEnderecos.forEach(function(itemEndereco){ | 508 | atendimentoItem.atendimentoRequisicaoConsumoItemEnderecos.forEach(function(itemEndereco){ |
| 514 | atendimentoItem.$hasError = false; | 509 | atendimentoItem.$hasError = false; |
| 510 | + atendimentoItem.$hasErrorQtdAtendidaMaiorQtdRequisitada = false; | ||
| 515 | itemEndereco.$hasError = false; | 511 | itemEndereco.$hasError = false; |
| 516 | }); | 512 | }); |
| 517 | }); | 513 | }); |
| @@ -666,6 +662,7 @@ citApp.controller( 'AtendimentoRequisicaoConsumoController', | @@ -666,6 +662,7 @@ citApp.controller( 'AtendimentoRequisicaoConsumoController', | ||
| 666 | $scope.listaEnderecosSelect = angular.copy(enderecosItem); | 662 | $scope.listaEnderecosSelect = angular.copy(enderecosItem); |
| 667 | } | 663 | } |
| 668 | 664 | ||
| 665 | + $scope.listaEnderecosTemp = angular.copy(enderecosAdicionados); | ||
| 669 | $scope.listaEnderecosAdicionados = enderecosAdicionados; | 666 | $scope.listaEnderecosAdicionados = enderecosAdicionados; |
| 670 | $scope.$openModal('modal-atendimento-item-enderecos.html', 'md'); | 667 | $scope.$openModal('modal-atendimento-item-enderecos.html', 'md'); |
| 671 | } | 668 | } |
| @@ -714,5 +711,11 @@ citApp.controller( 'AtendimentoRequisicaoConsumoController', | @@ -714,5 +711,11 @@ citApp.controller( 'AtendimentoRequisicaoConsumoController', | ||
| 714 | $scope.showAlert('error', mensagemErro, " ", false); | 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,14 +80,14 @@ | ||
| 80 | </h2> | 80 | </h2> |
| 81 | <div class="widget-toolbar"> | 81 | <div class="widget-toolbar"> |
| 82 | <a href="#void" ng-click="widgetAtendimentoCollapsed = !widgetAtendimentoCollapsed"> | 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 | </a> | 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 | <i class="fa fa-trash-o bigger-130 red" tooltip="{{$translate.instant('ALMOXARIFADO.MSG.REMOVER_REQUISICAO_ATENDIMENTO')}}"></i> | 86 | <i class="fa fa-trash-o bigger-130 red" tooltip="{{$translate.instant('ALMOXARIFADO.MSG.REMOVER_REQUISICAO_ATENDIMENTO')}}"></i> |
| 87 | </a> | 87 | </a> |
| 88 | </div> | 88 | </div> |
| 89 | </div> | 89 | </div> |
| 90 | - <div collapse="!widgetAtendimentoCollapsed" class="widget-body"> | 90 | + <div collapse="atendimentos.length == 1 ? widgetAtendimentoCollapsed : !widgetAtendimentoCollapsed" class="widget-body"> |
| 91 | <div class="widget-main clearfix"> | 91 | <div class="widget-main clearfix"> |
| 92 | <div class="row"> | 92 | <div class="row"> |
| 93 | <div class="col-md-3"> | 93 | <div class="col-md-3"> |
| @@ -139,8 +139,8 @@ | @@ -139,8 +139,8 @@ | ||
| 139 | </thead> | 139 | </thead> |
| 140 | <tbody> | 140 | <tbody> |
| 141 | <tr ng-repeat-start="atendimentoRequisicaoConsumoItem in atendimento.atendimentoRequisicaoConsumoItems" | 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 | <td class="text-center" ng-show="edit"> | 145 | <td class="text-center" ng-show="edit"> |
| 146 | <button type="button" ng-click="atendimentoRequisicaoConsumoItem.$verInfo = !atendimentoRequisicaoConsumoItem.$verInfo"> | 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,7 +8,7 @@ | ||
| 8 | 8 | ||
| 9 | <button title="{{$translate.instant('LABEL.CANCELAR')}}" | 9 | <button title="{{$translate.instant('LABEL.CANCELAR')}}" |
| 10 | alt="{{$translate.instant('LABEL.CANCELAR')}}" | 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 | <i class="fa fa-times red"></i> | 12 | <i class="fa fa-times red"></i> |
| 13 | <translate>LABEL.CANCELAR</translate> | 13 | <translate>LABEL.CANCELAR</translate> |
| 14 | </button> | 14 | </button> |
| @@ -16,6 +16,22 @@ | @@ -16,6 +16,22 @@ | ||
| 16 | 16 | ||
| 17 | <div class="modal-body"> | 17 | <div class="modal-body"> |
| 18 | <legend style="font-size: 20px"> | 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 | <translate>ALMOXARIFADO.LABEL.ENDERECOS_ESTOQUE</translate> | 35 | <translate>ALMOXARIFADO.LABEL.ENDERECOS_ESTOQUE</translate> |
| 20 | </legend> | 36 | </legend> |
| 21 | 37 | ||
| @@ -49,7 +65,8 @@ | @@ -49,7 +65,8 @@ | ||
| 49 | </tr> | 65 | </tr> |
| 50 | </thead> | 66 | </thead> |
| 51 | <tbody ng-repeat="atendimentoRequisicaoConsumoItemEndereco in listaEnderecosAdicionados"> | 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 | <td class="text-center"><input type="checkbox" ng-checked="atendimentoRequisicaoConsumoItemEndereco.$checkedChBox" ng-model="atendimentoRequisicaoConsumoItemEndereco.$checkedChBox" /></td> | 70 | <td class="text-center"><input type="checkbox" ng-checked="atendimentoRequisicaoConsumoItemEndereco.$checkedChBox" ng-model="atendimentoRequisicaoConsumoItemEndereco.$checkedChBox" /></td> |
| 54 | <td class="text-center">{{atendimentoRequisicaoConsumoItemEndereco.materialLocalEstoque.endereco.descricao}}</td> | 71 | <td class="text-center">{{atendimentoRequisicaoConsumoItemEndereco.materialLocalEstoque.endereco.descricao}}</td> |
| 55 | <td class="text-center">{{atendimentoRequisicaoConsumoItemEndereco.materialLocalEstoque.quantidade}}</td> | 72 | <td class="text-center">{{atendimentoRequisicaoConsumoItemEndereco.materialLocalEstoque.quantidade}}</td> |