Commit 2916fd9ae9d157cc512f272db6643e22e1f9d21e
Exists in
master
Merge branch 'master' into 'master'
Master(efernandez) See merge request modulos-npm/foca-crear-nota-pedido!9
Showing
6 changed files
Show diff stats
gulpfile.js
... | ... | @@ -44,7 +44,8 @@ gulp.task('uglify', ['templates'], function() { |
44 | 44 | rename('foca-crear-nota-pedido.min.js'), |
45 | 45 | uglify(), |
46 | 46 | replace('"ngRoute","ui.bootstrap","focaModalVendedores","focaBusquedaProductos",'+ |
47 | - '"focaModalPetroleras","focaBusquedaCliente","focaModalPrecioCondicion"', ''), | |
47 | + '"focaModalPetroleras","focaBusquedaCliente","focaModalPrecioCondicion",'+ | |
48 | + '"focaModalFlete"', ''), | |
48 | 49 | gulp.dest(paths.dist) |
49 | 50 | ] |
50 | 51 | ); |
index.html
... | ... | @@ -20,7 +20,7 @@ |
20 | 20 | <script src="node_modules/foca-modal-petroleras/dist/foca-modal-petroleras.min.js"></script> |
21 | 21 | <script src="node_modules/foca-busqueda-cliente/dist/foca-busqueda-cliente.min.js"></script> |
22 | 22 | <script src="node_modules/foca-modal-precio-condiciones/dist/foca-modal-precio-condiciones.min.js"></script> |
23 | - | |
23 | + <script src="node_modules/foca-modal-flete/dist/foca-modal-flete.min.js"></script> | |
24 | 24 | <script src="src/js/app.js"></script> |
25 | 25 | <script src="src/js/controller.js"></script> |
26 | 26 | <script src="src/js/service.js"></script> |
package.json
... | ... | @@ -8,7 +8,7 @@ |
8 | 8 | "compile": "gulp uglify", |
9 | 9 | "gulp-pre-commit": "gulp pre-commit", |
10 | 10 | "postinstall": "npm run compile && gulp clean-post-install", |
11 | - "install-dev": "npm install -D jasmine-core pre-commit angular angular-route bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-uglify jquery jshint pump git+https://debo.suite.repo/modulos-npm/foca-directivas.git git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git git+https://debo.suite.repo/nguarnieri/foca-modal-busqueda-productos git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git" | |
11 | + "install-dev": "npm install -D jasmine-core pre-commit angular angular-route bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-uglify jquery jshint pump git+https://debo.suite.repo/modulos-npm/foca-directivas.git git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git git+https://debo.suite.repo/nguarnieri/foca-modal-busqueda-productos git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git git+https://debo.suite.repo/modulos-npm/foca-modal-flete" | |
12 | 12 | }, |
13 | 13 | "pre-commit": [ |
14 | 14 | "gulp-pre-commit" |
... | ... | @@ -33,6 +33,7 @@ |
33 | 33 | "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git", |
34 | 34 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", |
35 | 35 | "foca-modal-busqueda-productos": "git+https://debo.suite.repo/nguarnieri/foca-modal-busqueda-productos", |
36 | + "foca-modal-flete": "git+https://debo.suite.repo/modulos-npm/foca-modal-flete", | |
36 | 37 | "foca-modal-petroleras": "git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git", |
37 | 38 | "foca-modal-precio-condiciones": "git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git", |
38 | 39 | "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git", |
src/js/app.js
src/js/controller.js
... | ... | @@ -43,7 +43,7 @@ angular.module('focaCrearNotaPedido') |
43 | 43 | $scope.notaPedido.fechaCarga = new Date(); |
44 | 44 | $scope.notaPedido.domicilio = [{ id: 0 }]; |
45 | 45 | $scope.notaPedido.bomba = '1'; |
46 | - $scope.notaPedido.flete = '1'; | |
46 | + $scope.notaPedido.flete = '0'; | |
47 | 47 | idLista = undefined; |
48 | 48 | } |
49 | 49 | $scope.addNewDom = function() { |
... | ... | @@ -228,6 +228,26 @@ angular.module('focaCrearNotaPedido') |
228 | 228 | } |
229 | 229 | ); |
230 | 230 | }; |
231 | + $scope.abrirModalFlete = function() { | |
232 | + if($scope.notaPedido.flete === '1') { | |
233 | + var modalInstance = $uibModal.open( | |
234 | + { | |
235 | + ariaLabelledBy: 'Busqueda de Flete', | |
236 | + templateUrl: 'modal-flete.html', | |
237 | + controller: 'focaModalFleteController', | |
238 | + size: 'lg' | |
239 | + } | |
240 | + ); | |
241 | + modalInstance.result.then( | |
242 | + function(flete) { | |
243 | + $scope.notaPedido.fleteNombre = flete.nombre; | |
244 | + $scope.notaPedido.costoUnitarioKmFlete = flete.costoKilometro; | |
245 | + }, function() { | |
246 | + | |
247 | + } | |
248 | + ); | |
249 | + } | |
250 | + }; | |
231 | 251 | } |
232 | 252 | ] |
233 | 253 | ) |
... | ... | @@ -260,10 +280,10 @@ angular.module('focaCrearNotaPedido') |
260 | 280 | $scope.editar = function(notaPedido) { |
261 | 281 | crearNotaPedidoService.setNotaPedido(notaPedido); |
262 | 282 | $location.path('/venta-nota-pedido/abm/'); |
263 | - } | |
283 | + }; | |
264 | 284 | $scope.crearPedido = function() { |
265 | 285 | crearNotaPedidoService.clearNotaPedido(); |
266 | 286 | $location.path('/venta-nota-pedido/abm/'); |
267 | - } | |
287 | + }; | |
268 | 288 | } |
269 | 289 | ]); |
src/views/nota-pedido.html
... | ... | @@ -70,11 +70,62 @@ |
70 | 70 | class="form-control selectable" |
71 | 71 | type="text" |
72 | 72 | readonly="true" |
73 | - ng-bind="notaPedido.precioCondicion" | |
73 | + ng-model="notaPedido.precioCondicion" | |
74 | 74 | ng-click="abrirModalListaPrecio()" |
75 | 75 | placeholder="Seleccione Lista de precio" |
76 | 76 | > |
77 | 77 | </div> |
78 | + <div class="form-group col-12 col-sm-6 col-md-4"> | |
79 | + <label>Flete</label> | |
80 | + <div class="form-check custom-radio custom-control-inline"> | |
81 | + <input | |
82 | + class="form-check-input" | |
83 | + type="radio" | |
84 | + name="radioFlete" | |
85 | + value="1" | |
86 | + ng-model="notaPedido.flete"> | |
87 | + <label class="form-check-label">Si</label> | |
88 | + </div> | |
89 | + <div class="form-check custom-radio custom-control-inline"> | |
90 | + <input | |
91 | + class="form-check-input" | |
92 | + type="radio" | |
93 | + name="radioFlete" | |
94 | + value="0" | |
95 | + ng-model="notaPedido.flete"> | |
96 | + <label class="form-check-label">No</label> | |
97 | + </div> | |
98 | + </div> | |
99 | + <div class="form-group col-12 col-sm-6 col-md-4"> | |
100 | + <input | |
101 | + class="form-control selectable" | |
102 | + type="text" | |
103 | + readonly="true" | |
104 | + ng-model="notaPedido.fleteNombre" | |
105 | + ng-click="abrirModalFlete()" | |
106 | + placeholder="Seleccione Flete" | |
107 | + > | |
108 | + </div> | |
109 | + <div class="form-group col-12 col-sm-6 col-md-4"> | |
110 | + <input | |
111 | + class="form-control selectable" | |
112 | + type="number" | |
113 | + step="0.01" | |
114 | + ng-disabled="notaPedido.flete == 0" | |
115 | + ng-model="notaPedido.costoUnitarioKmFlete" | |
116 | + placeholder="Costo por kilómetro" | |
117 | + > | |
118 | + </div> | |
119 | + <div class="form-group col-12 col-sm-6 col-md-4"> | |
120 | + <input | |
121 | + class="form-control selectable" | |
122 | + type="number" | |
123 | + step="0.1" | |
124 | + ng-disabled="notaPedido.flete == 0" | |
125 | + ng-model="notaPedido.kilometros" | |
126 | + placeholder="Kilómetros recorridos" | |
127 | + > | |
128 | + </div> | |
78 | 129 | </div> |
79 | 130 | </div> |
80 | 131 | </div> |