add new files
This commit is contained in:
0
app/views/batch_line_items/export.csv.erb
Normal file
0
app/views/batch_line_items/export.csv.erb
Normal file
60
app/views/batch_line_items/export.html.erb
Normal file
60
app/views/batch_line_items/export.html.erb
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<div class="row ">
|
||||||
|
<nav class="breadcrumb">
|
||||||
|
<a class="breadcrumb-item active" href="<%= dashboard_path %>">Home</a>
|
||||||
|
<a class="breadcrumb-item active" href="#">Batch Line Item List</a>
|
||||||
|
<a class="breadcrumb-item active" href="#">Export CSV</a>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
<div class="row content">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<strong>Export CSV</strong>
|
||||||
|
</div>
|
||||||
|
<div class="card-block">
|
||||||
|
<%= form_tag export_path(:format => :csv),:method => :post do%>
|
||||||
|
<div class="col-lg-4">
|
||||||
|
<label><strong>Select Client:</strong></label>
|
||||||
|
<%= select_tag "client", options_from_collection_for_select(@clients, "id", "name"),:class => 'form-control'%>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<label><strong>Select Batch:</strong></label><br>
|
||||||
|
<select class='selectpicker' id='batch' name='batch[]' multiple= "multiple"></select>
|
||||||
|
<%= button_tag "Export CSV",:class =>'btn btn-primary btn-sm',:id =>"btnexport" %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="spacer-30"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
client_id=$("#client").val();
|
||||||
|
get_batch(client_id)
|
||||||
|
$('#client').on('change', function() {
|
||||||
|
client_id=$(this).val()
|
||||||
|
get_batch(client_id)
|
||||||
|
});
|
||||||
|
function get_batch(client_id){
|
||||||
|
$('#batch').multiselect('disable');
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: '<%= get_batch_path %>',
|
||||||
|
dataType: "json",
|
||||||
|
data : {'client_id':client_id },
|
||||||
|
success: function(result){
|
||||||
|
if (result.status){
|
||||||
|
$('#batch').multiselect('enable');
|
||||||
|
$("#batch").empty();
|
||||||
|
$.each(result.data, function (i, item){
|
||||||
|
$("#batch").append("<option value="+item.id+">"+ item.order_ref +"</option>")
|
||||||
|
});
|
||||||
|
$('#batch').multiselect("refresh");
|
||||||
|
$("#batch").multiselect('rebuild');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user