Commit 44435d11ea49307b095fc6d3c718cbdeae6482ba

Authored by Nicolás Guarnieri
Exists in master

Merge branch 'master' into 'master'

Master

See merge request !38
src/js/controller.js
... ... @@ -34,8 +34,6 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo
34 34 focaBotoneraLateralService.showPausar(false);
35 35 focaBotoneraLateralService.showGuardar(false);
36 36  
37   -
38   -
39 37 $scope.general = function() {
40 38 $scope.idVendedor = 0;
41 39 getSeguimiento();
... ... @@ -74,13 +72,14 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo
74 72  
75 73 $scope.quitarVehiculo = function(vehiculo) {
76 74 if(!eligioFecha() || vehiculoEnUso(vehiculo)) return;
  75 +
77 76 focaModalService.confirm('Esta seguro que desea eliminar el vehículo ' +
78   - vehiculo.codigo + '?').then(function() {
  77 + vehiculo.codigo + ' de ' + vehiculo.transportista.NOM + '?').then(function() {
79 78 eliminarVehiculo(vehiculo);
80 79 });
81 80 };
82 81  
83   - $scope.hacerHojaRuta = function(vehiculo) {
  82 + $scope.hacerHojaRuta = function(vehiculo, cerrar) {
84 83 if(!eligioFecha() || vehiculoEnUso(vehiculo)) return;
85 84 var modalInstance = $uibModal.open(
86 85 {
... ... @@ -90,7 +89,8 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo
90 89 size: 'lg',
91 90 resolve: {
92 91 idVehiculo: function() {return vehiculo.id;},
93   - fechaReparto: function() {return $scope.fechaReparto;}
  92 + fechaReparto: function() {return $scope.fechaReparto;},
  93 + cerrar: function() {return cerrar;}
94 94 }
95 95 }
96 96 );
... ... @@ -233,7 +233,7 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo
233 233 }else {
234 234 focaModalService.alert('No ha sido posible eliminar el vehiculo porque ' +
235 235 'tiene remitos asociados').then(function() {
236   - $scope.hacerHojaRuta(vehiculo);
  236 + $scope.hacerHojaRuta(vehiculo, true);
237 237 });
238 238 }
239 239 });
src/js/controllerCerrarVehiculo.js
... ... @@ -8,8 +8,10 @@ angular.module('focaLogisticaPedidoRuta')
8 8 'focaModalService',
9 9 '$filter',
10 10 'fechaReparto',
  11 + 'cerrar',
11 12 function($scope, $uibModalInstance, $uibModal, focaLogisticaPedidoRutaService,
12   - idVehiculo, focaModalService, $filter, fechaReparto) {
  13 + idVehiculo, focaModalService, $filter, fechaReparto, cerrar) {
  14 + $scope.cerrar = cerrar;
13 15 $scope.vehiculo = {};
14 16 $scope.remitos = [];
15 17 $scope.now = fechaReparto;
... ... @@ -76,7 +78,6 @@ angular.module('focaLogisticaPedidoRuta')
76 78 var nuevosRemitos = $filter('filter')($scope.remitos, {checked: !true});
77 79 focaLogisticaPedidoRutaService.desasociarRemitos(remitosDel, $scope.vehiculo.id,
78 80 nuevosRemitos ? true : false).then(function() {
79   - focaModalService.alert('Remitos desasociados con éxito');
80 81 $scope.remitos = nuevosRemitos;
81 82 });
82 83 }
src/views/foca-modal-cerrar-vehiculo.html
... ... @@ -35,7 +35,7 @@
35 35 <input
36 36 class="form-control"
37 37 readonly
38   - ng-model="vehiculo.tractor"
  38 + ng-model="vehiculo.codigo"
39 39 >
40 40 </div>
41 41 </form>
... ... @@ -46,7 +46,7 @@
46 46 <th>Remito Nº</th>
47 47 <th>Cliente</th>
48 48 <th>Domicilio de entrega</th>
49   - <th>Eliminar
  49 + <th ng-if="cerrar">Eliminar
50 50 <i
51 51 class="fa fa-info"
52 52 uib-tooltip="Los remitos que no se pueden eliminar tienen asignada una hoja de ruta">
... ... @@ -64,7 +64,7 @@
64 64 <td ng-bind="[remito.sucursal, remito.numeroRemito] | comprobante"></td>
65 65 <td ng-bind="remito.nombreCliente"></td>
66 66 <td ng-bind="remito.domicilioStamp"></td>
67   - <td>
  67 + <td ng-if="cerrar">
68 68 <div class="custom-control custom-checkbox">
69 69 <input
70 70 type="checkbox"
... ... @@ -81,19 +81,24 @@
81 81 </div>
82 82 <div class="modal-footer py-1">
83 83 <button
84   - class="btn btn-sm btn-danger"
85   - type="button"
86   - ng-click="eliminarRemitos()"
87   - ng-disabled="minimoUnoChecked()">Eliminar</button>
88   - <button
89 84 class="btn btn-sm btn-secondary"
90 85 ladda="cargando"
91 86 type="button"
92   - ng-click="cancelar()">Cancelar</button>
  87 + ng-click="cancelar()"
  88 + >Cancelar</button>
  89 + <button
  90 + class="btn btn-sm btn-danger"
  91 + type="button"
  92 + ng-click="eliminarRemitos()"
  93 + ng-disabled="minimoUnoChecked()"
  94 + ng-if="cerrar"
  95 + >Eliminar</button>
93 96 <button
94 97 class="btn btn-sm btn-primary"
95 98 ladda="cargando"
96 99 type="button"
97 100 ng-disabled="!formHojaRuta.$valid || !remitos.length"
98   - ng-click="aceptar()">Cerrar distribución</button>
  101 + ng-click="aceptar()"
  102 + ng-if="!cerrar"
  103 + >Cerrar distribución</button>
99 104 </div>