Commit 5ca418f1772fc520b77f319689a007fe24bca343
1 parent
b8454e1414
Exists in
develop
validar nombre, tlf y DNI
Showing
2 changed files
with
24 additions
and
3 deletions
Show diff stats
src/js/controller.js
| 1 | angular.module('focaAbmChofer') | 1 | angular.module('focaAbmChofer') |
| 2 | .controller('focaAbmChoferesController', [ | 2 | .controller('focaAbmChoferesController', [ |
| 3 | '$scope', 'focaAbmChoferService', '$location', '$uibModal', | 3 | '$scope', 'focaAbmChoferService', '$location', '$uibModal', |
| 4 | 'focaModalService', 'focaBotoneraLateralService', '$timeout', '$localStorage', | 4 | 'focaModalService', 'focaBotoneraLateralService', '$timeout', '$localStorage', |
| 5 | '$routeParams', | 5 | '$routeParams', |
| 6 | function($scope, focaAbmChoferService, $location, $uibModal, focaModalService, | 6 | function($scope, focaAbmChoferService, $location, $uibModal, focaModalService, |
| 7 | focaBotoneraLateralService, $timeout, $localStorage, $routeParams) { | 7 | focaBotoneraLateralService, $timeout, $localStorage, $routeParams) { |
| 8 | 8 | ||
| 9 | $scope.focused = 1; | 9 | $scope.focused = 1; |
| 10 | $scope.now = new Date(); | 10 | $scope.now = new Date(); |
| 11 | $scope.nuevo = $routeParams.id === '0'; | 11 | $scope.nuevo = $routeParams.id === '0'; |
| 12 | $scope.filters = ''; | 12 | $scope.filters = ''; |
| 13 | $scope.choferes = []; | 13 | $scope.choferes = []; |
| 14 | $scope.creando = false; | 14 | $scope.creando = false; |
| 15 | $scope.crear = false; | 15 | $scope.crear = false; |
| 16 | $scope.transportistas = []; | 16 | $scope.transportistas = []; |
| 17 | $scope.botonera = [{ | 17 | $scope.botonera = [{ |
| 18 | label: 'Transportista', | 18 | label: 'Transportista', |
| 19 | image: 'cliente.png' | 19 | image: 'cliente.png' |
| 20 | }]; | 20 | }]; |
| 21 | $scope.next = function(key) { | 21 | $scope.next = function(key) { |
| 22 | if (key === 13) $scope.focused++; | 22 | if (key === 13) $scope.focused++; |
| 23 | }; | 23 | }; |
| 24 | 24 | ||
| 25 | //SETEO BOTONERA LATERAL | 25 | //SETEO BOTONERA LATERAL |
| 26 | $timeout(function() { | 26 | $timeout(function() { |
| 27 | focaBotoneraLateralService.showSalir(false); | 27 | focaBotoneraLateralService.showSalir(false); |
| 28 | focaBotoneraLateralService.showPausar(false); | 28 | focaBotoneraLateralService.showPausar(false); |
| 29 | focaBotoneraLateralService.showCancelar(false); | 29 | focaBotoneraLateralService.showCancelar(false); |
| 30 | focaBotoneraLateralService.showGuardar(true, $scope.guardar); | 30 | focaBotoneraLateralService.showGuardar(true, $scope.guardar); |
| 31 | focaBotoneraLateralService.addCustomButton('Salir', salir); | 31 | focaBotoneraLateralService.addCustomButton('Salir', salir); |
| 32 | }); | 32 | }); |
| 33 | 33 | ||
| 34 | if (focaAbmChoferService.transportistaSeleccionado.COD) { | 34 | if (focaAbmChoferService.transportistaSeleccionado.COD) { |
| 35 | elegirTransportista(focaAbmChoferService.transportistaSeleccionado); | 35 | elegirTransportista(focaAbmChoferService.transportistaSeleccionado); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | focaAbmChoferService.getTiposDocumento().then(function(res) { | 38 | focaAbmChoferService.getTiposDocumento().then(function(res) { |
| 39 | $scope.tiposDocumento = res.data; | 39 | $scope.tiposDocumento = res.data; |
| 40 | }); | 40 | }); |
| 41 | 41 | ||
| 42 | $scope.crearChofer = function () { | 42 | $scope.crearChofer = function () { |
| 43 | var chofer = { | 43 | var chofer = { |
| 44 | id: 0, | 44 | id: 0, |
| 45 | nombre: '', | 45 | nombre: '', |
| 46 | telefono: '', | 46 | telefono: '', |
| 47 | editando: true, | 47 | editando: true, |
| 48 | desactivado: false | 48 | desactivado: false |
| 49 | }; | 49 | }; |
| 50 | $scope.choferes.unshift(chofer); | 50 | $scope.choferes.unshift(chofer); |
| 51 | $scope.crear = false; | 51 | $scope.crear = false; |
| 52 | }; | 52 | }; |
| 53 | 53 | ||
| 54 | $scope.editar = function(chofer) { | 54 | $scope.editar = function(chofer) { |
| 55 | $scope.choferes.forEach(function(chofer) { | 55 | $scope.choferes.forEach(function(chofer) { |
| 56 | chofer.editando = false; | 56 | chofer.editando = false; |
| 57 | $scope.crear = false; | 57 | $scope.crear = false; |
| 58 | }); | 58 | }); |
| 59 | chofer.editando = true; | 59 | chofer.editando = true; |
| 60 | $scope.inicial = angular.copy(chofer); | 60 | $scope.inicial = angular.copy(chofer); |
| 61 | }; | 61 | }; |
| 62 | 62 | ||
| 63 | $scope.agregarChofer = function (chofer) { | 63 | $scope.agregarChofer = function (chofer) { |
| 64 | if (!chofer.nombre) { | 64 | if (!chofer.nombre) { |
| 65 | focaModalService.alert('Ingrese nombre'); | 65 | focaModalService.alert('Ingrese nombre'); |
| 66 | return; | 66 | return; |
| 67 | } else if (!chofer.idTipoDocumento) { | 67 | } else if (!chofer.idTipoDocumento) { |
| 68 | focaModalService.alert('Ingrese tipo documento'); | 68 | focaModalService.alert('Ingrese tipo documento'); |
| 69 | return; | 69 | return; |
| 70 | } | 70 | } else if (!/^([\d]{7,10})$/.test(chofer.telefono)) { |
| 71 | focaModalService.alert('El campo Teléfono debe tener de 7 a 10 digitos'); | ||
| 72 | } | ||
| 71 | validaDni(chofer); | 73 | validaDni(chofer); |
| 74 | console.log('Todo ok, guardar chofer'); | ||
| 72 | }; | 75 | }; |
| 73 | 76 | ||
| 74 | $scope.tipoDocumento = function (idTipoDocumento) { | 77 | $scope.tipoDocumento = function (idTipoDocumento) { |
| 75 | var value = ''; | 78 | var value = ''; |
| 76 | switch (parseInt(idTipoDocumento)) { | 79 | switch (parseInt(idTipoDocumento)) { |
| 77 | case 96 : | 80 | case 96 : |
| 78 | value = 'DNI'; | 81 | value = 'DNI'; |
| 79 | break; | 82 | break; |
| 80 | case 80 : | 83 | case 80 : |
| 81 | value = 'CUIT'; | 84 | value = 'CUIT'; |
| 82 | break; | 85 | break; |
| 83 | case 86 : | 86 | case 86 : |
| 84 | value = 'CUIL'; | 87 | value = 'CUIL'; |
| 85 | break; | 88 | break; |
| 86 | default: | 89 | default: |
| 87 | value = ''; | 90 | value = ''; |
| 88 | break; | 91 | break; |
| 89 | } | 92 | } |
| 90 | return value; | 93 | return value; |
| 91 | }; | 94 | }; |
| 92 | 95 | ||
| 93 | $scope.volver = function (chofer, key) { | 96 | $scope.volver = function (chofer, key) { |
| 94 | if (chofer.idTransportista === undefined) { | 97 | if (chofer.idTransportista === undefined) { |
| 95 | $scope.choferes.shift(); | 98 | $scope.choferes.shift(); |
| 96 | $scope.crear = true; | 99 | $scope.crear = true; |
| 97 | chofer.editando = false; | 100 | chofer.editando = false; |
| 98 | return; | 101 | return; |
| 99 | } else if (chofer.id !== 0 || !$scope.crear) { | 102 | } else if (chofer.id !== 0 || !$scope.crear) { |
| 100 | $scope.choferes[key] = $scope.inicial; | 103 | $scope.choferes[key] = $scope.inicial; |
| 101 | $scope.choferes[key].editando = false; | 104 | $scope.choferes[key].editando = false; |
| 102 | } | 105 | } |
| 103 | $scope.crear = true; | 106 | $scope.crear = true; |
| 104 | }; | 107 | }; |
| 105 | 108 | ||
| 106 | $scope.guardar = function() { | 109 | $scope.guardar = function() { |
| 107 | $scope.choferes.forEach( function (chofer) { | 110 | $scope.choferes.forEach( function (chofer) { |
| 108 | if (chofer.id === 0) { | 111 | if (chofer.id === 0) { |
| 109 | delete chofer.id; | 112 | delete chofer.id; |
| 110 | } | 113 | } |
| 111 | delete chofer.transportista; | 114 | delete chofer.transportista; |
| 112 | delete chofer.editando; | 115 | delete chofer.editando; |
| 113 | }); | 116 | }); |
| 114 | focaAbmChoferService | 117 | focaAbmChoferService |
| 115 | .guardarChoferes($scope.choferes) | 118 | .guardarChoferes($scope.choferes) |
| 116 | .then(salir) | 119 | .then(salir) |
| 117 | .catch(e => { | 120 | .catch(e => { |
| 118 | console.error(e); | 121 | console.error(e); |
| 119 | focaModalService.alert('Hubo un error al guardar'); | 122 | focaModalService.alert('Hubo un error al guardar'); |
| 120 | }); | 123 | }); |
| 121 | }; | 124 | }; |
| 122 | 125 | ||
| 123 | $scope.solicitarConfirmacion = function(chofer) { | 126 | $scope.solicitarConfirmacion = function(chofer) { |
| 124 | focaModalService.confirm('¿Está seguro que desea borrar el chofer ' + | 127 | focaModalService.confirm('¿Está seguro que desea borrar el chofer ' + |
| 125 | chofer.nombre + ' ?').then(function(confirmed) { | 128 | chofer.nombre + ' ?').then(function(confirmed) { |
| 126 | if (confirmed) { | 129 | if (confirmed) { |
| 127 | chofer.desactivado = true; | 130 | chofer.desactivado = true; |
| 128 | } | 131 | } |
| 129 | }); | 132 | }); |
| 130 | }; | 133 | }; |
| 131 | 134 | ||
| 132 | $scope.seleccionarTransportista = function() { | 135 | $scope.seleccionarTransportista = function() { |
| 133 | var parametrosModal = { | 136 | var parametrosModal = { |
| 134 | titulo: 'Búsqueda de Transportista', | 137 | titulo: 'Búsqueda de Transportista', |
| 135 | query: '/transportista', | 138 | query: '/transportista', |
| 136 | columnas: [ | 139 | columnas: [ |
| 137 | { | 140 | { |
| 138 | nombre: 'Código', | 141 | nombre: 'Código', |
| 139 | propiedad: 'COD' | 142 | propiedad: 'COD' |
| 140 | }, | 143 | }, |
| 141 | { | 144 | { |
| 142 | nombre: 'Nombre', | 145 | nombre: 'Nombre', |
| 143 | propiedad: 'NOM' | 146 | propiedad: 'NOM' |
| 144 | }, | 147 | }, |
| 145 | { | 148 | { |
| 146 | nombre: 'CUIT', | 149 | nombre: 'CUIT', |
| 147 | propiedad: 'CUIT' | 150 | propiedad: 'CUIT' |
| 148 | } | 151 | } |
| 149 | ] | 152 | ] |
| 150 | }; | 153 | }; |
| 151 | focaModalService.modal(parametrosModal).then( | 154 | focaModalService.modal(parametrosModal).then( |
| 152 | function(transportista) { | 155 | function(transportista) { |
| 153 | $scope.crear = true; | 156 | $scope.crear = true; |
| 154 | elegirTransportista(transportista); | 157 | elegirTransportista(transportista); |
| 155 | focaAbmChoferService.transportistaSeleccionado = transportista; | 158 | focaAbmChoferService.transportistaSeleccionado = transportista; |
| 156 | }, function() {} | 159 | }, function() {} |
| 157 | ); | 160 | ); |
| 158 | }; | 161 | }; |
| 159 | 162 | ||
| 160 | function elegirTransportista(transportista) { | 163 | function elegirTransportista(transportista) { |
| 161 | buscar(transportista.COD); | 164 | buscar(transportista.COD); |
| 162 | var codigo = ('00000' + transportista.COD).slice(-5); | 165 | var codigo = ('00000' + transportista.COD).slice(-5); |
| 163 | $scope.idTransportista = transportista.COD; | 166 | $scope.idTransportista = transportista.COD; |
| 164 | $timeout(function() { | 167 | $timeout(function() { |
| 165 | $scope.$broadcast('addCabecera', { | 168 | $scope.$broadcast('addCabecera', { |
| 166 | label: 'Transportista:', | 169 | label: 'Transportista:', |
| 167 | valor: codigo + ' - ' + transportista.NOM | 170 | valor: codigo + ' - ' + transportista.NOM |
| 168 | }); | 171 | }); |
| 169 | }); | 172 | }); |
| 170 | } | 173 | } |
| 171 | 174 | ||
| 172 | function buscar(id) { | 175 | function buscar(id) { |
| 173 | focaAbmChoferService.getChoferPorTransportista(id).then(function(res) { | 176 | focaAbmChoferService.getChoferPorTransportista(id).then(function(res) { |
| 174 | $scope.choferes = res.data; | 177 | $scope.choferes = res.data; |
| 175 | }); | 178 | }); |
| 176 | } | 179 | } |
| 177 | 180 | ||
| 178 | function salir() { | 181 | function salir() { |
| 179 | focaAbmChoferService.transportistaSeleccionado = {}; | 182 | focaAbmChoferService.transportistaSeleccionado = {}; |
| 180 | $location.path('/'); | 183 | $location.path('/'); |
| 181 | } | 184 | } |
| 182 | 185 | ||
| 183 | function validaDni(chofer) { | 186 | function validaDni(chofer) { |
| 184 | if (!chofer.dni) { | 187 | if (!chofer.dni) { |
| 185 | focaModalService.alert('Ingrese DNI'); | 188 | focaModalService.alert('Ingrese DNI'); |
| 186 | return; | 189 | return; |
| 187 | } else if (!chofer.telefono) { | 190 | } else if (!chofer.telefono) { |
| 188 | focaModalService.alert('Ingrese teléfono'); | 191 | focaModalService.alert('Ingrese teléfono'); |
| 189 | return; | 192 | return; |
| 190 | } | 193 | } |
| 191 | 194 | ||
| 192 | return new Promise(function(resolve, reject) { | 195 | return new Promise(function(resolve, reject) { |
| 193 | focaAbmChoferService | 196 | focaAbmChoferService |
| 194 | .getChoferPorDni(chofer.dni) | 197 | .getChoferPorDni(chofer.dni) |
| 195 | .then(function(res) { | 198 | .then(function(res) { |
| 196 | if (res.data.id && | 199 | if (res.data.id && |
| 197 | chofer.id !== res.data.id) { | 200 | chofer.id !== res.data.id) { |
| 198 | reject(res.data); | 201 | reject(res.data); |
| 199 | } else { | 202 | } else { |
| 200 | resolve(); | 203 | resolve(); |
| 201 | } | 204 | } |
| 202 | }) | 205 | }) |
| 203 | .then(function() { | 206 | .then(function() { |
| 204 | chofer.idTransportista = focaAbmChoferService | 207 | chofer.idTransportista = focaAbmChoferService |
| 205 | .transportistaSeleccionado.COD; | 208 | .transportistaSeleccionado.COD; |
| 206 | delete chofer.transportista; | 209 | delete chofer.transportista; |
| 207 | }, function() { | 210 | }, function() { |
| 208 | focaModalService.alert('Dni existente'); | 211 | focaModalService.alert('Dni existente'); |
| 209 | $scope.editando = true; | 212 | $scope.editando = true; |
| 210 | }); | 213 | }); |
| 211 | $scope.crear = true; | 214 | $scope.crear = true; |
| 212 | chofer.editando = false; | 215 | chofer.editando = false; |
| 213 | }); | 216 | }); |
| 214 | } | 217 | } |
| 215 | 218 | ||
| 216 | if ($localStorage.chofer) { | 219 | if ($localStorage.chofer) { |
| 217 | var chofer = JSON.parse($localStorage.chofer); | 220 | var chofer = JSON.parse($localStorage.chofer); |
| 218 | if (!chofer.id) { chofer.id = 0; } | 221 | if (!chofer.id) { chofer.id = 0; } |
| 219 | $location.path('/chofer/' + chofer.id + '/' + chofer.idTransportista); | 222 | $location.path('/chofer/' + chofer.id + '/' + chofer.idTransportista); |
| 220 | } | 223 | } |
| 224 | |||
| 225 | $scope.validarDatosChofer = function() { | ||
| 226 | // No permito numero ni caracteres especiles en nombre de chofer | ||
| 227 | if (!/^([a-zA-ZÀ-ÿ ])*$/.test($scope.chofer.nombre)) { | ||
| 228 | focaModalService.alert('el campo Nombre no debe incluir números o símbolos') | ||
| 229 | $scope.chofer.nombre = '' | ||
| 230 | } | ||
| 231 | // Solo numeros en el campo documento | ||
| 232 | if (!/^([0-9])*$/.test($scope.chofer.dni)) { | ||
| 233 | focaModalService.alert('el campo DNI solo puede incluir números') | ||
| 234 | $scope.chofer.dni = '' | ||
| 235 | } | ||
| 236 | } | ||
| 221 | } | 237 | } |
| 222 | ]); | 238 | ]); |
| 223 | 239 |
src/views/foca-abm-choferes-listado.html
| 1 | <div class="row"> | 1 | <div class="row"> |
| 2 | <foca-cabecera-facturador | 2 | <foca-cabecera-facturador |
| 3 | titulo="'Choferes'" | 3 | titulo="'Choferes'" |
| 4 | fecha="now" | 4 | fecha="now" |
| 5 | class="mb-0 col-lg-12" | 5 | class="mb-0 col-lg-12" |
| 6 | ></foca-cabecera-facturador> | 6 | ></foca-cabecera-facturador> |
| 7 | </div> | 7 | </div> |
| 8 | <div class="row"> | 8 | <div class="row"> |
| 9 | <div class="col-12 col-md-10 p-0 mt-4 border border-white rounded"> | 9 | <div class="col-12 col-md-10 p-0 mt-4 border border-white rounded"> |
| 10 | <div class="row px-5 py-2 botonera-secundaria"> | 10 | <div class="row px-5 py-2 botonera-secundaria"> |
| 11 | <div class="col-12"> | 11 | <div class="col-12"> |
| 12 | <foca-botonera-facturador botones="botonera" max="6" class="row"></foca-botonera-facturador> | 12 | <foca-botonera-facturador botones="botonera" max="6" class="row"></foca-botonera-facturador> |
| 13 | </div> | 13 | </div> |
| 14 | </div> | 14 | </div> |
| 15 | <table class="table table-default table-hover table-sm table-abm table-striped mb-0"> | 15 | <table class="table table-default table-hover table-sm table-abm table-striped mb-0"> |
| 16 | <thead> | 16 | <thead> |
| 17 | <tr> | 17 | <tr> |
| 18 | <th>Nombre</th> | 18 | <th>Nombre</th> |
| 19 | <th>Tipo</th> | 19 | <th>Tipo</th> |
| 20 | <th>Documento</th> | 20 | <th>Documento</th> |
| 21 | <th>Teléfono</th> | 21 | <th>Teléfono</th> |
| 22 | <th class="text-center"> | 22 | <th class="text-center"> |
| 23 | <button | 23 | <button |
| 24 | title="Agregar" | 24 | title="Agregar" |
| 25 | class="btn btn-outline-debo boton-accion" | 25 | class="btn btn-outline-debo boton-accion" |
| 26 | ng-click="crearChofer()" | 26 | ng-click="crearChofer()" |
| 27 | ng-disabled="!crear" | 27 | ng-disabled="!crear" |
| 28 | > | 28 | > |
| 29 | <i class="fa fa-plus"></i> | 29 | <i class="fa fa-plus"></i> |
| 30 | </button> | 30 | </button> |
| 31 | </th> | 31 | </th> |
| 32 | </tr> | 32 | </tr> |
| 33 | </thead> | 33 | </thead> |
| 34 | <tbody> | 34 | <tbody> |
| 35 | <tr ng-show="creando"> | 35 | <tr ng-show="creando"> |
| 36 | <td align="center"> | 36 | <td align="center"> |
| 37 | <input | 37 | <input |
| 38 | class="form-control" | 38 | class="form-control" |
| 39 | type="text" | 39 | type="text" |
| 40 | teclado-virtual | 40 | teclado-virtual |
| 41 | ng-model="chofer.nombre" | 41 | ng-model="chofer.nombre" |
| 42 | ng-keyup="validarDatosChofer()" | ||
| 42 | ng-required="true" | 43 | ng-required="true" |
| 43 | ng-keypress="next($event.keyCode)" | 44 | ng-keypress="next($event.keyCode)" |
| 44 | foca-focus="focused == 1" | 45 | foca-focus="focused == 1" |
| 45 | ng-focus="focused = 1" | 46 | ng-focus="focused = 1" |
| 46 | > | 47 | > |
| 47 | </td> | 48 | </td> |
| 48 | <td align="center"> | 49 | <td align="center"> |
| 49 | <div class="col-sm-4"> | 50 | <div class="col-sm-4"> |
| 50 | <select | 51 | <select |
| 51 | class="form-control" | 52 | class="form-control" |
| 52 | ng-options="tipoDocumento.id as tipoDocumento.descripcion for tipoDocumento in tiposDocumento track by tipoDocumento.id" | 53 | ng-options="tipoDocumento.id as tipoDocumento.descripcion for tipoDocumento in tiposDocumento track by tipoDocumento.id" |
| 53 | ng-model="chofer.idTipoDocumento"> | 54 | ng-model="chofer.idTipoDocumento"> |
| 54 | </select> | 55 | </select> |
| 55 | </div> | 56 | </div> |
| 56 | </td> | 57 | </td> |
| 57 | <td align="center"> | 58 | <td align="center"> |
| 58 | <input | 59 | <input |
| 59 | class="form-control" | 60 | class="form-control" |
| 60 | foca-tipo-input | 61 | foca-tipo-input |
| 61 | teclado-virtual | 62 | teclado-virtual |
| 62 | solo-positivos | 63 | solo-positivos |
| 63 | limite-numeros-max="15" | 64 | limite-numeros-max="12" |
| 65 | maxlength="12" | ||
| 66 | minlength="2" | ||
| 64 | ng-model="chofer.dni" | 67 | ng-model="chofer.dni" |
| 68 | ng-keyup="validarDatosChofer()" | ||
| 65 | ng-required="true" | 69 | ng-required="true" |
| 66 | ng-keypress="next($event.keyCode)" | 70 | ng-keypress="next($event.keyCode)" |
| 67 | foca-focus="focused == 2" | 71 | foca-focus="focused == 2" |
| 68 | ng-focus="focused = 2" | 72 | ng-focus="focused = 2" |
| 69 | ng-disabled="!nuevo" | 73 | ng-disabled="!nuevo" |
| 70 | string-toNumber | 74 | string-toNumber |
| 71 | > | 75 | > |
| 72 | </td> | 76 | </td> |
| 73 | <td align="center"> | 77 | <td align="center"> |
| 74 | <input | 78 | <input |
| 75 | class="form-control" | 79 | class="form-control" |
| 76 | foca-tipo-input | 80 | foca-tipo-input |
| 77 | teclado-virtual | 81 | teclado-virtual |
| 78 | solo-positivos | 82 | solo-positivos |
| 79 | limite-numeros-max="15" | 83 | limite-numeros-max="10" |
| 84 | maxlength="10" | ||
| 80 | ng-model="chofer.telefono" | 85 | ng-model="chofer.telefono" |
| 81 | ng-required="true" | 86 | ng-required="true" |
| 82 | foca-focus="focused == 3" | 87 | foca-focus="focused == 3" |
| 83 | ng-focus="focused = 3" | 88 | ng-focus="focused = 3" |
| 84 | string-toNumber | 89 | string-toNumber |
| 85 | > | 90 | > |
| 86 | </td> | 91 | </td> |
| 87 | <td align="center"> | 92 | <td align="center"> |
| 88 | <button | 93 | <button |
| 89 | class="btn btn-outline-dark boton-accion" | 94 | class="btn btn-outline-dark boton-accion" |
| 90 | ng-click="agregarChofer()" | 95 | ng-click="agregarChofer()" |
| 91 | > | 96 | > |
| 92 | <i class="fa fa-save"></i> | 97 | <i class="fa fa-save"></i> |
| 93 | </button> | 98 | </button> |
| 94 | </td> | 99 | </td> |
| 95 | </tr> | 100 | </tr> |
| 96 | 101 | ||
| 97 | <tr ng-repeat="(key, chofer) in choferes | filter:filters" ng-hide="chofer.desactivado"> | 102 | <tr ng-repeat="(key, chofer) in choferes | filter:filters" ng-hide="chofer.desactivado"> |
| 98 | <td ng-bind="chofer.nombre" ng-hide="chofer.editando"></td> | 103 | <td ng-bind="chofer.nombre" ng-hide="chofer.editando"></td> |
| 99 | <td align="center" ng-show="chofer.editando"> | 104 | <td align="center" ng-show="chofer.editando"> |
| 100 | <input | 105 | <input |
| 101 | class="form-control" | 106 | class="form-control" |
| 102 | type="text" | 107 | type="text" |
| 103 | teclado-virtual | 108 | teclado-virtual |
| 104 | ng-model="chofer.nombre" | 109 | ng-model="chofer.nombre" |
| 105 | ng-required="true" | 110 | ng-required="true" |
| 106 | ng-keypress="next($event.keyCode)" | 111 | ng-keypress="next($event.keyCode)" |
| 107 | foca-focus="focused == 1" | 112 | foca-focus="focused == 1" |
| 108 | ng-focus="focused = 1" | 113 | ng-focus="focused = 1" |
| 109 | esc-key="volver(chofer, key)" | 114 | esc-key="volver(chofer, key)" |
| 110 | > | 115 | > |
| 111 | </td> | 116 | </td> |
| 112 | <td ng-bind="tipoDocumento(chofer.idTipoDocumento)" ng-hide="chofer.editando"></td> | 117 | <td ng-bind="tipoDocumento(chofer.idTipoDocumento)" ng-hide="chofer.editando"></td> |
| 113 | <td align="center" ng-show="chofer.editando"> | 118 | <td align="center" ng-show="chofer.editando"> |
| 114 | <div class="col-sm-15"> | 119 | <div class="col-sm-15"> |
| 115 | <select | 120 | <select |
| 116 | class="form-control" | 121 | class="form-control" |
| 117 | ng-options="tipoDocumento.id as tipoDocumento.descripcion for tipoDocumento in tiposDocumento track by tipoDocumento.id" | 122 | ng-options="tipoDocumento.id as tipoDocumento.descripcion for tipoDocumento in tiposDocumento track by tipoDocumento.id" |
| 118 | ng-model="chofer.idTipoDocumento"> | 123 | ng-model="chofer.idTipoDocumento"> |
| 119 | </select> | 124 | </select> |
| 120 | </div> | 125 | </div> |
| 121 | </td> | 126 | </td> |
| 122 | <td ng-bind="chofer.dni" ng-hide="chofer.editando"> | 127 | <td ng-bind="chofer.dni" ng-hide="chofer.editando"> |
| 123 | <td align="center" ng-show="chofer.editando"> | 128 | <td align="center" ng-show="chofer.editando"> |
| 124 | <input | 129 | <input |
| 125 | class="form-control" | 130 | class="form-control" |
| 126 | type="text" | 131 | type="text" |
| 127 | teclado-virtual | 132 | teclado-virtual |
| 128 | ng-model="chofer.dni" | 133 | ng-model="chofer.dni" |
| 129 | ng-required="true" | 134 | ng-required="true" |
| 130 | ng-keypress="next($event.keyCode)" | 135 | ng-keypress="next($event.keyCode)" |
| 131 | foca-focus="focused == 2" | 136 | foca-focus="focused == 2" |
| 132 | ng-focus="focused = 2" | 137 | ng-focus="focused = 2" |
| 133 | esc-key="volver(chofer, key)" | 138 | esc-key="volver(chofer, key)" |
| 134 | > | 139 | > |
| 135 | </td> | 140 | </td> |
| 136 | </td> | 141 | </td> |
| 137 | <td ng-bind="chofer.telefono" ng-hide="chofer.editando"></td> | 142 | <td ng-bind="chofer.telefono" ng-hide="chofer.editando"></td> |
| 138 | <td align="center" ng-show="chofer.editando"> | 143 | <td align="center" ng-show="chofer.editando"> |
| 139 | <input | 144 | <input |
| 140 | class="form-control" | 145 | class="form-control" |
| 141 | foca-tipo-input | 146 | foca-tipo-input |
| 142 | teclado-virtual | 147 | teclado-virtual |
| 143 | solo-positivos | 148 | solo-positivos |
| 144 | limite-numeros-max="15" | 149 | limite-numeros-max="15" |
| 145 | ng-model="chofer.telefono" | 150 | ng-model="chofer.telefono" |
| 146 | ng-required="true" | 151 | ng-required="true" |
| 147 | foca-focus="focused == 3" | 152 | foca-focus="focused == 3" |
| 148 | ng-focus="focused = 3" | 153 | ng-focus="focused = 3" |
| 149 | string-toNumber | 154 | string-toNumber |
| 150 | esc-key="volver(chofer, key)" | 155 | esc-key="volver(chofer, key)" |
| 151 | > | 156 | > |
| 152 | </td> | 157 | </td> |
| 153 | <td class="text-center" ng-hide="chofer.editando"> | 158 | <td class="text-center" ng-hide="chofer.editando"> |
| 154 | <button | 159 | <button |
| 155 | class="btn btn-outline-dark boton-accion" | 160 | class="btn btn-outline-dark boton-accion" |
| 156 | title="Editar" | 161 | title="Editar" |
| 157 | ng-click="editar(chofer)" | 162 | ng-click="editar(chofer)" |
| 158 | > | 163 | > |
| 159 | <i class="fa fa-pencil"></i> | 164 | <i class="fa fa-pencil"></i> |
| 160 | </button> | 165 | </button> |
| 161 | <button | 166 | <button |
| 162 | class="btn btn-outline-dark boton-accion" | 167 | class="btn btn-outline-dark boton-accion" |
| 163 | title="Eliminar" | 168 | title="Eliminar" |
| 164 | ng-click="solicitarConfirmacion(chofer)" | 169 | ng-click="solicitarConfirmacion(chofer)" |
| 165 | > | 170 | > |
| 166 | <i class="fa fa-trash"></i> | 171 | <i class="fa fa-trash"></i> |
| 167 | </button> | 172 | </button> |
| 168 | </td> | 173 | </td> |
| 169 | <td align="center" ng-show="chofer.editando"> | 174 | <td align="center" ng-show="chofer.editando"> |
| 170 | <button | 175 | <button |
| 171 | class="btn btn-outline-dark boton-accion" | 176 | class="btn btn-outline-dark boton-accion" |
| 172 | ng-click="agregarChofer(chofer)" | 177 | ng-click="agregarChofer(chofer)" |
| 173 | > | 178 | > |
| 174 | <i class="fa fa-save"></i> | 179 | <i class="fa fa-save"></i> |
| 175 | </button> | 180 | </button> |
| 176 | <button | 181 | <button |
| 177 | class="btn btn-outline-dark boton-accion" | 182 | class="btn btn-outline-dark boton-accion" |
| 178 | ng-click="volver(chofer, key)" | 183 | ng-click="volver(chofer, key)" |
| 179 | > | 184 | > |
| 180 | <i class="fa fa-undo" aria-hidden="true"></i> | 185 | <i class="fa fa-undo" aria-hidden="true"></i> |
| 181 | </button> | 186 | </button> |
| 182 | </td> | 187 | </td> |
| 183 | </tr> | 188 | </tr> |
| 184 | </body> | 189 | </body> |
| 185 | </table> | 190 | </table> |
| 186 | </div> | 191 | </div> |
| 187 | </div> | 192 | </div> |
| 188 | 193 |