Commit f11af7f89cd7aa828213e4768922f0efbbf09a5e

Authored by Marcelo Puebla
1 parent dfa9935fd7
Exists in master

Cambio en interfaz de modal de despachos.

src/js/controllerCombustibles.js
... ... @@ -4,12 +4,38 @@ angular.module('focaCrearFactura')
4 4 '$scope',
5 5 '$uibModalInstance',
6 6 'parametros',
7   - function($filter, $scope, $uibModalInstance, parametros) {
  7 + function ($filter, $scope, $uibModalInstance, parametros) {
8 8  
9 9 $scope.mangueras = [];
10   -
  10 + $scope.nombreProducto = parametros.nombreProducto;
  11 + $scope.colorTexto = { color: 'black' };
11 12 var productosByMangera = [];
12 13  
  14 + setColorNombreProducto();
  15 +
  16 + //TODO: Cambiar switch case con los casos de nombres de productos axion
  17 + function setColorNombreProducto() {
  18 +
  19 + // Diesel #FF852E | Euro+Diesel #6C389A | Premium #00A857 | Super #175AA5
  20 + switch ($scope.nombreProducto) {
  21 + case 'NAFTA SUPER XXI':
  22 + $scope.colorTexto = { color: '#FF852E' };
  23 + break;
  24 + case 'GO-INFINIA DIESEL':
  25 + $scope.colorTexto = { color: '#6C389A' };
  26 + break;
  27 + case 'ULTRADIESEL XXI - RED':
  28 + $scope.colorTexto = { color: '#00A857' };
  29 + break;
  30 + case 'NAFTA INFINIA':
  31 + $scope.colorTexto = { color: '#175AA5' };
  32 + break;
  33 + default:
  34 + $scope.colorTexto = { color: 'black' };
  35 + break;
  36 + }
  37 + }
  38 +
13 39 parametros.despachos.forEach(function (despacho) {
14 40  
15 41 var findCsu = productosByMangera.filter(function (csu) {
src/views/modal-combustibles.html
1 1 <div class="modal-header py-1">
2 2 <div class="row w-100">
3 3 <div class="col-lg-6">
4   - <h5 class="modal-title my-1">Despachos Disponibles</h5>
  4 + <h5 class="modal-title my-1"><b>Despachos Disponibles</b></h5>
5 5 </div>
6 6 </div>
7 7 </div>
8 8 <div class="modal-body" id="modal-body">
  9 +
  10 + <div class="row pb-2 border-bottom">
  11 + <div class="col">
  12 + <p ng-style="colorTexto" class="m-1 h6">
  13 + <b>
  14 + <i class="fa fa-circle" aria-hidden="true"></i>&nbsp;&nbsp;{{nombreProducto}}
  15 + </b>
  16 + </p>
  17 + </div>
  18 + </div>
9 19 <div ng-repeat="(key, manguera) in mangueras">
10   - <strong>
11   - Manguera&nbsp;{{manguera.csu}}
12   - </strong>
13   - <button type="button" class="btn" ng-click="manguera.show = !manguera.show">
14   - <i ng-show="manguera.show" class="fa fa-minus"></i>
15   - <i ng-show="!manguera.show" class="fa fa-plus"></i>
16   - </button>
17   - <table class="table table-sm" ng-show="manguera.show">
18   - <tbody>
19   - <tr ng-repeat="(key, despacho) in manguera.despachos">
20   - <td ng-bind="despacho.FEC | date:'dd/MM/yyyy hh:MM:ss'"></td>
21   - <td ng-bind="despacho.LTS"></td>
22   - <td ng-bind="despacho.IMP | currency: '$'"></td>
23   - <td>
24   - <button
25   - type="button"
26   - class="btn btn-xs p-1 float-right"
27   - title="Seleccionar"
28   - ng-click="aceptar(despacho)"
29   - ><i class="fa fa-circle-thin" aria-hidden="true"></i>
30   - </button>
31   - </td>
32   - </tr>
33   - </tbody>
34   - </table>
  20 + <div class="row my-2">
  21 + <div class="col">
  22 + <label>
  23 + <img class="w-50" ng-src="./img/surtidor.png" alt="">
  24 + {{manguera.csu}}
  25 + </label>
  26 + <button
  27 + type="button"
  28 + class="btn p-1 text-secondary float-right border"
  29 + ng-click="manguera.show = !manguera.show">
  30 + <i ng-show="manguera.show" class="fa fa-minus px-1"></i>
  31 + <i ng-show="!manguera.show" class="fa fa-plus px-1"></i>
  32 + </button>
  33 + <table class="table table-sm table-striped" ng-show="manguera.show">
  34 + <tbody>
  35 + <tr ng-repeat="(key, despacho) in manguera.despachos">
  36 + <td class="py-2 py-sm-1" ng-bind="despacho.FEC | date:'dd/MM/yyyy hh:MM:ss'"></td>
  37 + <td class="py-2 py-sm-1" ng-bind="despacho.LTS"></td>
  38 + <td class="py-2 py-sm-1" ng-bind="despacho.IMP | currency: '$'"></td>
  39 + <td class="py-2 py-sm-1">
  40 + <button
  41 + type="button"
  42 + class="btn btn-default btn-xs p-1 float-right"
  43 + title="Seleccionar"
  44 + ng-click="aceptar(despacho)"
  45 + ><i class="fa fa-circle-thin" aria-hidden="true"></i>
  46 + </button>
  47 + </td>
  48 + </tr>
  49 + </tbody>
  50 + </table>
  51 + </div>
  52 + </div>
35 53 </div>
36 54  
37 55 </div>
38   -<div class="modal-footer py-1">
  56 +<div class="modal-footer py-2">
39 57 <nav ng-show="currentPageProveedores.length > 0 && primerBusqueda" class="mr-auto">
40 58 <ul class="pagination pagination-sm mb-0">
41 59 <li class="page-item" ng-class="{'disabled': currentPage == 1}">