pjmakey2

javascript_iwakura

Jan 31st, 2014
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. enviar_a_box: function(url, bloque_cod){
  2.         esperar.cubrir('body');
  3.         parametros = [{
  4.            name: 'bloque_cod', value: bloque_cod,
  5.             name: 'enviar_a_box', value: true
  6.         }];
  7.         values = $('#blo_select_peds').val();
  8.         box_cod = $( "li.ui-selected").text();
  9.         if (box_cod === "") {
  10.             notificaciones.noti_popu_faster('ERROR',
  11.             'DEBE SELECCIONAR AL MENOS UN BOX',
  12.             'danger');
  13.             return
  14.         }
  15.         if (!values) {
  16.             notificaciones.noti_popu_faster('ERROR',
  17.             'DEBE SELECCIONAR AL MENOS UN PEDIDO',
  18.             'danger');
  19.             return
  20.         }
  21.         parametros.push({name: 'box_cod', value: box_cod})
  22.         $.each(values, function(i, val){
  23.             parametros.push({ name: 'pedidos_numeros', value: val })
  24.         });
  25.  
  26.  
  27.         $.get(url, parametros, function(response){
  28.             notificaciones.noti_popu_faster('EXITOS',
  29.               'PEDIDOS MARCADOS PARA EL BOX ' + response.box_cod,
  30.               'info');
  31.             $( "li.ui-selected").css('color', 'red');
  32.             options = [];
  33.             select = $('#blo_select_peds');
  34.             $(select).find('option').each(function() {
  35.                 options.push({value: $(this).val(), text: $(this).text()});
  36.             });
  37.             $(select).data('options', options);
  38.             esperar.descubrir();
  39.          }, 'json' );
  40.     }
Advertisement
Add Comment
Please, Sign In to add comment