Commit 66fcbdd93fdc66195bf7985b9117b2af172ba4c1
1 parent
6768e62d48
Exists in
master
and in
2 other branches
avances mobile
Showing
3 changed files
with
85 additions
and
20 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -5,8 +5,19 @@ angular.module('focaModalDetalleHojaRuta') |
5 | 5 | '$scope', |
6 | 6 | '$uibModalInstance', |
7 | 7 | 'remito', |
8 | - function($filter, $scope, $uibModalInstance, remito) { | |
8 | + 'focaModalDetalleHojaRutaService', | |
9 | + function($filter, $scope, $uibModalInstance, remito, focaModalDetalleHojaRutaService) { | |
9 | 10 | $scope.remito = remito; |
11 | + $scope.cisternas = []; | |
12 | + $scope.articuloSeleccionado = {}; | |
13 | + $scope.cambio = function(articulo) { | |
14 | + $scope.articuloSeleccionado = articulo; | |
15 | + }; | |
16 | + focaModalDetalleHojaRutaService.getCisternasByIdRemito($scope.remito.id) | |
17 | + .then(function(res) { | |
18 | + $scope.cisternas = res.data; | |
19 | + }); | |
20 | + | |
10 | 21 | $scope.aceptar = function() { |
11 | 22 | var articulos = articulosDescargados(); |
12 | 23 | var cisternaMovimientos = []; |
... | ... | @@ -16,19 +27,20 @@ angular.module('focaModalDetalleHojaRuta') |
16 | 27 | idRemito: $scope.remito.id, |
17 | 28 | cantidad: articulos[i].aCargar, |
18 | 29 | metodo: 'descarga' |
19 | - } | |
30 | + }; | |
20 | 31 | var hojaRutaMovimiento = { |
21 | 32 | idRemito: $scope.remito.id, |
22 | 33 | reciboDescarga: articulos[i].numeroRecibo |
23 | - } | |
34 | + }; | |
24 | 35 | cisternaMovimientos.push(cisternaMovimiento); |
25 | 36 | hojaRutaMovimientos.push(hojaRutaMovimiento); |
26 | 37 | } |
27 | 38 | var result = { |
28 | 39 | cisternaMovimientos: cisternaMovimientos, |
29 | 40 | hojaRutaMovimientos: hojaRutaMovimientos, |
30 | - idHojaRuta: $scope.remito.idHojaRuta | |
31 | - } | |
41 | + idRemito: $scope.remito.id, | |
42 | + observaciones: $scope.remito.observaciones | |
43 | + }; | |
32 | 44 | $uibModalInstance.close(result); |
33 | 45 | }; |
34 | 46 |
src/js/service.js
... | ... | @@ -6,6 +6,9 @@ angular.module('focaModalDetalleHojaRuta') |
6 | 6 | return { |
7 | 7 | getDetallesHojaRuta: function() { |
8 | 8 | return $http.get(API_ENDPOINT.URL + '/transportista'); |
9 | + }, | |
10 | + getCisternasByIdRemito: function(idRemito) { | |
11 | + return $http.get(API_ENDPOINT.URL + '/cisternas/obtener/remito/' + idRemito); | |
9 | 12 | } |
10 | 13 | }; |
11 | 14 | } |
src/views/modal-detalle-hoja-ruta.html
... | ... | @@ -23,53 +23,103 @@ |
23 | 23 | </label> |
24 | 24 | </div> |
25 | 25 | <div class="col-12 px-0"> |
26 | + <strong>Articulo a descargar</strong> | |
26 | 27 | <table class="table table-sm"> |
27 | 28 | <thead> |
28 | 29 | <tr> |
30 | + <th></th> | |
29 | 31 | <th>Articulo</th> |
30 | 32 | <th>Total</th> |
31 | - <th>A descargar</th> | |
32 | - <th>Nº Recibo</th> | |
33 | + <th>Descargado</th> | |
33 | 34 | </tr> |
34 | 35 | </thead> |
35 | 36 | <tbody> |
36 | 37 | <tr ng-repeat="(key, articulo) in remito.articulosRemito"> |
38 | + <td class="pt-2"><input | |
39 | + type="radio" | |
40 | + name="articuloRadio" | |
41 | + id="{{'articulo' + articulo.id}}" | |
42 | + ng-click="cambio(articulo)" | |
43 | + ng-disabled="articulo.cargado" | |
44 | + ></td> | |
37 | 45 | <td ng-bind="articulo.descripcion"></td> |
38 | 46 | <td ng-bind="articulo.cantidad"></td> |
47 | + <td ng-bind="articulo.descargado || articulo.cantidad"></td> | |
48 | + </tbody> | |
49 | + </table> | |
50 | + <strong>Cisterna</strong> | |
51 | + <table class="table table-sm"> | |
52 | + <thead> | |
53 | + <tr> | |
54 | + <th>Código</th> | |
55 | + <th>Articulo</th> | |
56 | + <th>Total</th> | |
57 | + <th>A descargar</th> | |
58 | + </tr> | |
59 | + </thead> | |
60 | + <tbody> | |
61 | + <tr ng-repeat="(key, cisterna) in cisternas"> | |
62 | + <td ng-bind="cisterna.codigo"></td> | |
63 | + <td ng-bind="cisterna.cisternaCarga.articulo.DetArt"></td> | |
64 | + <td ng-bind="cisterna.cisternaCarga.cantidad"></td> | |
39 | 65 | <td><input |
40 | 66 | class="form-control form-control-sm" |
41 | 67 | type="number" |
42 | - ng-model="articulo.aCargar" | |
43 | - foca-focus="key === 0"/></td> | |
44 | - <td><input | |
45 | - class="form-control form-control-sm" | |
46 | - type="number" | |
47 | - ng-model="articulo.numeroRecibo"/></td> | |
48 | - </tr> | |
68 | + ng-model="cisterna.aDescargar" | |
69 | + foca-focus="" | |
70 | + ng-disabled="articuloSeleccionado.idArticulo != cisterna.cisternaCarga.idProducto"/></td> | |
71 | + </tr> | |
49 | 72 | </tbody> |
50 | 73 | </table> |
51 | 74 | </div> |
52 | - <div class="col-12 px-0 py-0"> | |
53 | - <label class="form-control-sm"> | |
75 | + <div class="col-12 px-0"> | |
76 | + <label class="form-control-sm px-0"> | |
54 | 77 | <b>Observaciones</b> |
55 | 78 | </label> |
56 | 79 | </div> |
57 | - <div class="col-12 pl-0"> | |
80 | + <div class="col-12"> | |
58 | 81 | <textarea |
59 | 82 | ng-model="remito.observaciones" |
60 | - class="form-control mx-2" | |
61 | - rows="5" | |
83 | + class="form-control form-control-sm" | |
84 | + rows="1" | |
62 | 85 | ></textarea> |
63 | 86 | </div> |
87 | + <div class="col-12 row mt-2"> | |
88 | + <label class="form-control-sm px-0 col-3"><b>Nº Recibo</b></label> | |
89 | + <input | |
90 | + class="form-control form-control-sm col-4" | |
91 | + type="number" | |
92 | + ng-model="numeroRecibo"> | |
93 | + <button | |
94 | + class="ml-4 form-control-sm btn btn-success col-4" | |
95 | + ladda="cargando" | |
96 | + data-spinner-color="#FF0000" | |
97 | + type="button" | |
98 | + ng-disabled="!distribucionDisponible()" | |
99 | + ng-click="cargarACisternas(vehiculo)" | |
100 | + foca-focus="distribucionDisponible()"> | |
101 | + Descargar | |
102 | + </button> | |
103 | + </div> | |
64 | 104 | </div> |
65 | 105 | </form> |
66 | 106 | </div> |
67 | 107 | <div class="modal-footer py-2"> |
68 | 108 | <button |
109 | + class="btn btn-danger btn-sm" | |
110 | + type="button" | |
111 | + ng-click="" | |
112 | + ng-disabled="" | |
113 | + >Anular</button> | |
114 | + <button | |
69 | 115 | class="btn btn-secondary btn-sm" |
70 | 116 | type="button" |
117 | + ng-click="cancel()" | |
118 | + >Cancelar</button> | |
119 | + <button | |
120 | + class="btn btn-primary btn-sm" | |
121 | + type="button" | |
71 | 122 | ng-click="aceptar()" |
72 | 123 | ng-disabled="validar()" |
73 | 124 | >Aceptar</button> |
74 | - <button class="btn btn-secondary btn-sm" type="button" ng-click="cancel()">Cancelar</button> | |
75 | 125 | </div> |