updated ui

This commit is contained in:
Yan
2017-06-02 11:28:07 +06:30
parent f28f0bf292
commit 95fd260c76
4 changed files with 43 additions and 25 deletions

View File

@@ -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!');
}
}); });
}); });
}); });

View File

@@ -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

View File

@@ -200,3 +200,4 @@
</div> </div>
</div> </div>

View File

@@ -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