Commit 914d9989974b322170d37e68c09572bcdf79a63e
1 parent
5ca500d8e2
Exists in
master
and in
1 other branch
Eliminar servicios
Showing
1 changed file
with
0 additions
and
6 deletions
Show diff stats
src/js/service.js
1 | angular.module('focaLogisticaPedidoRuta') | 1 | angular.module('focaLogisticaPedidoRuta') |
2 | .factory( | 2 | .factory( |
3 | 'focaLogisticaPedidoRutaService', [ | 3 | 'focaLogisticaPedidoRutaService', [ |
4 | '$http', | 4 | '$http', |
5 | '$cookies', | 5 | '$cookies', |
6 | 'API_ENDPOINT', | 6 | 'API_ENDPOINT', |
7 | '$filter', | 7 | '$filter', |
8 | function($http, $cookies, API_ENDPOINT, $filter) { | 8 | function($http, $cookies, API_ENDPOINT, $filter) { |
9 | var url = API_ENDPOINT.URL; | 9 | var url = API_ENDPOINT.URL; |
10 | return { | 10 | return { |
11 | idUsuario: $cookies.get('vendedorCobrador'), | 11 | idUsuario: $cookies.get('vendedorCobrador'), |
12 | obtenerActividad: function(parametros) { | 12 | obtenerActividad: function(parametros) { |
13 | return $http.post(url + '/seguimiento/filtros', parametros); | 13 | return $http.post(url + '/seguimiento/filtros', parametros); |
14 | }, | 14 | }, |
15 | numeroHojaRuta: function() { | 15 | numeroHojaRuta: function() { |
16 | return $http.get(url + '/hoja-ruta/numero-siguiente'); | 16 | return $http.get(url + '/hoja-ruta/numero-siguiente'); |
17 | }, | 17 | }, |
18 | getRemitos: function(idVehiculo) { | 18 | getRemitos: function(idVehiculo) { |
19 | return $http.get(url + '/remito/sin-hoja-ruta/' + idVehiculo); | 19 | return $http.get(url + '/remito/sin-hoja-ruta/' + idVehiculo); |
20 | }, | 20 | }, |
21 | cerrarDistribuicion: function(remitos) { | 21 | cerrarDistribuicion: function(remitos) { |
22 | return $http.post(url + '/vehiculo/cierre-distribuicion', remitos); | 22 | return $http.post(url + '/vehiculo/cierre-distribuicion', remitos); |
23 | }, | 23 | }, |
24 | getArticulos: function () { | ||
25 | return $http.get(url + '/articulos'); | ||
26 | }, | ||
27 | getAllClientes: function () { | ||
28 | return $http.get(url + '/cliente'); | ||
29 | }, | ||
30 | desasociarRemitos: function(remitos, idVehiculo, sinRemitos) { | 24 | desasociarRemitos: function(remitos, idVehiculo, sinRemitos) { |
31 | var idsRemitos = []; | 25 | var idsRemitos = []; |
32 | for (var i = 0; i < remitos.length; i++) { | 26 | for (var i = 0; i < remitos.length; i++) { |
33 | idsRemitos.push(remitos[i].id); | 27 | idsRemitos.push(remitos[i].id); |
34 | } | 28 | } |
35 | return $http.post(url + '/vehiculo/desasociar-remitos', | 29 | return $http.post(url + '/vehiculo/desasociar-remitos', |
36 | { | 30 | { |
37 | idsRemitos: idsRemitos, | 31 | idsRemitos: idsRemitos, |
38 | idVehiculo: idVehiculo, | 32 | idVehiculo: idVehiculo, |
39 | vehiculoSinRemitos: sinRemitos | 33 | vehiculoSinRemitos: sinRemitos |
40 | }); | 34 | }); |
41 | }, | 35 | }, |
42 | getRemitosByIdVehiculo: function(idVehiculo, sinConfirmar, sinHojaRuta) { | 36 | getRemitosByIdVehiculo: function(idVehiculo, sinConfirmar, sinHojaRuta) { |
43 | var sinHoja = sinHojaRuta ? '/sinHojaRuta' : ''; | 37 | var sinHoja = sinHojaRuta ? '/sinHojaRuta' : ''; |
44 | return $http.get(url + '/vehiculo/obtener/remitos/' + | 38 | return $http.get(url + '/vehiculo/obtener/remitos/' + |
45 | idVehiculo + '/' + this.fecha.toISOString().substring(0, 10) + | 39 | idVehiculo + '/' + this.fecha.toISOString().substring(0, 10) + |
46 | '/' + sinConfirmar + sinHoja); | 40 | '/' + sinConfirmar + sinHoja); |
47 | }, | 41 | }, |
48 | getVehiculosByIdUsuario: function() { | 42 | getVehiculosByIdUsuario: function() { |
49 | return $http.get(url + '/vehiculo/usuario/' + this.idUsuario); | 43 | return $http.get(url + '/vehiculo/usuario/' + this.idUsuario); |
50 | }, | 44 | }, |
51 | getUnidadesByFecha: function() { | 45 | getUnidadesByFecha: function() { |
52 | return $http.post(url + '/vehiculo/listar/fecha', | 46 | return $http.post(url + '/vehiculo/listar/fecha', |
53 | {fecha: this.fecha}); | 47 | {fecha: this.fecha}); |
54 | }, | 48 | }, |
55 | setFechaReparto: function(fechaReparto) { | 49 | setFechaReparto: function(fechaReparto) { |
56 | this.fecha = fechaReparto; | 50 | this.fecha = fechaReparto; |
57 | }, | 51 | }, |
58 | obtenerVehiculoById: function(idVehiculo) { | 52 | obtenerVehiculoById: function(idVehiculo) { |
59 | return $http.get(url + '/vehiculo/' + idVehiculo); | 53 | return $http.get(url + '/vehiculo/' + idVehiculo); |
60 | } | 54 | } |
61 | }; | 55 | }; |
62 | }]); | 56 | }]); |
63 | 57 |