Commit 63111b1f6921ab73e54bb685652b960ce5d671d5

Authored by Benjamin Rodriguez
1 parent 9d07c5e47c
Exists in master and in 1 other branch develop

bloqueo backdrop de modal clientes

Showing 2 changed files with 27 additions and 23 deletions   Show diff stats
... ... @@ -28,7 +28,7 @@
28 28 <script src="node_modules/foca-modal-precio-condiciones/dist/foca-modal-precio-condiciones.min.js"></script>
29 29 <script src="node_modules/foca-modal-flete/dist/foca-modal-flete.min.js"></script>
30 30 <script src="node_modules/foca-modal/dist/foca-modal.min.js"></script>
31   - <script src="node_modules/foca-modal-domicilio/dist/foca-modal-domicilios.min.js"></script>
  31 + <script src="node_modules/foca-modal-domicilio/dist/foca-modal-domicilio.min.js"></script>
32 32 <script src="node_modules/foca-modal-moneda/dist/foca-modal-moneda.min.js"></script>
33 33 <script src="node_modules/foca-modal-cotizacion/dist/foca-modal-cotizacion.min.js"></script>
34 34 <script src="node_modules/foca-seguimiento/dist/foca-seguimiento.min.js"></script>
src/js/controller.js
... ... @@ -146,9 +146,9 @@ angular.module(&#39;focaCrearNotaPedido&#39;).controller(&#39;notaPedidoCtrl&#39;,
146 146 return;
147 147 }
148 148  
149   - // Se crearon comentarios en las restricciones de vendedor para las bases
150   - // de datos que no poseen vendedor asignado a los clientes despues
151   - // descomentar en (crear-nota-pedido, modal-nota-pedido, crear-remito y modal-remito)
  149 + // Se crearon comentarios en las restricciones de vendedor para las bases
  150 + // de datos que no poseen vendedor asignado a los clientes despues
  151 + // descomentar en (crear-nota-pedido, modal-nota-pedido, crear-remito y modal-remito)
152 152 // if (!$scope.notaPedido.vendedor.id) {
153 153 // focaModalService.alert('Este cliente no tiene vendedor asignado');
154 154 // return;
... ... @@ -222,19 +222,21 @@ angular.module(&#39;focaCrearNotaPedido&#39;).controller(&#39;notaPedidoCtrl&#39;,
222 222 $scope.notaPedido.notaPedidoPuntoDescarga);
223 223 }
224 224  
225   - var rutaJson = JSON.parse($localStorage.rutas);
226   -
227   - removeItemFromArr( rutaJson, 'venta-nota-pedido/crear' );
228   - $localStorage.rutas = JSON.stringify(rutaJson);
229   -
230   - var plazos = $scope.notaPedido.notaPedidoPlazo;
231   - var plazosACrear = [];
232   - plazos.forEach(function (plazo) {
233   - plazosACrear.push({
234   - idNotaPedido: data.data.id,
235   - dias: plazo.dias
  225 + var rutaJson;
  226 + if ($localStorage.rutas) {
  227 + rutaJson = JSON.parse($localStorage.rutas);
  228 + removeItemFromArr(rutaJson, 'venta-nota-pedido/crear');
  229 + $localStorage.rutas = JSON.stringify(rutaJson);
  230 + }
  231 +
  232 + var plazos = $scope.notaPedido.notaPedidoPlazo;
  233 + var plazosACrear = [];
  234 + plazos.forEach(function (plazo) {
  235 + plazosACrear.push({
  236 + idNotaPedido: data.data.id,
  237 + dias: plazo.dias
  238 + });
236 239 });
237   - });
238 240  
239 241 if (plazosACrear.length) {
240 242 crearNotaPedidoService.crearPlazosParaNotaPedido(plazosACrear);
... ... @@ -517,9 +519,10 @@ angular.module(&#39;focaCrearNotaPedido&#39;).controller(&#39;notaPedidoCtrl&#39;,
517 519 };
518 520 }
519 521 },
  522 + backdrop: false,
520 523 size: 'lg'
521 524 }
522   - );
  525 + );
523 526 modalInstance.result.then(
524 527 function (cliente) {
525 528  
... ... @@ -605,6 +608,7 @@ angular.module(&#39;focaCrearNotaPedido&#39;).controller(&#39;notaPedidoCtrl&#39;,
605 608 idCliente: function () { return cliente.COD; },
606 609 esNuevo: function () { return cliente.esNuevo; }
607 610 },
  611 + backdrop: false,
608 612 size: 'lg',
609 613 }
610 614 );
... ... @@ -1114,11 +1118,11 @@ angular.module(&#39;focaCrearNotaPedido&#39;).controller(&#39;notaPedidoCtrl&#39;,
1114 1118 }
1115 1119 }
1116 1120  
1117   - function removeItemFromArr ( arr, item ) {
1118   - var i = arr.indexOf( item );
1119   -
1120   - if ( i !== -1 ) {
1121   - arr.splice( i, 1 );
  1121 + function removeItemFromArr(arr, item) {
  1122 + var i = arr.indexOf(item);
  1123 +
  1124 + if (i !== -1) {
  1125 + arr.splice(i, 1);
1122 1126 }
1123 1127 }
1124 1128  
... ... @@ -1136,7 +1140,7 @@ angular.module(&#39;focaCrearNotaPedido&#39;).controller(&#39;notaPedidoCtrl&#39;,
1136 1140 if (data) {
1137 1141 $location.path('/');
1138 1142 var rutaJson = JSON.parse($localStorage.rutas);
1139   - removeItemFromArr( rutaJson, 'venta-nota-pedido/crear' );
  1143 + removeItemFromArr(rutaJson, 'venta-nota-pedido/crear');
1140 1144 $localStorage.rutas = JSON.stringify(rutaJson);
1141 1145 }
1142 1146 });