Commit 88a160b5b9ef39abaa394981a15193b5e45e717b
1 parent
d836dbc78a
Exists in
master
arreglos para cerrar hoja ruta
Showing
4 changed files
with
25 additions
and
19 deletions
Show diff stats
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 | ); |
| ... | ... | @@ -230,7 +230,7 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo |
| 230 | 230 | }else { |
| 231 | 231 | focaModalService.alert('No ha sido posible eliminar el vehiculo porque ' + |
| 232 | 232 | 'tiene remitos asociados').then(function() { |
| 233 | - $scope.hacerHojaRuta(vehiculo); | |
| 233 | + $scope.hacerHojaRuta(vehiculo, true); | |
| 234 | 234 | }); |
| 235 | 235 | } |
| 236 | 236 | }); |
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; |
| ... | ... | @@ -75,7 +77,6 @@ angular.module('focaLogisticaPedidoRuta') |
| 75 | 77 | var nuevosRemitos = $filter('filter')($scope.remitos, {checked: !true}); |
| 76 | 78 | focaLogisticaPedidoRutaService.desasociarRemitos(remitosDel, $scope.vehiculo.id, |
| 77 | 79 | nuevosRemitos ? true : false).then(function() { |
| 78 | - focaModalService.alert('Remitos desasociados con éxito'); | |
| 79 | 80 | $scope.remitos = nuevosRemitos; |
| 80 | 81 | }); |
| 81 | 82 | } |
src/views/foca-logistica-pedido-ruta.html
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</th> | |
| 49 | + <th ng-if="cerrar">Eliminar</th> | |
| 50 | 50 | </tr> |
| 51 | 51 | </thead> |
| 52 | 52 | <tbody> |
| ... | ... | @@ -59,7 +59,7 @@ |
| 59 | 59 | <td ng-bind="[remito.sucursal, remito.numeroRemito] | comprobante"></td> |
| 60 | 60 | <td ng-bind="remito.nombreCliente"></td> |
| 61 | 61 | <td ng-bind="remito.domicilioStamp"></td> |
| 62 | - <td> | |
| 62 | + <td ng-if="cerrar"> | |
| 63 | 63 | <div class="custom-control custom-checkbox"> |
| 64 | 64 | <input |
| 65 | 65 | type="checkbox" |
| ... | ... | @@ -75,19 +75,24 @@ |
| 75 | 75 | </div> |
| 76 | 76 | <div class="modal-footer py-1"> |
| 77 | 77 | <button |
| 78 | - class="btn btn-sm btn-danger" | |
| 79 | - type="button" | |
| 80 | - ng-click="eliminarRemitos()" | |
| 81 | - ng-disabled="minimoUnoChecked()">Eliminar</button> | |
| 82 | - <button | |
| 83 | 78 | class="btn btn-sm btn-secondary" |
| 84 | 79 | ladda="cargando" |
| 85 | 80 | type="button" |
| 86 | - ng-click="cancelar()">Cancelar</button> | |
| 81 | + ng-click="cancelar()" | |
| 82 | + >Cancelar</button> | |
| 83 | + <button | |
| 84 | + class="btn btn-sm btn-danger" | |
| 85 | + type="button" | |
| 86 | + ng-click="eliminarRemitos()" | |
| 87 | + ng-disabled="minimoUnoChecked()" | |
| 88 | + ng-if="cerrar" | |
| 89 | + >Eliminar</button> | |
| 87 | 90 | <button |
| 88 | 91 | class="btn btn-sm btn-primary" |
| 89 | 92 | ladda="cargando" |
| 90 | 93 | type="button" |
| 91 | 94 | ng-disabled="!formHojaRuta.$valid || !remitos.length" |
| 92 | - ng-click="aceptar()">Cerrar distribución</button> | |
| 95 | + ng-click="aceptar()" | |
| 96 | + ng-if="!cerrar" | |
| 97 | + >Cerrar distribución</button> | |
| 93 | 98 | </div> |