update mobile view for online order

This commit is contained in:
Myat Zin Wai Maw
2019-06-12 11:24:11 +06:30
parent c771e2ef96
commit 65ee0165dd
6 changed files with 100 additions and 48 deletions

View File

@@ -288,6 +288,8 @@ function show_order_detail(url,sr_no){
data: {},
dataType: "json",
success: function(data) {
var scrollTo = document.getElementById('div_card_order');
$("HTML, body").animate({scrollTop: scrollTo.offsetTop - 60 }, 500 );
// console.log(data);
$("#order_remark").text("");
$(".tbl_customer").show();
@@ -373,24 +375,49 @@ function show_order_detail(url,sr_no){
item_price = items[i].unit_price;
}
var total = items[i].qty * item_price;
if(items[i].options!='[]' && items[i].options!="" && items[i].options!=null){
row = '<tr>'
+'<td width ="70%" class="body-td align-left">'+items[i].item_name
+' <br>'
+' <i><span class="font-12">'+items[i].options+'</span></i><br>'+
'<span class="font-13">'+items[i].qty+ '<span class="col-blue"> <b>X</b>'+items[i].unit_price+'</span></span>'
+'</td>'
+'<td width ="30%" class="body-td align-right">'+ total +'</td>'
+'</tr>';
}else{
row = '<tr>'
+'<td width ="70%" class="body-td align-left">'+items[i].item_name
+' <br>'+
'<span class="font-13">'+items[i].qty+ '<span class="col-blue"> <b>X</b>'+items[i].unit_price+'</span></span>'
+'</td>'
+'<td width ="30%" class="body-td align-right">'+ total +'</td>'
+'</tr>';
var check_mobile =document.getElementsByName("summary_items_mobile")[0].value;
if (check_mobile == "true"){
if(items[i].options!='[]' && items[i].options!="" && items[i].options!=null){
row =
'<tr>'
+'<td width ="70%" class="body-td align-left">'+items[i].item_name
+' <br>'
+' <i><span class="font-12">'+items[i].options+'</span></i></td>'+
'<td><span class="font-13">'+items[i].qty+ '</span>'
+'</td>'
+'<td width ="30%" class="body-td align-right">'+ total +'</td>'
+'</tr>';
}else{
row = '<tr>'
+'<td width ="70%" class="body-td align-left">'+items[i].item_name
+' </td>'+
'<td><span class="font-13">'+items[i].qty+ '</span></td>'
+'<td width ="30%" class="body-td align-right">'+ total +'</td>'
+'</tr>';
}
}
else{
if(items[i].options!='[]' && items[i].options!="" && items[i].options!=null){
row = '<tr>'
+'<td width ="70%" class="body-td align-left">'+items[i].item_name
+' <br>'
+' <i><span class="font-12">'+items[i].options+'</span></i><br>'+
'<span class="font-13">'+items[i].qty+ '<span class="col-blue"> <b>X</b>'+items[i].unit_price+'</span></span>'
+'</td>'
+'<td width ="30%" class="body-td align-right">'+ total +'</td>'
+'</tr>';
}else{
row = '<tr>'
+'<td width ="70%" class="body-td align-left">'+items[i].item_name
+' <br>'+
'<span class="font-13">'+items[i].qty+ '<span class="col-blue"> <b>X</b>'+items[i].unit_price+'</span></span>'
+'</td>'
+'<td width ="30%" class="body-td align-right">'+ total +'</td>'
+'</tr>';
}
}
$('.summary-items').append(row);
}

View File

@@ -99,4 +99,10 @@
td.grand-total-padding {
font-size: 17px;
padding-top: 20px !important;
}
.mobile_tab-col-teal > li {
margin:auto;
}
.mobile_tab-col-teal{
margin-left:1.5rem;
}

View File

@@ -38,20 +38,20 @@ class Printer::PrinterWorker
end
def print(file_path,printer_destination = nil )
if printer_destination.nil?
printer_destination = self.printer_destination
end
# if printer_destination.nil?
# printer_destination = self.printer_destination
# end
puts printer_destination
puts '........Printer Destination..........'
# puts printer_destination
# puts '........Printer Destination..........'
copy = self.print_copies
#Print only when printer information is not null
if !self.printer_destination.nil?
(1..copy).each do
page = Cups::PrintJob.new(file_path, printer_destination)
page.print
end
end
# copy = self.print_copies
# #Print only when printer information is not null
# if !self.printer_destination.nil?
# (1..copy).each do
# page = Cups::PrintJob.new(file_path, printer_destination)
# page.print
# end
# end
end
end

View File

@@ -29,9 +29,17 @@
%>
<!-- end count function -->
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
<div class="row m-t--10">
<% if request.user_agent.include? "Mobile" %>
<div class="row m-t-10" style="margin-left: 0.2rem">
<% else %>
<div class="row m-t-10">
<% end %>
<div class="col-lg-5 col-md-5 col-sm-5 div_order_margin">
<% if !request.user_agent.include? "Mobile" %>
<ul class="nav nav-tabs tab-col-teal <%= @shop.shop_code ? @shop.shop_code : '' %>" role="tablist">
<% else %>
<ul class="nav nav-tabs tab-col-teal mobile_tab-col-teal <%= @shop.shop_code ? @shop.shop_code : '' %>" role="tablist">
<% end %>
<li class="nav-item red m-b-5" data-color="#F44336" data-type="pending">
<a class="nav-link" data-toggle="tab" href="#pending" role="tab">
<p class="num p-t-5">
@@ -50,6 +58,7 @@
<%= delivered_count %>
</p> <%= t :delivering %></a>
</li>
<% if !request.user_agent.include? "Mobile" %>
<li class="nav-item m-b-5" data-color="#03A9F4" data-type="completed" style="background-color: #03A9F4;">
<a class="nav-link" data-toggle="tab" href="#completed" role="tab">
<p class="num p-t-5">
@@ -62,6 +71,7 @@
<%= processed_count %>
</p> <%= t :processed %></a>
</li>
<% end %>
</ul>
<div class="tab-content m-t--10">
@@ -334,7 +344,7 @@
</div>
<div class="col-lg-4 col-md-4 col-sm-4 div_card_order">
<div class="col-lg-4 col-md-4 col-sm-4 div_card_order" id="div_card_order">
<div class="card m-b-5 p-t-5">
<div class="card-header custom-card-header">
<table class="table">
@@ -355,6 +365,11 @@
</div>
<div class="card-block custom-card-block">
<div id="order-detail-slimscroll" data-height="110">
<% if request.user_agent.include? "Mobile" %>
<input type="hidden" name="summary_items_mobile" value="true">
<%else %>
<input type="hidden" name="summary_items_mobile" value="false">
<%end %>
<table class="table summary-items">
<tbody>
<!-- <tr>
@@ -406,8 +421,12 @@
</div>
</div>
</div>
<% if request.user_agent.include? "Mobile" %>
<div class="col-lg-3 col-md-3 col-sm-3" style="margin-right: 0.5rem">
<% else %>
<div class="col-lg-3 col-md-3 col-sm-3">
<% end %>
<div class="card m-b-5 p-t-5" style="background-color: #E8EAF6">
<div class="card-header custom-card-header" style="background-color: #E8EAF6">
<table class="table">