Commit 784774b68510458e0bb06d32528a8c6c15affbe8

Authored by Jose Pinto
Exists in master

Merge branch 'master' into 'master'

Master(efernandez)

See merge request !13
src/js/controller.js
... ... @@ -10,7 +10,7 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo
10 10 $scope.titulo = 'Logistica de Pedidos';
11 11 $scope.botonera = ['Transportista'];
12 12 var cabecera = '';
13   -
  13 + $scope.now = new Date();
14 14 $scope.idVendedor = 0;
15 15 $scope.marcadores = [];
16 16 $scope.vehiculos = [];
... ... @@ -112,16 +112,8 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo
112 112 $location.path('/');
113 113 };
114 114  
115   - $scope.search = function(key) {
116   - if (key === 13) {
117   - $scope.idVendedor = $scope.idVendedorInput;
118   - getSeguimiento();
119   - $scope.$broadcast('removeCabecera', 'General');
120   - $scope.$broadcast('addCabecera', {
121   - label: cabecera,
122   - valor: $scope.idVendedorInput
123   - });
124   - }
  115 + $scope.search = function() {
  116 + getSeguimiento();
125 117 };
126 118  
127 119 $scope.fecha = function() {
... ... @@ -174,17 +166,24 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo
174 166 function getSeguimiento() {
175 167 var desde = new Date('1900/01/01');
176 168 var hasta = new Date('2099/01/01');
177   - if ($scope.now) {
178   - var now = $scope.now;
179   - desde = new Date(new Date(now.setHours(0)).setMinutes(0));
180   - desde = desde.setDate(desde.getDate() - 1);
  169 + if($scope.fechaDesde) {
  170 + var fechaDesde = $scope.fechaDesde;
  171 + desde = new Date(new Date(fechaDesde.setHours(0)).setMinutes(0));
181 172 desde = new Date(desde);
182 173 }
  174 + if($scope.fechaHasta) {
  175 + var fechaHasta = $scope.fechaHasta;
  176 + hasta = new Date(new Date(fechaHasta.setHours(0)).setMinutes(0));
  177 + hasta = hasta.setDate(hasta.getDate() + 1);
  178 + hasta = new Date(hasta);
  179 + }
183 180 var datos = {
184 181 actividad: $scope.actividad,
185 182 idUsuario: $scope.idVendedor,
186 183 fechaDesde: desde,
187   - fechaHasta: hasta
  184 + fechaHasta: hasta,
  185 + asignacion: $scope.filtroEstado ? true : ($scope.filtroEstado !== undefined ?
  186 + false : undefined)
188 187 };
189 188  
190 189 $scope.datosBuscados = {
src/js/controllerDetalleVehiculo.js
... ... @@ -27,7 +27,7 @@ angular.module('focaLogisticaPedidoRuta')
27 27 function(res) {
28 28 $scope.remito = res.data;
29 29 if($scope.remito.idUsuarioProceso) {
30   - focaModalService.alert('El remito esta siendo cargado por otro usario');
  30 + focaModalService.alert('Remito ya asignado');
31 31 $uibModalInstance.close();
32 32 }
33 33 $scope.articulos = res.data.articulosRemito;
src/js/osm-directive.js
... ... @@ -3,6 +3,7 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function()
3 3 restrict: 'E',
4 4 link: function(scope, el, attrs) {
5 5 var contenedor = document.createElement('div');
  6 + contenedor.className = 'border border-light rounded';
6 7 el.append(contenedor);
7 8 scope.map = L.map(contenedor).setView([attrs.latitud, attrs.longitud], attrs.zoom);
8 9 L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(scope.map);
... ... @@ -48,9 +49,9 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function()
48 49 JSON.stringify(marcador)+')\' draggable="true"></i>(Arrastrar icono)';
49 50 var icon;
50 51 if(marcador.notaPedido.remito.idUsuarioProceso) {
51   - //Asignado AZUL
  52 + //Asignado ROJO
52 53 icon = new L.Icon({
53   - iconUrl: 'img/marker-icon-2x-blue.png',
  54 + iconUrl: 'img/marker-icon-2x-red.png',
54 55 shadowUrl: 'img/marker-shadow.png',
55 56 iconSize: [25, 41],
56 57 iconAnchor: [12, 41],
... ... @@ -58,9 +59,9 @@ angular.module(&#39;focaLogisticaPedidoRuta&#39;).directive(&#39;focaLogistica&#39;, function()
58 59 shadowSize: [41, 41]
59 60 });
60 61 }else {
61   - //Sin asignar ROJO
  62 + //Sin asignar VERDE
62 63 icon = new L.Icon({
63   - iconUrl: 'img/marker-icon-2x-red.png',
  64 + iconUrl: 'img/marker-icon-2x-green.png',
64 65 shadowUrl: 'img/marker-shadow.png',
65 66 iconSize: [25, 41],
66 67 iconAnchor: [12, 41],
src/views/foca-detalle-vehiculo.html
... ... @@ -83,7 +83,7 @@
83 83 </div>
84 84 </div>
85 85 </td>
86   - <td ng-bind="cisterna.cisternaCarga.articulo.DetArt || 'Sin articulo'"></td>
  86 + <td ng-bind="cisterna.cisternaCarga.articulo.DetArt || 'Sin asignar'"></td>
87 87 </tr>
88 88 </tbody>
89 89 </table>
src/views/foca-logistica-pedido-ruta.html
... ... @@ -22,19 +22,36 @@
22 22 />
23 23 </div>
24 24 <div class="col-2 pl-0">
  25 + <strong>Filtros: </strong>
  26 + <br>
  27 + <span>Fecha Desde</span>
25 28 <input
26 29 type="text"
27 30 readonly
28   - ng-model="now"
29   - class="form-control"
  31 + ng-model="fechaDesde"
  32 + class="form-control form-control-sm"
30 33 uib-datepicker-popup="dd/MM/yyyy"
31 34 show-button-bar="false"
32   - is-open="datepickerOpen"
  35 + is-open="fechaDesdeOpen"
33 36 on-open-focus="false"
34   - ng-focus="datepickerOpen = true"
35   - datepicker-options="dateOptions"
  37 + ng-focus="fechaDesdeOpen = true"
  38 + ng-change="search()"
36 39 />
37   - <button
  40 + <span>Fecha Hasta</span>
  41 + <input
  42 + type="text"
  43 + readonly
  44 + ng-model="fechaHasta"
  45 + class="form-control form-control-sm"
  46 + uib-datepicker-popup="dd/MM/yyyy"
  47 + show-button-bar="false"
  48 + is-open="fechaHastaOpen"
  49 + on-open-focus="false"
  50 + ng-focus="fechaHastaOpen = true"
  51 + ng-change="search()"
  52 + />
  53 + <!-- TODO: descomentar cuando se quite definitivamente -->
  54 + <!-- <button
38 55 type="button"
39 56 ng-class="{'active': idVendedor == 0}"
40 57 class="btn col-12 my-1"
... ... @@ -55,14 +72,46 @@
55 72 ng-keypress="search($event.keyCode)"
56 73 foca-focus="idVendedor == -1"
57 74 >
  75 + </div> -->
  76 + <div class="custom-control custom-radio">
  77 + <input
  78 + type="radio"
  79 + class="custom-control-input"
  80 + id="idTodos"
  81 + name="filtro"
  82 + ng-model="filtroEstado"
  83 + ng-change="search()"
  84 + checked>
  85 + <label class="custom-control-label pb-3" for="idTodos"></label>
  86 + <img src="img/marker-icon-grey.png">
  87 + <strong>Todos</strong>
58 88 </div>
59   - <div>
60   - <img src="img/marker-icon-blue.png">
61   - <strong>Asignado</strong>
62   - <br>
63   - <img src="img/marker-icon-red.png">
  89 + <div class="custom-control custom-radio">
  90 + <input
  91 + type="radio"
  92 + class="custom-control-input"
  93 + id="idSinAsignar"
  94 + name="filtro"
  95 + ng-model="filtroEstado"
  96 + ng-change="search()"
  97 + ng-value="false">
  98 + <label class="custom-control-label pb-3" for="idSinAsignar"></label>
  99 + <img src="img/marker-icon-green.png">
64 100 <strong>Sin asignar</strong>
65 101 </div>
  102 + <div class="custom-control custom-radio">
  103 + <input
  104 + type="radio"
  105 + class="custom-control-input"
  106 + id="idAsignado"
  107 + name="filtro"
  108 + ng-model="filtroEstado"
  109 + ng-change="search()"
  110 + ng-value="true">
  111 + <label class="custom-control-label pb-3" for="idAsignado"></label>
  112 + <img src="img/marker-icon-red.png">
  113 + <strong>Asignado</strong>
  114 + </div>
66 115 </div>
67 116 <div class="row">
68 117 <div