Commit ab932f68ed69dd73a9ade0104c60e653cec0ccbe
Exists in
master
and in
2 other branches
Merge branch 'master' into 'master'
Master(efernandez) See merge request !11
Showing
5 changed files
Show diff stats
gulpfile.js
... | ... | @@ -40,7 +40,6 @@ gulp.task('uglify', ['templates'], function() { |
40 | 40 | ]), |
41 | 41 | concat('foca-crear-hoja-ruta.js'), |
42 | 42 | replace('src/views/', ''), |
43 | - replace("'ngRoute','focaModalRemito','ui.bootstrap','focaBotoneraLateral'", ''), | |
44 | 43 | gulp.dest(paths.tmp), |
45 | 44 | rename('foca-crear-hoja-ruta.min.js'), |
46 | 45 | uglify(), |
src/js/app.js
1 | -angular.module('focaCrearHojaRuta', [ | |
2 | - 'ngRoute', | |
3 | - 'focaModalRemito', | |
4 | - 'ui.bootstrap', | |
5 | - 'focaBotoneraLateral', | |
6 | - /*'focaBusquedaProductos', | |
7 | - 'focaModalProveedor', | |
8 | - 'focaBusquedaCliente', | |
9 | - 'focaModalPrecioCondicion', | |
10 | - 'focaModalFlete', | |
11 | - 'focaDirectivas', | |
12 | - 'focaModal', | |
13 | - 'focaModalDomicilio', | |
14 | - 'focaModalMoneda', | |
15 | - 'focaModalCotizacion', | |
16 | - 'focaSeguimiento', | |
17 | - 'angular-ladda', | |
18 | - 'cordovaGeolocationModule'*/ | |
19 | -]); | |
1 | +angular.module('focaCrearHojaRuta', []); |
src/js/controller.js
... | ... | @@ -78,6 +78,10 @@ angular.module('focaCrearHojaRuta') .controller('hojaRutaCtrl', |
78 | 78 | focaModalService.alert('Ingrese Tarifario'); |
79 | 79 | return; |
80 | 80 | } |
81 | + if(!$scope.hojaRuta.datosExtra) { | |
82 | + focaModalService.alert('Ingrese Datos extra'); | |
83 | + return; | |
84 | + } | |
81 | 85 | var date = new Date(); |
82 | 86 | var save = { |
83 | 87 | hojaRuta: { |
... | ... | @@ -93,7 +97,7 @@ angular.module('focaCrearHojaRuta') .controller('hojaRutaCtrl', |
93 | 97 | }, |
94 | 98 | remitos: $scope.remitosTabla |
95 | 99 | }; |
96 | - | |
100 | + save.hojaRuta = angular.extend({}, save.hojaRuta, $scope.hojaRuta.datosExtra); | |
97 | 101 | focaCrearHojaRutaService.crearHojaRuta(save).then( |
98 | 102 | function(data) { |
99 | 103 | focaModalService.alert( |
... | ... | @@ -294,6 +298,29 @@ angular.module('focaCrearHojaRuta') .controller('hojaRutaCtrl', |
294 | 298 | }); |
295 | 299 | }; |
296 | 300 | |
301 | + $scope.seleccionarDatosExtra = function() { | |
302 | + var datosHojaRuta = $scope.hojaRuta.datosExtra; | |
303 | + var modalInstance = $uibModal.open( | |
304 | + { | |
305 | + templateUrl: 'foca-modal-datos-hoja-ruta.html', | |
306 | + controller: 'focaModalDatosHojaRutaCtrl', | |
307 | + size: 'lg', | |
308 | + resolve: { | |
309 | + parametrosDatos: function() { | |
310 | + return { | |
311 | + datosHojaRuta: datosHojaRuta | |
312 | + }; | |
313 | + } | |
314 | + } | |
315 | + } | |
316 | + ); | |
317 | + return modalInstance.result.then(function(datosExtra) { | |
318 | + $scope.hojaRuta.datosExtra = datosExtra; | |
319 | + }, function() { | |
320 | + //se ejecuta cuando se cancela el modal | |
321 | + }); | |
322 | + }; | |
323 | + | |
297 | 324 | function elegirFecha() { |
298 | 325 | focaModalService.modalFecha('Fecha de entrega').then(function(fecha) { |
299 | 326 | $scope.$broadcast('addCabecera', { |
src/js/service.js
src/views/hoja-ruta.html
... | ... | @@ -10,7 +10,7 @@ |
10 | 10 | <div class="col-12 col-md-10 border border-light rounded"> |
11 | 11 | <div class="row px-5 py-2 botonera-secundaria"> |
12 | 12 | <div class="col-12"> |
13 | - <foca-botonera-facturador botones="botonera" extra="5" class="row"></foca-botonera-facturador> | |
13 | + <foca-botonera-facturador botones="botonera" extra="4" class="row"></foca-botonera-facturador> | |
14 | 14 | </div> |
15 | 15 | </div> |
16 | 16 | <!-- PC --> |
... | ... | @@ -81,181 +81,7 @@ |
81 | 81 | </tfoot> |
82 | 82 | </table> |
83 | 83 | </div> |
84 | - | |
85 | - <!-- MOBILE --> | |
86 | - <div class="row d-sm-none"> | |
87 | - <table class="table table-sm table-striped tabla-articulo margin-bottom-mobile"> | |
88 | - <thead> | |
89 | - <tr class="d-flex"> | |
90 | - <th class="">#</th> | |
91 | - <th class="col px-0"> | |
92 | - <div class="d-flex"> | |
93 | - <div class="col-4 px-1">Cรณdigo</div> | |
94 | - <div class="col-8 px-1">Descripciรณn</div> | |
95 | - </div> | |
96 | - <div class="d-flex"> | |
97 | - <div class="col-3 px-1">Cantidad</div> | |
98 | - <div class="col px-1 text-right">P. Uni.</div> | |
99 | - <div class="col px-1 text-right">Subtotal</div> | |
100 | - </div> | |
101 | - </th> | |
102 | - <th class="text-center tamaรฑo-boton"> | |
103 | - | |
104 | - </th> | |
105 | - </tr> | |
106 | - </thead> | |
107 | - <tbody> | |
108 | - <tr | |
109 | - ng-repeat="(key, articulo) in remitosTabla" | |
110 | - ng-show="show || key == remitosTabla.length - 1" | |
111 | - > | |
112 | - <td class="w-100 align-middle d-flex p-0"> | |
113 | - <div class="align-middle p-1"> | |
114 | - <span ng-bind="key+1" class="align-middle"></span> | |
115 | - </div> | |
116 | - <div class="col px-0"> | |
117 | - <div class="d-flex"> | |
118 | - <div class="col-4 px-1"> | |
119 | - <span | |
120 | - ng-bind="articulo.sector + '-' + articulo.codigo" | |
121 | - ></span> | |
122 | - </div> | |
123 | - <div class="col-8 px-1"> | |
124 | - <span ng-bind="articulo.descripcion"></span> | |
125 | - </div> | |
126 | - </div> | |
127 | - <div class="d-flex"> | |
128 | - <div class="col-3 px-1"> | |
129 | - <span ng-bind="'x' + articulo.cantidad"></span> | |
130 | - </div> | |
131 | - <div class="col-3 px-1 text-right"> | |
132 | - <span ng-bind="articulo.precio | currency: hojaRuta.moneda.simbolo : 4"></span> | |
133 | - </div> | |
134 | - <div class="col px-1 text-right"> | |
135 | - <span | |
136 | - ng-bind="(articulo.precio * articulo.cantidad) | currency: hojaRuta.moneda.simbolo" | |
137 | - > | |
138 | - </span> | |
139 | - </div> | |
140 | - </div> | |
141 | - </div> | |
142 | - <div class="align-middle p-1"> | |
143 | - <button | |
144 | - class="btn btn-outline-light" | |
145 | - ng-click="quitarArticulo(key)" | |
146 | - > | |
147 | - <i class="fa fa-trash"></i> | |
148 | - </button> | |
149 | - </div> | |
150 | - </td> | |
151 | - </tr> | |
152 | - </tbody> | |
153 | - <tfoot> | |
154 | - <!-- CARGANDO ITEM --> | |
155 | - <tr ng-show="!cargando" class="d-flex"> | |
156 | - <td | |
157 | - class="align-middle p-1" | |
158 | - ng-bind="remitosTabla.length + 1" | |
159 | - ></td> | |
160 | - <td class="col p-0"> | |
161 | - <div class="d-flex"> | |
162 | - <div class="col-4 px-1"> | |
163 | - <span | |
164 | - ng-bind="articuloACargar.sectorCodigo" | |
165 | - ></span> | |
166 | - </div> | |
167 | - <div class="col-8 px-1"> | |
168 | - <span ng-bind="articuloACargar.descripcion"></span> | |
169 | - </div> | |
170 | - </div> | |
171 | - <div class="d-flex"> | |
172 | - <div class="col-3 px-1 m-1"> | |
173 | - <input | |
174 | - class="form-control p-1" | |
175 | - type="number" | |
176 | - min="1" | |
177 | - ng-model="articuloACargar.cantidad" | |
178 | - foca-focus="!cargando" | |
179 | - ng-keypress="agregarATabla($event.keyCode)" | |
180 | - style="height: auto; line-height: 1.1em" | |
181 | - > | |
182 | - </div> | |
183 | - <div class="col-3 px-1 text-right"> | |
184 | - <span ng-bind="articuloACargar.precio | currency: hojaRuta.moneda.simbolo : 4"></span> | |
185 | - </div> | |
186 | - <div class="col px-1 text-right"> | |
187 | - <span | |
188 | - ng-bind="getSubTotal() | currency: hojaRuta.moneda.simbolo" | |
189 | - > | |
190 | - </span> | |
191 | - </div> | |
192 | - </div> | |
193 | - </td> | |
194 | - <td class="text-center align-middle"> | |
195 | - <button | |
196 | - class="btn btn-outline-light" | |
197 | - ng-click="agregarATabla(13)" | |
198 | - > | |
199 | - <i class="fa fa-save"></i> | |
200 | - </button> | |
201 | - </td> | |
202 | - </tr> | |
203 | - <!-- SELECCIONAR PRODUCTO --> | |
204 | - <tr ng-show="cargando" class="d-flex"> | |
205 | - <td class="col-12"> | |
206 | - <input | |
207 | - placeholder="Seleccione Articulo" | |
208 | - class="form-control form-control-sm" | |
209 | - readonly | |
210 | - ng-click="seleccionarArticulo()" | |
211 | - /> | |
212 | - </td> | |
213 | - </tr> | |
214 | - <!-- TOOGLE EXPANDIR --> | |
215 | - <tr> | |
216 | - <td class="col"> | |
217 | - <button | |
218 | - class="btn btn-outline-light selectable w-100" | |
219 | - ng-click="show = !show; masMenos()" | |
220 | - ng-show="remitosTabla.length > 0" | |
221 | - > | |
222 | - <i | |
223 | - class="fa fa-chevron-down" | |
224 | - ng-hide="show" | |
225 | - aria-hidden="true" | |
226 | - > | |
227 | - </i> | |
228 | - <i | |
229 | - class="fa fa-chevron-up" | |
230 | - ng-show="show" | |
231 | - aria-hidden="true"> | |
232 | - </i> | |
233 | - </button> | |
234 | - </td> | |
235 | - </tr> | |
236 | - <!-- FOOTER --> | |
237 | - <tr class="d-flex"> | |
238 | - <td class="align-middle no-border-top" colspan="2"> | |
239 | - <strong>Cantidad Items:</strong> | |
240 | - <a ng-bind="remitosTabla.length"></a> | |
241 | - </td> | |
242 | - <td class="text-right ml-auto table-celda-total no-border-top"> | |
243 | - <h3>Total:</h3> | |
244 | - </td> | |
245 | - <td class="table-celda-total text-right no-border-top"> | |
246 | - <h3>{{getTotal() | currency: hojaRuta.moneda.simbolo}}</h3> | |
247 | - </td> | |
248 | - </tr> | |
249 | - </tfoot> | |
250 | - </table> | |
251 | - </div> | |
252 | 84 | </div> |
253 | 85 | </div> |
254 | 86 | </div> |
255 | - <div class="row d-md-none fixed-bottom"> | |
256 | - <div class="w-100 bg-dark d-flex px-3 acciones-mobile"> | |
257 | - <span class="ml-3 text-muted" ng-click="salir()">Salir</span> | |
258 | - <span class="mr-3 ml-auto" ng-click="crearHojaRuta()">Guardar</span> | |
259 | - </div> | |
260 | - </div> | |
261 | 87 | </div> |