Commit 1f343e7653db07e2557230cffefebd3c11e9667c
Exists in
master
Merge branch 'master' into 'master'
Master (pmarco) See merge request modulos-npm/foca-modal-nota-pedido!1
Showing
4 changed files
Show diff stats
gulpfile.js
... | ... | @@ -73,7 +73,7 @@ gulp.task('webserver', function() { |
73 | 73 | ] |
74 | 74 | }); |
75 | 75 | |
76 | -gulp.task('clean-post-install', function(){ | |
76 | +gulp.task('clean-post-install', function() { | |
77 | 77 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
78 | 78 | 'index.html'], {read: false}) |
79 | 79 | .pipe(clean()); |
... | ... | @@ -82,10 +82,14 @@ gulp.task('clean-post-install', function(){ |
82 | 82 | gulp.task('default', ['webserver']); |
83 | 83 | |
84 | 84 | gulp.task('watch', function() { |
85 | - gulp.watch([paths.srcJS, paths.srcViews], ['copy']) | |
85 | + gulp.watch([paths.srcJS, paths.srcViews], ['uglify']) | |
86 | 86 | }); |
87 | 87 | |
88 | -gulp.task('copy', ['uglify'], function(){ | |
88 | +gulp.task('copy', ['uglify'], function() { | |
89 | 89 | gulp.src('dist/*.js') |
90 | 90 | .pipe(gulp.dest('../../wrapper-demo/node_modules/foca-modal-nota-pedido/dist')); |
91 | 91 | }); |
92 | + | |
93 | +gulp.task('watchAndCopy', function() { | |
94 | + return gulp.watch([paths.srcJS, paths.srcViews], ['copy']); | |
95 | +}); |
src/js/controller.js
... | ... | @@ -26,19 +26,13 @@ angular.module('focaModalNotaPedido') |
26 | 26 | $scope.busquedaPress = function(key) { |
27 | 27 | if (key === 13) { |
28 | 28 | $scope.searchLoading = true; |
29 | - if(parametroNotaPedido.idLista > 0) { | |
30 | - focaModalNotaPedidoService | |
31 | - .getNotasPedidoByIdLista(parametroNotaPedido.idLista, $scope.filters) | |
32 | - .then(llenarDatos); | |
33 | - } else if(parametroNotaPedido.idLista === -1) { | |
34 | - focaModalNotaPedidoService.getNotasPedido() | |
35 | - .then(llenarDatos); | |
36 | - } | |
29 | + focaModalNotaPedidoService.getNotasPedido().then(llenarDatos); | |
37 | 30 | } |
38 | 31 | }; |
39 | 32 | function llenarDatos(res) { |
40 | 33 | for(var i = 0; i < res.data.length; i++) { |
41 | - res.data[i].precio = res.data[i].precio / parametroNotaPedido.cotizacion; | |
34 | + res.data[i].precio = | |
35 | + res.data[i].precio / parametroNotaPedido.cotizacion; | |
42 | 36 | } |
43 | 37 | $scope.searchLoading = false; |
44 | 38 | $scope.primerBusqueda = true; |
src/js/service.js
... | ... | @@ -5,11 +5,7 @@ angular.module('focaModalNotaPedido') |
5 | 5 | function($http, API_ENDPOINT) { |
6 | 6 | return { |
7 | 7 | getNotasPedido: function() { |
8 | - return $http.get(API_ENDPOINT.URL + '/articulos'); | |
9 | - }, | |
10 | - getNotasPedidoByIdLista: function(id, filters) { | |
11 | - return $http.post(API_ENDPOINT.URL + '/articulos/lista', | |
12 | - {filters: filters, id: id}); | |
8 | + return $http.get(API_ENDPOINT.URL + '/nota-pedido'); | |
13 | 9 | } |
14 | 10 | }; |
15 | 11 | } |
src/views/foca-modal-nota-pedido.html
... | ... | @@ -29,10 +29,9 @@ |
29 | 29 | <table ng-show="primerBusqueda" class="table table-striped table-sm"> |
30 | 30 | <thead> |
31 | 31 | <tr> |
32 | - <th>Sec.</th> | |
33 | - <th>Cod.</th> | |
34 | - <th>Descripción</th> | |
35 | - <th>P. Base</th> | |
32 | + <th>Fecha</th> | |
33 | + <th>Cliente</th> | |
34 | + <th>Comprobante</th> | |
36 | 35 | <th></th> |
37 | 36 | </tr> |
38 | 37 | </thead> |
... | ... | @@ -45,10 +44,9 @@ |
45 | 44 | <tr class="selectable" |
46 | 45 | ng-repeat="(key,notaPedido) in currentPageNotasPedido" |
47 | 46 | ng-click="select(notaPedido)"> |
48 | - <td ng-bind="notaPedido.sector"></td> | |
49 | - <td ng-bind="notaPedido.codigo"></td> | |
50 | - <td ng-bind="notaPedido.descripcion"></td> | |
51 | - <td ng-bind="notaPedido.precio | currency: simbolo : 4"></td> | |
47 | + <td ng-bind="notaPedido.fechaCarga | date : 'dd/MM/yyyy'"></td> | |
48 | + <td ng-bind="notaPedido.nombreCliente"></td> | |
49 | + <td ng-bind="[notaPedido.sucursal, notaPedido.numeroNotaPedido] | comprobante"></td> | |
52 | 50 | <td> |
53 | 51 | <button |
54 | 52 | type="button" |