Commit 243f2e883dd96727ca552ae7ef82e1bb8821a01b
1 parent
95869a524d
Exists in
master
and in
1 other branch
Agregado data a la vista de ultimos despachos.
Showing
2 changed files
with
16 additions
and
31 deletions
Show diff stats
src/js/controllerUltimosDespachos.js
1 | angular.module('focaCrearFactura') | 1 | angular.module('focaCrearFactura') |
2 | .controller('ultimosDespachosController', [ | 2 | .controller('ultimosDespachosController', [ |
3 | '$filter', | 3 | '$filter', |
4 | '$scope', | 4 | '$scope', |
5 | '$uibModalInstance', | 5 | '$uibModalInstance', |
6 | 'crearFacturaService', | 6 | 'crearFacturaService', |
7 | 'parametros', | 7 | 'parametros', |
8 | function ($filter, $scope, $uibModalInstance, crearFacturaService, parametros) { | 8 | function ($filter, $scope, $uibModalInstance, crearFacturaService, parametros) { |
9 | 9 | ||
10 | $scope.colorTexto = { color: 'black' }; | ||
11 | |||
12 | config(); | 10 | config(); |
13 | 11 | ||
14 | function config() { | 12 | function config() { |
15 | 13 | ||
16 | crearFacturaService.getUltimosDespachos(parametros.planilla).then(function (res) { | 14 | crearFacturaService.getUltimosDespachos(parametros.planilla).then(function (res) { |
17 | $scope.productos = res.data; | 15 | $scope.productos = res.data; |
18 | }); | 16 | }); |
19 | } | 17 | } |
20 | 18 | ||
21 | $scope.aceptar = function (despacho) { | 19 | $scope.aceptar = function (despacho) { |
22 | $uibModalInstance.close(despacho); | 20 | $uibModalInstance.close(despacho); |
23 | }; | 21 | }; |
24 | 22 | ||
25 | $scope.cancel = function () { | 23 | $scope.cancel = function () { |
26 | $uibModalInstance.dismiss('cancel'); | 24 | $uibModalInstance.dismiss('cancel'); |
27 | }; | 25 | }; |
28 | 26 | ||
29 | //TODO: Cambiar switch case con los casos de nombres de productos axion | ||
30 | function setColorNombreProducto() { | ||
31 | |||
32 | // Diesel #FF852E | Euro+Diesel #6C389A | Premium #00A857 | Super #175AA5 | ||
33 | switch ($scope.nombreProducto) { | ||
34 | case 'NAFTA SUPER XXI': | ||
35 | $scope.colorTexto = { color: '#FF852E' }; | ||
36 | break; | ||
37 | case 'GO-INFINIA DIESEL': | ||
38 | $scope.colorTexto = { color: '#6C389A' }; | ||
39 | break; | ||
40 | case 'ULTRADIESEL XXI - RED': | ||
41 | $scope.colorTexto = { color: '#00A857' }; | ||
42 | break; | ||
43 | case 'NAFTA INFINIA': | ||
44 | $scope.colorTexto = { color: '#175AA5' }; | ||
45 | break; | ||
46 | default: | ||
47 | $scope.colorTexto = { color: 'black' }; | ||
48 | break; | ||
49 | } | ||
50 | } | ||
51 | } | 27 | } |
52 | ]); | 28 | ]); |
53 | 29 |
src/views/modal-ultimos-despachos.html
1 | <div class="modal-header py-1"> | 1 | <div class="modal-header py-1"> |
2 | <div class="row w-100"> | 2 | <div class="row w-100"> |
3 | <div class="col-lg-6"> | 3 | <div class="col-lg-6"> |
4 | <h5 class="modal-title my-1"><b>Despachos Disponibles</b></h5> | 4 | <h5 class="modal-title my-1"><b>Últimos Despachos</b></h5> |
5 | </div> | 5 | </div> |
6 | </div> | 6 | </div> |
7 | </div> | 7 | </div> |
8 | <div class="modal-body" id="modal-body"> | 8 | <div class="modal-body" id="modal-body"> |
9 | <div ng-repeat="(key, producto) in productos"> | 9 | <div ng-repeat="(key, producto) in productos"> |
10 | <div class="row pb-2 border-bottom"> | ||
11 | <div class="col"> | ||
12 | <p class="m-1 h6"> | ||
13 | <b> | ||
14 | <i class="fa fa-circle" aria-hidden="true"></i> {{producto.DetArt}} | ||
15 | </b> | ||
16 | </p> | ||
17 | </div> | ||
18 | </div> | ||
10 | <div class="row my-2"> | 19 | <div class="row my-2"> |
11 | <div class="col"> | 20 | <div class="col"> |
12 | <label> | 21 | <label> |
13 | <img class="w-50" ng-src="./img/surtidor.png" alt=""> | 22 | <img class="w-50" ng-src="./img/surtidor.png" alt=""> |
14 | {{manguera.csu}} | 23 | {{producto.despachos[0].CSU}} |
15 | </label> | 24 | </label> |
16 | <button | 25 | <button |
17 | type="button" | 26 | type="button" |
18 | class="btn p-1 text-secondary float-right border" | 27 | class="btn p-1 text-secondary float-right border" |
19 | ng-click="manguera.show = !manguera.show"> | 28 | ng-click="manguera.show = !manguera.show"> |
20 | <i ng-show="manguera.show" class="fa fa-minus px-1"></i> | 29 | <i ng-show="manguera.show" class="fa fa-minus px-1"></i> |
21 | <i ng-show="!manguera.show" class="fa fa-plus px-1"></i> | 30 | <i ng-show="!manguera.show" class="fa fa-plus px-1"></i> |
22 | </button> | 31 | </button> |
23 | <table class="table table-sm table-striped" ng-show="manguera.show"> | 32 | <table class="table table-sm table-striped" ng-show="manguera.show"> |
24 | <tbody> | 33 | <tbody> |
25 | <tr ng-repeat="(key, despacho) in manguera.despachos"> | 34 | <tr> |
26 | <td class="py-2 py-sm-1" ng-bind="despacho.FEC | date:'dd/MM/yyyy hh:MM:ss'"></td> | 35 | <td class="py-2 py-sm-1" ng-bind="producto.despachos[0].FEC | date:'dd/MM/yyyy hh:MM:ss'"></td> |
27 | <td class="py-2 py-sm-1" ng-bind="despacho.LTS"></td> | 36 | <td class="py-2 py-sm-1" ng-bind="producto.despachos[0].LTS"></td> |
28 | <td class="py-2 py-sm-1" ng-bind="despacho.IMP | currency: '$'"></td> | 37 | <td class="py-2 py-sm-1" ng-bind="producto.despachos[0].IMP | currency: '$'"></td> |
29 | <td class="py-2 py-sm-1"> | 38 | <td class="py-2 py-sm-1"> |
30 | <button | 39 | <button |
31 | type="button" | 40 | type="button" |
32 | class="btn btn-default btn-xs p-1 float-right" | 41 | class="btn btn-default btn-xs p-1 float-right" |
33 | title="Seleccionar" | 42 | title="Seleccionar" |
34 | ng-click="aceptar(despacho)" | 43 | ng-click="aceptar(producto)" |
35 | ><i class="fa fa-circle-thin" aria-hidden="true"></i> | 44 | ><i class="fa fa-circle-thin" aria-hidden="true"></i> |
36 | </button> | 45 | </button> |
37 | </td> | 46 | </td> |
38 | </tr> | 47 | </tr> |
39 | </tbody> | 48 | </tbody> |
40 | </table> | 49 | </table> |
41 | </div> | 50 | </div> |
42 | </div> | 51 | </div> |
43 | </div> | 52 | </div> |
44 | 53 | ||
45 | </div> | 54 | </div> |
46 | <div class="modal-footer py-2"> | 55 | <div class="modal-footer py-2"> |
47 | <nav ng-show="currentPageProveedores.length > 0 && primerBusqueda" class="mr-auto"> | 56 | <nav ng-show="currentPageProveedores.length > 0 && primerBusqueda" class="mr-auto"> |
48 | <ul class="pagination pagination-sm mb-0"> | 57 | <ul class="pagination pagination-sm mb-0"> |
49 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | 58 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> |
50 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> | 59 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> |
51 | <span aria-hidden="true">«</span> | 60 | <span aria-hidden="true">«</span> |
52 | <span class="sr-only">Anterior</span> | 61 | <span class="sr-only">Anterior</span> |
53 | </a> | 62 | </a> |
54 | </li> | 63 | </li> |
55 | <li | 64 | <li |
56 | class="page-item" | 65 | class="page-item" |
57 | ng-repeat="pagina in paginas" | 66 | ng-repeat="pagina in paginas" |
58 | ng-class="{'active': pagina == currentPage}" | 67 | ng-class="{'active': pagina == currentPage}" |
59 | > | 68 | > |
60 | <a | 69 | <a |
61 | class="page-link" | 70 | class="page-link" |
62 | href="javascript:void();" | 71 | href="javascript:void();" |
63 | ng-click="selectPage(pagina)" | 72 | ng-click="selectPage(pagina)" |
64 | ng-bind="pagina" | 73 | ng-bind="pagina" |
65 | ></a> | 74 | ></a> |
66 | </li> | 75 | </li> |
67 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | 76 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> |
68 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage + 1)"> | 77 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage + 1)"> |
69 | <span aria-hidden="true">»</span> | 78 | <span aria-hidden="true">»</span> |
70 | <span class="sr-only">Siguiente</span> | 79 | <span class="sr-only">Siguiente</span> |
71 | </a> | 80 | </a> |
72 | </li> | 81 | </li> |
73 | </ul> | 82 | </ul> |
74 | </nav> | 83 | </nav> |
75 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> | 84 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> |
76 | </div> | 85 | </div> |
77 | 86 |