Commit e3c58f61b682f367e3935b44e1c82319c9121edc
1 parent
542d5d36
Exists in
master
Redmine #4783 Terminando reestruturação da primeira página do wizard da nova entrada de materiais
Showing
3 changed files
with
76 additions
and
6 deletions
Show diff stats
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/controller/EntradaAlmoxarifadoController.js
@@ -17,6 +17,7 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp | @@ -17,6 +17,7 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp | ||
17 | * Inicializa as datas do formulario de cadastro como data padrao hoje. | 17 | * Inicializa as datas do formulario de cadastro como data padrao hoje. |
18 | */ | 18 | */ |
19 | $scope.resetFormInicializarDatas = function(){ | 19 | $scope.resetFormInicializarDatas = function(){ |
20 | + $scope.resetForm(); | ||
20 | // Obtem estrutura almoxarifado padrao | 21 | // Obtem estrutura almoxarifado padrao |
21 | EstruturaOrganizacionalAlmoxarifadoRepository.getAlmoxarifadoPadrao($scope.usuarioLogado.organizacao.id).then(function(result){ | 22 | EstruturaOrganizacionalAlmoxarifadoRepository.getAlmoxarifadoPadrao($scope.usuarioLogado.organizacao.id).then(function(result){ |
22 | $scope.estruturaAlmoxarifadoPadrao = {}; | 23 | $scope.estruturaAlmoxarifadoPadrao = {}; |
@@ -25,7 +26,6 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp | @@ -25,7 +26,6 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp | ||
25 | } | 26 | } |
26 | $scope.resetForm(); | 27 | $scope.resetForm(); |
27 | $scope.entradaAlmoxarifado.dataRecebimento = $filter('date')(new Date(), "dd/MM/yyyy"); | 28 | $scope.entradaAlmoxarifado.dataRecebimento = $filter('date')(new Date(), "dd/MM/yyyy"); |
28 | - $scope.entradaAlmoxarifado.dataContabil = $filter('date')(new Date(), "dd/MM/yyyy"); | ||
29 | }); | 29 | }); |
30 | }; | 30 | }; |
31 | 31 | ||
@@ -687,9 +687,27 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp | @@ -687,9 +687,27 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp | ||
687 | }; | 687 | }; |
688 | //### FIM METODOS RELACIONADOS AOS RELATORIOS DE INVENTARIO ### | 688 | //### FIM METODOS RELACIONADOS AOS RELATORIOS DE INVENTARIO ### |
689 | 689 | ||
690 | - | ||
691 | - | ||
692 | - | 690 | + //Watch para controlar os tipos de recebimento |
691 | + $scope.$watch('entradaAlmoxarifado.dominioTipoEntrada', function() { | ||
692 | + $timeout(function() { | ||
693 | + if ($scope.entradaAlmoxarifado.dominioTipoEntrada && ($scope.entradaAlmoxarifado.dominioTipoEntrada.codigo == 1)) { | ||
694 | + $scope.dominiosTipoRecebimento = $scope.dominiosTipoRecebimentoOrcamentaria; | ||
695 | + if ($scope.entradaAlmoxarifado.dominioTipoRecebimento && $scope.entradaAlmoxarifado.dominioTipoRecebimento.codigo != CODIGO_DOMINIO_TIPO_RECEBIMENTO_COMPRA_ORCAMENTARIA) { | ||
696 | + delete $scope.entradaAlmoxarifado.dominioTipoRecebimento; | ||
697 | + } | ||
698 | + } else if ($scope.entradaAlmoxarifado.dominioTipoEntrada && ($scope.entradaAlmoxarifado.dominioTipoEntrada.codigo == 2)) { | ||
699 | + $scope.dominiosTipoRecebimento = $scope.dominiosTipoRecebimentoExtraOrcamentaria; | ||
700 | + if ($scope.entradaAlmoxarifado.dominioTipoRecebimento && $scope.entradaAlmoxarifado.dominioTipoRecebimento.codigo == CODIGO_DOMINIO_TIPO_RECEBIMENTO_COMPRA_ORCAMENTARIA) { | ||
701 | + delete $scope.entradaAlmoxarifado.dominioTipoRecebimento; | ||
702 | + } | ||
703 | + } else { | ||
704 | + $scope.dominiosTipoRecebimento = []; | ||
705 | + if ($scope.entradaAlmoxarifado.dominioTipoRecebimento) { | ||
706 | + delete $scope.entradaAlmoxarifado.dominioTipoRecebimento; | ||
707 | + } | ||
708 | + } | ||
709 | + }); | ||
710 | + }); | ||
693 | 711 | ||
694 | 712 | ||
695 | 713 | ||
@@ -755,14 +773,17 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp | @@ -755,14 +773,17 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp | ||
755 | if ($scope.step === 0) { | 773 | if ($scope.step === 0) { |
756 | if (!validStepDadosEntrada() && $scope.permitidoAvancar) { | 774 | if (!validStepDadosEntrada() && $scope.permitidoAvancar) { |
757 | $scope.entradaAlmoxarifadoForm.dadosEntradaForm.$submitted = true; | 775 | $scope.entradaAlmoxarifadoForm.dadosEntradaForm.$submitted = true; |
776 | + $scope.permitidoAvancar = false; | ||
758 | } | 777 | } |
759 | } else if ($scope.step === 1) { | 778 | } else if ($scope.step === 1) { |
760 | if (!validStepMateriais() && $scope.permitidoAvancar) { | 779 | if (!validStepMateriais() && $scope.permitidoAvancar) { |
761 | $scope.entradaAlmoxarifadoForm.materiaisForm.$submitted = true; | 780 | $scope.entradaAlmoxarifadoForm.materiaisForm.$submitted = true; |
781 | + $scope.permitidoAvancar = false; | ||
762 | } | 782 | } |
763 | } else if ($scope.step === 2) { | 783 | } else if ($scope.step === 2) { |
764 | if (!validStepDocumentos() && $scope.permitidoAvancar) { | 784 | if (!validStepDocumentos() && $scope.permitidoAvancar) { |
765 | $scope.entradaAlmoxarifadoForm.documentosForm.$submitted = true; | 785 | $scope.entradaAlmoxarifadoForm.documentosForm.$submitted = true; |
786 | + $scope.permitidoAvancar = false; | ||
766 | } | 787 | } |
767 | } else if ($scope.step === 3) { | 788 | } else if ($scope.step === 3) { |
768 | $scope.entradaAlmoxarifadoForm.observacoesForm.$submitted = true; | 789 | $scope.entradaAlmoxarifadoForm.observacoesForm.$submitted = true; |
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/controller/EntradaAlmoxarifadoListController.js
@@ -4,7 +4,7 @@ citApp.controller('EntradaAlmoxarifadoListController', ['$scope', 'EntradaAlmoxa | @@ -4,7 +4,7 @@ citApp.controller('EntradaAlmoxarifadoListController', ['$scope', 'EntradaAlmoxa | ||
4 | $scope.$showAdvancedFilters = false; | 4 | $scope.$showAdvancedFilters = false; |
5 | 5 | ||
6 | $scope.resetForm = function() { | 6 | $scope.resetForm = function() { |
7 | - angular.element("#editEntradaAlmoxarifado").scope().resetFormInicializarDatas(); | 7 | + angular.element("#entradaAlmoxarifadoControllerId").scope().resetFormInicializarDatas(); |
8 | }; | 8 | }; |
9 | 9 | ||
10 | $scope.headers = [ {title : $translate.instant('ALMOXARIFADO.LABEL.NOTA_RECEBIMENTO'), value : 'notaRecebimento' } , | 10 | $scope.headers = [ {title : $translate.instant('ALMOXARIFADO.LABEL.NOTA_RECEBIMENTO'), value : 'notaRecebimento' } , |
@@ -42,7 +42,7 @@ citApp.controller('EntradaAlmoxarifadoListController', ['$scope', 'EntradaAlmoxa | @@ -42,7 +42,7 @@ citApp.controller('EntradaAlmoxarifadoListController', ['$scope', 'EntradaAlmoxa | ||
42 | $scope.showAlert('warning', !edit ? $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_VISUALIZACAO') : $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_EDICAO')); | 42 | $scope.showAlert('warning', !edit ? $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_VISUALIZACAO') : $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_EDICAO')); |
43 | return; | 43 | return; |
44 | } | 44 | } |
45 | - angular.element('#editEntradaAlmoxarifado').scope().getEntradaAlmoxarifado(entradaAlmoxarifado, edit); | 45 | + angular.element('#entradaAlmoxarifadoControllerId').scope().getEntradaAlmoxarifado(entradaAlmoxarifado, edit); |
46 | $scope.$showPageEditWorkspace($scope.workspace); | 46 | $scope.$showPageEditWorkspace($scope.workspace); |
47 | }; | 47 | }; |
48 | 48 |
cit-almoxarifado-web/src/main/webapp/html/entradaAlmoxarifado/entradaAlmoxarifadoPg1.html
@@ -5,7 +5,56 @@ | @@ -5,7 +5,56 @@ | ||
5 | <translate>ALMOXARIFADO.LABEL.DADOS_ENTRADA</translate> | 5 | <translate>ALMOXARIFADO.LABEL.DADOS_ENTRADA</translate> |
6 | </legend> | 6 | </legend> |
7 | 7 | ||
8 | + <div class="row"> | ||
9 | + <div class="col-md-5"> | ||
10 | + <auto-complete ng-id="entradaAlmoxarifado.almoxarifado" ng-label="ALMOXARIFADO.LABEL.ALMOXARIFADO" ng-model="entradaAlmoxarifado.almoxarifado" form="dadosEntradaForm" | ||
11 | + ng-obrigatorio="{{edit}}" ng-disabled="!edit" ng-find="findAutoCompleteAlmoxarifado(value)" ng-item="item.nome + ' - ' + item.classificacao"/> | ||
12 | + </div> | ||
13 | + <div class="col-md-4"> | ||
14 | + <auto-complete ng-id="entradaAlmoxarifado.fornecedor" ng-label="LABEL.FORNECEDOR" ng-model="entradaAlmoxarifado.fornecedor" form="dadosEntradaForm" | ||
15 | + ng-obrigatorio="{{edit}}" ng-disabled="!edit" ng-find="findAutoCompleteFornecedor(value)" ng-item="item['pessoa.nome']" /> | ||
16 | + </div> | ||
17 | + <div class="col-md-3"> | ||
18 | + <label-input-number ng-id="entradaAlmoxarifado.notaRecebimento" ng-label="ALMOXARIFADO.LABEL.NOTA_RECEBIMENTO" ng-model="entradaAlmoxarifado.notaRecebimento" | ||
19 | + ng-obrigatorio="false" ng-disabled="true"/> | ||
20 | + </div> | ||
21 | + </div> | ||
22 | + | ||
23 | + <div class="row"> | ||
24 | + <div class="col-md-4"> | ||
25 | + <label-select ng-id="entradaAlmoxarifado.dominioTipoEntrada" ng-label="LABEL.TIPO_ENTRADA" ng-model="entradaAlmoxarifado.dominioTipoEntrada" form="dadosEntradaForm" | ||
26 | + ng-obrigatorio="edit" ng-disabled="!edit" ng-custom-options="dominio.originalElement as dominio.descricao for dominio" track-by="track by dominio.id" | ||
27 | + ng-list="dominioTipoEntradaList" /> | ||
28 | + </div> | ||
29 | + | ||
30 | + <div class="col-md-4" ng-if="edit"> | ||
31 | + <label-select ng-id="entradaAlmoxarifado.dominioTipoRecebimento" ng-label="LABEL.TIPO_RECEBIMENTO" ng-model="entradaAlmoxarifado.dominioTipoRecebimento" | ||
32 | + form="dadosEntradaForm" ng-obrigatorio="edit" ng-disabled="!edit" ng-custom-options="dominio.originalElement as dominio.descricao for dominio" | ||
33 | + ng-list="dominiosTipoRecebimento" track-by="track by dominio.id" /> | ||
34 | + </div> | ||
35 | + | ||
36 | + <div class="col-md-4"> | ||
37 | + <label-input-data ng-id="entradaAlmoxarifado.dataRecebimento" ng-label="ALMOXARIFADO.LABEL.DATA_RECEBIMENTO" ng-model="entradaAlmoxarifado.dataRecebimento" form="dadosEntradaForm" | ||
38 | + ng-obrigatorio="edit" ng-disabled="!edit" ng-mode="day" ng-format="dd/MM/yyyy" /> | ||
39 | + </div> | ||
40 | + </div> | ||
41 | + | ||
42 | + <div class="row"> | ||
43 | + <div class="col-md-4"> | ||
44 | + <label-input-radio ng-id="entradaAlmoxarifado.dominioFinalidade.codigo" ng-model="entradaAlmoxarifado.dominioFinalidade.codigo" ng-label="LABEL.FINALIDADE" | ||
45 | + ng-obrigatorio="edit" text="descricao" value="codigo" form="entradaAlmoxarifadoForm" ng-disabled="true" list="dominiosTipoFinalidade"/> | ||
46 | + </div> | ||
8 | 47 | ||
48 | + <div class="col-sm-4"> | ||
49 | + <label-input-data ng-id="entradaAlmoxarifado.dataReferencia" ng-label="LABEL.DATA_REGISTRO" ng-obrigatorio="false" ng-disabled="true" ng-model="entradaAlmoxarifado.dataReferencia" | ||
50 | + form="dadosEntradaForm" /> | ||
51 | + </div> | ||
52 | + | ||
53 | + <div class="col-md-4"> | ||
54 | + <label-input-data ng-id="entradaAlmoxarifado.dataContabilizacao" ng-label="LABEL.DATA_CONTABILIZACAO" ng-model="entradaAlmoxarifado.dataContabil" form="dadosEntradaForm" | ||
55 | + ng-obrigatorio="false" ng-disabled="true" ng-mode="day" ng-format="dd/MM/yyyy"/> | ||
56 | + </div> | ||
57 | + </div> | ||
9 | 58 | ||
10 | </fieldset> | 59 | </fieldset> |
11 | </div> <!-- /.page-content --> | 60 | </div> <!-- /.page-content --> |