Commit 198e2b5a14176055602e0821fd4b49dc14a771c5

Authored by Ronan Tavares Camargo
2 parents 56cb2f51 a3256711
Exists in master

Merge remote-tracking branch 'remotes/origin/tarefa-3717' into adm-1.12.0

citgrp-patrimonio-web/src/main/webapp/assets/js/angular/custom/controller/EntradaController.js
@@ -748,7 +748,7 @@ citApp.controller('EntradaController', ['$scope', '$timeout', 'FileUploader', 'E @@ -748,7 +748,7 @@ citApp.controller('EntradaController', ['$scope', '$timeout', 'FileUploader', 'E
748 748
749 $scope.carregaProximoNumeroPatrimonial = function() { 749 $scope.carregaProximoNumeroPatrimonial = function() {
750 BemPatrimonialRepository.geraNumeroPatrimonio($scope.usuarioLogado.organizacao.id).then(function(result) { 750 BemPatrimonialRepository.geraNumeroPatrimonio($scope.usuarioLogado.organizacao.id).then(function(result) {
751 - $scope.numeroPatrimonialInicial = angular.copy(completarZerosEsquerda(result, soNumeros($scope.parametroSistemaMascaraNumeroPatrimonial.valor).length)); 751 + $scope.numeroPatrimonialInicial = angular.copy(aplicarMascara(result, $scope.parametroSistemaMascaraNumeroPatrimonial.valor));
752 }); 752 });
753 $scope.showAtributosEmMassa = true; 753 $scope.showAtributosEmMassa = true;
754 }; 754 };
citgrp-patrimonio-web/src/main/webapp/assets/js/angular/custom/directive/InputNumeroBem.js
@@ -21,7 +21,7 @@ citApp.directive("inputNumeroBem", ['$translate', 'ConfiguracaoParametroSistemaR @@ -21,7 +21,7 @@ citApp.directive("inputNumeroBem", ['$translate', 'ConfiguracaoParametroSistemaR
21 " </label>"+ 21 " </label>"+
22 " <span class='red' ng-if='obrigatorio'>*</span> " + 22 " <span class='red' ng-if='obrigatorio'>*</span> " +
23 " <i ng-if='obrigatorio' ng-show='form[id].$error && (!form[id].$pristine || form.$submitted)' class='fa fa-warning red' tooltip='{{labelAlertTooltipCopy}}' tooltip-placement='top'></i> " + 23 " <i ng-if='obrigatorio' ng-show='form[id].$error && (!form[id].$pristine || form.$submitted)' class='fa fa-warning red' tooltip='{{labelAlertTooltipCopy}}' tooltip-placement='top'></i> " +
24 - " <input type='text' form='{{form}}' ui-mask='{{mask}}' title='{{title}}' ng-blur='aplicarMascara()' class='form-control' id='{{id}}' ng-model='model' class='inline' ng-disabled='disabled' ng-required='obrigatorio'/>" + 24 + " <input type='text' form='{{form}}' maxlength='{{maxlength ? maxlength : 255}}' placeholder='{{placeholder}}' title='{{title}}' ng-blur='aplicarMascara()' class='form-control' id='{{id}}' ng-model='model' class='inline' ng-disabled='disabled' ng-required='obrigatorio'/>" +
25 "</div>", 25 "</div>",
26 controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) { 26 controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {
27 27
@@ -47,21 +47,23 @@ citApp.directive(&quot;inputNumeroBem&quot;, [&#39;$translate&#39;, &#39;ConfiguracaoParametroSistemaR @@ -47,21 +47,23 @@ citApp.directive(&quot;inputNumeroBem&quot;, [&#39;$translate&#39;, &#39;ConfiguracaoParametroSistemaR
47 } 47 }
48 ConfiguracaoParametroSistemaRepository.getParametro('PATRIMONIO_MASCARA_NUMERO_PATRIMONIO').then(function(result) { 48 ConfiguracaoParametroSistemaRepository.getParametro('PATRIMONIO_MASCARA_NUMERO_PATRIMONIO').then(function(result) {
49 $scope.paramentroSistema = result.originalElement; 49 $scope.paramentroSistema = result.originalElement;
  50 + var mascara = $scope.paramentroSistema.valor;
50 51
51 $scope.aplicaMascara = $scope.aplicaMascara === undefined ? true : $scope.aplicaMascara; 52 $scope.aplicaMascara = $scope.aplicaMascara === undefined ? true : $scope.aplicaMascara;
52 - if($scope.paramentroSistema.valor && $scope.aplicaMascara){  
53 - $scope.mask = $scope.paramentroSistema.valor; 53 + if(mascara && $scope.aplicaMascara){
  54 + $scope.maxlength = mascara.length;
  55 + $scope.placeholder = mascara.replace(/[0-9]/g,"_");
54 } 56 }
55 57
56 - if($scope.model && $scope.paramentroSistema.valor){  
57 - $scope.model = completarZerosEsquerda($scope.model, soNumeros($scope.paramentroSistema.valor).length); 58 + if($scope.model && mascara){
  59 + $scope.model = aplicarMascara($scope.model, mascara);
58 } 60 }
59 }); 61 });
60 }], 62 }],
61 link : function($scope, element, attibutes) { 63 link : function($scope, element, attibutes) {
62 $scope.aplicarMascara = function() { 64 $scope.aplicarMascara = function() {
63 if($scope.model && $scope.paramentroSistema.valor) { 65 if($scope.model && $scope.paramentroSistema.valor) {
64 - $scope.model = completarZerosEsquerda($scope.model, soNumeros($scope.paramentroSistema.valor).length); 66 + $scope.model = aplicarMascara($scope.model, $scope.paramentroSistema.valor);
65 if ($scope.directiveFn) { 67 if ($scope.directiveFn) {
66 $scope.directiveFn($scope.model); 68 $scope.directiveFn($scope.model);
67 } 69 }