Commit ba5693e55950309bc6a804c828c80df24f5e4630

Authored by Eric Fernandez
1 parent 51c4e039ec
Exists in master

progreso logistica

src/js/controllerDetalleVehiculo.js
1 1 angular.module('focaLogisticaPedidoRuta')
2   - .controller('focaDetalleVehiculo', ['$scope', '$uibModalInstance', 'vehiculo', 'marcador',
  2 + .controller('focaDetalleVehiculo',
  3 + ['$scope',
  4 + '$uibModalInstance',
  5 + 'vehiculo',
  6 + 'marcador',
3 7 function($scope, $uibModalInstance, vehiculo, marcador) {
4 8 $scope.articulos = marcador.notaPedido.articulosNotaPedido;
  9 + $scope.articuloSeleccionado = {};
5 10 $scope.vehiculo = vehiculo;
6 11 $scope.aceptar = function() {
7 12 $uibModalInstance.close();
8 13 };
  14 +
  15 + $scope.cargarACisterna = function(cisterna) {
  16 + if(!$scope.articuloSeleccionado.id) {
  17 + //TODO: usar modal de foca
  18 + alert('Debe seleccionar un articulo');
  19 + return;
  20 + }
  21 + if(cisterna.cisternaCarga.cantidad) {
  22 + cisterna.cisternaCarga.cantidad += parseFloat(cisterna.aCargar);
  23 + }else {
  24 + cisterna.cisternaCarga.cantidad = parseFloat(cisterna.aCargar);
  25 + cisterna.cisternaCarga.idProducto = $scope.articuloSeleccionado.id;
  26 + }
  27 + cisterna.disponible = cisterna.capacidad - cisterna.cisternaCarga.cantidad;
  28 + cisterna.aCargar = '';
  29 + };
  30 + $scope.calcularPorcentaje = function(cisterna) {
  31 + if(!cisterna.cisternaCarga.cantidad) {
  32 + cisterna.cisternaCarga.cantidad = 0;
  33 + }
  34 + var porcentaje = (cisterna.cisternaCarga.cantidad * 100 /
  35 + cisterna.capacidad) + '%';
  36 + document.getElementById(cisterna.id).style.width = porcentaje;
  37 + };
  38 + $scope.cambioArticulo = function(articulo) {
  39 + $scope.articuloSeleccionado = articulo;
  40 + };
9 41 }]);
src/js/osm-directive.js
... ... @@ -7,7 +7,7 @@ angular.module('focaLogisticaPedidoRuta').directive('foca', function() {
7 7 scope.map = L.map(contenedor).setView([attrs.latitud, attrs.longitud], attrs.zoom);
8 8 L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(scope.map);
9 9 },
10   - controller: ['$scope', function($scope) {
  10 + controller: ['$scope', '$filter', function($scope, $filter) {
11 11 $scope.markers = [];
12 12 $scope.$watch('marcadores', function() {
13 13 for(var i in $scope.markers) {
... ... @@ -15,8 +15,41 @@ angular.module('focaLogisticaPedidoRuta').directive('foca', function() {
15 15 }
16 16 $scope.markers = [];
17 17  
18   - angular.forEach($scope.marcadores, function(marcador) {
19   - var observacion = '<i class="fa fa-map-marker fa-5x" aria-hidden="true"'+
  18 + angular.forEach($scope.marcadores, function(marcador) {
  19 + var observacion =
  20 + 'Vendedor: ' + marcador.notaPedido.idVendedor + ' - ' +
  21 + (
  22 + marcador.notaPedido.vendedor ?
  23 + marcador.notaPedido.vendedor.NomVen :
  24 + ''
  25 + ) + '<br/>';
  26 + observacion += 'Fecha: ' +
  27 + $filter('date')(marcador.fecha.slice(0,10), 'dd/MM/yyyy') + ' ' +
  28 + marcador.fecha.slice(11,19) + '<br/>';
  29 + observacion += 'Nยบ: ' + $filter('comprobante')([
  30 + marcador.notaPedido.sucursal,
  31 + marcador.notaPedido.numeroNotaPedido
  32 + ]) + '<br/>';
  33 + observacion += 'Cliente: ' +
  34 + marcador.notaPedido.cliente.NOM + '<br/>';
  35 +
  36 + if ($scope.parametros.individual) {
  37 + observacion +=
  38 + 'Total: ' + $filter('currency')(marcador.notaPedido.total, '$');
  39 + observacion = 'Orden: ' + marcador.orden + '<br/>' + observacion;
  40 +
  41 + if (marcador.distancia) {
  42 + observacion += '<br/>Distancia a casa central: ' +
  43 + marcador.distancia + 'km';
  44 + }
  45 + } else {
  46 + observacion += 'Cantidad de nota de pedido: ' +
  47 + marcador.cantidad + '<br/>';
  48 + observacion += 'Total Vendido: ' +
  49 + $filter('currency')(marcador.total, '$');
  50 + }
  51 + observacion += '<br/>';
  52 + observacion += '<i class="fa fa-map-marker fa-3x" aria-hidden="true"'+
20 53 'class="form-control" ondragend="dropEnd()" ondragstart=\'drag(event, '+
21 54 JSON.stringify(marcador)+')\' draggable="true"></i>';
22 55 $scope.markers.push(
src/views/foca-detalle-vehiculo.html
1 1 <div class="modal-header">
2 2 <h4>Detalle de carga</h4>
  3 + <h3>-EN DESARROLLO</h3>
3 4 </div>
4 5 <div class="modal-body">
5   - <div class="row">
  6 + <div>
6 7 <div class="col-12" ng-repeat="articulo in articulos">
7 8 <input
8   - type="checkbox"
9   - ng-model="articulo.chequed"
  9 + type="radio"
  10 + name="articuloRadio"
  11 + id="{{articulo.id}}"
  12 + ng-click="cambioArticulo(articulo)"
10 13 >
11 14 <span>Articulo: {{articulo.descripcion}},</span>
12   - <span>Cantidad: {{articulo.cantidad}}</span>
  15 + <span>Cantidad Cargada: {{articulo.cantidad}}</span>
  16 + <span>Cantidad a Cargar: </span>
13 17 </div>
14 18 <strong class="col-12" ng-bind="vehiculo.tractor"></strong>
15 19 <strong class="col-12">Cisternas:</strong>
16   - <!-- <div class="text-center">
17   - <div class="progress" ng-repeat="cisterna in vehiculo.cisternas">
18   - <div class="progress-bar" role="progressbar" aria-valuenow="30" aria-valuemin="0" aria-valuemax="100" style="height: 30%;">
19   - <span class="sr-only">30% Complete</span>
  20 + <div class="form-group row input-group" ng-repeat="cisterna in vehiculo.cisternas">
  21 + <div class="col-1 mt-2">
  22 + <strong>{{cisterna.codigo}}</strong>
  23 + </div>
  24 + <input
  25 + class="form-control col-2"
  26 + foca-tipo-input
  27 + foca-teclado
  28 + placeholder="A cargar..."
  29 + ng-model="cisterna.aCargar"
  30 + ng-disabled="articuloSeleccionado.cantidad > cisterna.disponible"
  31 + >
  32 + <div class="input-group-append">
  33 + <button
  34 + class="form-control btn btn-outline-secondary"
  35 + ng-disabled="articuloSeleccionado.cantidad > cisterna.disponible">
  36 + <i
  37 + class="fa fa-save"
  38 + ng-click="cargarACisterna(cisterna)"
  39 + aria-hidden="true"></i>
  40 + </button>
  41 + </div>
  42 + <div class="progress foca-alto col-8 pl-0 pr-0 mt-1">
  43 + <strong class="col-12 mt-1 text-center position-absolute"
  44 + >{{cisterna.cisternaCarga.cantidad || 0}} / {{cisterna.capacidad}}</strong>
  45 + <div
  46 + id="{{cisterna.id}}"
  47 + class="progress-bar"
  48 + role="progressbar"
  49 + aria-valuemin="0"
  50 + aria-valuemax="{{cisterna.capacidad}}"
  51 + ng-style="{'width':'{{calcularPorcentaje(cisterna)}}'}">
20 52 </div>
21 53 </div>
22   - </div> -->
23   - <div class="progress col-12" ng-repeat="cisterna in vehiculo.cisternas">
24   - <div class="progress-bar" role="progressbar" aria-valuenow="70"
25   - aria-valuemin="0" aria-valuemax="100" style="width:70%">
26   - <span class="sr-only">70% Complete</span>
  54 + <div class="col-1 mt-1">
  55 + <i class="fa fa-info" data-toggle="tooltip" title="asd"></i>
27 56 </div>
28 57 </div>
29 58 </div>
... ... @@ -48,4 +77,7 @@
48 77 -o-transition: height 0.6s ease;
49 78 transition: height 0.6s ease;
50 79 }
  80 +.foca-alto{
  81 + height: 2rem;
  82 +}
51 83 </style>
52 84 \ No newline at end of file
src/views/foca-logistica-pedido-ruta.html
... ... @@ -26,6 +26,7 @@
26 26 }
27 27 </script>
28 28 <div class="foca-logistica-pedido-ruta" id="test">
  29 + <h3>-EN DESARROLLO</h3>
29 30 <div class="row">
30 31 <div class="offset-1 col-9">
31 32 <foca
... ... @@ -245,8 +246,8 @@
245 246 transform: rotate(0deg);
246 247 }
247 248 100%{
248   - -webkit-transform: rotate(144deg);
249   - transform: rotate(144deg);
  249 + -webkit-transform: rotate(180deg);
  250 + transform: rotate(180deg);
250 251 }
251 252 }
252 253 @keyframes loading-3{