Commit 198e2b5a14176055602e0821fd4b49dc14a771c5
Exists in
master
Merge remote-tracking branch 'remotes/origin/tarefa-3717' into adm-1.12.0
Showing
2 changed files
with
9 additions
and
7 deletions
Show diff stats
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 | 748 | |
749 | 749 | $scope.carregaProximoNumeroPatrimonial = function() { |
750 | 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 | 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 | 21 | " </label>"+ |
22 | 22 | " <span class='red' ng-if='obrigatorio'>*</span> " + |
23 | 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 | 25 | "</div>", |
26 | 26 | controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) { |
27 | 27 | |
... | ... | @@ -47,21 +47,23 @@ citApp.directive("inputNumeroBem", ['$translate', 'ConfiguracaoParametroSistemaR |
47 | 47 | } |
48 | 48 | ConfiguracaoParametroSistemaRepository.getParametro('PATRIMONIO_MASCARA_NUMERO_PATRIMONIO').then(function(result) { |
49 | 49 | $scope.paramentroSistema = result.originalElement; |
50 | + var mascara = $scope.paramentroSistema.valor; | |
50 | 51 | |
51 | 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 | 63 | link : function($scope, element, attibutes) { |
62 | 64 | $scope.aplicarMascara = function() { |
63 | 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 | 67 | if ($scope.directiveFn) { |
66 | 68 | $scope.directiveFn($scope.model); |
67 | 69 | } | ... | ... |