update oqs action cable for order cahnnel and oqs channel
This commit is contained in:
@@ -11,7 +11,7 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann
|
||||
items = data.order;
|
||||
for(var field in items) {
|
||||
var price = parseFloat(items[field].price).toFixed(2);
|
||||
if (items[field]["options"] == "[]" || data[field]["options"] == "") {
|
||||
if (items[field]["options"] == "[]" || items[field]["options"] == "") {
|
||||
var options = "";
|
||||
}else{
|
||||
var options = items.options;
|
||||
@@ -34,7 +34,8 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann
|
||||
|
||||
if (oqs_id == items[field]["order_queue_station_id"]) {
|
||||
|
||||
row ='<div class="card queue_station" id="oqsBox" style="order: initial;">'
|
||||
row ='<div class="card queue_station queue_station_box" data-date="'+date+'">'
|
||||
+'<strong class="hidden">'+items[field]["order_id"]+'</strong>'
|
||||
+'<div class="card-block">'
|
||||
+'<h4 class="card-title">'
|
||||
+'<span class="order-zone-type">'+items[field]["table_type"]+'- </span>'
|
||||
@@ -65,11 +66,18 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann
|
||||
+'<button id="edit_'+ items[field]["assigned_order_item_id"]+'" class="btn btn-warning order-item order-item-edit">EDIT</button>'
|
||||
+' <button id="assigned_queue_' + items[field]["assigned_order_item_id"] +'" class="btn btn-primary order-item order-complete">COMPLETE</button>'
|
||||
+'</div>'
|
||||
+'</div>';
|
||||
$('.oqs_append').append(row);
|
||||
+'</div>';
|
||||
$('.oqs_append').append(row);
|
||||
}
|
||||
}
|
||||
// $("[data-behaviour='message']").html(data.order);
|
||||
}//end looping
|
||||
|
||||
var $divs = $("div.queue_station");
|
||||
var SortListDivs = $divs.sort(function (a, b) {
|
||||
first = $(a).attr('data-date');
|
||||
next = $(b).attr('data-date');
|
||||
return new Date(first).getTime() < new Date(next).getTime();
|
||||
});
|
||||
$("#oqs_container").html(SortListDivs);
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user