Commit 13d19c8087fd0d8830a419a1d2866c33c9f8d290
Exists in
master
Merge branch 'master' into 'master'
Master See merge request !6
Showing
2 changed files
Show diff stats
src/js/controller.js
1 | angular.module('focaModalPuntoDescarga') | 1 | angular.module('focaModalPuntoDescarga') |
2 | .controller('focaModalPuntoDescargaController', [ | 2 | .controller('focaModalPuntoDescargaController', [ |
3 | '$timeout', | 3 | '$timeout', |
4 | '$filter', | 4 | '$filter', |
5 | '$scope', | 5 | '$scope', |
6 | '$uibModalInstance', | 6 | '$uibModalInstance', |
7 | 'focaModalPuntoDescargaService', | 7 | 'focaModalPuntoDescargaService', |
8 | 'filters', | 8 | 'filters', |
9 | 'focaModalService', | 9 | 'focaModalService', |
10 | function($timeout, $filter, $scope, $uibModalInstance, | 10 | function($timeout, $filter, $scope, $uibModalInstance, |
11 | focaModalPuntoDescargaService, filters, focaModalService) { | 11 | focaModalPuntoDescargaService, filters, focaModalService) { |
12 | 12 | ||
13 | $scope.cantidadArticulo = 0; | 13 | $scope.cantidadArticulo = 0; |
14 | $scope.articuloSeleccionado = 0; | 14 | $scope.articuloSeleccionado = 0; |
15 | $scope.ivas = []; | 15 | $scope.ivas = []; |
16 | $scope.puntosSeleccionados = []; | 16 | $scope.puntosSeleccionados = []; |
17 | $scope.puntoDescarga = { | 17 | $scope.puntoDescarga = { |
18 | id: 0, | 18 | id: 0, |
19 | id_cliente: filters.idCliente, | 19 | id_cliente: filters.idCliente, |
20 | id_da_config_0: filters.idDomicilio, | 20 | id_da_config_0: filters.idDomicilio, |
21 | latitud: -32.89214159952345, | 21 | latitud: -32.89214159952345, |
22 | longitud: -68.84572999101856 | 22 | longitud: -68.84572999101856 |
23 | }; | 23 | }; |
24 | $scope.articulos = angular.copy(filters.articulos); | 24 | $scope.articulos = angular.copy(filters.articulos); |
25 | $scope.articulos.map(function(articulo) { | 25 | $scope.articulos.map(function(articulo) { |
26 | articulo.restante = articulo.cantidad; | 26 | articulo.restante = articulo.cantidad; |
27 | }); | 27 | }); |
28 | actualizarTabla(); | 28 | actualizarTabla(); |
29 | cargarPuntos(filters.puntosDescarga); | 29 | cargarPuntos(filters.puntosDescarga); |
30 | 30 | ||
31 | $scope.cancel = function() { | 31 | $scope.cancel = function() { |
32 | if($scope.ingreso) { | 32 | if($scope.ingreso) { |
33 | $scope.ingreso = false; | 33 | $scope.ingreso = false; |
34 | }else { | 34 | }else { |
35 | $uibModalInstance.dismiss('cancel'); | 35 | $uibModalInstance.dismiss('cancel'); |
36 | } | 36 | } |
37 | }; | 37 | }; |
38 | 38 | ||
39 | $scope.aceptar = function() { | 39 | $scope.aceptar = function() { |
40 | if($scope.cargaArticulos) { | 40 | if($scope.cargaArticulos) { |
41 | cargarArticulos(); | 41 | cargarArticulos(); |
42 | }else { | 42 | }else { |
43 | verCargaArticulos(); | 43 | verCargaArticulos(); |
44 | } | 44 | } |
45 | }; | 45 | }; |
46 | 46 | ||
47 | $scope.guardar = function() { | 47 | $scope.guardar = function() { |
48 | focaModalPuntoDescargaService | 48 | focaModalPuntoDescargaService |
49 | .guardarPuntoDescarga($scope.puntoDescarga) | 49 | .guardarPuntoDescarga($scope.puntoDescarga) |
50 | .then(function() { | 50 | .then(function() { |
51 | actualizarTabla(); | 51 | actualizarTabla(); |
52 | $scope.ingreso = false; | 52 | $scope.ingreso = false; |
53 | $scope.puntoDescarga = { | ||
54 | id: 0, | ||
55 | id_cliente: filters.idCliente, | ||
56 | id_da_config_0: filters.idDomicilio, | ||
57 | latitud: -32.89214159952345, | ||
58 | longitud: -68.84572999101856 | ||
59 | }; | ||
53 | }); | 60 | }); |
54 | }; | 61 | }; |
55 | 62 | ||
56 | $scope.editar = function(id) { | 63 | $scope.editar = function(id) { |
57 | focaModalPuntoDescargaService.getPuntoDescargaById(id).then(function(res) { | 64 | focaModalPuntoDescargaService.getPuntoDescargaById(id).then(function(res) { |
58 | $scope.puntoDescarga = res.data; | 65 | $scope.puntoDescarga = res.data; |
59 | $scope.ingreso = true; | 66 | $scope.ingreso = true; |
60 | }); | 67 | }); |
61 | }; | 68 | }; |
62 | 69 | ||
63 | $scope.eliminar = function(idx, id) { | 70 | $scope.eliminar = function(idx, id) { |
64 | focaModalPuntoDescargaService.eliminarPuntoDescarga(id).then(function() { | 71 | focaModalPuntoDescargaService.eliminarPuntoDescarga(id).then(function() { |
65 | $scope.puntosDescarga.splice(idx, 1); | 72 | $scope.puntosDescarga.splice(idx, 1); |
66 | }); | 73 | }); |
67 | }; | 74 | }; |
68 | 75 | ||
69 | $scope.seleccionarPunto = function(idx) { | 76 | $scope.seleccionarPunto = function(idx) { |
70 | var indexPunto = $scope.puntosSeleccionados.indexOf(idx); | 77 | var indexPunto = $scope.puntosSeleccionados.indexOf(idx); |
71 | if(indexPunto !== -1) { | 78 | if(indexPunto !== -1) { |
72 | $scope.puntosSeleccionados.splice(indexPunto, 1); | 79 | $scope.puntosSeleccionados.splice(indexPunto, 1); |
73 | }else { | 80 | }else { |
74 | $scope.puntosSeleccionados.push(idx); | 81 | $scope.puntosSeleccionados.push(idx); |
75 | } | 82 | } |
76 | }; | 83 | }; |
77 | 84 | ||
78 | $scope.agregarArticulo = function(punto) { | 85 | $scope.agregarArticulo = function(punto, key) { |
79 | var articulo = $scope.articulos[$scope.articuloSeleccionado], | 86 | key = (typeof key === 'undefined') ? 13 : key; |
87 | |||
88 | if(key === 13){ | ||
89 | var articulo = $scope.articulos[$scope.articuloSeleccionado], | ||
80 | cantidadRestante = articulo.restante - punto.cantidadACargar; | 90 | cantidadRestante = articulo.restante - punto.cantidadACargar; |
81 | 91 | ||
82 | if(cantidadRestante < 0) { | 92 | if(cantidadRestante < 0) { |
83 | focaModalService.alert('La cantidad a cargar debe ser menor o igual al restante'); | 93 | focaModalService.alert('La cantidad a cargar debe ser menor o igual al restante'); |
84 | }else if(punto.cantidadACargar <= 0) { | 94 | }else if(punto.cantidadACargar <= 0) { |
85 | focaModalService.alert('La cantidad a cargar debe ser mayor que cero'); | 95 | focaModalService.alert('La cantidad a cargar debe ser mayor que cero'); |
86 | }else { | ||
87 | punto.cargado += parseInt(punto.cantidadACargar); | ||
88 | articulo.restante = cantidadRestante; | ||
89 | var existeArticulo = punto.articulosAgregados.filter( | ||
90 | function (articuloAAgregar) { | ||
91 | return articuloAAgregar.id === articulo.id; | ||
92 | }); | ||
93 | //Si el articulo ya fue agregado | ||
94 | if(existeArticulo.length) { | ||
95 | //Solo sumo cantidad | ||
96 | var total = parseInt(existeArticulo[0].cantidad) + parseInt(punto.cantidadACargar); | ||
97 | existeArticulo[0].cantidad = total; | ||
98 | }else { | 96 | }else { |
99 | //Agrego el articulo con la cantidad | 97 | punto.cargado += parseInt(punto.cantidadACargar); |
100 | punto.articulosAgregados.push({ | 98 | articulo.restante = cantidadRestante; |
101 | id: articulo.id, | 99 | var existeArticulo = punto.articulosAgregados.filter( |
102 | descripcion: articulo.descripcion, | 100 | function (articuloAAgregar) { |
103 | cantidad: punto.cantidadACargar, | 101 | return articuloAAgregar.id === articulo.idArticulo; |
104 | index: $scope.articuloSeleccionado | 102 | }); |
105 | }); | 103 | //Si el articulo ya fue agregado |
104 | if(existeArticulo.length) { | ||
105 | //Solo sumo cantidad | ||
106 | var total = parseInt(existeArticulo[0].cantidad) + parseInt(punto.cantidadACargar); | ||
107 | existeArticulo[0].cantidad = total; | ||
108 | }else { | ||
109 | //Agrego el articulo con la cantidad | ||
110 | punto.articulosAgregados.push({ | ||
111 | id: articulo.idArticulo, | ||
112 | descripcion: articulo.descripcion, | ||
113 | cantidad: punto.cantidadACargar, | ||
114 | index: $scope.articuloSeleccionado | ||
115 | }); | ||
116 | } | ||
117 | punto.cantidadACargar = 0; | ||
106 | } | 118 | } |
107 | punto.cantidadACargar = 0; | ||
108 | } | 119 | } |
109 | }; | 120 | }; |
110 | 121 | ||
111 | $scope.quitarArticulo = function(articulo, idx, punto) { | 122 | $scope.quitarArticulo = function(articulo, idx, punto) { |
112 | var articuloAEliminar = $scope.articulos.filter(function(art) { | 123 | var articuloAEliminar = $scope.articulos.filter(function(art) { |
113 | return art.id == articulo.id; | 124 | return art.id == articulo.id; |
114 | }); | 125 | }); |
115 | var restante = parseInt(articuloAEliminar[0].restante); | 126 | var restante = parseInt(articuloAEliminar[0].restante); |
116 | restante += parseInt(articulo.cantidad); | 127 | restante += parseInt(articulo.cantidad); |
117 | articuloAEliminar[0].restante = restante; | 128 | articuloAEliminar[0].restante = restante; |
118 | 129 | ||
119 | punto.cargado -= parseInt(punto.articulosAgregados[idx].cantidad); | 130 | punto.cargado -= parseInt(punto.articulosAgregados[idx].cantidad); |
120 | punto.articulosAgregados.splice(idx, 1); | 131 | punto.articulosAgregados.splice(idx, 1); |
121 | }; | 132 | }; |
122 | 133 | ||
123 | function actualizarTabla() { | 134 | function actualizarTabla() { |
124 | focaModalPuntoDescargaService | 135 | focaModalPuntoDescargaService |
125 | .getPuntosDescargaByClienDom(filters.idDomicilio, filters.idCliente) | 136 | .getPuntosDescargaByClienDom(filters.idDomicilio, filters.idCliente) |
126 | .then(function(res) { | 137 | .then(function(res) { |
127 | $scope.puntosDescarga = res.data; | 138 | $scope.puntosDescarga = res.data; |
128 | }); | 139 | }); |
129 | } | 140 | } |
130 | function verCargaArticulos() { | 141 | function verCargaArticulos() { |
131 | $scope.puntosACargar = []; | 142 | $scope.puntosACargar = []; |
132 | $scope.cargaArticulos = true; | 143 | $scope.cargaArticulos = true; |
133 | $scope.puntosSeleccionados.forEach(function(idx) { | 144 | $scope.puntosSeleccionados.forEach(function(idx) { |
134 | $scope.puntosACargar.push($scope.puntosDescarga[idx]); | 145 | $scope.puntosACargar.push($scope.puntosDescarga[idx]); |
135 | }); | 146 | }); |
136 | 147 | ||
137 | $scope.puntosACargar.map(function(punto) { | 148 | $scope.puntosACargar.map(function(punto) { |
138 | punto.articulosAgregados = []; | 149 | punto.articulosAgregados = []; |
139 | punto.cantidadACargar = 0; | 150 | punto.cantidadACargar = 0; |
140 | punto.cargado = 0; | 151 | punto.cargado = 0; |
141 | }); | 152 | }); |
142 | } | 153 | } |
143 | function cargarArticulos() { | 154 | function cargarArticulos() { |
144 | $uibModalInstance.close($scope.puntosACargar); | 155 | $uibModalInstance.close($scope.puntosACargar); |
145 | } | 156 | } |
146 | function cargarPuntos(puntosDescarga) { | 157 | function cargarPuntos(puntosDescarga) { |
147 | //Si existen puntos ya cargados | 158 | //Si existen puntos ya cargados |
148 | if(puntosDescarga) { | 159 | if(puntosDescarga) { |
149 | if(!puntosDescarga[0].cargado) { | 160 | if(!puntosDescarga[0].cargado) { |
150 | agregarTotalCargado(puntosDescarga); | 161 | agregarTotalCargado(puntosDescarga); |
151 | } | 162 | } |
152 | $scope.puntosACargar = puntosDescarga; | 163 | $scope.puntosACargar = puntosDescarga; |
153 | $scope.cargaArticulos = true; | 164 | $scope.cargaArticulos = true; |
154 | //Recorro los puntos | 165 | //Recorro los puntos |
155 | puntosDescarga.forEach(function(punto) { | 166 | puntosDescarga.forEach(function(punto) { |
156 | //Recorro los articulos cargados en cada punto | 167 | //Recorro los articulos cargados en cada punto |
157 | punto.articulosAgregados.forEach(function(articulo) { | 168 | punto.articulosAgregados.forEach(function(articulo) { |
158 | var articuloARestar = $scope.articulos.filter(function(art) { | 169 | var articuloARestar = $scope.articulos.filter(function(art) { |
159 | return art.id == articulo.id; | 170 | return art.idArticulo == articulo.id; |
160 | }); | 171 | }); |
161 | articuloARestar[0].restante -= articulo.cantidad; | 172 | articuloARestar[0].restante -= articulo.cantidad; |
162 | }); | 173 | }); |
163 | }); | 174 | }); |
164 | } | 175 | } |
165 | } | 176 | } |
166 | function agregarTotalCargado(puntosDescarga) { | 177 | function agregarTotalCargado(puntosDescarga) { |
167 | puntosDescarga.map(function(punto) { | 178 | puntosDescarga.map(function(punto) { |
src/views/modal-punto-descarga.html
1 | <div class="modal-header d-flex"> | 1 | <div class="modal-header d-flex"> |
2 | <h5 class="modal-title my-1" ng-hide="ingreso || cargaArticulos">Búsqueda de puntos de descarga</h5> | 2 | <h5 class="modal-title my-1" ng-hide="ingreso || cargaArticulos">Búsqueda de puntos de descarga</h5> |
3 | <h5 class="modal-title my-1" ng-show="ingreso">Crear punto de descarga</h5> | 3 | <h5 class="modal-title my-1" ng-show="ingreso">Crear punto de descarga</h5> |
4 | <h5 class="modal-title my-1" ng-show="cargaArticulos">Cargar artículos en puntos de descarga</h5> | 4 | <h5 class="modal-title my-1" ng-show="cargaArticulos">Cargar artículos en puntos de descarga</h5> |
5 | <button | 5 | <button |
6 | class="btn btn-primary" | 6 | class="btn btn-primary" |
7 | title="Nuevo" | 7 | title="Nuevo" |
8 | ng-click="ingreso = true" | 8 | ng-click="ingreso = true" |
9 | ng-hide="ingreso || cargaArticulos"> | 9 | ng-hide="ingreso || cargaArticulos"> |
10 | <i class="fa fa-plus" aria-hidden="true"></i> | 10 | <i class="fa fa-plus" aria-hidden="true"></i> |
11 | </button> | 11 | </button> |
12 | </div> | 12 | </div> |
13 | <div class="modal-body" id="modal-body"> | 13 | <div class="modal-body" id="modal-body"> |
14 | <table | 14 | <table |
15 | class="table table-striped table-sm col-12" | 15 | class="table table-striped table-sm col-12" |
16 | ng-hide="ingreso || cargaArticulos"> | 16 | ng-hide="ingreso || cargaArticulos"> |
17 | <thead> | 17 | <thead> |
18 | <tr> | 18 | <tr> |
19 | <th>Código</th> | 19 | <th>Código</th> |
20 | <th>Descripción</th> | 20 | <th>Descripción</th> |
21 | <th>Latitud</th> | 21 | <th>Latitud</th> |
22 | <th>Longitud</th> | 22 | <th>Longitud</th> |
23 | <th></th> | 23 | <th></th> |
24 | </tr> | 24 | </tr> |
25 | </thead> | 25 | </thead> |
26 | <tbody> | 26 | <tbody> |
27 | <tr ng-show="!puntosDescarga.length"> | 27 | <tr ng-show="!puntosDescarga.length"> |
28 | <td colspan="3"> | 28 | <td colspan="3"> |
29 | No se encontraron resultados. | 29 | No se encontraron resultados. |
30 | </td> | 30 | </td> |
31 | </tr> | 31 | </tr> |
32 | <tr class="selected" | 32 | <tr class="selected" |
33 | ng-repeat="(key, puntoDescarga) in puntosDescarga | filter: filters" | 33 | ng-repeat="(key, puntoDescarga) in puntosDescarga | filter: filters" |
34 | > | 34 | > |
35 | <td ng-bind="puntoDescarga.id | rellenarDigitos: 3: 0"></td> | 35 | <td ng-bind="puntoDescarga.id | rellenarDigitos: 3: 0"></td> |
36 | <td ng-bind="puntoDescarga.descripcion"></td> | 36 | <td ng-bind="puntoDescarga.descripcion"></td> |
37 | <td ng-bind="puntoDescarga.latitud"></td> | 37 | <td ng-bind="puntoDescarga.latitud"></td> |
38 | <td ng-bind="puntoDescarga.longitud"></td> | 38 | <td ng-bind="puntoDescarga.longitud"></td> |
39 | <td class="d-md-none text-primary"> | 39 | <td class="d-md-none text-primary"> |
40 | <i class="fa fa-circle-thin" aria-hidden="true"></i> | 40 | <i class="fa fa-circle-thin" aria-hidden="true"></i> |
41 | </td> | 41 | </td> |
42 | <td class="d-none d-md-table-cell"> | 42 | <td class="d-none d-md-table-cell"> |
43 | <input | 43 | <input |
44 | type="checkbox" | 44 | type="checkbox" |
45 | class="custom-control-input float-right" | 45 | class="custom-control-input float-right" |
46 | id="checkSelect{{key}}"> | 46 | id="checkSelect{{key}}"> |
47 | <label | 47 | <label |
48 | class="custom-control-label float-right" | 48 | class="custom-control-label float-right" |
49 | for="checkSelect{{key}}" | 49 | for="checkSelect{{key}}" |
50 | ng-click="seleccionarPunto(key)"></label> | 50 | ng-click="seleccionarPunto(key)"></label> |
51 | <button | 51 | <button |
52 | type="button" | 52 | type="button" |
53 | class="btn btn-xs p-1 float-right mr-5" | 53 | class="btn btn-xs p-1 float-right mr-5" |
54 | ng-click="eliminar(key, puntoDescarga.id)" | 54 | ng-click="eliminar(key, puntoDescarga.id)" |
55 | title="Eliminar"> | 55 | title="Eliminar"> |
56 | <i class="fa fa-trash" aria-hidden="true"></i> | 56 | <i class="fa fa-trash" aria-hidden="true"></i> |
57 | </button> | 57 | </button> |
58 | <button | 58 | <button |
59 | type="button" | 59 | type="button" |
60 | class="btn btn-xs p-1 float-right mr-1" | 60 | class="btn btn-xs p-1 float-right mr-1" |
61 | ng-click="editar(puntoDescarga.id)" | 61 | ng-click="editar(puntoDescarga.id)" |
62 | title="Editar"> | 62 | title="Editar"> |
63 | <i class="fa fa-pencil" aria-hidden="true"></i> | 63 | <i class="fa fa-pencil" aria-hidden="true"></i> |
64 | </button> | 64 | </button> |
65 | </td> | 65 | </td> |
66 | </tr> | 66 | </tr> |
67 | </tbody> | 67 | </tbody> |
68 | </table> | 68 | </table> |
69 | <div ng-show="cargaArticulos"> | 69 | <div ng-show="cargaArticulos"> |
70 | <div ng-show="!articulos.length"> | 70 | <div ng-show="!articulos.length"> |
71 | <h6>No existen articulos para agregar</h6> | 71 | <h6>No existen articulos para agregar</h6> |
72 | </div> | 72 | </div> |
73 | <div ng-show="articulos.length"> | 73 | <div ng-show="articulos.length"> |
74 | <div class="row"> | 74 | <div class="row"> |
75 | <div class="col-12"> | 75 | <div class="col-12"> |
76 | <table class="table table-sm"> | 76 | <table class="table table-sm"> |
77 | <thead> | 77 | <thead> |
78 | <tr> | 78 | <tr> |
79 | <th></th> | 79 | <th></th> |
80 | <th>Articulo</th> | 80 | <th>Articulo</th> |
81 | <th>Total</th> | 81 | <th>Total</th> |
82 | <th>Restante</th> | 82 | <th>Restante</th> |
83 | </tr> | 83 | </tr> |
84 | </thead> | 84 | </thead> |
85 | <tbody> | 85 | <tbody> |
86 | <tr ng-repeat="(key, articulo) in articulos"> | 86 | <tr ng-repeat="(key, articulo) in articulos"> |
87 | <td> | 87 | <td> |
88 | <input | 88 | <input |
89 | type="radio" | 89 | type="radio" |
90 | ng-value="key" | 90 | ng-value="key" |
91 | ng-model="$parent.articuloSeleccionado" | 91 | ng-model="$parent.articuloSeleccionado" |
92 | > | 92 | > |
93 | </td> | 93 | </td> |
94 | <td ng-bind="articulo.descripcion"></td> | 94 | <td ng-bind="articulo.descripcion"></td> |
95 | <td ng-bind="articulo.cantidad"></td> | 95 | <td ng-bind="articulo.cantidad"></td> |
96 | <td ng-bind="articulo.restante"></td> | 96 | <td ng-bind="articulo.restante"></td> |
97 | </tr> | 97 | </tr> |
98 | </tbody> | 98 | </tbody> |
99 | </table> | 99 | </table> |
100 | </div> | 100 | </div> |
101 | </div> | 101 | </div> |
102 | <div class="row"> | 102 | <div class="row"> |
103 | <div class="col-12"> | 103 | <div class="col-12"> |
104 | <h5 class="col-12 my-3">Puntos de descarga</h5> | 104 | <h5 class="col-12 my-3">Puntos de descarga</h5> |
105 | <table class="table table-sm"> | 105 | <table class="table table-sm"> |
106 | <thead> | 106 | <thead> |
107 | <tr> | 107 | <tr> |
108 | <th>Lugar</th> | 108 | <th>Lugar</th> |
109 | <th class="text-right">Total cargado</th> | 109 | <th class="text-right">Total cargado</th> |
110 | <th class="text-right">Cantidad</th> | 110 | <th class="text-right">Cantidad</th> |
111 | <th></th> | 111 | <th></th> |
112 | </tr> | 112 | </tr> |
113 | </thead> | 113 | </thead> |
114 | <tbody> | 114 | <tbody> |
115 | <tr ng-repeat="punto in puntosACargar"> | 115 | <tr ng-repeat="punto in puntosACargar"> |
116 | <td ng-bind="punto.descripcion"></td> | 116 | <td ng-bind="punto.descripcion"></td> |
117 | <td ng-bind="punto.cargado" class="text-right"></td> | 117 | <td ng-bind="punto.cargado" class="text-right"></td> |
118 | <td> | 118 | <td> |
119 | <input | 119 | <input |
120 | type="text" | 120 | type="text" |
121 | class="form-control col-4 float-right" | 121 | class="form-control col-4 float-right" |
122 | id="inputCantidad" | 122 | id="inputCantidad" |
123 | placeholder="A cargar" | 123 | placeholder="A cargar" |
124 | ng-model="punto.cantidadACargar" | 124 | ng-model="punto.cantidadACargar" |
125 | ng-keypress="agregarArticulo(punto, $event.keyCode)" | ||
125 | > | 126 | > |
126 | </td> | 127 | </td> |
127 | <td> | 128 | <td> |
128 | <button | 129 | <button |
129 | class="btn btn-sm btn-outline-primary ml-auto" | 130 | class="btn btn-sm btn-outline-primary ml-auto" |
130 | type="button" | 131 | type="button" |
131 | ng-click="agregarArticulo(punto)" | 132 | ng-click="agregarArticulo(punto)" |
132 | > | 133 | > |
133 | Agregar | 134 | Agregar |
134 | </button> | 135 | </button> |
135 | </td> | 136 | </td> |
136 | </tr> | 137 | </tr> |
137 | </tbody> | 138 | </tbody> |
138 | </table> | 139 | </table> |
139 | <table class="table table-sm"> | 140 | <table class="table table-sm"> |
140 | <thead> | 141 | <thead> |
141 | <tr> | 142 | <tr> |
142 | <th>Lugar</th> | 143 | <th>Lugar</th> |
143 | <th>Articulo</th> | 144 | <th>Articulo</th> |
144 | <th class="text-right">Cantidad</th> | 145 | <th class="text-right">Cantidad</th> |
145 | <th></th> | 146 | <th></th> |
146 | </tr> | 147 | </tr> |
147 | </thead> | 148 | </thead> |
148 | <tbody ng-repeat="punto in puntosACargar"> | 149 | <tbody ng-repeat="punto in puntosACargar"> |
149 | <tr ng-repeat="(key, articulo) in punto.articulosAgregados"> | 150 | <tr ng-repeat="(key, articulo) in punto.articulosAgregados"> |
150 | <td ng-bind="punto.descripcion"></td> | 151 | <td ng-bind="punto.descripcion"></td> |
151 | <td ng-bind="articulo.descripcion" class="p-2"></td> | 152 | <td ng-bind="articulo.descripcion" class="p-2"></td> |
152 | <td ng-bind="articulo.cantidad" class="text-right p-2"></td> | 153 | <td ng-bind="articulo.cantidad" class="text-right p-2"></td> |
153 | <td class="p-2"> | 154 | <td class="p-2"> |
154 | <button | 155 | <button |
155 | type="button" | 156 | type="button" |
156 | class="btn btn-xs p-1 float-right mr-5" | 157 | class="btn btn-xs p-1 float-right mr-5" |
157 | ng-click="quitarArticulo(articulo, key, punto)" | 158 | ng-click="quitarArticulo(articulo, key, punto)" |
158 | title="Eliminar"> | 159 | title="Eliminar"> |
159 | <i class="fa fa-trash" aria-hidden="true"></i> | 160 | <i class="fa fa-trash" aria-hidden="true"></i> |
160 | </button> | 161 | </button> |
161 | </td> | 162 | </td> |
162 | </tr> | 163 | </tr> |
163 | </tbody> | 164 | </tbody> |
164 | </table> | 165 | </table> |
165 | </div> | 166 | </div> |
166 | </div> | 167 | </div> |
167 | </div> | 168 | </div> |
168 | </div> | 169 | </div> |
169 | <form ng-show="ingreso"> | 170 | <form ng-show="ingreso"> |
170 | <div class="row"> | 171 | <div class="row"> |
171 | <div class="col-12"> | 172 | <div class="col-12"> |
172 | <label>Descripción</label> | 173 | <label>Descripción</label> |
173 | <input | 174 | <input |
174 | type="text" | 175 | type="text" |
175 | class="form-control form-control-sm" | 176 | class="form-control form-control-sm" |
176 | ng-model="puntoDescarga.descripcion" | 177 | ng-model="puntoDescarga.descripcion" |
177 | uppercase-only> | 178 | uppercase-only> |
178 | </div> | 179 | </div> |
179 | </div> | 180 | </div> |
180 | <div class="row"> | 181 | <div class="row"> |
181 | <div class="col-6"> | 182 | <div class="col-6"> |
182 | <label>Latitud</label> | 183 | <label>Latitud</label> |
183 | <input | 184 | <input |
184 | type="text" | 185 | type="text" |
185 | class="form-control form-control-sm" | 186 | class="form-control form-control-sm" |
186 | ng-model="puntoDescarga.latitud" | 187 | ng-model="puntoDescarga.latitud" |
187 | ng-required="true" | 188 | ng-required="true" |
188 | /> | 189 | /> |
189 | </div> | 190 | </div> |
190 | <div class="col-6"> | 191 | <div class="col-6"> |
191 | <label>Longitud</label> | 192 | <label>Longitud</label> |
192 | <input | 193 | <input |
193 | type="text" | 194 | type="text" |
194 | class="form-control form-control-sm" | 195 | class="form-control form-control-sm" |
195 | ng-model="puntoDescarga.longitud" | 196 | ng-model="puntoDescarga.longitud" |
196 | ng-required="true" | 197 | ng-required="true" |
197 | /> | 198 | /> |
198 | </div> | 199 | </div> |
199 | </div> | 200 | </div> |
200 | <osm-punto-descarga | 201 | <osm-punto-descarga |
201 | latitud="puntoDescarga.latitud" | 202 | latitud="puntoDescarga.latitud" |
202 | longitud="puntoDescarga.longitud" | 203 | longitud="puntoDescarga.longitud" |
203 | zoom="14" | 204 | zoom="14" |
204 | /> | 205 | /> |
205 | </form> | 206 | </form> |
206 | </div> | 207 | </div> |
207 | <div class="modal-footer"> | 208 | <div class="modal-footer"> |
208 | <button | 209 | <button |
209 | class="btn btn-sm btn-secondary my-1" | 210 | class="btn btn-sm btn-secondary my-1" |
210 | type="button" | 211 | type="button" |
211 | ng-click="cancel()">Cancelar</button> | 212 | ng-click="cancel()">Cancelar</button> |
212 | <button | 213 | <button |
213 | class="btn btn-sm btn-primary my-1" | 214 | class="btn btn-sm btn-primary my-1" |
214 | type="button" | 215 | type="button" |
215 | ng-click="aceptar()" | 216 | ng-click="aceptar()" |
216 | ng-hide="ingreso">Aceptar</button> | 217 | ng-hide="ingreso">Aceptar</button> |
217 | <button | 218 | <button |
218 | class="btn btn-sm btn-primary my-1" | 219 | class="btn btn-sm btn-primary my-1" |
219 | type="button" | 220 | type="button" |
220 | ng-click="guardar()" | 221 | ng-click="guardar()" |
221 | ng-show="ingreso">Guardar</button> | 222 | ng-show="ingreso">Guardar</button> |
222 | </div> | 223 | </div> |
223 | 224 |