check shop code in order reservation

This commit is contained in:
phyusin
2018-05-11 17:14:42 +06:30
parent e618cd6e6d
commit c65bf1c163
3 changed files with 8 additions and 8 deletions

View File

@@ -8,12 +8,12 @@ App.order_reservation = App.cable.subscriptions.create('OrderReservationChannel'
var order = data.data;
if(order.length > 0){
$('.custom-table.'+shop_code+'_order_reserve_cable tbody').html("");
$(".nav-item.red > a > p.num").text(order.length);
$(".nav-item ."+shop_code+" .red > a > p.num").text(order.length);
$.each(order, function(key,value){
var active_class = "";
if(key==0){
active_class = "tr-active";
showNewOrder(order[key]);
showNewOrder(order[key],shop_code);
}
var rowCount = key+1;
var date = new Date(value.created_at);

View File

@@ -404,7 +404,7 @@ function timeFormat(date){
return time;
}
function showNewOrder(order_reservation){
function showNewOrder(order_reservation,shop_code){
if((order_reservation!=undefined) && (order_reservation!=null) && (order_reservation!="")){
var date = new Date(order_reservation.requested_time);
var time = timeFormat(date);
@@ -418,15 +418,15 @@ function showNewOrder(order_reservation){
$("#new_order").text(order_reservation.order_reservation_id);
$("#new_order_date").text(requested_date);
$("#doemal_new_order").on('show.bs.modal', function(e){
$("#"+shop_code+"_doemal_new_order").on('show.bs.modal', function(e){
$("#notify_new_order").modal('hide');
$("#notify_order_send_to_kitchen").modal('hide');
$("#notify_order_ready_to_delivery").modal('hide');
}).on('shown.bs.modal', function(e){
$("#doemal_new_order").focus();
$("#"+shop_code+"_doemal_new_order").focus();
}).on('hide.bs.modal', function (e) {
audio.pause();
$("#doemal_new_order").modal("hide");
$("#"+shop_code+"_doemal_new_order").modal("hide");
}).modal({show: true, keyboard: false, backdrop: false});
}
}

View File

@@ -31,7 +31,7 @@
<div class="row m-t--10">
<div class="col-lg-5 col-md-5 col-sm-5 div_order_margin">
<ul class="nav nav-tabs tab-col-teal" role="tablist">
<li class="nav-item red m-b-5" data-color="#F44336" data-type="pending">
<li class="nav-item <%= @shop.shop_code %> 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">
<%= pending_count %>
@@ -571,7 +571,7 @@
</div>
</div>
<div class="modal fade text-center" id="doemal_new_order" tabindex="-1" role="dialog">
<div class="modal fade text-center" id="<%= @shop.shop_code %>_doemal_new_order" tabindex="-1" role="dialog">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">