app order
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
<%= stylesheet_link_tag 'addorder', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'addorder', 'data-turbolinks-track': 'reload' %>
|
||||
|
||||
|
||||
<% type = request.path_info.include?('quick_service') || request.path_info.include?('food_court')%>
|
||||
<% modify_order = request.path_info.include?('modify_order')%>
|
||||
<div class="container-fluid " style="padding:0px 3px 0px 3px;">
|
||||
@@ -147,9 +145,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 col-lg-3 col-sm-3 m-t-10">
|
||||
<button type="button" class="btn btn-lg btn-primary waves-effect col-md-12" id='app_order'>App Order
|
||||
<button type="button" class="btn btn-lg btn-primary waves-effect col-md-12" id='app_order'>
|
||||
Application Orders <span class="badge badge-danger" style="font-size: 0.75rem;border-radius: 5px;"><%= @app_order_new_count %></span>
|
||||
</button>
|
||||
<br>
|
||||
<div class="card-header" style="padding: 0.12rem 0.25rem">
|
||||
@@ -526,18 +524,23 @@
|
||||
|
||||
<script>
|
||||
var cashier_type = $('#cashier_type').val();
|
||||
jQuery(function(){
|
||||
var menus = JSON.parse(localStorage.getItem("menus"));
|
||||
if (menus != null) {
|
||||
var id = menus[0]["categories"][0]["id"];
|
||||
// console.log(id);
|
||||
}else{
|
||||
var id = 1;
|
||||
}
|
||||
jQuery('.first_'+id).click();
|
||||
});
|
||||
|
||||
//get menu item cache
|
||||
function getAllMenu(){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '/foodcourt/get_all_menu',
|
||||
data: {},
|
||||
success:function(result){
|
||||
localStorage.setItem("menus", JSON.stringify(result));
|
||||
var menu = localStorage.getItem("menus");
|
||||
if (menu != null ) {
|
||||
$( "#loading_wrapper").hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
$(document).ready(function () {
|
||||
getAllMenu();
|
||||
var menus = JSON.parse(localStorage.getItem("menus"));
|
||||
if (menus != null) {
|
||||
menu_cache_append(menus);
|
||||
@@ -597,10 +600,6 @@ $(document).ready(function () {
|
||||
$('#table_type').text(type);
|
||||
$('.select_table').text(name);
|
||||
});
|
||||
|
||||
$('#pending_order').on('click', function () {
|
||||
window.location.href = '/foodcourt/'+'<%= @cashier_type %>'+'/pending_order';
|
||||
});
|
||||
$('#app_order').on('click', function () {
|
||||
window.location.href = '/en/foodcourt/app_orders';
|
||||
});
|
||||
@@ -628,11 +627,6 @@ menu_cat.empty();
|
||||
|
||||
$(".main_menu").text(name);
|
||||
|
||||
// row = ' <li class="nav-item product" data-ref="<%= foodcourt_get_all_product_path %>">'
|
||||
// +'<a class="nav-link" data-toggle="tab" href="" role="tab">Products</a>'
|
||||
// +'</li>';
|
||||
// $(".category_cache_list").append(row);
|
||||
|
||||
for(var i in menus) {
|
||||
|
||||
if (menu_id == menus[i]["id"] && menus[i]["is_active"] == true) {
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
<div class="container-fluid " style="padding:0px 3px 0px 3px;">
|
||||
<div id="oqs_loading_wrapper" style="display:none;">
|
||||
<div id="oqs_loading"></div>
|
||||
</div>
|
||||
<div class="row m-t--20">
|
||||
<div class="col-md-9 col-lg-9 col-sm-12 m-t-10">
|
||||
</div>
|
||||
<div class="col-md-3 col-lg-3 col-sm-12 m-t-10">
|
||||
<div class="card-header" style="padding: 0.12rem 0.25rem">
|
||||
<div class="row ">
|
||||
<div class="col-md-9 col-lg-9 col-sm-9 ">
|
||||
<strong id="order-title" class="font-14 p-l-10">ORDER DETAILS </strong>
|
||||
<strong class="font-14 p-l-10">Booking Id : </strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-text" id="order-detail-slimscroll" data-height="140">
|
||||
<table class="table table-striped summary-items" id="order-items-table" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-qty">QTY</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="font-13 order_item_list" >
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer custom-card-footer" style="padding: 0.35rem 0.15rem !important;">
|
||||
<input type="hidden" name="customer_id" id="customer_id" value="CUS-000000000001">
|
||||
<button type="button" class="btn btn-primary action-btn create col-md-11" id="done_order" disabled="disabled" style="padding-top:4px !important;padding-bottom:4px !important;"><i class="material-icons" style="font-size:34px;width:34px">done</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,15 +1,148 @@
|
||||
<style type ="text/css">
|
||||
.assign {
|
||||
background-color:blue;
|
||||
}
|
||||
.completed{
|
||||
background-color:green;
|
||||
}
|
||||
</style>
|
||||
<%= javascript_include_tag 'custom', 'data-turbolinks-track': 'reload' %>
|
||||
<% if @booking.nil?%>
|
||||
<div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= foodcourt_food_court_path %>">Foodcourt</a></li>
|
||||
<li class="breadcrumb-item active">Application Orders</li>
|
||||
<span class="float-right">
|
||||
<%= link_to 'Back', foodcourt_food_court_path %>
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="container-fluid " style="padding:0px 3px 0px 3px;">
|
||||
<div id="oqs_loading_wrapper" style="display:none;">
|
||||
<div id="oqs_loading"></div>
|
||||
</div>
|
||||
<div class="row m-t--20">
|
||||
<div class="col-md-9 col-lg-9 col-sm-9 m-t-10" >
|
||||
<div class="card">
|
||||
<div class="card-block" style="">
|
||||
<div class="card-text" id="custom-slimscroll">
|
||||
<% if !@booking.nil?%>
|
||||
<div class="col-md-9 col-lg-9 col-sm-12 m-t-10">
|
||||
<% else %>
|
||||
<div class="col-md-12 col-lg-12 col-sm-12 m-t-10">
|
||||
<% end %>
|
||||
<div id="custom-slimscroll">
|
||||
<div class="card-columns">
|
||||
<% bk_status ='' %>
|
||||
<% @bookings.each do |bk|
|
||||
if !@booking.nil?
|
||||
if bk.booking_id == @booking.booking_id
|
||||
bk_status ='bg-red'
|
||||
else
|
||||
bk_status =bk.booking_status
|
||||
end
|
||||
else
|
||||
bk_status =bk.booking_status
|
||||
end %>
|
||||
<%= link_to foodcourt_app_order_by_booking_path(booking_id:bk.booking_id) do %>
|
||||
<div class="card <%= bk_status %> text-white" data-id ="<%= bk.booking_id %>">
|
||||
<div class="card-block">
|
||||
Cus Ph :<%= bk.contact_no %><span style="font-size:12px;float:right;line-height:inherit;">Order Time :<%= bk.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span><br>
|
||||
BK :<%= bk.booking_id %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% if !@booking.nil?%>
|
||||
<div class="col-md-3 col-lg-3 col-sm-12 m-t-10">
|
||||
<div class="card-header" style="padding: 0.12rem 0.25rem">
|
||||
<div class="row" style="margin:auto">
|
||||
<div class="col-md-9 col-lg-9 col-sm-9">
|
||||
<strong id="order-title" class="font-14 p-l-10">ORDER DETAILS </strong>| <span class="font-14">Table-<%=@booking.dining_facility.name%></span><br>
|
||||
<strong class="font-14 p-l-10">Booking - <%=@booking.booking_id%></strong>
|
||||
</div>
|
||||
<div class="col-md-3 col-lg-3 col-sm-3">
|
||||
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
|
||||
<i class="material-icons">reply</i>
|
||||
Back
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-text" id="order-detail-slimscroll" data-height="140">
|
||||
<table class="table table-striped summary-items">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-qty">Qty</th>
|
||||
<th class="item-attr">Price</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="font-13" >
|
||||
<% count =0 %>
|
||||
<% total_price =0 %>
|
||||
<% total_qty =0 %>
|
||||
<% @booking.booking_orders.each do |bo| %>
|
||||
<% bo.order.order_items.each do |oi| %>
|
||||
<% count +=1 %>
|
||||
<% total_price += oi.price %>
|
||||
<% total_qty += oi.qty.to_i%>
|
||||
<tr class="item_box">
|
||||
<td><%= count%></td>
|
||||
<td><%= oi.item_name%></td>
|
||||
<td><%= oi.qty.to_i%></td>
|
||||
<td class="item-attr"><%= oi.price%></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer custom-card-footer" style="padding: 0.35rem 0.15rem !important;">
|
||||
<table class="table" id="order-charges-table" border="0">
|
||||
<tr>
|
||||
<td colspan="2" style="padding:2px; text-align:" class="charges-name" width="25%"><strong>Total:</strong></td>
|
||||
<td style="padding:2px;" width="15%"><strong id="total_qty"><%=total_qty %></strong></td>
|
||||
<td style="padding:2px; text-align:" width="25%" class="item-attr"><strong id="sub_total"><%=total_qty * total_price %></strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
<button type="button" class="btn btn-primary action-btn create col-md-12" id="done_order" style="padding-top:4px !important;padding-bottom:4px !important;"><i class="material-icons" style="font-size:34px;width:34px">done</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$('#back').on('click', function () {
|
||||
window.location.href ="<%=foodcourt_food_court_path %>";
|
||||
});
|
||||
$('#done_order').on('click', function () {
|
||||
swal({
|
||||
title: "Alert !",
|
||||
text: 'This order is really done!',
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "Yes!",
|
||||
cancelButtonClass: 'btn btn-danger',
|
||||
closeOnConfirm: false
|
||||
}, function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
$('.confirm').prop("disabled",true);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/foodcourt/<%=@booking_id %>/completed",
|
||||
data: {customer_id:"<%=@customer_id %>"},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
window.location.href ="<%=foodcourt_app_order_by_booking_path %>";
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user