Commit 0b7cac22dbb8af4c9140d86cb8ba208bc3fc5a79
Exists in
master
and in
2 other branches
Merge branch 'master' into 'develop'
Master(mpuebla) See merge request !32
Showing
3 changed files
Show diff stats
package.json
| 1 | { | 1 | { |
| 2 | "name": "foca-admin-seguimiento", | 2 | "name": "foca-admin-seguimiento", |
| 3 | "version": "0.0.2", | 3 | "version": "0.0.2", |
| 4 | "description": "Seguimiento de actividad", | 4 | "description": "Seguimiento de actividad", |
| 5 | "main": "index.js", | 5 | "main": "index.js", |
| 6 | "scripts": { | 6 | "scripts": { |
| 7 | "refresh": "gulp uglify && cp tmp/foca-admin-seguimiento.js ../wrapper-demo/node_modules/foca-admin-seguimiento/dist/foca-admin-seguimiento.min.js", | ||
| 7 | "test": "echo \"Error: no test specified\" && exit 1", | 8 | "test": "echo \"Error: no test specified\" && exit 1", |
| 8 | "compile": "gulp uglify", | 9 | "compile": "gulp uglify", |
| 9 | "gulp-pre-commit": "gulp pre-commit", | 10 | "gulp-pre-commit": "gulp pre-commit", |
| 10 | "postinstall": "npm run compile && gulp clean-post-install", | 11 | "postinstall": "npm run compile && gulp clean-post-install", |
| 11 | "install-dev": "npm install -D jasmine-core pre-commit angular angular-route bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-uglify jquery jshint leaflet pump" | 12 | "install-dev": "npm install -D jasmine-core pre-commit angular angular-route bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-uglify jquery jshint leaflet pump" |
| 12 | }, | 13 | }, |
| 13 | "pre-commit": [ | 14 | "pre-commit": [ |
| 14 | "gulp-pre-commit" | 15 | "gulp-pre-commit" |
| 15 | ], | 16 | ], |
| 16 | "repository": { | 17 | "repository": { |
| 17 | "type": "git", | 18 | "type": "git", |
| 18 | "url": "https://debo.suite.repo/modulos-npm/foca-admin-seguimiento.git" | 19 | "url": "https://debo.suite.repo/modulos-npm/foca-admin-seguimiento.git" |
| 19 | }, | 20 | }, |
| 20 | "author": "Foca Software", | 21 | "author": "Foca Software", |
| 21 | "license": "ISC", | 22 | "license": "ISC", |
| 22 | "devDependencies": { | 23 | "devDependencies": { |
| 23 | "angular": "^1.7.5", | 24 | "angular": "^1.7.5", |
| 24 | "angular-route": "^1.7.5", | 25 | "angular-route": "^1.7.5", |
| 25 | "bootstrap": "^4.1.3", | 26 | "bootstrap": "^4.1.3", |
| 26 | "font-awesome": "^4.7.0", | 27 | "font-awesome": "^4.7.0", |
| 27 | "gulp": "^3.9.1", | 28 | "gulp": "^3.9.1", |
| 28 | "gulp-angular-templatecache": "^2.2.3", | 29 | "gulp-angular-templatecache": "^2.2.3", |
| 29 | "gulp-clean": "^0.4.0", | 30 | "gulp-clean": "^0.4.0", |
| 30 | "gulp-concat": "^2.6.1", | 31 | "gulp-concat": "^2.6.1", |
| 31 | "gulp-connect": "^5.6.1", | 32 | "gulp-connect": "^5.6.1", |
| 32 | "gulp-htmlmin": "^5.0.1", | 33 | "gulp-htmlmin": "^5.0.1", |
| 33 | "gulp-jshint": "^2.1.0", | 34 | "gulp-jshint": "^2.1.0", |
| 34 | "gulp-rename": "^1.4.0", | 35 | "gulp-rename": "^1.4.0", |
| 35 | "gulp-replace": "^1.0.0", | 36 | "gulp-replace": "^1.0.0", |
| 36 | "gulp-sequence": "^1.0.0", | 37 | "gulp-sequence": "^1.0.0", |
| 37 | "gulp-uglify": "^3.0.1", | 38 | "gulp-uglify": "^3.0.1", |
| 38 | "gulp-uglify-es": "^1.0.4", | 39 | "gulp-uglify-es": "^1.0.4", |
| 39 | "jasmine-core": "^3.3.0", | 40 | "jasmine-core": "^3.3.0", |
| 40 | "jquery": "^3.3.1", | 41 | "jquery": "^3.3.1", |
| 41 | "jshint": "^2.9.6", | 42 | "jshint": "^2.9.6", |
| 42 | "leaflet": "^1.3.4", | 43 | "leaflet": "^1.3.4", |
| 43 | "pre-commit": "^1.2.2", | 44 | "pre-commit": "^1.2.2", |
| 44 | "pump": "^3.0.0", | 45 | "pump": "^3.0.0", |
| 45 | "ui-bootstrap4": "^3.0.5" | 46 | "ui-bootstrap4": "^3.0.5" |
| 46 | } | 47 | } |
| 47 | } | 48 | } |
| 48 | 49 |
src/js/controller.js
| 1 | angular.module('focaAdminSeguimiento').controller('focaAdminSeguimientoController', [ | 1 | angular.module('focaAdminSeguimiento').controller('focaAdminSeguimientoController', [ |
| 2 | '$scope', '$timeout', 'focaAdminSeguimientoService', '$uibModal', | 2 | '$scope', '$timeout', 'focaAdminSeguimientoService', '$uibModal', |
| 3 | 'focaBotoneraLateralService', '$location', '$routeParams', 'focaModalService', | 3 | 'focaBotoneraLateralService', '$location', '$routeParams', 'focaModalService', |
| 4 | function ($scope, $timeout, focaAdminSeguimientoService, $uibModal, | 4 | function ($scope, $timeout, focaAdminSeguimientoService, $uibModal, |
| 5 | focaBotoneraLateralService, $location, $routeParams, focaModalService) { | 5 | focaBotoneraLateralService, $location, $routeParams, focaModalService) { |
| 6 | $scope.actividad = ''; | 6 | $scope.actividad = ''; |
| 7 | $scope.titulo = ''; | 7 | $scope.titulo = ''; |
| 8 | var cabecera = ''; | 8 | var cabecera = ''; |
| 9 | var plural = ''; | 9 | var plural = ''; |
| 10 | 10 | ||
| 11 | $scope.now = new Date(); | 11 | $scope.now = new Date(); |
| 12 | $scope.dateOptions = { | 12 | $scope.dateOptions = { |
| 13 | maxDate: new Date() | 13 | maxDate: new Date() |
| 14 | }; | 14 | }; |
| 15 | 15 | ||
| 16 | switch ($routeParams.parametro) { | 16 | switch ($routeParams.parametro) { |
| 17 | case 'nota-pedido': | 17 | case 'nota-pedido': |
| 18 | $scope.actividad = 'Nota de pedido'; | 18 | $scope.actividad = 'Nota de pedido'; |
| 19 | $scope.titulo = 'Seguimiento de nota de pedido'; | 19 | $scope.titulo = 'Seguimiento de nota de pedido'; |
| 20 | cabecera = 'Vendedor:'; | 20 | cabecera = 'Vendedor:'; |
| 21 | plural = 'Vendedores'; | 21 | plural = 'Vendedores'; |
| 22 | break; | 22 | break; |
| 23 | case 'hoja-ruta': | 23 | case 'hoja-ruta': |
| 24 | $scope.actividad = 'Entrega de producto'; | 24 | $scope.actividad = 'Entrega de producto'; |
| 25 | $scope.titulo = 'Seguimiento de hoja de ruta'; | 25 | $scope.titulo = 'Seguimiento de hoja de ruta'; |
| 26 | cabecera = 'Vehiculo:'; | 26 | cabecera = 'Vehiculo:'; |
| 27 | plural = 'Vehiculos'; | 27 | plural = 'Vehiculos'; |
| 28 | break; | 28 | break; |
| 29 | case 'cobranza': | 29 | case 'cobranza': |
| 30 | $scope.actividad = 'Cobranza'; | 30 | $scope.actividad = 'Cobranza'; |
| 31 | $scope.titulo = 'Seguimiento de cobranza'; | 31 | $scope.titulo = 'Seguimiento de cobranza'; |
| 32 | cabecera = 'Cobrador:'; | 32 | cabecera = 'Cobrador:'; |
| 33 | plural = 'Cobradores'; | 33 | plural = 'Cobradores'; |
| 34 | break; | 34 | break; |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | $scope.idUsuario = 0; | 37 | $scope.idUsuario = 0; |
| 38 | $scope.marcadores = []; | 38 | $scope.marcadores = []; |
| 39 | getSeguimiento(); | 39 | getSeguimiento(); |
| 40 | 40 | ||
| 41 | //SETEO BOTONERA LATERAL | 41 | //SETEO BOTONERA LATERAL |
| 42 | focaBotoneraLateralService.showSalir(true); | 42 | focaBotoneraLateralService.showSalir(true); |
| 43 | focaBotoneraLateralService.showPausar(false); | 43 | focaBotoneraLateralService.showPausar(false); |
| 44 | focaBotoneraLateralService.showGuardar(false); | 44 | focaBotoneraLateralService.showGuardar(false); |
| 45 | 45 | ||
| 46 | $scope.general = function () { | 46 | $scope.general = function () { |
| 47 | $scope.idUsuario = 0; | 47 | $scope.idUsuario = 0; |
| 48 | getSeguimiento(); | 48 | getSeguimiento(); |
| 49 | }; | 49 | }; |
| 50 | 50 | ||
| 51 | $scope.individual = function () { | 51 | $scope.individual = function () { |
| 52 | $scope.idUsuario = -1; | 52 | $scope.idUsuario = -1; |
| 53 | }; | 53 | }; |
| 54 | 54 | ||
| 55 | $scope.salir = function () { | 55 | $scope.salir = function () { |
| 56 | $location.path('/'); | 56 | $location.path('/'); |
| 57 | }; | 57 | }; |
| 58 | 58 | ||
| 59 | $scope.search = function (key) { | 59 | $scope.search = function (key) { |
| 60 | if (key === 13) { | 60 | if (key === 13) { |
| 61 | $scope.idUsuario = $scope.idUsuarioInput; | 61 | $scope.idUsuario = $scope.idUsuarioInput; |
| 62 | 62 | ||
| 63 | getSeguimiento(); | 63 | getSeguimiento(); |
| 64 | if ($scope.actividad === 'Entrega de producto' && $scope.idUsuario !== 0) { | 64 | if ($scope.actividad === 'Entrega de producto' && $scope.idUsuario !== 0) { |
| 65 | focaAdminSeguimientoService.obtenerRemitosVehiculo($scope.idUsuario) | 65 | focaAdminSeguimientoService.obtenerRemitosVehiculo($scope.idUsuario) |
| 66 | .then(function (res) { | 66 | .then(function (res) { |
| 67 | var remitos = []; | 67 | var remitos = []; |
| 68 | for (var i = 0; i < res.data.length; i++) { | 68 | for (var i = 0; i < res.data.length; i++) { |
| 69 | remitos = remitos.concat(res.data[i].remitos); | 69 | remitos = remitos.concat(res.data[i].remitos); |
| 70 | } | 70 | } |
| 71 | $scope.remitosVehiculo = remitos; | 71 | $scope.remitosVehiculo = remitos; |
| 72 | }); | 72 | }); |
| 73 | } | 73 | } |
| 74 | } | 74 | } |
| 75 | }; | 75 | }; |
| 76 | 76 | ||
| 77 | $scope.fecha = function () { | 77 | $scope.fecha = function () { |
| 78 | getSeguimiento(); | 78 | getSeguimiento(); |
| 79 | }; | 79 | }; |
| 80 | 80 | ||
| 81 | $scope.showMarcadores = function () { | 81 | $scope.showMarcadores = function () { |
| 82 | var texto = ''; | 82 | var texto = ''; |
| 83 | 83 | ||
| 84 | if ($scope.actividad === 'Nota de pedido') { | 84 | if ($scope.actividad === 'Nota de pedido') { |
| 85 | texto = 'Marcadores de notas de pedido'; | 85 | texto = 'Marcadores de notas de pedido'; |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | if ($scope.actividad === 'Entrega de producto') { | 88 | if ($scope.actividad === 'Entrega de producto') { |
| 89 | texto = 'Marcadores de entregas'; | 89 | texto = 'Marcadores de entregas'; |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | if ($scope.actividad === 'Cobranza') { | 92 | if ($scope.actividad === 'Cobranza') { |
| 93 | texto = 'Marcadores de cobranzas'; | 93 | texto = 'Marcadores de cobranzas'; |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | 96 | ||
| 97 | var modalInstance = $uibModal.open( | 97 | var modalInstance = $uibModal.open( |
| 98 | { | 98 | { |
| 99 | ariaLabelledBy: texto, | 99 | ariaLabelledBy: texto, |
| 100 | templateUrl: 'foca-modal-marcadores.html', | 100 | templateUrl: 'foca-modal-marcadores.html', |
| 101 | controller: 'focaModalMarcadoresController', | 101 | controller: 'focaModalMarcadoresController', |
| 102 | size: 'lg', | 102 | size: 'lg', |
| 103 | resolve: { | 103 | resolve: { |
| 104 | parametros: function () { | 104 | parametros: function () { |
| 105 | var parametros = { | 105 | var parametros = { |
| 106 | marcadores: $scope.marcadores, | 106 | marcadores: $scope.marcadores, |
| 107 | actividad: $scope.actividad | 107 | actividad: $scope.actividad |
| 108 | }; | 108 | }; |
| 109 | 109 | ||
| 110 | return parametros; | 110 | return parametros; |
| 111 | } | 111 | } |
| 112 | } | 112 | } |
| 113 | } | 113 | } |
| 114 | ); | 114 | ); |
| 115 | 115 | ||
| 116 | modalInstance.result.then( | 116 | modalInstance.result.then( |
| 117 | function (localizacion) { | 117 | function (localizacion) { |
| 118 | $scope.$broadcast('moveMap', { | 118 | $scope.$broadcast('moveMap', { |
| 119 | latitud: localizacion.latitud, | 119 | latitud: localizacion.latitud, |
| 120 | longitud: localizacion.longitud, | 120 | longitud: localizacion.longitud, |
| 121 | indice: localizacion.indice | 121 | indice: localizacion.indice |
| 122 | }); | 122 | }); |
| 123 | }, function () { | 123 | }, function () { |
| 124 | // funcion ejecutada cuando se cancela el modal | 124 | // funcion ejecutada cuando se cancela el modal |
| 125 | } | 125 | } |
| 126 | ); | 126 | ); |
| 127 | }; | 127 | }; |
| 128 | 128 | ||
| 129 | function getSeguimiento() { | 129 | function getSeguimiento() { |
| 130 | var now = $scope.now; | 130 | var now = $scope.now; |
| 131 | var hasta = angular.copy(now); | 131 | var hasta = angular.copy(now); |
| 132 | hasta.setDate(hasta.getDate() + 1); | 132 | hasta.setDate(hasta.getDate() + 1); |
| 133 | 133 | ||
| 134 | var datos = { | 134 | var datos = { |
| 135 | actividad: $scope.actividad, | 135 | actividad: $scope.actividad, |
| 136 | idUsuario: $scope.idUsuario, | 136 | idUsuario: $scope.idUsuario, |
| 137 | fechaDesde: now, | 137 | fechaDesde: now, |
| 138 | fechaHasta: hasta, | 138 | fechaHasta: hasta, |
| 139 | entregado: $scope.filtroEstado ? true : ($scope.filtroEstado !== undefined ? | 139 | entregado: $scope.filtroEstado ? true : ($scope.filtroEstado !== undefined ? |
| 140 | false : undefined) | 140 | false : undefined) |
| 141 | }; | 141 | }; |
| 142 | 142 | ||
| 143 | $scope.datosBuscados = { | 143 | $scope.datosBuscados = { |
| 144 | actividad: $scope.actividad, | 144 | actividad: $scope.actividad, |
| 145 | individual: $scope.idUsuario !== 0 ? true : false | 145 | individual: $scope.idUsuario !== 0 ? true : false |
| 146 | }; | 146 | }; |
| 147 | 147 | ||
| 148 | focaAdminSeguimientoService | 148 | focaAdminSeguimientoService |
| 149 | .obtenerActividad(datos) | 149 | .obtenerActividad(datos) |
| 150 | .then(function (datos) { | 150 | .then(function (datos) { |
| 151 | $scope.marcadores = datos.data; | 151 | $scope.marcadores = datos.data; |
| 152 | $scope.$broadcast('cleanCabecera'); | 152 | $scope.$broadcast('cleanCabecera'); |
| 153 | 153 | ||
| 154 | if ($scope.idUsuario !== 0) { | 154 | if ($scope.idUsuario !== 0) { |
| 155 | $scope.$broadcast('addCabecera', { | 155 | $scope.$broadcast('addCabecera', { |
| 156 | label: 'Individual', | 156 | label: 'Individual', |
| 157 | valor: '' | 157 | valor: '' |
| 158 | }); | 158 | }); |
| 159 | 159 | ||
| 160 | var valor = ''; | 160 | var valor = ''; |
| 161 | switch ($routeParams.parametro) { | 161 | switch ($routeParams.parametro) { |
| 162 | case 'nota-pedido': | 162 | case 'nota-pedido': |
| 163 | if (datos.data.length) { | 163 | if (datos.data.length) { |
| 164 | valor = datos.data[0].notaPedido.vendedor.NUM + ' - ' + | 164 | valor = datos.data[0].notaPedido.vendedor.NUM + ' - ' + |
| 165 | datos.data[0].notaPedido.vendedor.NOM.trim(); | 165 | datos.data[0].notaPedido.vendedor.NOM.trim(); |
| 166 | } else { | 166 | } else { |
| 167 | valor = $scope.idUsuario; | 167 | valor = $scope.idUsuario; |
| 168 | } | 168 | } |
| 169 | break; | 169 | break; |
| 170 | case 'hoja-ruta': | 170 | case 'hoja-ruta': |
| 171 | if (datos.data.length) { | 171 | if (datos.data.length) { |
| 172 | valor = datos.data[0].hojaRutaMovimiento.remito.hojaRuta | 172 | valor = datos.data[0].hojaRutaMovimiento.remito.hojaRuta |
| 173 | .vehiculo.codigo + ' - ' + datos.data[0] | 173 | .vehiculo.codigo + ' - ' + datos.data[0] |
| 174 | .hojaRutaMovimiento.remito.hojaRuta.vehiculo.tractor.trim(); | 174 | .hojaRutaMovimiento.remito.hojaRuta.vehiculo.tractor.trim(); |
| 175 | } else { | 175 | } else { |
| 176 | valor = $scope.idUsuario; | 176 | valor = $scope.idUsuario; |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | break; | 179 | break; |
| 180 | case 'cobranza': | 180 | case 'cobranza': |
| 181 | if (datos.data.length) { | 181 | if (datos.data.length) { |
| 182 | valor = datos.data[0].recibo.cobrador.NUM + ' - ' + | 182 | valor = datos.data[0].recibo.cobrador.NUM + ' - ' + |
| 183 | datos.data[0].recibo.cobrador.NOM.trim(); | 183 | datos.data[0].recibo.cobrador.NOM.trim(); |
| 184 | } else { | 184 | } else { |
| 185 | valor = $scope.idUsuario; | 185 | valor = $scope.idUsuario; |
| 186 | } | 186 | } |
| 187 | break; | 187 | break; |
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | $scope.$broadcast('addCabecera', { | 190 | $scope.$broadcast('addCabecera', { |
| 191 | label: cabecera, | 191 | label: cabecera, |
| 192 | valor: valor | 192 | valor: valor |
| 193 | }); | 193 | }); |
| 194 | 194 | ||
| 195 | } else { | 195 | } else { |
| 196 | $scope.$broadcast('addCabecera', { | 196 | $scope.$broadcast('addCabecera', { |
| 197 | label: 'General', | 197 | label: 'General', |
| 198 | valor: '' | 198 | valor: '' |
| 199 | }); | 199 | }); |
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | $scope.$broadcast('addCabecera', { | 202 | $scope.$broadcast('addCabecera', { |
| 203 | label: 'Cantidad: ', | 203 | label: 'Cantidad: ', |
| 204 | valor: datos.data.length + ' Marcadores' | 204 | valor: datos.data.length + ' Marcadores' |
| 205 | }); | 205 | }); |
| 206 | }); | 206 | }); |
| 207 | } | 207 | } |
| 208 | $scope.openModal = function () { | 208 | $scope.openModal = function (key) { |
| 209 | if (key !== 13) return; | ||
| 209 | var parametrosModal = {}; | 210 | var parametrosModal = {}; |
| 210 | switch ($routeParams.parametro) { | 211 | switch ($routeParams.parametro) { |
| 211 | case 'nota-pedido': | 212 | case 'nota-pedido': |
| 212 | parametrosModal = { | 213 | parametrosModal = { |
| 213 | titulo: 'Búsqueda vendedores', | 214 | titulo: 'Búsqueda vendedores', |
| 214 | query: '/vendedor', | 215 | query: '/vendedor', |
| 215 | columnas: [ | 216 | columnas: [ |
| 216 | { | 217 | { |
| 217 | propiedad: 'NUM', | 218 | propiedad: 'NUM', |
| 218 | nombre: 'Código', | 219 | nombre: 'Código', |
| 219 | filtro: { | 220 | filtro: { |
| 220 | nombre: 'rellenarDigitos', | 221 | nombre: 'rellenarDigitos', |
| 221 | parametro: 3 | 222 | parametro: 3 |
| 222 | } | 223 | } |
| 223 | }, | 224 | }, |
| 224 | { | 225 | { |
| 225 | propiedad: 'NOM', | 226 | propiedad: 'NOM', |
| 226 | nombre: 'Nombre' | 227 | nombre: 'Nombre' |
| 227 | } | 228 | } |
| 228 | ], | 229 | ], |
| 229 | size: 'md' | 230 | size: 'md' |
| 230 | }; | 231 | }; |
| 231 | break; | 232 | break; |
| 232 | case 'hoja-ruta': | 233 | case 'hoja-ruta': |
| 233 | parametrosModal = { | 234 | parametrosModal = { |
| 234 | titulo: 'Búsqueda de Transportista', | 235 | titulo: 'Búsqueda de Transportista', |
| 235 | query: '/transportista', | 236 | query: '/transportista', |
| 236 | columnas: [ | 237 | columnas: [ |
| 237 | { | 238 | { |
| 238 | nombre: 'Código', | 239 | nombre: 'Código', |
| 239 | propiedad: 'COD' | 240 | propiedad: 'COD' |
| 240 | }, | 241 | }, |
| 241 | { | 242 | { |
| 242 | nombre: 'Nombre', | 243 | nombre: 'Nombre', |
| 243 | propiedad: 'NOM' | 244 | propiedad: 'NOM' |
| 244 | }, | 245 | }, |
| 245 | { | 246 | { |
| 246 | nombre: 'CUIT', | 247 | nombre: 'CUIT', |
| 247 | propiedad: 'CUIT' | 248 | propiedad: 'CUIT' |
| 248 | } | 249 | } |
| 249 | ], | 250 | ], |
| 250 | size: 'md' | 251 | size: 'md' |
| 251 | }; | 252 | }; |
| 252 | break; | 253 | break; |
| 253 | case 'cobranza': | 254 | case 'cobranza': |
| 254 | parametrosModal = { | 255 | parametrosModal = { |
| 255 | titulo: 'Búsqueda de cobradores', | 256 | titulo: 'Búsqueda de cobradores', |
| 256 | query: '/cobrador', | 257 | query: '/cobrador', |
| 257 | columnas: [ | 258 | columnas: [ |
| 258 | { | 259 | { |
| 259 | propiedad: 'NUM', | 260 | propiedad: 'NUM', |
| 260 | nombre: 'Codigo', | 261 | nombre: 'Codigo', |
| 261 | filtro: { | 262 | filtro: { |
| 262 | nombre: 'rellenarDigitos', | 263 | nombre: 'rellenarDigitos', |
| 263 | parametro: 3 | 264 | parametro: 3 |
| 264 | } | 265 | } |
| 265 | }, | 266 | }, |
| 266 | { | 267 | { |
| 267 | propiedad: 'NOM', | 268 | propiedad: 'NOM', |
| 268 | nombre: 'Nombre' | 269 | nombre: 'Nombre' |
| 269 | } | 270 | } |
| 270 | ], | 271 | ], |
| 271 | size: 'md' | 272 | size: 'md' |
| 272 | }; | 273 | }; |
| 273 | break; | 274 | break; |
| 274 | default: | 275 | default: |
| 275 | break; | 276 | break; |
| 276 | } | 277 | } |
| 277 | focaModalService.modal(parametrosModal) | 278 | focaModalService.modal(parametrosModal) |
| 278 | .then( | 279 | .then(function (data) { |
| 279 | function (data) { | 280 | $scope.idUsuario = $scope.idUsuarioInput = data.NUM; |
| 280 | $scope.idUsuario = $scope.idUsuarioInput = data.NUM; | 281 | getSeguimiento(); |
| 281 | getSeguimiento(); | 282 | if ($scope.actividad === 'Entrega de producto' && $scope.idUsuario !== 0) { |
| 282 | if ($scope.actividad === 'Entrega de producto' && $scope.idUsuario !== 0) { | 283 | focaAdminSeguimientoService.obtenerRemitosVehiculo($scope.idUsuario) |
| 283 | focaAdminSeguimientoService.obtenerRemitosVehiculo($scope.idUsuario) | 284 | .then(function (res) { |
| 284 | .then(function (res) { | 285 | var remitos = []; |
| 285 | var remitos = []; | 286 | for (var i = 0; i < res.data.length; i++) { |
| 286 | for (var i = 0; i < res.data.length; i++) { | 287 | remitos = remitos.concat(res.data[i].remitos); |
| 287 | remitos = remitos.concat(res.data[i].remitos); | 288 | } |
| 288 | } | 289 | $scope.remitosVehiculo = remitos; |
| 289 | $scope.remitosVehiculo = remitos; | 290 | }); |
| 290 | }); | ||
| 291 | } | ||
| 292 | } | 291 | } |
| 293 | ) | 292 | }) |
| 294 | .catch(function (e) { console.log(e) }); | 293 | .catch(function (e) { console.error(e) }); |
| 295 | } | 294 | } |
| 296 | } | 295 | } |
| 297 | ]); | 296 | ]); |
src/views/foca-admin-seguimiento.html
| 1 | <div class="foca-admin-seguimiento"> | 1 | <div class="foca-admin-seguimiento"> |
| 2 | <div class="row"> | 2 | <div class="row"> |
| 3 | <foca-cabecera-facturador | 3 | <foca-cabecera-facturador |
| 4 | titulo="titulo" | 4 | titulo="titulo" |
| 5 | fecha="now" | 5 | fecha="now" |
| 6 | class="mb-0 col-lg-12" | 6 | class="mb-0 col-lg-12" |
| 7 | ></foca-cabecera-facturador> | 7 | ></foca-cabecera-facturador> |
| 8 | </div> | 8 | </div> |
| 9 | <div class="row"> | 9 | <div class="row"> |
| 10 | <div class="col-10"> | 10 | <div class="col-10"> |
| 11 | <osm | 11 | <osm |
| 12 | latitud="-34.7152975" | 12 | latitud="-34.7152975" |
| 13 | longitud="-65.9053867" | 13 | longitud="-65.9053867" |
| 14 | zoom="6" | 14 | zoom="6" |
| 15 | marcadores="marcadores" | 15 | marcadores="marcadores" |
| 16 | parametros= "datosBuscados" | 16 | parametros= "datosBuscados" |
| 17 | /> | 17 | /> |
| 18 | </div> | 18 | </div> |
| 19 | <div class="col-2 pl-0"> | 19 | <div class="col-2 pl-0"> |
| 20 | <div class="input-group mb-3"> | 20 | <div class="input-group mb-3"> |
| 21 | <div class="input-group-prepend my-2"> | 21 | <div class="input-group-prepend my-2"> |
| 22 | <button | 22 | <button |
| 23 | class="input-group-text" | 23 | class="input-group-text" |
| 24 | ng-click="datepickerOpen = true" | 24 | ng-click="datepickerOpen = true" |
| 25 | > | 25 | > |
| 26 | <i class="fa fa-calendar" aria-hidden="true"></i> | 26 | <i class="fa fa-calendar" aria-hidden="true"></i> |
| 27 | </button> | 27 | </button> |
| 28 | </div> | 28 | </div> |
| 29 | <input | 29 | <input |
| 30 | type="text" | 30 | type="text" |
| 31 | ng-model="now" | 31 | ng-model="now" |
| 32 | class="form-control col-12 my-2" | 32 | class="form-control col-12 my-2" |
| 33 | ng-blur="fecha()" | 33 | ng-blur="fecha()" |
| 34 | uib-datepicker-popup="dd/MM/yyyy" | 34 | uib-datepicker-popup="dd/MM/yyyy" |
| 35 | show-button-bar="false" | 35 | show-button-bar="false" |
| 36 | is-open="datepickerOpen" | 36 | is-open="datepickerOpen" |
| 37 | on-open-focus="false" | 37 | on-open-focus="false" |
| 38 | ng-focus="datepickerOpen = true" | 38 | ng-focus="datepickerOpen = true" |
| 39 | datepicker-options="dateOptions" | 39 | datepicker-options="dateOptions" |
| 40 | /> | 40 | /> |
| 41 | </div> | 41 | </div> |
| 42 | <button | 42 | <button |
| 43 | type="button" | 43 | type="button" |
| 44 | ng-class="{'active': idUsuario == 0}" | 44 | class="btn btn-outline-light col-12 my-1" |
| 45 | class="btn btn-outline-debo col-12 my-1" | 45 | ng-click="general()"> |
| 46 | ng-click="general()" | 46 | General |
| 47 | >General</button> | 47 | <div |
| 48 | ng-class="{'btn-default': idUsuario != 0,'btn-primary': idUsuario == 0}" | ||
| 49 | class="btn fa fa-circle-thin icon-white p-1 float-right"> | ||
| 50 | </div> | ||
| 51 | </button> | ||
| 48 | <button | 52 | <button |
| 49 | type="button" | 53 | type="button" |
| 50 | ng-class="{'active': idUsuario != 0}" | 54 | class="btn btn-outline-light col-12 my-1" |
| 51 | class="btn btn-outline-debo col-12 my-1" | 55 | ng-click="individual()"> |
| 52 | ng-click="individual()" | 56 | Individual |
| 53 | >Individual</button> | 57 | <div |
| 54 | <div class="form-group my-1" ng-show="idUsuario != 0"> | 58 | ng-class="{'btn-default': idUsuario == 0, 'btn-primary': idUsuario != 0}" |
| 55 | <button | 59 | class="btn fa fa-circle-thin icon-white p-1 float-right"> |
| 56 | class="btn btn-default" | 60 | </div> |
| 57 | foca-focus="idUsuario == -1" | 61 | </button> |
| 58 | ng-show="actividad == 'Nota de pedido'" | 62 | <div class="my-1" ng-show="idUsuario != 0"> |
| 59 | ng-click="openModal()"> | 63 | <div |
| 60 | <i class="fa fa-hand-pointer-o" aria-hidden="true"></i> | 64 | class="input-group mb-3" |
| 61 | Vendedor | 65 | ng-show="actividad == 'Nota de pedido'"> |
| 62 | </button> | 66 | <input |
| 63 | <button | 67 | class="form-control" |
| 64 | class="btn btn-default" | 68 | placeholder="Vendedor" |
| 65 | foca-focus="idUsuario == -1" | 69 | teclado-virtual |
| 66 | ng-show="actividad == 'Entrega de producto'" | 70 | ng-keypress="openModal($event.keyCode)" |
| 67 | ng-click="openModal()"> | 71 | ng-disabled="true"> |
| 68 | <i class="fa fa-hand-pointer-o" aria-hidden="true"></i> | 72 | <div class="input-group-append"> |
| 69 | Transportista | 73 | <button |
| 70 | </button> | 74 | class="btn btn-outline-secondary" |
| 71 | <button | 75 | foca-focus="idUsuario == -1" |
| 72 | class="btn btn-default" | 76 | ng-click="openModal(13)"> |
| 73 | foca-focus="idUsuario == -1" | 77 | <i class="fa fa-search" aria-hidden="true"></i> |
| 74 | ng-show="actividad == 'Cobranza'" | 78 | </button> |
| 75 | ng-click="openModal()"> | 79 | </div> |
| 76 | <i class="fa fa-hand-pointer-o" aria-hidden="true"></i> | 80 | </div> |
| 77 | Cobrador | 81 | <div |
| 78 | </button> | 82 | class="input-group mb-3" |
| 83 | ng-show="actividad == 'Entrega de producto'"> | ||
| 84 | <input | ||
| 85 | class="form-control" | ||
| 86 | placeholder="Transportista" | ||
| 87 | teclado-virtual | ||
| 88 | ng-keypress="openModal($event.keyCode)" | ||
| 89 | ng-disabled="true"> | ||
| 90 | <div class="input-group-append"> | ||
| 91 | <button | ||
| 92 | class="btn btn-outline-secondary" | ||
| 93 | foca-focus="idUsuario == -1" | ||
| 94 | ng-click="openModal(13)"> | ||
| 95 | <i class="fa fa-search" aria-hidden="true"></i> | ||
| 96 | </button> | ||
| 97 | </div> | ||
| 98 | </div> | ||
| 99 | <div | ||
| 100 | class="input-group mb-3" | ||
| 101 | ng-show="actividad == 'Cobranza'"> | ||
| 102 | <input | ||
| 103 | class="form-control" | ||
| 104 | placeholder="Cobrador" | ||
| 105 | teclado-virtual | ||
| 106 | ng-keypress="openModal($event.keyCode)" | ||
| 107 | ng-disabled="true"> | ||
| 108 | <div class="input-group-append"> | ||
| 109 | <button | ||
| 110 | class="btn btn-outline-secondary" | ||
| 111 | foca-focus="idUsuario == -1" | ||
| 112 | ng-click="openModal(13)"> | ||
| 113 | <i class="fa fa-search" aria-hidden="true"></i> | ||
| 114 | </button> | ||
| 115 | </div> | ||
| 116 | </div> | ||
| 79 | </div> | 117 | </div> |
| 80 | <button | 118 | <button |
| 81 | type="button" | 119 | type="button" |
| 82 | class="btn btn-danger col-12 my-1" | 120 | class="btn btn-outline-light col-12 my-1" |
| 83 | ng-show="marcadores.length > 0 && idUsuario > 0" | 121 | ng-show="marcadores.length > 0 && idUsuario > 0" |
| 84 | ng-click="showMarcadores()" | 122 | ng-click="showMarcadores()" |
| 85 | >Listar marcadores</button> | 123 | >Listar marcadores</button> |
| 86 | <div ng-show="actividad === 'Entrega de producto' && idUsuario !== 0"> | 124 | <div ng-show="actividad === 'Entrega de producto' && idUsuario !== 0"> |
| 87 | <div class="custom-control custom-radio"> | 125 | <div class="custom-control custom-radio"> |
| 88 | <input | 126 | <input |
| 89 | type="radio" | 127 | type="radio" |
| 90 | class="custom-control-input" | 128 | class="custom-control-input" |
| 91 | id="idTodos" | 129 | id="idTodos" |
| 92 | name="filtro" | 130 | name="filtro" |
| 93 | ng-model="filtroEstado" | 131 | ng-model="filtroEstado" |
| 94 | ng-change="search(13)" | 132 | ng-change="search(13)" |
| 95 | checked> | 133 | checked> |
| 96 | <label class="custom-control-label pb-3" for="idTodos"></label> | 134 | <label class="custom-control-label pb-3" for="idTodos"></label> |
| 97 | <img src="img/marker-icon-grey.png"> | 135 | <img src="img/marker-icon-grey.png"> |
| 98 | <strong>Todos</strong> | 136 | <strong>Todos</strong> |
| 99 | </div> | 137 | </div> |
| 100 | <div class="custom-control custom-radio"> | 138 | <div class="custom-control custom-radio"> |
| 101 | <input | 139 | <input |
| 102 | type="radio" | 140 | type="radio" |
| 103 | class="custom-control-input" | 141 | class="custom-control-input" |
| 104 | id="entregado" | 142 | id="entregado" |
| 105 | name="filtro" | 143 | name="filtro" |
| 106 | ng-model="filtroEstado" | 144 | ng-model="filtroEstado" |
| 107 | ng-change="search(13)" | 145 | ng-change="search(13)" |
| 108 | ng-value="true"> | 146 | ng-value="true"> |
| 109 | <label class="custom-control-label pb-3" for="entregado"></label> | 147 | <label class="custom-control-label pb-3" for="entregado"></label> |
| 110 | <img src="img/marker-icon-green.png"> | 148 | <img src="img/marker-icon-green.png"> |
| 111 | <strong>Entregado</strong> | 149 | <strong>Entregado</strong> |
| 112 | </div> | 150 | </div> |
| 113 | <div class="custom-control custom-radio"> | 151 | <div class="custom-control custom-radio"> |
| 114 | <input | 152 | <input |
| 115 | type="radio" | 153 | type="radio" |
| 116 | class="custom-control-input" | 154 | class="custom-control-input" |
| 117 | id="noEntregado" | 155 | id="noEntregado" |
| 118 | name="filtro" | 156 | name="filtro" |
| 119 | ng-model="filtroEstado" | 157 | ng-model="filtroEstado" |
| 120 | ng-change="search(13)" | 158 | ng-change="search(13)" |
| 121 | ng-value="false"> | 159 | ng-value="false"> |
| 122 | <label class="custom-control-label pb-3" for="noEntregado"></label> | 160 | <label class="custom-control-label pb-3" for="noEntregado"></label> |
| 123 | <img src="img/marker-icon-yellow.png"> | 161 | <img src="img/marker-icon-yellow.png"> |
| 124 | <strong>No entregado</strong> | 162 | <strong>No entregado</strong> |
| 125 | </div> | 163 | </div> |
| 126 | </div> | 164 | </div> |
| 127 | </div> | 165 | </div> |
| 128 | </div> | 166 | </div> |
| 129 | <div ng-show="actividad === 'Entrega de producto' && idUsuario != 0"> | 167 | <div ng-show="actividad === 'Entrega de producto' && idUsuario != 0"> |
| 130 | <strong>Remitos pendientes de entrega</strong> | 168 | <strong>Remitos pendientes de entrega</strong> |
| 131 | <table class="table"> | 169 | <table class="table"> |
| 132 | <thead> | 170 | <thead> |
| 133 | <tr> | 171 | <tr> |
| 134 | <th>Remito Nº</th> | 172 | <th>Remito Nº</th> |
| 135 | <th>Cliente</th> | 173 | <th>Cliente</th> |
| 136 | <th>Dirección</th> | 174 | <th>Dirección</th> |
| 137 | </tr> | 175 | </tr> |
| 138 | </thead> | 176 | </thead> |
| 139 | <tbody> | 177 | <tbody> |
| 140 | <tr ng-repeat="remito in remitosVehiculo"> | 178 | <tr ng-repeat="remito in remitosVehiculo"> |
| 141 | <td ng-bind="[remito.sucursal, remito.numeroRemito] | comprobante"></td> | 179 | <td ng-bind="[remito.sucursal, remito.numeroRemito] | comprobante"></td> |
| 142 | <td ng-bind="remito.nombreCliente"></td> | 180 | <td ng-bind="remito.nombreCliente"></td> |
| 143 | <td ng-bind="remito.domicilioStamp"></td> | 181 | <td ng-bind="remito.domicilioStamp"></td> |
| 144 | </tr> | 182 | </tr> |
| 145 | </tbody> | 183 | </tbody> |
| 146 | </table> | 184 | </table> |
| 147 | </div> | 185 | </div> |
| 148 | </div> | 186 | </div> |
| 149 | 187 |