Subversion Repositories SmartDukaan

Rev

Rev 28272 | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed


$(function() {

$(document).on('click', '.brands-limit-submit', function() { 
       
               var brand = $('#show-brands').val();
              
        
        doGetAjaxRequestHandler(context + "/getRetailerBrandslimitMapping?brand=" + brand,
                        function(response) {
                                $('.partnerByBrandsLimit').html(response);
                        });
        });
        
        $(document).on('click', '.brands-update', function() { 
        
        
         var brands = $(this).data('brand');
         console.log(brands);
        var limit= $("form#brand-limit-container input[name=inputLimit]").val();      
        
     doPostAjaxRequestHandler(context + "/setBrandWiseLimit?brands=" + brands + "&limit=" + limit, 
                        function(response) {
                                $('.partnerByBrandsLimit').html(response);
                        });
        
        });
        
        
        $(document).on('click', '.set-stock-limit', function() { 
                
                
                 var brands = $(this).data('brand');
                var stockLimit= $("form#brand-limit-container input[name=stockLimit]").val();      
                console.log(stockLimit);
             doPostAjaxRequestHandler(context + "/setBrandWiseStockLimit?brands=" + brands + "&stockLimit=" + stockLimit, 
                                function(response) {
                                        $('.partnerByBrandsLimit').html(response);
                                });
                
                });
        
$(document).on('click', '.limit_update_submit', function() {    
     var row = $(this).closest("tr");
 
     var fofoId = $(this).data('id');
  
      var limit = $(row).find("td:eq(3) input[type='text']").val();
      var minStockLimit = $(row).find("td:eq(5) input[type='text']").val();
        var preLimit = $(row).find("td:eq(2)").text();
        var preStockLimit = $(row).find("td:eq(4)").text();

       var brand = $(this).data('brand');
       
       console.log(minStockLimit);
       console.log(limit);

  doPostAjaxRequestHandler(context + "/setUpdateLimit?brand=" + brand + "&limit=" + limit + "&fofoId=" + fofoId + "&minStockLimit=" + minStockLimit + "&preLimit=" + preLimit + "&preStockLimit=" + preStockLimit,  
                        function(response) {
                                row.html(response);
                        });

        });
        
        });