updated ui
This commit is contained in:
@@ -38,11 +38,17 @@ $(document).ready(function(){
|
|||||||
// complete for queue item
|
// complete for queue item
|
||||||
$('.order-complete').on('click',function(){
|
$('.order-complete').on('click',function(){
|
||||||
var assigned_item_id=$(this).attr('id').substr(15);
|
var assigned_item_id=$(this).attr('id').substr(15);
|
||||||
|
var params = { 'id':assigned_item_id };
|
||||||
|
// $(this).parent().parent(".queue_station").remove();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "",
|
type: 'POST',
|
||||||
data: ""
|
url: '/oqs/update_delivery',
|
||||||
}).done(function(){
|
data: params,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(data){
|
||||||
|
$('.order-complete').parent().parent(".queue_station").remove();
|
||||||
|
alert('updated!');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -26,8 +26,17 @@ class Oqs::HomeController < BaseOqsController
|
|||||||
def show
|
def show
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# update delivery status when complete click
|
||||||
def update_delivery_status
|
def update_delivery_status
|
||||||
|
puts "WWWW" + params[:id]
|
||||||
|
assigned_item_id = params[:id]
|
||||||
|
assigned_item=AssignedOrderItem.find(assigned_item_id)
|
||||||
|
assigned_item.delivery_status=true
|
||||||
|
assigned_item.save
|
||||||
|
# respond_to do |format|
|
||||||
|
# format.json { render json: "updated" }
|
||||||
|
# end
|
||||||
|
flash[:success] = "updated!"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Query for OQS with status
|
# Query for OQS with status
|
||||||
|
|||||||
@@ -200,3 +200,4 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -92,6 +92,8 @@ Rails.application.routes.draw do
|
|||||||
#--------- Order Queue Station ------------#
|
#--------- Order Queue Station ------------#
|
||||||
namespace :oqs do
|
namespace :oqs do
|
||||||
root "home#index"
|
root "home#index"
|
||||||
|
|
||||||
|
post 'update_delivery', to: "home#update_delivery_status"
|
||||||
#dashboard
|
#dashboard
|
||||||
#
|
#
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user