merge with origin master
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
//= require cable
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
// auto refresh every 10 seconds
|
||||
// setTimeout(function(){
|
||||
// window.location.reload(1);
|
||||
@@ -67,10 +68,10 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
// complete for queue item
|
||||
$('.order-complete').on('click',function(e){
|
||||
$('.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 _self = $(this); // To know in ajax return
|
||||
var assigned_item_id=$(this).attr('id').substr(15);
|
||||
var params = { 'id':assigned_item_id };
|
||||
|
||||
// Call update_delivery_status() for changed delivery and move to delivery
|
||||
@@ -79,8 +80,8 @@ $(document).ready(function(){
|
||||
url: '/oqs/update_delivery',
|
||||
data: params,
|
||||
dataType: 'json',
|
||||
success: function(data){
|
||||
for (i = 0; i < data.length; i++) {
|
||||
success: function(data){
|
||||
for (i = 0; i < data.length; i++) {
|
||||
var queue_station = $('#assigned_queue_' + data[i]).parent().parent(".queue_station");
|
||||
var station = queue_station.parent().parent().attr('id');
|
||||
|
||||
@@ -89,7 +90,7 @@ $(document).ready(function(){
|
||||
|
||||
// Remove a queue card from current station
|
||||
queue_station.children('.card-footer').remove();
|
||||
|
||||
|
||||
// Add removed queue card from station to completed
|
||||
$("#completed").children('.card-columns').append(queue_station);
|
||||
|
||||
@@ -97,35 +98,35 @@ $(document).ready(function(){
|
||||
var station_count=parseInt($("#"+station+"_count").text()) - 1;
|
||||
$("#"+station+"_count").text(station_count);
|
||||
}
|
||||
|
||||
// update queue item count in completed station
|
||||
|
||||
// update queue item count in completed station
|
||||
$("#completed_count").text(parseInt($("#completed_count").text()) + data.length);
|
||||
|
||||
alert("updated!");
|
||||
// Page reload
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Print Order Item
|
||||
$('#print_order_item').on('click',function(){
|
||||
var assigned_item_id=$('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
||||
var assigned_item_id=$('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
||||
var params = { 'id':assigned_item_id };
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/oqs/print/print/'+assigned_item_id,
|
||||
url: '/oqs/print/print/'+assigned_item_id,
|
||||
success: function(data){ }
|
||||
});
|
||||
});
|
||||
|
||||
// Print Order Summary
|
||||
$('#print_order_summary').on('click',function(){
|
||||
var assigned_item_id=$('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
||||
var assigned_item_id=$('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
||||
var params = { 'id':assigned_item_id };
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/oqs/print/print_order_summary/'+assigned_item_id,
|
||||
url: '/oqs/print/print_order_summary/'+assigned_item_id,
|
||||
success: function(data){ }
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user