Commit 26875e59c42a2fff1b61d2fa047fa088a664e6b7
Exists in
master
Merge branch 'master' into 'master'
Master(efernandez) See merge request !10
Showing
2 changed files
Show diff stats
src/js/service.js
1 | angular.module('focaModalDescarga') | 1 | angular.module('focaModalDescarga') |
2 | .factory('focaModalDescargasService', ['$http', 'API_ENDPOINT', 'crearRemitoService', | 2 | .factory('focaModalDescargasService', ['$http', 'API_ENDPOINT', 'crearRemitoService', |
3 | function ($http, API_ENDPOINT, crearRemitoService) { | 3 | function ($http, API_ENDPOINT, crearRemitoService) { |
4 | var route = API_ENDPOINT.URL; | 4 | var route = API_ENDPOINT.URL; |
5 | return { | 5 | return { |
6 | crearRemito: function (remito) { | 6 | crearRemito: function (remito) { |
7 | return $http.post('http://10.231.45.197:9900' + '/remito/mobile', remito); | 7 | return $http.post(route + '/remito/mobile', remito); |
8 | }, | 8 | }, |
9 | validarSucursalRemito: function (sucursal, remito) { | 9 | validarSucursalRemito: function (sucursal, remito) { |
10 | return $http.get('http://10.231.45.197:9900' + '/remito/validar/' + | 10 | return $http.get(route + '/remito/validar/' + |
11 | sucursal + '/' + remito); | 11 | sucursal + '/' + remito); |
12 | }, | 12 | }, |
13 | addArticulos: function (articulosRemito, articulosBase, idRemito, cotizacion) { | 13 | addArticulos: function (articulosRemito, articulosBase, idRemito, cotizacion) { |
14 | 14 | ||
15 | for (var i = 0; i < articulosRemito.length; i++) { | 15 | for (var i = 0; i < articulosRemito.length; i++) { |
16 | 16 | ||
17 | var articuloReferencia = articulosBase.filter(function (articulo) { | 17 | var articuloReferencia = articulosBase.filter(function (articulo) { |
18 | return articulosRemito[i].idArticulo == articulo.id; | 18 | return articulosRemito[i].idArticulo == articulo.id; |
19 | })[0]; | 19 | })[0]; |
20 | 20 | ||
21 | delete articulosRemito[i].id | 21 | delete articulosRemito[i].id |
22 | delete articulosRemito[i].editCantidad; | 22 | delete articulosRemito[i].editCantidad; |
23 | delete articulosRemito[i].editPrecio; | 23 | delete articulosRemito[i].editPrecio; |
24 | 24 | ||
25 | articulosRemito[i].idRemito = articulosRemito[i].idRemito !== -1 ? | 25 | articulosRemito[i].idRemito = articulosRemito[i].idRemito !== -1 ? |
26 | idRemito : articulosRemito[i].idRemito; | 26 | idRemito : articulosRemito[i].idRemito; |
27 | 27 | ||
28 | articulosRemito[i].precio = articuloReferencia.PreVen * cotizacion; | 28 | articulosRemito[i].precio = articuloReferencia.PreVen * cotizacion; |
29 | articulosRemito[i].cantidad = articuloReferencia.cantidad; | 29 | articulosRemito[i].cantidad = articuloReferencia.cantidad; |
30 | articulosRemito[i].cantidadDescargada = articuloReferencia.cantidad; | 30 | articulosRemito[i].cantidadDescargada = articuloReferencia.cantidad; |
31 | 31 | ||
32 | delete articulosRemito[i].idNotaPedido; | 32 | delete articulosRemito[i].idNotaPedido; |
33 | crearRemitoService.crearArticulosParaRemito(articulosRemito[i]); | 33 | crearRemitoService.crearArticulosParaRemito(articulosRemito[i]); |
34 | } | 34 | } |
35 | } | 35 | } |
36 | }; | 36 | }; |
37 | }]); | 37 | }]); |
38 | 38 |
src/views/foca-modal-descarga.html
1 | <div class="modal-header"> | 1 | <div class="modal-header"> |
2 | <h5>Detalle de descarga</h5> | 2 | <h5>Detalle de descarga</h5> |
3 | </div> | 3 | </div> |
4 | <div class="modal-body"> | 4 | <div class="modal-body"> |
5 | <div class="row px-1"> | 5 | <div class="row px-1"> |
6 | <div class="col-3 align-self-center mt-1 pl-1"> | 6 | <div class="col-3 align-self-center mt-1 pl-1"> |
7 | <strong>Cliente</strong> | 7 | <strong>Cliente</strong> |
8 | </div> | 8 | </div> |
9 | <div class="col-9"> | 9 | <div class="col-9"> |
10 | <div class="input-group"> | 10 | <div class="input-group"> |
11 | <input | 11 | <input |
12 | type="text" | 12 | type="text" |
13 | ladda="searchLoading" | 13 | ladda="searchLoading" |
14 | class="form-control form-control-sm foca-input" | 14 | class="form-control form-control-sm foca-input" |
15 | placeholder="Busqueda cliente" | 15 | placeholder="Busqueda cliente" |
16 | ng-model="remito.cliente.nom" | 16 | ng-model="remito.cliente.nom" |
17 | readonly | 17 | readonly |
18 | > | 18 | > |
19 | <div class="input-group-append"> | 19 | <div class="input-group-append"> |
20 | <button | 20 | <button |
21 | ladda="searchLoading" | 21 | ladda="searchLoading" |
22 | data-spinner-color="#FF0000" | 22 | data-spinner-color="#FF0000" |
23 | class="btn btn-outline-secondary" | 23 | class="btn btn-outline-secondary" |
24 | type="button" | 24 | type="button" |
25 | ng-click="seleccionarCliente()" | 25 | ng-click="seleccionarCliente()" |
26 | > | 26 | > |
27 | <i class="fa fa-search fa-x1" aria-hidden="true"></i> | 27 | <i class="fa fa-search fa-x1" aria-hidden="true"></i> |
28 | </button> | 28 | </button> |
29 | </div> | 29 | </div> |
30 | </div> | 30 | </div> |
31 | </div> | 31 | </div> |
32 | <div class="col-3 align-self-center pl-1 mt-1"> | 32 | <div class="col-3 align-self-center pl-1 mt-1"> |
33 | <strong>Domicilio</strong> | 33 | <strong>Domicilio</strong> |
34 | </div> | 34 | </div> |
35 | <div class="col-9 align-self-center mt-1"> | 35 | <div class="col-9 align-self-center mt-1"> |
36 | <label ng-bind="remito.cliente.DOM"></label> | 36 | <label ng-bind="remito.cliente.DOM"></label> |
37 | </div> | 37 | </div> |
38 | <div class="col-3 align-self-center px-1 mt-1"> | 38 | <div class="col-3 align-self-center px-1 mt-1"> |
39 | <strong>Remito Nº</strong> | 39 | <strong>Remito Nº</strong> |
40 | </div> | 40 | </div> |
41 | <div class="col-3 pr-0 mt-1"> | 41 | <div class="col-3 pr-0 mt-1"> |
42 | <input | 42 | <input |
43 | type="number" class="text-center form-control form-control-sm" | 43 | type="number" class="text-center form-control form-control-sm" |
44 | ng-focus="$event.target.select();" | 44 | ng-focus="$event.target.select();" |
45 | ng-model="nroSucursal" | 45 | ng-model="nroSucursal" |
46 | ng-change="validateSucursalRemito(nroSucursal, nroRemito)"> | 46 | ng-change="validateSucursalRemito(nroSucursal, nroRemito)" |
47 | limite-numeros-max="4"> | ||
47 | </div> | 48 | </div> |
48 | <div class="col-6 mt-1"> | 49 | <div class="col-6 mt-1"> |
49 | <input | 50 | <input |
50 | type="number" class="text-center form-control form-control-sm" | 51 | type="number" class="text-center form-control form-control-sm" |
51 | ng-focus="$event.target.select();" | 52 | ng-focus="$event.target.select();" |
52 | ng-model="nroRemito" | 53 | ng-model="nroRemito" |
53 | ng-change="validateSucursalRemito(nroSucursal, nroRemito)"> | 54 | ng-change="validateSucursalRemito(nroSucursal, nroRemito)" |
55 | limite-numeros-max="8"> | ||
54 | </div> | 56 | </div> |
55 | <div | 57 | <div |
56 | class="col-12 mt-1 alert alert-danger text-center" role="alert" | 58 | class="col-12 mt-1 alert alert-danger text-center" role="alert" |
57 | ng-show="hasErrorSucursalRemito"> | 59 | ng-show="hasErrorSucursalRemito"> |
58 | Error numero de remito existente!<br>Ingrese otro número | 60 | Error numero de remito existente!<br>Ingrese otro número |
59 | </div> | 61 | </div> |
60 | <div class="col-12 mt-3 p-0"> | 62 | <div class="col-12 mt-3 p-0"> |
61 | <table class="table"> | 63 | <table class="table"> |
62 | <thead> | 64 | <thead> |
63 | <tr> | 65 | <tr> |
64 | <th>Cisterna</th> | 66 | <th>Cisterna</th> |
65 | <th>Articulo/Disponibles</th> | 67 | <th>Articulo/Disponibles</th> |
66 | <th>Descargar</th> | 68 | <th>Descargar</th> |
67 | </tr> | 69 | </tr> |
68 | </thead> | 70 | </thead> |
69 | <tbody> | 71 | <tbody> |
70 | <tr ng-repeat="cisterna in cisternas"> | 72 | <tr ng-repeat="cisterna in cisternas"> |
71 | <td class="text-center" ng-bind="cisterna.codigo"></td> | 73 | <td class="text-center" ng-bind="cisterna.codigo"></td> |
72 | <td class="text-center"> | 74 | <td class="text-center"> |
73 | {{cisterna.cisternaCarga.articulo.DetArt}}<br> | 75 | {{cisterna.cisternaCarga.articulo.DetArt}}<br> |
74 | {{cisterna.cisternaCarga.cantidad}} | 76 | {{cisterna.cisternaCarga.cantidad}} |
75 | </td> | 77 | </td> |
76 | <td> | 78 | <td> |
77 | <input | 79 | <input |
78 | ng-init="cisterna.cisternaCarga.descargar = | 80 | ng-init="cisterna.cisternaCarga.descargar = |
79 | cisterna.cisternaCarga.cantidad" | 81 | cisterna.cisternaCarga.cantidad" |
80 | ng-model="cisterna.cisternaCarga.descargar" | 82 | ng-model="cisterna.cisternaCarga.descargar" |
81 | ng-focus="$event.target.select();" | 83 | ng-focus="$event.target.select();" |
82 | class="text-center form-control col-12"> | 84 | class="text-center form-control col-12"> |
83 | </td> | 85 | </td> |
84 | </tr> | 86 | </tr> |
85 | </tbody> | 87 | </tbody> |
86 | </table> | 88 | </table> |
87 | </div> | 89 | </div> |
88 | <div class="col-3 align-self-center px-1"> | 90 | <div class="col-3 align-self-center px-1"> |
89 | <strong>Nº Recibo</strong> | 91 | <strong>Nº Recibo</strong> |
90 | </div> | 92 | </div> |
91 | <div class="col-9"> | 93 | <div class="col-9"> |
92 | <input | 94 | <input |
93 | ng-model="nroRecibo" class="form-control" | 95 | ng-model="nroRecibo" class="form-control" |
94 | ng-focus="$event.target.select();" | 96 | ng-focus="$event.target.select();" |
95 | type="number" placeholder="Nº de recibo"> | 97 | type="number" placeholder="Nº de recibo"> |
96 | </div> | 98 | </div> |
97 | </div> | 99 | </div> |
98 | </div> | 100 | </div> |
99 | <div class="modal-footer"> | 101 | <div class="modal-footer"> |
100 | <button | 102 | <button |
101 | class="btn btn-sm btn-secondary" | 103 | class="btn btn-sm btn-secondary" |
102 | ladda="cargando" | 104 | ladda="cargando" |
103 | type="button" | 105 | type="button" |
104 | ng-click="cancelar()">Cancelar</button> | 106 | ng-click="cancelar()">Cancelar</button> |
105 | <button | 107 | <button |
106 | class="btn btn-sm btn-primary" | 108 | class="btn btn-sm btn-primary" |
107 | ladda="cargando" | 109 | ladda="cargando" |
108 | type="button" | 110 | type="button" |
109 | ng-click="crearRemito()" | 111 | ng-click="crearRemito()" |
110 | ng-disabled="tieneArticulosPendientes() || | 112 | ng-disabled="tieneArticulosPendientes() || |
111 | idRemito === -1 || hasErrorSucursalRemito || !nroSucursal || !nroRemito" | 113 | idRemito === -1 || hasErrorSucursalRemito || !nroSucursal || !nroRemito" |
112 | foca-focus="!tieneArticulosPendientes() && idRemito !== -1">Descargar</button> | 114 | foca-focus="!tieneArticulosPendientes() && idRemito !== -1">Descargar</button> |
113 | </div> | 115 | </div> |
114 | 116 |