Commit 75a9948b74d542a202d678ba5f8633b1a4e45ae8
Exists in
master
Merge branch 'master' into 'master'
Master See merge request !18
Showing
2 changed files
 
Show diff stats
src/js/controller.js
| 1 | angular.module('focaAbmVehiculo') | 1 | angular.module('focaAbmVehiculo') | 
| 2 | .controller('focaAbmVehiculosController', [ | 2 | .controller('focaAbmVehiculosController', [ | 
| 3 | '$scope', 'focaAbmVehiculoService', '$location', 'focaModalService', | 3 | '$scope', 'focaAbmVehiculoService', '$location', 'focaModalService', | 
| 4 | '$uibModal', 'focaBotoneraLateralService', '$timeout', | 4 | '$uibModal', 'focaBotoneraLateralService', '$timeout', | 
| 5 | function($scope, focaAbmVehiculoService, $location, focaModalService, | 5 | function($scope, focaAbmVehiculoService, $location, focaModalService, | 
| 6 | $uibModal, focaBotoneraLateralService, $timeout) { | 6 | $uibModal, focaBotoneraLateralService, $timeout) { | 
| 7 | 7 | ||
| 8 | $scope.now = new Date(); | 8 | $scope.now = new Date(); | 
| 9 | $scope.botonera = [{ | 9 | $scope.botonera = [{ | 
| 10 | label: 'Transportista', | 10 | label: 'Transportista', | 
| 11 | image: 'cliente.png' | 11 | image: 'cliente.png' | 
| 12 | }]; | 12 | }]; | 
| 13 | 13 | ||
| 14 | //SETEO BOTONERA LATERAL | 14 | //SETEO BOTONERA LATERAL | 
| 15 | focaBotoneraLateralService.showSalir(true); | 15 | focaBotoneraLateralService.showSalir(false); | 
| 16 | focaBotoneraLateralService.showPausar(false); | 16 | focaBotoneraLateralService.showPausar(false); | 
| 17 | focaBotoneraLateralService.showCancelar(false); | 17 | focaBotoneraLateralService.showCancelar(false); | 
| 18 | focaBotoneraLateralService.showGuardar(false); | 18 | focaBotoneraLateralService.showGuardar(false); | 
| 19 | focaBotoneraLateralService.addCustomButton('Salir', salir); | ||
| 19 | 20 | ||
| 20 | if(focaAbmVehiculoService.transportistaSeleccionado.COD) { | 21 | if(focaAbmVehiculoService.transportistaSeleccionado.COD) { | 
| 21 | elegirTransportista(focaAbmVehiculoService.transportistaSeleccionado); | 22 | elegirTransportista(focaAbmVehiculoService.transportistaSeleccionado); | 
| 22 | } | 23 | } | 
| 23 | focaAbmVehiculoService.cleanCisternasLocal(); | 24 | focaAbmVehiculoService.cleanCisternasLocal(); | 
| 24 | $scope.editar = function(id) { | 25 | $scope.editar = function(id) { | 
| 25 | $location.path('/vehiculo/' + id + '/' + $scope.idTransportista); | 26 | $location.path('/vehiculo/' + id + '/' + $scope.idTransportista); | 
| 26 | }; | 27 | }; | 
| 27 | $scope.solicitarConfirmacion = function(vehiculo) { | 28 | $scope.solicitarConfirmacion = function(vehiculo) { | 
| 28 | focaModalService.confirm('¿Está seguro que desea borrar el vehiculo ' + | 29 | focaModalService.confirm('¿Está seguro que desea borrar el vehiculo ' + | 
| 29 | vehiculo.id + ' ' + vehiculo.tractor + ' ?').then( | 30 | vehiculo.id + ' ' + vehiculo.tractor + ' ?').then( | 
| 30 | function(data) { | 31 | function(data) { | 
| 31 | if(data) { | 32 | if(data) { | 
| 32 | focaAbmVehiculoService.deleteVehiculo(vehiculo.id); | 33 | focaAbmVehiculoService.deleteVehiculo(vehiculo.id); | 
| 33 | $scope.vehiculos.splice($scope.vehiculos.indexOf(vehiculo), 1); | 34 | $scope.vehiculos.splice($scope.vehiculos.indexOf(vehiculo), 1); | 
| 34 | } | 35 | } | 
| 35 | } | 36 | } | 
| 36 | ); | 37 | ); | 
| 37 | }; | 38 | }; | 
| 38 | $scope.seleccionarTransportista = function() { | 39 | $scope.seleccionarTransportista = function() { | 
| 39 | var modalInstance = $uibModal.open( | 40 | var modalInstance = $uibModal.open( | 
| 40 | { | 41 | { | 
| 41 | ariaLabelledBy: 'Busqueda de Transportista', | 42 | ariaLabelledBy: 'Busqueda de Transportista', | 
| 42 | templateUrl: 'modal-proveedor.html', | 43 | templateUrl: 'modal-proveedor.html', | 
| 43 | controller: 'focaModalProveedorCtrl', | 44 | controller: 'focaModalProveedorCtrl', | 
| 44 | size: 'lg', | 45 | size: 'lg', | 
| 45 | resolve: { | 46 | resolve: { | 
| 46 | transportista: function() { | 47 | transportista: function() { | 
| 47 | return true; | 48 | return true; | 
| 48 | } | 49 | } | 
| 49 | } | 50 | } | 
| 50 | } | 51 | } | 
| 51 | ); | 52 | ); | 
| 52 | modalInstance.result.then( | 53 | modalInstance.result.then( | 
| 53 | function(transportista) { | 54 | function(transportista) { | 
| 54 | elegirTransportista(transportista); | 55 | elegirTransportista(transportista); | 
| 55 | focaAbmVehiculoService.transportistaSeleccionado = transportista; | 56 | focaAbmVehiculoService.transportistaSeleccionado = transportista; | 
| 56 | }, function() { | 57 | }, function() { | 
| 57 | 58 | ||
| 58 | } | 59 | } | 
| 59 | ); | 60 | ); | 
| 60 | }; | 61 | }; | 
| 61 | 62 | ||
| 62 | function elegirTransportista(transportista) { | 63 | function elegirTransportista(transportista) { | 
| 63 | var codigo = ('00000' + transportista.COD).slice(-5); | 64 | var codigo = ('00000' + transportista.COD).slice(-5); | 
| 64 | $scope.idTransportista = transportista.COD; | 65 | $scope.idTransportista = transportista.COD; | 
| 65 | $scope.filtros = transportista.NOM.trim(); | 66 | $scope.filtros = transportista.NOM.trim(); | 
| 66 | $timeout(function() { | 67 | $timeout(function() { | 
| 67 | $scope.$broadcast('addCabecera', { | 68 | $scope.$broadcast('addCabecera', { | 
| 68 | label: 'Transportista:', | 69 | label: 'Transportista:', | 
| 69 | valor: codigo + ' - ' + transportista.NOM | 70 | valor: codigo + ' - ' + transportista.NOM | 
| 70 | }); | 71 | }); | 
| 71 | }); | 72 | }); | 
| 72 | buscar(transportista.COD); | 73 | buscar(transportista.COD); | 
| 73 | } | 74 | } | 
| 74 | 75 | ||
| 75 | function buscar(idTransportista) { | 76 | function buscar(idTransportista) { | 
| 76 | focaAbmVehiculoService | 77 | focaAbmVehiculoService | 
| 77 | .getVehiculosPorTransportista(idTransportista) | 78 | .getVehiculosPorTransportista(idTransportista) | 
| 78 | .then(function(datos) { | 79 | .then(function(datos) { | 
| 79 | $scope.vehiculos = datos.data; | 80 | $scope.vehiculos = datos.data; | 
| 80 | }); | 81 | }); | 
| 81 | } | 82 | } | 
| 83 | function salir() { | ||
| 84 | focaAbmVehiculoService.transportistaSeleccionado = {}; | ||
| 85 | $location.path('/'); | ||
| 86 | } | ||
| 82 | } | 87 | } | 
| 83 | ]) | 88 | ]) | 
| 84 | .controller('focaAbmVehiculoController', [ | 89 | .controller('focaAbmVehiculoController', [ | 
| 85 | '$scope', 'focaAbmVehiculoService', '$routeParams', '$location', '$uibModal', | 90 | '$scope', 'focaAbmVehiculoService', '$routeParams', '$location', '$uibModal', | 
| 86 | 'focaModalService', '$timeout', 'focaBotoneraLateralService', '$window', | 91 | 'focaModalService', '$timeout', 'focaBotoneraLateralService', '$window', | 
| 87 | function($scope, focaAbmVehiculoService, $routeParams, $location, $uibModal, | 92 | function($scope, focaAbmVehiculoService, $routeParams, $location, $uibModal, | 
| 88 | focaModalService, $timeout, focaBotoneraLateralService, $window) { | 93 | focaModalService, $timeout, focaBotoneraLateralService, $window) { | 
| 89 | $scope.nuevo = $routeParams.idVehiculo === '0' ? true : false; | 94 | $scope.nuevo = $routeParams.idVehiculo === '0' ? true : false; | 
| 90 | $scope.now = new Date(); | 95 | $scope.now = new Date(); | 
| 91 | $scope.focused = 1; | 96 | $scope.focused = 1; | 
| 92 | $scope.transportistaStamp = ''; | 97 | $scope.transportistaStamp = ''; | 
| 93 | $scope.cisternas = []; | 98 | $scope.cisternas = []; | 
| 94 | 99 | ||
| 95 | $timeout(function() { | 100 | $timeout(function() { | 
| 96 | focaBotoneraLateralService.showSalir(false); | 101 | focaBotoneraLateralService.showSalir(false); | 
| 97 | focaBotoneraLateralService.showPausar(false); | 102 | focaBotoneraLateralService.showPausar(false); | 
| 98 | focaBotoneraLateralService.showCancelar(false); | 103 | focaBotoneraLateralService.showCancelar(false); | 
| 99 | focaBotoneraLateralService.showGuardar(true, $scope.guardar); | 104 | focaBotoneraLateralService.showGuardar(true, $scope.guardar); | 
| 100 | focaBotoneraLateralService.addCustomButton('Salir', $scope.cancelar); | 105 | focaBotoneraLateralService.addCustomButton('Salir', $scope.cancelar); | 
| 101 | }); | 106 | }); | 
| 102 | 107 | ||
| 103 | if($scope.nuevo) { | 108 | if($scope.nuevo) { | 
| 104 | focaAbmVehiculoService | 109 | focaAbmVehiculoService | 
| 105 | .getTransportistaPorId($routeParams.idTransportista) | 110 | .getTransportistaPorId($routeParams.idTransportista) | 
| 106 | .then(function(res) { | 111 | .then(function(res) { | 
| 107 | var codigo = ('00000' + res.data.COD).slice(-5); | 112 | var codigo = ('00000' + res.data.COD).slice(-5); | 
| 108 | $scope.vehiculo.idTransportista = res.data.COD; | 113 | $scope.vehiculo.idTransportista = res.data.COD; | 
| 109 | $scope.vehiculo.transportista = res.data; | 114 | $scope.vehiculo.transportista = res.data; | 
| 110 | $scope.$broadcast('addCabecera', { | 115 | $scope.$broadcast('addCabecera', { | 
| 111 | label: 'Transportista:', | 116 | label: 'Transportista:', | 
| 112 | valor: codigo + ' - ' + res.data.NOM | 117 | valor: codigo + ' - ' + res.data.NOM | 
| 113 | }); | 118 | }); | 
| 114 | }); | 119 | }); | 
| 115 | } | 120 | } | 
| 116 | $scope.vehiculo = {}; | 121 | $scope.vehiculo = {}; | 
| 117 | focaAbmVehiculoService.getVehiculo($routeParams.idVehiculo).then(function(res) { | 122 | focaAbmVehiculoService.getVehiculo($routeParams.idVehiculo).then(function(res) { | 
| 118 | if(res.data) { | 123 | if(res.data) { | 
| 119 | $scope.transportistaStamp = ('00000' + res.data.transportista.COD).slice(-5); | 124 | $scope.transportistaStamp = ('00000' + res.data.transportista.COD).slice(-5); | 
| 120 | $scope.transportistaStamp += ' - ' + res.data.transportista.NOM | 125 | $scope.transportistaStamp += ' - ' + res.data.transportista.NOM | 
| 121 | 126 | ||
| 122 | $scope.vehiculo = res.data; | 127 | $scope.vehiculo = res.data; | 
| 123 | $scope.$broadcast('addCabecera', { | 128 | $scope.$broadcast('addCabecera', { | 
| 124 | label: 'Transportista:', | 129 | label: 'Transportista:', | 
| 125 | valor: $scope.transportistaStamp | 130 | valor: $scope.transportistaStamp | 
| 126 | }); | 131 | }); | 
| 127 | $scope.$broadcast('addCabecera', { | 132 | $scope.$broadcast('addCabecera', { | 
| 128 | label: 'Unidad:', | 133 | label: 'Unidad:', | 
| 129 | valor: res.data.codigo | 134 | valor: res.data.codigo | 
| 130 | }); | 135 | }); | 
| 131 | } | 136 | } | 
| 132 | }); | 137 | }); | 
| 133 | focaAbmVehiculoService.getCisternadoPorVehiculo($routeParams.idVehiculo) | 138 | focaAbmVehiculoService.getCisternadoPorVehiculo($routeParams.idVehiculo) | 
| 134 | .then(function(res) { | 139 | .then(function(res) { | 
| 135 | //CONCATENA LAS CISTERNAS DEL SERVICIO Y LAS DE LA BASE DE DATOS | 140 | //CONCATENA LAS CISTERNAS DEL SERVICIO Y LAS DE LA BASE DE DATOS | 
| 136 | $scope.cisternas = focaAbmVehiculoService.getCisternasLocal().concat(res.data); | 141 | $scope.cisternas = focaAbmVehiculoService.getCisternasLocal().concat(res.data); | 
| 137 | }); | 142 | }); | 
| 138 | $scope.next = function(key) { | 143 | $scope.next = function(key) { | 
| 139 | if (key === 13) $scope.focused++; | 144 | if (key === 13) $scope.focused++; | 
| 140 | }; | 145 | }; | 
| 141 | $scope.cancelar = function() { | 146 | $scope.cancelar = function() { | 
| 142 | $location.path('/vehiculo'); | 147 | $location.path('/vehiculo'); | 
| 143 | }; | 148 | }; | 
| 144 | $scope.editar = function(cisterna) { | 149 | $scope.editar = function(cisterna) { | 
| 145 | if(cisterna) { | 150 | if(cisterna) { | 
| 146 | if(cisterna.idTemp != undefined) { | 151 | if(cisterna.idTemp != undefined) { | 
| 147 | $location.path('/vehiculo/' + $routeParams.idVehiculo + | 152 | $location.path('/vehiculo/' + $routeParams.idVehiculo + | 
| 148 | '/cisterna/0/' + cisterna.idTemp); | 153 | '/cisterna/0/' + cisterna.idTemp); | 
| 149 | }else { | 154 | }else { | 
| 150 | $location.path('/vehiculo/' + $routeParams.idVehiculo + | 155 | $location.path('/vehiculo/' + $routeParams.idVehiculo + | 
| 151 | '/cisterna/' + cisterna.id); | 156 | '/cisterna/' + cisterna.id); | 
| 152 | } | 157 | } | 
| 153 | }else { | 158 | }else { | 
| 154 | $location.path('/vehiculo/' + $routeParams.idVehiculo + '/cisterna/0/'); | 159 | $location.path('/vehiculo/' + $routeParams.idVehiculo + '/cisterna/0/'); | 
| 155 | } | 160 | } | 
| 156 | }; | 161 | }; | 
| 157 | $scope.guardar = function() { | 162 | $scope.guardar = function(key) { | 
| 158 | //Valida si existe numero de unidad | 163 | key = (typeof key === 'undefined') ? 13 : key; | 
| 159 | if(!validaTotalCargas() && !$scope.nuevo) { | 164 | if(key === 13){ | 
| 160 | focaModalService.alert('La suma de las capacidades de las cisternas' + | 165 | //Valida si existe numero de unidad | 
| 161 | ' debe ser igual a la capacidad total del vehículo'); | 166 | if(!validaTotalCargas() && !$scope.nuevo) { | 
| 162 | return; | 167 | focaModalService.alert('La suma de las capacidades de las cisternas' + | 
| 168 | ' debe ser igual a la capacidad total del vehículo'); | ||
| 169 | return; | ||
| 170 | } | ||
| 171 | validaCodigoUnidad().then(function() { | ||
| 172 | delete $scope.vehiculo.transportista; | ||
| 173 | delete $scope.vehiculo.cisternas; | ||
| 174 | focaAbmVehiculoService.guardarVehiculo($scope.vehiculo) | ||
| 175 | .then(function(res) { | ||
| 176 | if($scope.nuevo) { | ||
| 177 | $location.path('/vehiculo/' + res.data.id + | ||
| 178 | '/' + res.data.idTransportista); | ||
| 179 | }else { | ||
| 180 | guardarCisternas().then(function() { | ||
| 181 | $window.location.assign('/#!/vehiculo'); | ||
| 182 | }); | ||
| 183 | } | ||
| 184 | }); | ||
| 185 | }, function(){ | ||
| 186 | focaModalService.alert('Código de unidad existente'); | ||
| 187 | }); | ||
| 163 | } | 188 | } | 
| 164 | validaCodigoUnidad().then(function() { | ||
| 165 | delete $scope.vehiculo.transportista; | ||
| 166 | delete $scope.vehiculo.cisternas; | ||
| 167 | focaAbmVehiculoService.guardarVehiculo($scope.vehiculo) | ||
| 168 | .then(function(res) { | ||
| 169 | if($scope.nuevo) { | ||
| 170 | $location.path('/vehiculo/' + res.data.id + | ||
| 171 | '/' + res.data.idTransportista); | ||
| 172 | }else { | ||
| 173 | guardarCisternas().then(function() { | ||
| 174 | $window.location.assign('/#!/vehiculo'); | ||
| 175 | }); | ||
| 176 | } | ||
| 177 | }); | ||
| 178 | }, function(){ | ||
| 179 | focaModalService.alert('Código de unidad existente'); | ||
| 180 | }); | ||
| 181 | 189 | ||
| 182 | }; | 190 | }; | 
| 183 | $scope.solicitarConfirmacionCisterna = function(cisterna) { | 191 | $scope.solicitarConfirmacionCisterna = function(cisterna) { | 
| 184 | focaModalService.confirm('¿Está seguro que desea borrar la cisterna ' + | 192 | focaModalService.confirm('¿Está seguro que desea borrar la cisterna ' + | 
| 185 | cisterna.id + ' ' + cisterna.codigo + ' ?').then( | 193 | cisterna.id + ' ' + cisterna.codigo + ' ?').then( | 
| 186 | function(data) { | 194 | function(data) { | 
| 187 | if(data) { | 195 | if(data) { | 
| 188 | if(cisterna.id) { | 196 | if(cisterna.id) { | 
| 189 | focaAbmVehiculoService.deleteCisterna(cisterna.id); | 197 | focaAbmVehiculoService.deleteCisterna(cisterna.id); | 
| 190 | } | 198 | } | 
| 191 | $scope.cisternas.splice($scope.cisternas.indexOf(cisterna), 1); | 199 | $scope.cisternas.splice($scope.cisternas.indexOf(cisterna), 1); | 
| 192 | } | 200 | } | 
| 193 | } | 201 | } | 
| 194 | ); | 202 | ); | 
| 195 | }; | 203 | }; | 
| 196 | 204 | ||
| 197 | function validaCodigoUnidad() { | 205 | function validaCodigoUnidad() { | 
| 198 | return new Promise(function(resolve, reject) { | 206 | return new Promise(function(resolve, reject) { | 
| 199 | focaAbmVehiculoService | 207 | focaAbmVehiculoService | 
| 200 | .getVehiculosPorTransportista(parseInt($routeParams.idTransportista)) | 208 | .getVehiculosPorTransportista(parseInt($routeParams.idTransportista)) | 
| 201 | .then(function(res) { | 209 | .then(function(res) { | 
| 202 | //Valida si existe numero de unidad | 210 | //Valida si existe numero de unidad | 
| 203 | var existe = res.data.filter(function(vehiculo) { | 211 | var existe = res.data.filter(function(vehiculo) { | 
| 204 | return vehiculo.codigo === $scope.vehiculo.codigo && | 212 | return vehiculo.codigo === $scope.vehiculo.codigo && | 
| 205 | vehiculo.id !== $scope.vehiculo.id; | 213 | vehiculo.id !== $scope.vehiculo.id; | 
| 206 | }); | 214 | }); | 
| 207 | 215 | ||
| 208 | if(existe.length) { | 216 | if(existe.length) { | 
| 209 | reject(existe); | 217 | reject(existe); | 
| 210 | }else { | 218 | }else { | 
| 211 | resolve(); | 219 | resolve(); | 
| 212 | } | 220 | } | 
| 213 | }); | 221 | }); | 
| 214 | }); | 222 | }); | 
| 215 | } | 223 | } | 
| 216 | 224 | ||
| 217 | function validaTotalCargas() { | 225 | function validaTotalCargas() { | 
| 218 | var total = 0; | 226 | var total = 0; | 
| 219 | $scope.cisternas.forEach(function(cisterna) { | 227 | $scope.cisternas.forEach(function(cisterna) { | 
| 220 | total += parseInt(cisterna.capacidad); | 228 | total += parseInt(cisterna.capacidad); | 
src/views/foca-abm-vehiculos-item.html
| 1 | <div class="row"> | 1 | <div class="row"> | 
| 2 | <foca-cabecera-facturador | 2 | <foca-cabecera-facturador | 
| 3 | titulo="'Vehículo'" | 3 | titulo="'Vehículo'" | 
| 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 | <form name="formVehiculo" class="px-3"> | 10 | <form name="formVehiculo" class="px-3"> | 
| 11 | <input type="hidden" name="id" ng-model="sector.id" /> | 11 | <input type="hidden" name="id" ng-model="sector.id" /> | 
| 12 | <div class="row mt-3"> | 12 | <div class="row mt-3"> | 
| 13 | <div class="form-group d-flex mb-2 col-md-6"> | 13 | <div class="form-group d-flex mb-2 col-md-6"> | 
| 14 | <label class="col-form-label col-md-3">Transportista</label> | 14 | <label class="col-form-label col-md-4">Unidad</label> | 
| 15 | <div class="input-group col-md-9 pl-0"> | 15 | <div class="input-group col-md-8 pl-0"> | 
| 16 | <input | ||
| 17 | class="form-control" | ||
| 18 | type="text" | ||
| 19 | ng-value="transportistaStamp" | ||
| 20 | readonly | ||
| 21 | /> | ||
| 22 | </div> | ||
| 23 | </div> | ||
| 24 | <div class="form-group d-flex mb-2 col-md-6"> | ||
| 25 | <label class="col-form-label col-md-3">Unidad</label> | ||
| 26 | <div class="input-group col-md-9 pl-0"> | ||
| 27 | <input | 16 | <input | 
| 28 | class="form-control" | 17 | class="form-control" | 
| 29 | type="text" | 18 | type="text" | 
| 30 | teclado-virtual | 19 | teclado-virtual | 
| 31 | ng-model="vehiculo.codigo" | 20 | ng-model="vehiculo.codigo" | 
| 32 | foca-focus="focused == 3" | 21 | foca-focus="focused == 1" | 
| 33 | ng-focus="focused = 3" | 22 | ng-focus="focused = 1" | 
| 34 | ng-keypress="next($event.keyCode)" | 23 | ng-keypress="next($event.keyCode)" | 
| 35 | /> | 24 | /> | 
| 36 | </div> | 25 | </div> | 
| 37 | </div> | 26 | </div> | 
| 38 | <div class="form-group d-flex mb-2 col-md-6"> | 27 | <div class="form-group d-flex mb-2 col-md-6"> | 
| 39 | <label class="col-form-label col-md-4">Dominio tractor</label> | 28 | <label class="col-form-label col-md-4">Dominio tractor</label> | 
| 40 | <div class="input-group col-md-8 pl-0"> | 29 | <div class="input-group col-md-8 pl-0"> | 
| 41 | <input | 30 | <input | 
| 42 | class="form-control" | 31 | class="form-control" | 
| 43 | type="text" | 32 | type="text" | 
| 44 | teclado-virtual | 33 | teclado-virtual | 
| 45 | ng-model="vehiculo.tractor" | 34 | ng-model="vehiculo.tractor" | 
| 46 | ng-required="true" | 35 | ng-required="true" | 
| 47 | foca-focus="focused == 1" | 36 | foca-focus="focused == 2" | 
| 48 | ng-focus="focused = 1" | 37 | ng-focus="focused = 2" | 
| 49 | ng-keypress="next($event.keyCode)" | 38 | ng-keypress="next($event.keyCode)" | 
| 50 | /> | 39 | /> | 
| 51 | </div> | 40 | </div> | 
| 52 | </div> | 41 | </div> | 
| 53 | <div class="form-group d-flex mb-2 col-md-6"> | 42 | <div class="form-group d-flex mb-2 col-md-6"> | 
| 54 | <label class="col-form-label col-md-4">Dominio semi</label> | 43 | <label class="col-form-label col-md-4">Dominio semi</label> | 
| 55 | <div class="input-group col-md-8 pl-0"> | 44 | <div class="input-group col-md-8 pl-0"> | 
| 56 | <input | 45 | <input | 
| 57 | class="form-control" | 46 | class="form-control" | 
| 58 | type="text" | 47 | type="text" | 
| 59 | teclado-virtual | 48 | teclado-virtual | 
| 60 | ng-model="vehiculo.semi" | 49 | ng-model="vehiculo.semi" | 
| 61 | ng-required="true" | 50 | ng-required="true" | 
| 62 | foca-focus="focused == 4" | 51 | foca-focus="focused == 3" | 
| 63 | ng-focus="focused = 4" | 52 | ng-focus="focused = 3" | 
| 64 | ng-keypress="next($event.keyCode)" | 53 | ng-keypress="next($event.keyCode)" | 
| 65 | /> | 54 | /> | 
| 66 | </div> | 55 | </div> | 
| 67 | </div> | 56 | </div> | 
| 68 | <div class="form-group d-flex mb-2 col-md-6"> | 57 | <div class="form-group d-flex mb-2 col-md-6"> | 
| 69 | <label class="col-form-label col-md-4">Capacidad total</label> | 58 | <label class="col-form-label col-md-4">Capacidad total</label> | 
| 70 | <div class="input-group col-md-8 pl-0"> | 59 | <div class="input-group col-md-8 pl-0"> | 
| 71 | <input | 60 | <input | 
| 72 | class="form-control" | 61 | class="form-control" | 
| 73 | type="text" | 62 | type="text" | 
| 74 | teclado-virtual | 63 | teclado-virtual | 
| 75 | ng-model="vehiculo.capacidad" | 64 | ng-model="vehiculo.capacidad" | 
| 76 | ng-required="true" | 65 | ng-required="true" | 
| 77 | foca-focus="focused == 2" | 66 | foca-focus="focused == 4" | 
| 78 | ng-focus="focused = 2" | 67 | ng-focus="focused = 4" | 
| 79 | ng-keypress="next($event.keyCode)" | 68 | ng-keypress="guardar($event.keyCode)" | 
| 80 | /> | 69 | /> | 
| 81 | </div> | 70 | </div> | 
| 82 | </div> | 71 | </div> | 
| 83 | </div> | 72 | </div> | 
| 84 | </form> | 73 | </form> | 
| 85 | <div ng-show="!nuevo"> | 74 | <div ng-show="!nuevo"> | 
| 86 | <h5 class="pl-4 table-title">Cisternas</h5> | 75 | <h5 class="pl-4 table-title">Cisternas</h5> | 
| 87 | <table class="table table-default table-hover table-sm table-abm table-striped mb-0"> | 76 | <table class="table table-default table-hover table-sm table-abm table-striped mb-0"> | 
| 88 | <thead> | 77 | <thead> | 
| 89 | <tr> | 78 | <tr> | 
| 90 | <th class="px-5">Código</th> | 79 | <th class="px-5">Código</th> | 
| 91 | <th class="text-right px-5">Capacidad</th> | 80 | <th class="text-right px-5">Capacidad</th> | 
| 92 | <th class="text-center px-4"> | 81 | <th class="text-center px-4"> | 
| 93 | <button | 82 | <button | 
| 94 | class="btn btn-outline-debo boton-accion" | 83 | class="btn btn-outline-debo boton-accion" | 
| 95 | title="Agregar" | 84 | title="Agregar" | 
| 96 | ng-click="editar()"> | 85 | ng-click="editar()"> | 
| 97 | <i class="fa fa-plus"></i> | 86 | <i class="fa fa-plus"></i> | 
| 98 | </button> | 87 | </button> | 
| 99 | </th> | 88 | </th> | 
| 100 | </tr> | 89 | </tr> | 
| 101 | </thead> | 90 | </thead> | 
| 102 | <tbody> | 91 | <tbody> | 
| 103 | <tr ng-repeat="cisterna in cisternas | filter:filtros"> | 92 | <tr ng-repeat="cisterna in cisternas | filter:filtros"> | 
| 104 | <td ng-bind="cisterna.codigo" class="px-5"></td> | 93 | <td ng-bind="cisterna.codigo" class="px-5"></td> | 
| 105 | <td ng-bind="cisterna.capacidad + ' ' + cisterna.unidadMedida.NOM" class="text-right px-5"></td> | 94 | <td ng-bind="cisterna.capacidad + ' ' + cisterna.unidadMedida.NOM" class="text-right px-5"></td> | 
| 106 | <td class="text-center px-4"> | 95 | <td class="text-center px-4"> | 
| 107 | <button | 96 | <button | 
| 108 | class="btn btn-outline-dark boton-accion" | 97 | class="btn btn-outline-dark boton-accion" | 
| 109 | title="Editar" | 98 | title="Editar" | 
| 110 | ng-click="editar(cisterna)" | 99 | ng-click="editar(cisterna)" | 
| 111 | > | 100 | > | 
| 112 | <i class="fa fa-pencil"></i> | 101 | <i class="fa fa-pencil"></i> | 
| 113 | </button> | 102 | </button> | 
| 114 | <button | 103 | <button | 
| 115 | class="btn btn-outline-dark boton-accion" | 104 | class="btn btn-outline-dark boton-accion" | 
| 116 | title="Eliminar" | 105 | title="Eliminar" | 
| 117 | ng-click="solicitarConfirmacionCisterna(cisterna)" | 106 | ng-click="solicitarConfirmacionCisterna(cisterna)" | 
| 118 | > | 107 | > | 
| 119 | <i class="fa fa-trash"></i> | 108 | <i class="fa fa-trash"></i> | 
| 120 | </button> | 109 | </button> | 
| 121 | </td> | 110 | </td> | 
| 122 | </tr> | 111 | </tr> | 
| 123 | </body> | 112 | </body> | 
| 124 | </table> | 113 | </table> | 
| 125 | </div> | 114 | </div> | 
| 126 | </div> | 115 | </div> | 
| 127 | </div> | 116 | </div> | 
| 128 | 117 |