Commit 0e602a98a5ed8c7b184772a4f68f1159fb121d5f
Exists in
master
Merge branch 'master' into 'master'
Master (pmarco) See merge request modulos-npm/foca-crear-nota-pedido!19
Showing
2 changed files
Show diff stats
src/js/controller.js
... | ... | @@ -3,14 +3,16 @@ angular.module('focaCrearNotaPedido') |
3 | 3 | ['$scope', '$uibModal', 'crearNotaPedidoService', 'focaModalService', |
4 | 4 | function($scope, $uibModal, crearNotaPedidoService, focaModalService) { |
5 | 5 | $scope.botonera = [ |
6 | - {texto: 'moneda', accion: function() {$scope.abrirModalMoneda();}}, | |
6 | + {texto: 'Vendedor', accion: function() {$scope.seleccionarVendedor();}}, | |
7 | + {texto: 'Cliente', accion: function() {$scope.seleccionarCliente();}}, | |
8 | + {texto: 'Moneda', accion: function() {$scope.abrirModalMoneda();}}, | |
7 | 9 | { |
8 | - texto: 'precios y condiciones', | |
10 | + texto: 'Precios y condiciones', | |
9 | 11 | accion: function() {$scope.abrirModalListaPrecio();}}, |
10 | - {texto: 'flete', accion: function() {$scope.abrirModalFlete();}}, | |
11 | - {texto: 'bomba', accion: function() {}}, | |
12 | - {texto: 'detalle', accion: function() {}}, | |
13 | - {texto: 'totales', accion: function() {}} | |
12 | + {texto: 'Flete', accion: function() {$scope.abrirModalFlete();}}, | |
13 | + {texto: 'Bomba', accion: function() {}}, | |
14 | + {texto: 'Detalle', accion: function() {}}, | |
15 | + {texto: 'Totales', accion: function() {}} | |
14 | 16 | ]; |
15 | 17 | $scope.show = false; |
16 | 18 | $scope.cargando = true; |
... | ... | @@ -21,7 +23,8 @@ angular.module('focaCrearNotaPedido') |
21 | 23 | $scope.notaPedido = { |
22 | 24 | vendedor: {}, |
23 | 25 | cliente: {}, |
24 | - domicilio: { dom: ''} | |
26 | + domicilio: {dom: ''}, | |
27 | + moneda: {detalle: ''} | |
25 | 28 | }; |
26 | 29 | $scope.articulosTabla = []; |
27 | 30 | var idLista; |
... | ... | @@ -196,7 +199,6 @@ angular.module('focaCrearNotaPedido') |
196 | 199 | ); |
197 | 200 | modalInstance.result.then( |
198 | 201 | function(cliente) { |
199 | - $scope.limpiarPantalla(); | |
200 | 202 | $scope.notaPedido.cliente.nombre = cliente.nom; |
201 | 203 | $scope.notaPedido.cliente.id = cliente.cod; |
202 | 204 | crearNotaPedidoService.getDomiciliosByIdCliente(cliente.cod).then( |
... | ... | @@ -294,7 +296,11 @@ angular.module('focaCrearNotaPedido') |
294 | 296 | ); |
295 | 297 | modalInstance.result.then( |
296 | 298 | function(moneda) { |
297 | - console.log('moneda', moneda); | |
299 | + $scope.notaPedido.moneda = { | |
300 | + id: moneda.ID, | |
301 | + detalle: moneda.DETALLE, | |
302 | + simbolo: moneda.SIMBOLO | |
303 | + }; | |
298 | 304 | }, function() { |
299 | 305 | |
300 | 306 | } |
src/views/nota-pedido.html
1 | -<form name="formCrearNota" ng-submit="crearNotaPedido()"> | |
2 | - <div class="row"> | |
3 | - <div class="col-md-10 offset-md-1 col-lg-8 offset-lg-2"> | |
4 | - <div class="row p-2 panel-informativo"> | |
5 | - <div class="col"> | |
6 | - <div class="row"> | |
7 | - <div class="form-group col-12 col-sm-6 col-md-4"> | |
8 | - <div class="input-group"> | |
9 | - <input | |
10 | - class="form-control form-control-sm selectable" | |
11 | - type="text" | |
12 | - ng-model="notaPedido.cliente.nombre" | |
13 | - placeholder="Seleccione Cliente" | |
14 | - readonly="true" | |
15 | - ng-click="seleccionarCliente()" | |
16 | - ng-required="true" | |
17 | - foca-focus="true" | |
18 | - > | |
19 | - <span class="input-group-append"> | |
20 | - <button | |
21 | - type="button" | |
22 | - class="btn btn-default" | |
23 | - ng-click="seleccionarCliente()" | |
24 | - > | |
25 | - <i class="fa fa-search"></i> | |
26 | - </button> | |
27 | - </span> | |
1 | +<div class="crear-nota-pedido"> | |
2 | + <form name="formCrearNota" ng-submit="crearNotaPedido()"> | |
3 | + <div class="row"> | |
4 | + <div class="col-md-10 offset-md-1 col-lg-8 offset-lg-2"> | |
5 | + <div class="row p-1 panel-informativo"> | |
6 | + <div class="col-12"> | |
7 | + <div class="row"> | |
8 | + <div class="col-5"> | |
9 | + <span class="label">Vendedor:</span> | |
10 | + <span class="valor" ng-bind="notaPedido.vendedor.nombre"></span> | |
11 | + </div> | |
12 | + <div class="col-4"> | |
13 | + <span class="label">Moneda:</span> | |
14 | + <span class="valor" ng-bind="notaPedido.moneda.detalle"></span> | |
15 | + </div> | |
16 | + <div class="col-3"> | |
17 | + <span class="label">Flete:</span> | |
18 | + <span class="valor" ng-bind="notaPedido.flete"></span> | |
28 | 19 | </div> |
29 | 20 | </div> |
30 | - </div> | |
31 | - <div class="row"> | |
32 | - <div class="form-group col-12 col-sm-6 col-md-4"> | |
33 | - <div class="input-group"> | |
34 | - <input | |
35 | - class="form-control form-control-sm" | |
36 | - type="text" | |
37 | - ng-model="notaPedido.vendedor.nombre" | |
38 | - placeholder="Seleccione Vendedor" | |
39 | - readonly="true" | |
40 | - > | |
41 | - <span class="input-group-append"> | |
42 | - <button | |
43 | - type="button" | |
44 | - class="btn btn-default" | |
45 | - ng-click="seleccionarVendedor()" | |
46 | - > | |
47 | - <i class="fa fa-search"></i> | |
48 | - </button> | |
49 | - </span> | |
21 | + <div class="row"> | |
22 | + <div class="col-5"> | |
23 | + <span class="label">Cliente:</span> | |
24 | + <span class="valor" ng-bind="notaPedido.cliente.nombre"></span> | |
25 | + </div> | |
26 | + <div class="col-5"> | |
27 | + <span class="label">Precios y condiciones:</span> | |
28 | + <span class="valor" ng-bind="notaPedido.cliente.nombre"></span> | |
29 | + </div> | |
30 | + <div class="col-3"> | |
31 | + <span class="label">Bomba:</span> | |
32 | + <span class="valor" ng-bind="notaPedido.bomba"></span> | |
50 | 33 | </div> |
51 | 34 | </div> |
52 | 35 | </div> |
53 | 36 | </div> |
54 | - </div> | |
55 | - <div class="row p-2 botonera-secundaria"> | |
56 | - <div class=" col-12 col-sm-6 col-md-3 botonera" ng-repeat="boton in botonera"> | |
57 | - <button | |
58 | - type="button" | |
59 | - class="btn btn-default btn-block btn-sm" | |
60 | - ng-bind="boton.texto" | |
61 | - ng-click="boton.accion()" | |
62 | - ></button> | |
37 | + <div class="row p-1 botonera-secundaria"> | |
38 | + <div class=" col-12 col-sm-6 col-md-3 botonera" ng-repeat="boton in botonera"> | |
39 | + <button | |
40 | + type="button" | |
41 | + class="btn btn-default btn-block btn-xs" | |
42 | + ng-bind="boton.texto" | |
43 | + ng-click="boton.accion()" | |
44 | + ></button> | |
45 | + </div> | |
63 | 46 | </div> |
64 | 47 | </div> |
65 | 48 | </div> |
66 | - </div> | |
67 | -</form> | |
68 | -<div class="row"> | |
69 | - <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2"> | |
70 | - <div class="row"> | |
71 | - </div> | |
72 | - <div class="row"> | |
73 | - <table class="table table-striped table-sm"> | |
74 | - <thead> | |
75 | - <tr> | |
76 | - <th>Sector</th> | |
77 | - <th>Cรณdigo</th> | |
78 | - <th>Descripciรณn</th> | |
79 | - <th>Precio Unitario</th> | |
80 | - <th>Cantidad</th> | |
81 | - <th>SubTotal</th> | |
82 | - <th> | |
83 | - <button | |
84 | - class="btn btn-outline-secondary selectable" | |
85 | - style="float: right;" | |
86 | - ng-click="show = !show; masMenos()" | |
87 | - > | |
88 | - <i | |
89 | - class="fa fa-chevron-down" | |
90 | - ng-hide="show" | |
91 | - aria-hidden="true" | |
49 | + </form> | |
50 | + <div class="row"> | |
51 | + <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2"> | |
52 | + <div class="row grilla-articulos align-items-end"> | |
53 | + <table class="table table-striped table-sm table-dark"> | |
54 | + <thead> | |
55 | + <tr> | |
56 | + <th>Sector</th> | |
57 | + <th>Cรณdigo</th> | |
58 | + <th>Descripciรณn</th> | |
59 | + <th>Precio Unitario</th> | |
60 | + <th>Cantidad</th> | |
61 | + <th>SubTotal</th> | |
62 | + <th> | |
63 | + <button | |
64 | + class="btn btn-outline-secondary selectable" | |
65 | + style="float: right;" | |
66 | + ng-click="show = !show; masMenos()" | |
67 | + > | |
68 | + <i | |
69 | + class="fa fa-chevron-down" | |
70 | + ng-hide="show" | |
71 | + aria-hidden="true" | |
72 | + > | |
73 | + </i> | |
74 | + <i | |
75 | + class="fa fa-chevron-up" | |
76 | + ng-show="show" | |
77 | + aria-hidden="true"> | |
78 | + </i> | |
79 | + </button> | |
80 | + </th> | |
81 | + </tr> | |
82 | + </thead> | |
83 | + <tbody> | |
84 | + <tr ng-show="!cargando"> | |
85 | + <td><input | |
86 | + class="form-control" | |
87 | + ng-model="articuloACargar.sector" | |
88 | + readonly></td> | |
89 | + <td><input | |
90 | + class="form-control" | |
91 | + ng-model="articuloACargar.codigo" | |
92 | + readonly></td> | |
93 | + <td><input | |
94 | + class="form-control" | |
95 | + ng-model="articuloACargar.descripcion" | |
96 | + readonly></td> | |
97 | + <td><input | |
98 | + class="form-control" | |
99 | + ng-value="articuloACargar.precio | currency: '$'" | |
100 | + readonly></td> | |
101 | + <td><input | |
102 | + class="form-control" | |
103 | + type="number" | |
104 | + min="1" | |
105 | + ng-model="articuloACargar.cantidad" | |
106 | + foca-focus="!cargando" | |
107 | + esc-key="resetFilter()" | |
108 | + ng-keypress="agregarATabla($event.keyCode)"></td> | |
109 | + <td><input | |
110 | + class="form-control" | |
111 | + ng-value="getSubTotal() | currency: '$'" | |
112 | + readonly></td> | |
113 | + <td class="text-center"><button | |
114 | + class="btn btn-outline-secondary btn-sm" | |
115 | + ng-click="agregarATabla(13)"> | |
116 | + <i class="fa fa-save"></i> | |
117 | + </button></td> | |
118 | + </tr> | |
119 | + <tr | |
120 | + ng-repeat="(key, articulo) in articulosTabla" | |
121 | + ng-show="show || key == 0" | |
122 | + > | |
123 | + <td ng-bind="articulo.sector"></td> | |
124 | + <td ng-bind="articulo.codigo"></td> | |
125 | + <td ng-bind="articulo.descripcion"></td> | |
126 | + <td ng-bind="articulo.precio | currency: '$'"></td> | |
127 | + <td><input | |
128 | + ng-show="articulo.edit" | |
129 | + ng-model="articulo.cantidad" | |
130 | + class="form-control" | |
131 | + type="number" | |
132 | + min="1" | |
133 | + foca-focus="articulo.edit" | |
134 | + ng-keypress="editarArticulo($event.keyCode, articulo)" | |
135 | + ng-focus="selectFocus($event)" | |
92 | 136 | > |
137 | + <i | |
138 | + class="selectable" | |
139 | + ng-click="cambioEdit(articulo)" | |
140 | + ng-hide="articulo.edit" | |
141 | + ng-bind="articulo.cantidad"> | |
93 | 142 | </i> |
94 | - <i class="fa fa-chevron-up" ng-show="show" aria-hidden="true"></i> | |
95 | - </button> | |
96 | - </th> | |
97 | - </tr> | |
98 | - </thead> | |
99 | - <tbody> | |
100 | - <tr ng-show="cargando"> | |
101 | - <td colspan="2"> | |
102 | - <input | |
103 | - placeholder="Seleccione Articulo" | |
104 | - class="form-control" | |
105 | - readonly | |
106 | - ng-click="seleccionarArticulo()" | |
107 | - /> | |
108 | - </td> | |
109 | - <td></td> | |
110 | - <td></td> | |
111 | - <td></td> | |
112 | - <td></td> | |
113 | - <td></td> | |
114 | - </tr> | |
115 | - <tr ng-show="!cargando"> | |
116 | - <td><input | |
117 | - class="form-control" | |
118 | - ng-model="articuloACargar.sector" | |
119 | - readonly></td> | |
120 | - <td><input | |
121 | - class="form-control" | |
122 | - ng-model="articuloACargar.codigo" | |
123 | - readonly></td> | |
124 | - <td><input | |
125 | - class="form-control" | |
126 | - ng-model="articuloACargar.descripcion" | |
127 | - readonly></td> | |
128 | - <td><input | |
129 | - class="form-control" | |
130 | - ng-value="articuloACargar.precio | currency:'$'" | |
131 | - readonly></td> | |
132 | - <td><input | |
133 | - class="form-control" | |
134 | - type="number" | |
135 | - min="1" | |
136 | - ng-model="articuloACargar.cantidad" | |
137 | - foca-focus="!cargando" | |
138 | - esc-key="resetFilter()" | |
139 | - ng-keypress="agregarATabla($event.keyCode)"></td> | |
140 | - <td><input | |
141 | - class="form-control" | |
142 | - ng-value="getSubTotal() | currency:'$'" | |
143 | - readonly></td> | |
144 | - <td class="text-center"><button | |
145 | - class="btn btn-outline-secondary btn-sm" | |
146 | - ng-click="agregarATabla(13)"> | |
147 | - <i class="fa fa-save"></i> | |
148 | - </button></td> | |
149 | - </tr> | |
150 | - <tr ng-repeat="(key, articulo) in articulosTabla" ng-show="show || key == 0"> | |
151 | - <td ng-bind="articulo.sector"></td> | |
152 | - <td ng-bind="articulo.codigo"></td> | |
153 | - <td ng-bind="articulo.descripcion"></td> | |
154 | - <td ng-bind="articulo.precio | currency:'$'"></td> | |
155 | - <td><input | |
156 | - ng-show="articulo.edit" | |
157 | - ng-model="articulo.cantidad" | |
158 | - class="form-control" | |
159 | - type="number" | |
160 | - min="1" | |
161 | - foca-focus="articulo.edit" | |
162 | - ng-keypress="editarArticulo($event.keyCode, articulo)" | |
163 | - ng-focus="selectFocus($event)" | |
164 | - > | |
165 | - <i | |
166 | - class="selectable" | |
167 | - ng-click="cambioEdit(articulo)" | |
168 | - ng-hide="articulo.edit" | |
169 | - ng-bind="articulo.cantidad"> | |
170 | - </i> | |
171 | - </td> | |
172 | - <td ng-bind="(articulo.precio * articulo.cantidad) | currency: '$'"></td> | |
173 | - <td class="text-center"> | |
174 | - <button class="btn btn-outline-secondary btn-sm" ng-click="quitarArticulo(key)"> | |
175 | - <i class="fa fa-trash"></i> | |
176 | - </button> | |
177 | - </td> | |
178 | - </tr> | |
179 | - </tbody> | |
180 | - <tfoot> | |
181 | - <tr class="table-secondary"> | |
182 | - <td colspan="4"> | |
183 | - <strong>Cantidad Items:</strong> | |
184 | - <a ng-bind="articulosTabla.length"></a> | |
185 | - </td> | |
186 | - <td class="text-right"><strong>Total:</strong></td> | |
187 | - <td colspan="3">{{getTotal() | currency:'$'}}</td> | |
188 | - </tr> | |
189 | - </tfoot> | |
190 | - </table> | |
143 | + </td> | |
144 | + <td | |
145 | + ng-bind="(articulo.precio * articulo.cantidad) | currency: '$'"> | |
146 | + </td> | |
147 | + <td class="text-center"> | |
148 | + <button | |
149 | + class="btn btn-outline-secondary btn-sm" | |
150 | + ng-click="quitarArticulo(key)" | |
151 | + > | |
152 | + <i class="fa fa-trash"></i> | |
153 | + </button> | |
154 | + </td> | |
155 | + </tr> | |
156 | + <tr ng-show="cargando"> | |
157 | + <td colspan="7"> | |
158 | + <input | |
159 | + placeholder="Seleccione Articulo" | |
160 | + class="form-control form-control-sm" | |
161 | + readonly | |
162 | + ng-click="seleccionarArticulo()" | |
163 | + /> | |
164 | + </td> | |
165 | + </tr> | |
166 | + </tbody> | |
167 | + <tfoot> | |
168 | + <tr class=""> | |
169 | + <td colspan="4"> | |
170 | + <strong>Cantidad Items:</strong> | |
171 | + <a ng-bind="articulosTabla.length"></a> | |
172 | + </td> | |
173 | + <td class="text-right table-celda-total"><h3>Total:</h3></td> | |
174 | + <td class="table-celda-total text-right" colspan="1"> | |
175 | + <h3>{{getTotal() | currency: '$'}}</h3> | |
176 | + </td> | |
177 | + <td colspan="2"></td> | |
178 | + </tr> | |
179 | + </tfoot> | |
180 | + </table> | |
181 | + </div> | |
182 | + </div> | |
183 | + <div class="col-auto my-2"> | |
184 | + <button | |
185 | + ng-click="crearNotaPedido()" | |
186 | + type="submit" | |
187 | + title="Crear nota pedido" | |
188 | + class="btn btn-primary float-right"> | |
189 | + Guardar | |
190 | + </button> | |
191 | 191 | </div> |
192 | 192 | </div> |
193 | 193 | </div> |
194 | -<div class="row"> | |
195 | - <div class="col-auto my-2"> | |
196 | - <button | |
197 | - ng-click="crearNotaPedido()" | |
198 | - type="submit" | |
199 | - title="Crear nota pedido" | |
200 | - class="btn btn-primary float-right"> | |
201 | - Guardar | |
202 | - </button> | |
203 | - </div> | |
204 | -</div> | |
205 | - | |
206 | 194 | <!-- |
207 | 195 | <form name="formCrearNota"> |
208 | 196 | <uib-tabset active="active"> |