service.js
2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
angular.module('focaOrdenCarga')
.factory('focaOrdenCargaService', ['$http', 'API_ENDPOINT', function ($http, API_ENDPOINT) {
return {
getVehiculos: function () {
return $http.get(API_ENDPOINT.URL + '/vehiculo');
},
getTransportistas: function () {
return $http.get(API_ENDPOINT.URL + '/transportista');
},
getCisternadoPorVehiculo: function (idVehiculo) {
return $http.get(API_ENDPOINT.URL + '/cisterna/listar/' + idVehiculo);
},
getCisterna: function (id) {
return $http.get(API_ENDPOINT.URL + '/cisterna/obtener/' + id);
},
guardarCisterna: function (cisterna) {
return $http.post(API_ENDPOINT.URL + '/cisterna/guardar', { cisterna: cisterna });
},
deleteCisterna: function (id) {
return $http.delete(API_ENDPOINT.URL + '/cisterna/borrar/' + id);
},
getVehiculosPorTransportista: function (id) {
return $http.get(API_ENDPOINT.URL + '/vehiculo/transportista/' + id);
},
getEstadoCisterna: function (id, fecha) {
console.log(id, " ", fecha);
return $http.post(API_ENDPOINT.URL + '/cisterna/stock',
{ idCisterna: id, fecha: fecha });
},
getBotonera: function () {
var result = [
{
label: 'Vehiculo',
image: 'vehiculo_secundario.png'
},
{
label: 'Fecha de Reparto',
image: 'fechaDeEntrega.png'
},
{
label: 'Hojas de Ruta',
image: 'hojaDeRuta.png'
},
{
label: 'Remito Abierto',
image: 'remito_abierto.png'
},
{
label: 'Chofer',
image: 'chofer_secundario.png'
},
{
label: 'Ver Cisternas',
image: 'verCisterna.png'
}
];
return result;
},
};
}]);