auto reload page for oqs 5sec and origami 10sec

This commit is contained in:
Yan
2017-06-14 15:59:08 +06:30
parent c1e8f3ffb2
commit 7d6414cce6
3 changed files with 19 additions and 5 deletions

View File

@@ -17,6 +17,11 @@
//= require cable
$(document).ready(function(){
// auto refresh every 5 seconds
setTimeout(function(){
window.location.reload(1);
}, 5000);
$('.queue_station').on('click',function(){
var orderZone=$(this).children().children().children('.order-zone').text();
var orderItem=$(this).children().children().children('.order-item').text();
@@ -39,7 +44,8 @@ $(document).ready(function(){
});
// complete for queue item
$('.order-complete').on('click',function(){
$('.order-complete').on('click',function(e){
//e.preventDefault();
var _self = $(this); // To know in ajax return
var assigned_item_id=$(this).attr('id').substr(15);
var params = { 'id':assigned_item_id };
@@ -72,8 +78,10 @@ $(document).ready(function(){
$("#completed_count").text(parseInt($("#completed_count").text()) + data.length);
alert("updated!");
// Page reload
location.reload();
}
});
});
});
$('#print_order_item').on('click',function(){

View File

@@ -18,11 +18,16 @@
//= require jquery-ui
//= require bootstrap-datepicker
$(document).ready(function(){
$(document).ready(function(){
// auto refresh every 10 seconds
setTimeout(function(){
window.location.reload(1);
}, 10000);
// For selected order return
var order_status = "";
order_status = $(".selected-item").children().find(".orders-order-status").text().substr(0,6).trim();
console.log(order_status) ;
order_status = $(".selected-item").children().find(".orders-order-status").text().substr(0,6).trim();
// Enable/Disable Button
control_button(order_status);

View File

@@ -16,5 +16,6 @@
}
.selected-item {
color: #fff !important;
background-color: blue;
}