Commit aa638f1d70e3677c9f6dfc5303786e0317b75f4b
1 parent
60ef5550d3
Exists in
master
and in
1 other branch
cambio tamaño textos, arreglo detalles
Showing
3 changed files
with
7 additions
and
12 deletions
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 = ['Transportista']; | 9 | $scope.botonera = ['Transportista']; |
| 10 | 10 | ||
| 11 | //SETEO BOTONERA LATERAL | 11 | //SETEO BOTONERA LATERAL |
| 12 | focaBotoneraLateralService.showSalir(true); | 12 | focaBotoneraLateralService.showSalir(true); |
| 13 | focaBotoneraLateralService.showPausar(false); | 13 | focaBotoneraLateralService.showPausar(false); |
| 14 | focaBotoneraLateralService.showCancelar(false); | 14 | focaBotoneraLateralService.showCancelar(false); |
| 15 | focaBotoneraLateralService.showGuardar(false); | 15 | focaBotoneraLateralService.showGuardar(false); |
| 16 | 16 | ||
| 17 | if(focaAbmVehiculoService.transportistaSeleccionado.COD) { | 17 | if(focaAbmVehiculoService.transportistaSeleccionado.COD) { |
| 18 | elegirTransportista(focaAbmVehiculoService.transportistaSeleccionado); | 18 | elegirTransportista(focaAbmVehiculoService.transportistaSeleccionado); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | $scope.editar = function(id) { | 21 | $scope.editar = function(id) { |
| 22 | $location.path('/vehiculo/' + id + '/' + $scope.idTransportista); | 22 | $location.path('/vehiculo/' + id + '/' + $scope.idTransportista); |
| 23 | }; | 23 | }; |
| 24 | $scope.solicitarConfirmacion = function(vehiculo) { | 24 | $scope.solicitarConfirmacion = function(vehiculo) { |
| 25 | focaModalService.confirm('¿Está seguro que desea borrar el vehiculo ' + | 25 | focaModalService.confirm('¿Está seguro que desea borrar el vehiculo ' + |
| 26 | vehiculo.id + ' ' + vehiculo.tractor + ' ?').then( | 26 | vehiculo.id + ' ' + vehiculo.tractor + ' ?').then( |
| 27 | function(data) { | 27 | function(data) { |
| 28 | if(data) { | 28 | if(data) { |
| 29 | focaAbmVehiculoService.deleteVehiculo(vehiculo.id); | 29 | focaAbmVehiculoService.deleteVehiculo(vehiculo.id); |
| 30 | $scope.vehiculos.splice($scope.vehiculos.indexOf(vehiculo), 1); | 30 | $scope.vehiculos.splice($scope.vehiculos.indexOf(vehiculo), 1); |
| 31 | } | 31 | } |
| 32 | } | 32 | } |
| 33 | ); | 33 | ); |
| 34 | }; | 34 | }; |
| 35 | $scope.seleccionarTransportista = function() { | 35 | $scope.seleccionarTransportista = function() { |
| 36 | var modalInstance = $uibModal.open( | 36 | var modalInstance = $uibModal.open( |
| 37 | { | 37 | { |
| 38 | ariaLabelledBy: 'Busqueda de Transportista', | 38 | ariaLabelledBy: 'Busqueda de Transportista', |
| 39 | templateUrl: 'modal-proveedor.html', | 39 | templateUrl: 'modal-proveedor.html', |
| 40 | controller: 'focaModalProveedorCtrl', | 40 | controller: 'focaModalProveedorCtrl', |
| 41 | size: 'lg', | 41 | size: 'lg', |
| 42 | resolve: { | 42 | resolve: { |
| 43 | transportista: function() { | 43 | transportista: function() { |
| 44 | return true; | 44 | return true; |
| 45 | } | 45 | } |
| 46 | } | 46 | } |
| 47 | } | 47 | } |
| 48 | ); | 48 | ); |
| 49 | modalInstance.result.then( | 49 | modalInstance.result.then( |
| 50 | function(transportista) { | 50 | function(transportista) { |
| 51 | elegirTransportista(transportista); | 51 | elegirTransportista(transportista); |
| 52 | focaAbmVehiculoService.transportistaSeleccionado = transportista; | 52 | focaAbmVehiculoService.transportistaSeleccionado = transportista; |
| 53 | }, function() { | 53 | }, function() { |
| 54 | 54 | ||
| 55 | } | 55 | } |
| 56 | ); | 56 | ); |
| 57 | }; | 57 | }; |
| 58 | 58 | ||
| 59 | function elegirTransportista(transportista) { | 59 | function elegirTransportista(transportista) { |
| 60 | $scope.idTransportista = transportista.COD; | 60 | $scope.idTransportista = transportista.COD; |
| 61 | $scope.filtros = transportista.NOM.trim(); | 61 | $scope.filtros = transportista.NOM.trim(); |
| 62 | $timeout(function() { | 62 | $timeout(function() { |
| 63 | $scope.$broadcast('addCabecera', { | 63 | $scope.$broadcast('addCabecera', { |
| 64 | label: 'Transportista:', | 64 | label: 'Transportista:', |
| 65 | valor: transportista.COD + ' - ' + transportista.NOM | 65 | valor: transportista.COD + ' - ' + transportista.NOM |
| 66 | }); | 66 | }); |
| 67 | }); | 67 | }); |
| 68 | buscar(transportista.COD); | 68 | buscar(transportista.COD); |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | function buscar(idTransportista) { | 71 | function buscar(idTransportista) { |
| 72 | focaAbmVehiculoService | 72 | focaAbmVehiculoService |
| 73 | .getVehiculosPorTransportista(idTransportista) | 73 | .getVehiculosPorTransportista(idTransportista) |
| 74 | .then(function(datos) { | 74 | .then(function(datos) { |
| 75 | $scope.vehiculos = datos.data; | 75 | $scope.vehiculos = datos.data; |
| 76 | }); | 76 | }); |
| 77 | } | 77 | } |
| 78 | |||
| 79 | } | 78 | } |
| 80 | ]) | 79 | ]) |
| 81 | .controller('focaAbmVehiculoController', [ | 80 | .controller('focaAbmVehiculoController', [ |
| 82 | '$scope', 'focaAbmVehiculoService', '$routeParams', '$location', '$uibModal', | 81 | '$scope', 'focaAbmVehiculoService', '$routeParams', '$location', '$uibModal', |
| 83 | 'focaModalService', '$timeout', 'focaBotoneraLateralService', | 82 | 'focaModalService', '$timeout', 'focaBotoneraLateralService', |
| 84 | function($scope, focaAbmVehiculoService, $routeParams, $location, $uibModal, | 83 | function($scope, focaAbmVehiculoService, $routeParams, $location, $uibModal, |
| 85 | focaModalService, $timeout, focaBotoneraLateralService) { | 84 | focaModalService, $timeout, focaBotoneraLateralService) { |
| 86 | $scope.nuevo = $routeParams.idVehiculo == 0 ? true : false; | 85 | $scope.nuevo = $routeParams.idVehiculo === '0' ? true : false; |
| 87 | $scope.now = new Date(); | 86 | $scope.now = new Date(); |
| 88 | $scope.focused = 1; | 87 | $scope.focused = 1; |
| 89 | 88 | ||
| 90 | |||
| 91 | |||
| 92 | $timeout(function() { | 89 | $timeout(function() { |
| 93 | focaBotoneraLateralService.showSalir(false); | 90 | focaBotoneraLateralService.showSalir(false); |
| 94 | focaBotoneraLateralService.showPausar(false); | 91 | focaBotoneraLateralService.showPausar(false); |
| 95 | focaBotoneraLateralService.showCancelar(true); | 92 | focaBotoneraLateralService.showCancelar(true); |
| 96 | focaBotoneraLateralService.showGuardar(true, $scope.guardar); | 93 | focaBotoneraLateralService.showGuardar(true, $scope.guardar); |
| 97 | }); | 94 | }); |
| 98 | console.log($routeParams); | ||
| 99 | |||
| 100 | 95 | ||
| 101 | if($scope.nuevo) { | 96 | if($scope.nuevo) { |
| 102 | focaAbmVehiculoService | 97 | focaAbmVehiculoService |
| 103 | .getTransportistaPorId($routeParams.idTransportista) | 98 | .getTransportistaPorId($routeParams.idTransportista) |
| 104 | .then(function(res) { | 99 | .then(function(res) { |
| 105 | $scope.vehiculo.idTransportista = res.data.COD; | 100 | $scope.vehiculo.idTransportista = res.data.COD; |
| 106 | $scope.vehiculo.transportista = res.data; | 101 | $scope.vehiculo.transportista = res.data; |
| 107 | $scope.$broadcast('addCabecera', { | 102 | $scope.$broadcast('addCabecera', { |
| 108 | label: 'Transportista:', | 103 | label: 'Transportista:', |
| 109 | valor: res.data.COD + ' - ' + res.data.NOM | 104 | valor: res.data.COD + ' - ' + res.data.NOM |
| 110 | }); | 105 | }); |
| 111 | }); | 106 | }); |
| 112 | } | 107 | } |
| 113 | $scope.vehiculo = {}; | 108 | $scope.vehiculo = {}; |
| 114 | focaAbmVehiculoService.getVehiculo($routeParams.idVehiculo).then(function(res) { | 109 | focaAbmVehiculoService.getVehiculo($routeParams.idVehiculo).then(function(res) { |
| 115 | if(res.data) { | 110 | if(res.data) { |
| 116 | $scope.vehiculo = res.data; | 111 | $scope.vehiculo = res.data; |
| 117 | $scope.$broadcast('addCabecera', { | 112 | $scope.$broadcast('addCabecera', { |
| 118 | label: 'Transportista:', | 113 | label: 'Transportista:', |
| 119 | valor: res.data.transportista.COD + ' - ' + res.data.transportista.NOM | 114 | valor: res.data.transportista.COD + ' - ' + res.data.transportista.NOM |
| 120 | }); | 115 | }); |
| 121 | $scope.$broadcast('addCabecera', { | 116 | $scope.$broadcast('addCabecera', { |
| 122 | label: 'Vehículo:', | 117 | label: 'Unidad:', |
| 123 | valor: res.data.codigo | 118 | valor: res.data.codigo |
| 124 | }); | 119 | }); |
| 125 | } | 120 | } |
| 126 | }); | 121 | }); |
| 127 | focaAbmVehiculoService.getCisternadoPorVehiculo($routeParams.idVehiculo) | 122 | focaAbmVehiculoService.getCisternadoPorVehiculo($routeParams.idVehiculo) |
| 128 | .then(function(res) { | 123 | .then(function(res) { |
| 129 | $scope.cisternas = res.data; | 124 | $scope.cisternas = res.data; |
| 130 | }); | 125 | }); |
| 131 | $scope.next = function(key) { | 126 | $scope.next = function(key) { |
| 132 | if (key === 13) $scope.focused++; | 127 | if (key === 13) $scope.focused++; |
| 133 | }; | 128 | }; |
| 134 | $scope.cancelar = function() { | 129 | $scope.cancelar = function() { |
| 135 | $location.path('/vehiculo'); | 130 | $location.path('/vehiculo'); |
| 136 | }; | 131 | }; |
| 137 | $scope.editar = function(id) { | 132 | $scope.editar = function(id) { |
| 138 | $location.path('/vehiculo/' + $routeParams.idVehiculo + '/cisterna/' + id); | 133 | $location.path('/vehiculo/' + $routeParams.idVehiculo + '/cisterna/' + id); |
| 139 | }; | 134 | }; |
| 140 | $scope.guardar = function() { | 135 | $scope.guardar = function() { |
| 141 | if(!$scope.vehiculo.transportista) { | 136 | if(!$scope.vehiculo.transportista) { |
| 142 | focaModalService.alert('Elija Transportista'); | 137 | focaModalService.alert('Elija Transportista'); |
| 143 | return; | 138 | return; |
| 144 | } | 139 | } |
| 145 | delete $scope.vehiculo.transportista; | 140 | delete $scope.vehiculo.transportista; |
| 146 | focaAbmVehiculoService.guerdarVehiculo($scope.vehiculo).then(function(res) { | 141 | focaAbmVehiculoService.guerdarVehiculo($scope.vehiculo).then(function(res) { |
| 147 | if($scope.nuevo) { | 142 | if($scope.nuevo) { |
| 148 | $location.path('/vehiculo/' + res.data.id + '/' + res.data.idTransportista); | 143 | $location.path('/vehiculo/' + res.data.id + '/' + res.data.idTransportista); |
| 149 | } else { | 144 | } else { |
| 150 | $location.path('/vehiculo'); | 145 | $location.path('/vehiculo'); |
| 151 | } | 146 | } |
| 152 | }); | 147 | }); |
| 153 | }; | 148 | }; |
| 154 | $scope.solicitarConfirmacionCisterna = function(cisterna) { | 149 | $scope.solicitarConfirmacionCisterna = function(cisterna) { |
| 155 | focaModalService.confirm('¿Está seguro que desea borrar la cisterna ' + | 150 | focaModalService.confirm('¿Está seguro que desea borrar la cisterna ' + |
| 156 | cisterna.id + ' ' + cisterna.codigo + ' ?').then( | 151 | cisterna.id + ' ' + cisterna.codigo + ' ?').then( |
| 157 | function(data) { | 152 | function(data) { |
| 158 | if(data) { | 153 | if(data) { |
| 159 | focaAbmVehiculoService.deleteCisterna(cisterna.id); | 154 | focaAbmVehiculoService.deleteCisterna(cisterna.id); |
| 160 | $scope.cisternas.splice($scope.cisternas.indexOf(cisterna), 1); | 155 | $scope.cisternas.splice($scope.cisternas.indexOf(cisterna), 1); |
| 161 | } | 156 | } |
| 162 | } | 157 | } |
| 163 | ); | 158 | ); |
| 164 | }; | 159 | }; |
| 165 | $scope.seleccionarTransportista = function() { | 160 | $scope.seleccionarTransportista = function() { |
| 166 | var modalInstance = $uibModal.open( | 161 | var modalInstance = $uibModal.open( |
| 167 | { | 162 | { |
| 168 | ariaLabelledBy: 'Busqueda de Transportista', | 163 | ariaLabelledBy: 'Busqueda de Transportista', |
| 169 | templateUrl: 'modal-proveedor.html', | 164 | templateUrl: 'modal-proveedor.html', |
| 170 | controller: 'focaModalProveedorCtrl', | 165 | controller: 'focaModalProveedorCtrl', |
| 171 | size: 'lg', | 166 | size: 'lg', |
| 172 | resolve: { | 167 | resolve: { |
| 173 | transportista: function() { | 168 | transportista: function() { |
| 174 | return true; | 169 | return true; |
| 175 | } | 170 | } |
| 176 | } | 171 | } |
| 177 | } | 172 | } |
| 178 | ); | 173 | ); |
| 179 | modalInstance.result.then( | 174 | modalInstance.result.then( |
| 180 | function(transportista) { | 175 | function(transportista) { |
| 181 | $scope.vehiculo.idTransportista = transportista.COD; | 176 | $scope.vehiculo.idTransportista = transportista.COD; |
| 182 | $scope.vehiculo.transportista = transportista; | 177 | $scope.vehiculo.transportista = transportista; |
| 183 | }, function() { | 178 | }, function() { |
| 184 | 179 | ||
| 185 | } | 180 | } |
| 186 | ); | 181 | ); |
| 187 | }; | 182 | }; |
| 188 | } | 183 | } |
| 189 | ]); | 184 | ]); |
| 190 | 185 |
src/js/controllerCisterna.js
| 1 | angular.module('focaAbmVehiculo') | 1 | angular.module('focaAbmVehiculo') |
| 2 | .controller('focaAbmVehiculoCisternaController', [ | 2 | .controller('focaAbmVehiculoCisternaController', [ |
| 3 | '$scope', 'focaAbmVehiculoService', '$routeParams', '$location', '$uibModal', | 3 | '$scope', 'focaAbmVehiculoService', '$routeParams', '$location', '$uibModal', |
| 4 | 'focaModalService', 'focaBotoneraLateralService', '$timeout', | 4 | 'focaModalService', 'focaBotoneraLateralService', '$timeout', |
| 5 | function($scope, focaAbmVehiculoService, $routeParams, $location, $uibModal, | 5 | function($scope, focaAbmVehiculoService, $routeParams, $location, $uibModal, |
| 6 | focaModalService, focaBotoneraLateralService, $timeout) { | 6 | focaModalService, focaBotoneraLateralService, $timeout) { |
| 7 | $scope.editar = false; | 7 | $scope.editar = false; |
| 8 | $scope.now = new Date(); | 8 | $scope.now = new Date(); |
| 9 | $scope.cisterna = { | 9 | $scope.cisterna = { |
| 10 | cisternaCarga: { | 10 | cisternaCarga: { |
| 11 | articulo: {} | 11 | articulo: {} |
| 12 | } | 12 | } |
| 13 | }; | 13 | }; |
| 14 | 14 | ||
| 15 | $scope.focused = 1; | 15 | $scope.focused = 1; |
| 16 | $scope.next = function(key) { | 16 | $scope.next = function(key) { |
| 17 | if (key === 13) $scope.focused++; | 17 | if (key === 13) $scope.focused++; |
| 18 | }; | 18 | }; |
| 19 | 19 | ||
| 20 | //SETEO BOTONERA LATERAL | 20 | //SETEO BOTONERA LATERAL |
| 21 | $timeout(function() { | 21 | $timeout(function() { |
| 22 | focaBotoneraLateralService.showSalir(false); | 22 | focaBotoneraLateralService.showSalir(false); |
| 23 | focaBotoneraLateralService.showPausar(false); | 23 | focaBotoneraLateralService.showPausar(false); |
| 24 | focaBotoneraLateralService.showCancelar(true); | 24 | focaBotoneraLateralService.showCancelar(true); |
| 25 | focaBotoneraLateralService.showGuardar(true, $scope.guardar); | 25 | focaBotoneraLateralService.showGuardar(true, $scope.guardar); |
| 26 | }); | 26 | }); |
| 27 | 27 | ||
| 28 | focaAbmVehiculoService.getCisterna($routeParams.id).then(function(res) { | 28 | focaAbmVehiculoService.getCisterna($routeParams.id).then(function(res) { |
| 29 | if(res.data) { | 29 | if(res.data) { |
| 30 | $scope.cisterna = res.data; | 30 | $scope.cisterna = res.data; |
| 31 | $scope.editar = true; | 31 | $scope.editar = true; |
| 32 | }else { | 32 | }else { |
| 33 | $scope.editar = false; | 33 | $scope.editar = false; |
| 34 | } | 34 | } |
| 35 | }); | 35 | }); |
| 36 | focaAbmVehiculoService.getVehiculo($routeParams.idVehiculo).then(function(res) { | 36 | focaAbmVehiculoService.getVehiculo($routeParams.idVehiculo).then(function(res) { |
| 37 | $scope.$broadcast('addCabecera', { | 37 | $scope.$broadcast('addCabecera', { |
| 38 | label: 'Transportista:', | 38 | label: 'Transportista:', |
| 39 | valor: res.data.transportista.COD + ' - ' + res.data.transportista.NOM | 39 | valor: res.data.transportista.COD + ' - ' + res.data.transportista.NOM |
| 40 | }); | 40 | }); |
| 41 | $scope.$broadcast('addCabecera', { | 41 | $scope.$broadcast('addCabecera', { |
| 42 | label: 'Vehículo:', | 42 | label: 'Unidad:', |
| 43 | valor: res.data.codigo | 43 | valor: res.data.codigo |
| 44 | }); | 44 | }); |
| 45 | }); | 45 | }); |
| 46 | $scope.cancelar = function() { | 46 | $scope.cancelar = function() { |
| 47 | $location.path('/vehiculo/' + $routeParams.idVehiculo); | 47 | $location.path('/vehiculo/' + $routeParams.idVehiculo); |
| 48 | }; | 48 | }; |
| 49 | $scope.guardar = function() { | 49 | $scope.guardar = function() { |
| 50 | if(!$scope.cisterna.unidadMedida) { | 50 | if(!$scope.cisterna.unidadMedida) { |
| 51 | focaModalService.alert('Ingrese unidad de medida'); | 51 | focaModalService.alert('Ingrese unidad de medida'); |
| 52 | return; | 52 | return; |
| 53 | } | 53 | } |
| 54 | if(!$scope.cisterna.cisternaCarga.articulo) { | 54 | if(!$scope.cisterna.cisternaCarga.articulo) { |
| 55 | focaModalService.alert('Ingrese producto'); | 55 | focaModalService.alert('Ingrese producto'); |
| 56 | return; | 56 | return; |
| 57 | } | 57 | } |
| 58 | $scope.cisterna.idVehiculo = $routeParams.idVehiculo; | 58 | $scope.cisterna.idVehiculo = $routeParams.idVehiculo; |
| 59 | delete $scope.cisterna.unidadMedida; | 59 | delete $scope.cisterna.unidadMedida; |
| 60 | delete $scope.cisterna.cisternaCarga.articulo; | 60 | delete $scope.cisterna.cisternaCarga.articulo; |
| 61 | focaAbmVehiculoService.guardarCisterna($scope.cisterna).then(function() { | 61 | focaAbmVehiculoService.guardarCisterna($scope.cisterna).then(function() { |
| 62 | $location.path('/vehiculo/' + $routeParams.idVehiculo); | 62 | $location.path('/vehiculo/' + $routeParams.idVehiculo); |
| 63 | }); | 63 | }); |
| 64 | }; | 64 | }; |
| 65 | 65 | ||
| 66 | // $scope.seleccionarArticulo = function() { | 66 | // $scope.seleccionarArticulo = function() { |
| 67 | // var modalInstance = $uibModal.open( | 67 | // var modalInstance = $uibModal.open( |
| 68 | // { | 68 | // { |
| 69 | // ariaLabelledBy: 'Busqueda de Productos', | 69 | // ariaLabelledBy: 'Busqueda de Productos', |
| 70 | // templateUrl: 'modal-busqueda-productos.html', | 70 | // templateUrl: 'modal-busqueda-productos.html', |
| 71 | // controller: 'modalBusquedaProductosCtrl', | 71 | // controller: 'modalBusquedaProductosCtrl', |
| 72 | // resolve: { | 72 | // resolve: { |
| 73 | // parametroProducto: { | 73 | // parametroProducto: { |
| 74 | // idLista: -1, | 74 | // idLista: -1, |
| 75 | // cotizacion: 1, | 75 | // cotizacion: 1, |
| 76 | // simbolo: '$' | 76 | // simbolo: '$' |
| 77 | // } | 77 | // } |
| 78 | // }, | 78 | // }, |
| 79 | // size: 'lg' | 79 | // size: 'lg' |
| 80 | // } | 80 | // } |
| 81 | // ); | 81 | // ); |
| 82 | // modalInstance.result.then( | 82 | // modalInstance.result.then( |
| 83 | // function(producto) { | 83 | // function(producto) { |
| 84 | // $scope.cisterna.cisternaCarga.idProducto = producto.id, | 84 | // $scope.cisterna.cisternaCarga.idProducto = producto.id, |
| 85 | // $scope.cisterna.cisternaCarga.articulo.DetArt = producto.descripcion; | 85 | // $scope.cisterna.cisternaCarga.articulo.DetArt = producto.descripcion; |
| 86 | // }, function() { | 86 | // }, function() { |
| 87 | // // funcion ejecutada cuando se cancela el modal | 87 | // // funcion ejecutada cuando se cancela el modal |
| 88 | // } | 88 | // } |
| 89 | // ); | 89 | // ); |
| 90 | // }; | 90 | // }; |
| 91 | 91 | ||
| 92 | $scope.seleccionarUnidadMedida = function() { | 92 | $scope.seleccionarUnidadMedida = function() { |
| 93 | var modalInstance = $uibModal.open( | 93 | var modalInstance = $uibModal.open( |
| 94 | { | 94 | { |
| 95 | ariaLabelledBy: 'Busqueda de Unidades de medida', | 95 | ariaLabelledBy: 'Busqueda de Unidades de medida', |
| 96 | templateUrl: 'modal-unidad-medida.html', | 96 | templateUrl: 'modal-unidad-medida.html', |
| 97 | controller: 'focaModalUnidadMedidaCtrl', | 97 | controller: 'focaModalUnidadMedidaCtrl', |
| 98 | size: 'lg' | 98 | size: 'lg' |
| 99 | } | 99 | } |
| 100 | ); | 100 | ); |
| 101 | modalInstance.result.then(function(unidaMedida) { | 101 | modalInstance.result.then(function(unidaMedida) { |
| 102 | $scope.cisterna.idUnidadMedida = unidaMedida.ID; | 102 | $scope.cisterna.idUnidadMedida = unidaMedida.ID; |
| 103 | $scope.cisterna.unidadMedida = unidaMedida; | 103 | $scope.cisterna.unidadMedida = unidaMedida; |
| 104 | }); | 104 | }); |
| 105 | }; | 105 | }; |
| 106 | } | 106 | } |
| 107 | ]); | 107 | ]); |
| 108 | 108 |
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-3">Transportista</label> |
| 15 | <div class="input-group col-md-9 pl-0"> | 15 | <div class="input-group col-md-9 pl-0"> |
| 16 | <input | 16 | <input |
| 17 | class="form-control" | 17 | class="form-control" |
| 18 | type="text" | 18 | type="text" |
| 19 | ng-model="vehiculo.transportista.NOM" | 19 | ng-model="vehiculo.transportista.NOM" |
| 20 | readonly | 20 | readonly |
| 21 | /> | 21 | /> |
| 22 | </div> | 22 | </div> |
| 23 | </div> | 23 | </div> |
| 24 | <div class="form-group d-flex mb-2 col-md-6"> | 24 | <div class="form-group d-flex mb-2 col-md-6"> |
| 25 | <label class="col-form-label col-md-3">Unidad</label> | 25 | <label class="col-form-label col-md-3">Unidad</label> |
| 26 | <div class="input-group col-md-9 pl-0"> | 26 | <div class="input-group col-md-9 pl-0"> |
| 27 | <input | 27 | <input |
| 28 | class="form-control" | 28 | class="form-control" |
| 29 | type="text" | 29 | type="text" |
| 30 | teclado-virtual | 30 | teclado-virtual |
| 31 | ng-model="vehiculo.codigo" | 31 | ng-model="vehiculo.codigo" |
| 32 | foca-focus="focused == 2" | 32 | foca-focus="focused == 2" |
| 33 | ng-focus="focused = 2" | 33 | ng-focus="focused = 2" |
| 34 | ng-keypress="next($event.keyCode)" | 34 | ng-keypress="next($event.keyCode)" |
| 35 | /> | 35 | /> |
| 36 | </div> | 36 | </div> |
| 37 | </div> | 37 | </div> |
| 38 | <div class="form-group d-flex mb-2 col-md-6"> | 38 | <div class="form-group d-flex mb-2 col-md-6"> |
| 39 | <label class="col-form-label col-md-3 pt-0">Dominio tractor</label> | 39 | <label class="col-form-label col-md-4">Dominio tractor</label> |
| 40 | <div class="input-group col-md-9 pl-0"> | 40 | <div class="input-group col-md-8 pl-0"> |
| 41 | <input | 41 | <input |
| 42 | class="form-control" | 42 | class="form-control" |
| 43 | type="text" | 43 | type="text" |
| 44 | teclado-virtual | 44 | teclado-virtual |
| 45 | ng-model="vehiculo.tractor" | 45 | ng-model="vehiculo.tractor" |
| 46 | ng-required="true" | 46 | ng-required="true" |
| 47 | foca-focus="focused == 1" | 47 | foca-focus="focused == 1" |
| 48 | ng-focus="focused = 1" | 48 | ng-focus="focused = 1" |
| 49 | ng-keypress="next($event.keyCode)" | 49 | ng-keypress="next($event.keyCode)" |
| 50 | /> | 50 | /> |
| 51 | </div> | 51 | </div> |
| 52 | </div> | 52 | </div> |
| 53 | <div class="form-group d-flex mb-2 col-md-6"> | 53 | <div class="form-group d-flex mb-2 col-md-6"> |
| 54 | <label class="col-form-label col-md-3 pt-0">Dominio semi</label> | 54 | <label class="col-form-label col-md-4">Dominio semi</label> |
| 55 | <div class="input-group col-md-9 pl-0"> | 55 | <div class="input-group col-md-8 pl-0"> |
| 56 | <input | 56 | <input |
| 57 | class="form-control" | 57 | class="form-control" |
| 58 | type="text" | 58 | type="text" |
| 59 | teclado-virtual | 59 | teclado-virtual |
| 60 | ng-model="vehiculo.semi" | 60 | ng-model="vehiculo.semi" |
| 61 | ng-required="true" | 61 | ng-required="true" |
| 62 | foca-focus="focused == 3" | 62 | foca-focus="focused == 3" |
| 63 | ng-focus="focused = 3" | 63 | ng-focus="focused = 3" |
| 64 | ng-keypress="next($event.keyCode)" | 64 | ng-keypress="next($event.keyCode)" |
| 65 | /> | 65 | /> |
| 66 | </div> | 66 | </div> |
| 67 | </div> | 67 | </div> |
| 68 | </div> | 68 | </div> |
| 69 | </form> | 69 | </form> |
| 70 | <div ng-show="!nuevo"> | 70 | <div ng-show="!nuevo"> |
| 71 | <h5 class="pl-4 table-title">Cisternas</h5> | 71 | <h5 class="pl-4 table-title">Cisternas</h5> |
| 72 | <table class="table table-default table-hover table-sm table-abm table-striped mb-0"> | 72 | <table class="table table-default table-hover table-sm table-abm table-striped mb-0"> |
| 73 | <thead> | 73 | <thead> |
| 74 | <tr> | 74 | <tr> |
| 75 | <th class="px-5">Código</th> | 75 | <th class="px-5">Código</th> |
| 76 | <th class="text-right px-5">Capacidad</th> | 76 | <th class="text-right px-5">Capacidad</th> |
| 77 | <th class="px-5">Unidad de Medida</th> | 77 | <th class="px-5">Unidad de Medida</th> |
| 78 | <th class="text-right px-5">Carga</th> | 78 | <th class="text-right px-5">Carga</th> |
| 79 | <th class="text-center px-4"> | 79 | <th class="text-center px-4"> |
| 80 | <button | 80 | <button |
| 81 | class="btn btn-outline-debo boton-accion" | 81 | class="btn btn-outline-debo boton-accion" |
| 82 | title="Agregar" | 82 | title="Agregar" |
| 83 | ng-click="editar(0)"> | 83 | ng-click="editar(0)"> |
| 84 | <i class="fa fa-plus"></i> | 84 | <i class="fa fa-plus"></i> |
| 85 | </button> | 85 | </button> |
| 86 | </th> | 86 | </th> |
| 87 | </tr> | 87 | </tr> |
| 88 | </thead> | 88 | </thead> |
| 89 | <tbody> | 89 | <tbody> |
| 90 | <tr ng-repeat="cisterna in cisternas | filter:filtros"> | 90 | <tr ng-repeat="cisterna in cisternas | filter:filtros"> |
| 91 | <td ng-bind="cisterna.codigo" class="px-5"></td> | 91 | <td ng-bind="cisterna.codigo" class="px-5"></td> |
| 92 | <td ng-bind="cisterna.capacidad" class="text-right px-5"></td> | 92 | <td ng-bind="cisterna.capacidad" class="text-right px-5"></td> |
| 93 | <td ng-bind="cisterna.unidadMedida.NOM" class="px-5"></td> | 93 | <td ng-bind="cisterna.unidadMedida.NOM" class="px-5"></td> |
| 94 | <td ng-bind="cisterna.cisternaCarga.cantidad || 0" class="text-right px-5"></td> | 94 | <td ng-bind="cisterna.cisternaCarga.cantidad || 0" class="text-right px-5"></td> |
| 95 | <td class="text-center px-4"> | 95 | <td class="text-center px-4"> |
| 96 | <button | 96 | <button |
| 97 | class="btn btn-outline-dark boton-accion" | 97 | class="btn btn-outline-dark boton-accion" |
| 98 | title="Editar" | 98 | title="Editar" |
| 99 | ng-click="editar(cisterna.id)" | 99 | ng-click="editar(cisterna.id)" |
| 100 | > | 100 | > |
| 101 | <i class="fa fa-pencil"></i> | 101 | <i class="fa fa-pencil"></i> |
| 102 | </button> | 102 | </button> |
| 103 | <button | 103 | <button |
| 104 | class="btn btn-outline-dark boton-accion" | 104 | class="btn btn-outline-dark boton-accion" |
| 105 | title="Eliminar" | 105 | title="Eliminar" |
| 106 | ng-click="solicitarConfirmacionCisterna(cisterna)" | 106 | ng-click="solicitarConfirmacionCisterna(cisterna)" |
| 107 | > | 107 | > |
| 108 | <i class="fa fa-trash"></i> | 108 | <i class="fa fa-trash"></i> |
| 109 | </button> | 109 | </button> |
| 110 | </td> | 110 | </td> |
| 111 | </tr> | 111 | </tr> |
| 112 | </body> | 112 | </body> |
| 113 | </table> | 113 | </table> |
| 114 | </div> | 114 | </div> |
| 115 | </div> | 115 | </div> |
| 116 | </div> | 116 | </div> |
| 117 | 117 |