Commit 84ca285bed2bae718496974e09c9c530aec0917e

Authored by Pablo Marco del Pont
1 parent e8ffc5498a
Exists in master

- Refactor de columnas y datos.

- Tareas gulp.
... ... @@ -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 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,14 +26,7 @@ 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) {
... ... @@ -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"