Commit cd8db0663465d566e356118fe5a8269f8da8eb13
Exists in
master
Merge branch 'master' into 'master'
inputs text change to number, keyboard virtual See merge request modulos-npm/foca-crear-nota-pedido!67
Showing
2 changed files
Show diff stats
src/js/controller.js
| ... | ... | @@ -580,6 +580,11 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 580 | 580 | $location.path('/'); |
| 581 | 581 | }; |
| 582 | 582 | |
| 583 | + $scope.parsearATexto = function(articulo) { | |
| 584 | + articulo.cantidad = parseFloat(articulo.cantidad); | |
| 585 | + articulo.precio = parseFloat(articulo.precio); | |
| 586 | + }; | |
| 587 | + | |
| 583 | 588 | function addCabecera(label, valor) { |
| 584 | 589 | var propiedad = $filter('filter')($scope.cabecera, {label: label}, true); |
| 585 | 590 | if(propiedad.length === 1) { |
src/views/nota-pedido.html
| ... | ... | @@ -120,7 +120,7 @@ |
| 120 | 120 | class="d-flex" |
| 121 | 121 | > |
| 122 | 122 | <td ng-bind="key + 1"></td> |
| 123 | - <td | |
| 123 | + <td | |
| 124 | 124 | class="col" |
| 125 | 125 | ng-bind="articulo.sector + '-' + articulo.codigo" |
| 126 | 126 | ></td> |
| ... | ... | @@ -133,11 +133,12 @@ |
| 133 | 133 | ng-show="articulo.editCantidad" |
| 134 | 134 | ng-model="articulo.cantidad" |
| 135 | 135 | class="form-control" |
| 136 | - type="number" | |
| 137 | - min="1" | |
| 136 | + type="text" | |
| 138 | 137 | foca-focus="articulo.editCantidad" |
| 139 | 138 | ng-keypress="editarArticulo($event.keyCode, articulo)" |
| 140 | 139 | ng-focus="selectFocus($event)" |
| 140 | + ng-blur="parsearATexto(articulo)" | |
| 141 | + teclado-virtual | |
| 141 | 142 | > |
| 142 | 143 | <i |
| 143 | 144 | class="selectable" |
| ... | ... | @@ -151,12 +152,12 @@ |
| 151 | 152 | ng-show="articulo.editPrecio" |
| 152 | 153 | ng-model="articulo.precio" |
| 153 | 154 | class="form-control" |
| 154 | - type="number" | |
| 155 | - min="1" | |
| 156 | - step="0.0001" | |
| 155 | + type="text" | |
| 157 | 156 | foca-focus="articulo.editPrecio" |
| 158 | 157 | ng-keypress="editarArticulo($event.keyCode, articulo)" |
| 159 | 158 | ng-focus="selectFocus($event)" |
| 159 | + ng-blur="parsearATexto(articulo)" | |
| 160 | + teclado-virtual | |
| 160 | 161 | > |
| 161 | 162 | <i |
| 162 | 163 | class="selectable" |
| ... | ... | @@ -202,12 +203,13 @@ |
| 202 | 203 | <td class="col text-right"> |
| 203 | 204 | <input |
| 204 | 205 | class="form-control" |
| 205 | - type="number" | |
| 206 | - min="1" | |
| 206 | + type="text" | |
| 207 | 207 | ng-model="articuloACargar.cantidad" |
| 208 | 208 | foca-focus="!cargando" |
| 209 | 209 | esc-key="resetFilter()" |
| 210 | 210 | ng-keypress="agregarATabla($event.keyCode)" |
| 211 | + ng-blur="parsearATexto(articuloACargar)" | |
| 212 | + teclado-virtual | |
| 211 | 213 | > |
| 212 | 214 | </td> |
| 213 | 215 | <td class="col text-right"> |
| ... | ... | @@ -219,12 +221,13 @@ |
| 219 | 221 | > |
| 220 | 222 | <input |
| 221 | 223 | class="form-control" |
| 222 | - type="number" | |
| 223 | - step="0.0001" | |
| 224 | + type="text" | |
| 224 | 225 | ng-model="articuloACargar.precio" |
| 225 | 226 | esc-key="resetFilter()" |
| 226 | 227 | ng-keypress="agregarATabla($event.keyCode)" |
| 227 | 228 | ng-show="idLista == -1" |
| 229 | + ng-blur="parsearATexto(articuloACargar)" | |
| 230 | + teclado-virtual | |
| 228 | 231 | > |
| 229 | 232 | </td> |
| 230 | 233 | <td class="col text-right"> |