Subversion Repositories SmartDukaan

Rev

Rev 32339 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<script>        
        $(function() {
                getItemAheadOptions($("#item-search-text"), false, function(
                                selectedItem) {
                        catalogItemId = selectedItem.catalogId;
                        console.log(catalogItemId);
                });
                
                
                getItemAheadOptions($("#item-mapping-search-text"), false, function(
                                selectedItem) {
                        mappedCatalogItemId = selectedItem.catalogId;
                        console.log(mappedCatalogItemId);
                });
                
                
            $("select.criteria-warehouseregion").chosen({no_results_text: "Oops, nothing found!"});
 
                
                
        });
        
        
  var table = $('#comboModel').DataTable( {
   "scrollX": true,
        orderCellsTop: true,
        fixedHeader: true
    });

</script>
        
            
</script>



<section class="wrapper">
        <div class="row">
                <div class="col-lg-12">
                        <h3 class="page-header"><i class="icon_document_alt"></i>COMBO</h3>
                        <ol class="breadcrumb">
                                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
                                <li><i class="icon_document_alt"></i>COMBO</li>
                        </ol>
                </div>
        </div>
        

   <div class = "row">
        <div class="col-lg-2">
            <label>Item</label>
                        <input type="text" class="typeahead form-control"
                                                        id="item-search-text" name="Item"
                                                        data-provide="typeahead" autocomplete="off" value=""
                                                        style="width: 300px;" placeholder="Search for product..." />  
            </div>
            
             <div class="col-lg-2">
            <label>Qty</label>
                        <input type="text" id="item-qty" class="typeahead form-control" name="item-qty" value="" style="width: 300px;" placeholder="Item Qty" />  
            </div>
            
              <div class="col-lg-2">
              <label>Region</label>
                        
                    <select multiple class="criteria-warehouseregion chosen-select"> 
                    #foreach ($wmEntry in $warehouseMap.entrySet())
                    <option value="$wmEntry.getKey()">$wmEntry.getValue()</option>
                    #end
            </select>
              </div>
              
            
   </div>
   
   
   
      <div class = "row" style="margin-top:12px" >
        <div class="col-lg-2">
            <label>Combo Item</label>
                        <input type="text" class="typeahead form-control"
                                                        id="item-mapping-search-text" name="Item"
                                                        data-provide="typeahead" autocomplete="off" value=""
                                                        style="width: 300px;" placeholder="Search for product..." />  
            </div>
            
             <div class="col-lg-2">
            <label>Combo Qty</label>
                        <input type="text" id="item-mapping-qty" class="typeahead form-control" name="item-mapping-qty" value="" style="width: 300px;" placeholder="Item Qty" />  
            </div>
            

              
              <div class="col-lg-2">
           
                <button class="btn btn-primary add-combo" style = "margin-top:25px" type="button">Add Combo</button>
                </div>
   </div>
        
        
          <div class = "row" style="margin-top:12px" >
                <div class="col-lg-4">
                                <div class="panel panel-default">
                            <div class="panel-heading">Create Combo </div>
                          <div class="panel-content">
                                  <div id="cosummary">
                                   <table class="table table-sm" id="cm-table">
                                          <thead>
                                                            <tr>
                                                              <th>catalogId</th>
                                                              <th>Name</th>
                                                              <th>Quantity</th>
                                                             
                                                            </tr>
                                                          </thead>
                                                            <tbody>
                                                        
                                                           </tbody>
                                                        </table>
                                  </div>
                                  <div id="cmbuttons">
                                              
                                                
                                                   <button class="btn btn-primary create-combo-model">Create Combo</button>
                                                  
                                          </div>
                          </div>
                        </div>
            </div>
            
            
            
     <div class = "row" style="margin-top:12px" >
                <div class="col-lg-8">
                <div class="panel-content">
                               
                <table class="table table-striped table-advance table-hover" id="comboModel">
                
                          <thead>
                                    <tr>
                                      <th>Name</th>
                                      <th>Quantity</th>
                                      <th>warehouseId</th>
                                       <th>MappedModel</th>
                                       <th>Action</th>
                                     
                                    </tr>
                                  </thead>
                                    <tbody>
                                                #if(!$comboModels.isEmpty())
                                        #foreach( $request in $comboModels )
                                                <tr class="combo-model" data="$request.getId()">
                                                        <td>$request.getItemDescription()</td>
                                                        <td>$request.getQty()</td>
                                                        <td>$warehouseMap.get($request.getWarehouseId())</td>
                                                        <td>
                                                        #foreach($mappedModel in $request.getComboMappedModels())
                                                         <div> $mappedModel.getItemDescription() - $mappedModel.getComboQty() </div>
                                                        #end
                                                        </td>
                                                        
                                                        <td><button class="btn btn-primary remove-combo" data-requestid="$request.getId()"  type="button" >Remove</button></td>
                                                        
                                                </tr>   
                               #end
                               #end
                                   </tbody>
                                </table>
                              
                                 
              </div>
        </div>
    </div>
    
            
         

</section>