separate foodcourt module
This commit is contained in:
@@ -1,5 +1,23 @@
|
||||
//middle edit
|
||||
$(function() {
|
||||
$("#loading_wrapper").show();
|
||||
getAllMenu();
|
||||
//get menu item cache
|
||||
function getAllMenu(){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '/foodcourt/get_all_menu',
|
||||
data: {},
|
||||
success:function(result){
|
||||
console.log(result)
|
||||
localStorage.setItem("menus", JSON.stringify(result));
|
||||
var menu = localStorage.getItem("menus");
|
||||
if (menu != null ) {
|
||||
$( "#loading_wrapper").hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
var role = $('#role').val();
|
||||
var second_display_lookup = $("#display_type").val();
|
||||
type = window.location.href.indexOf("quick_service") || window.location.href.indexOf("food_court");
|
||||
@@ -623,7 +641,7 @@ $(function() {
|
||||
row = "<h5>"+attributes[field]["type"]+"</h5>";
|
||||
|
||||
$(value).each(function(i){
|
||||
disabled = ""
|
||||
disabled = "false";
|
||||
status ="";
|
||||
if(parseInt(jQuery.inArray(value[i], selected_item)) !== -1){
|
||||
status = "selected-attribute";
|
||||
@@ -1041,7 +1059,11 @@ $(function() {
|
||||
}else if(result.data == 'OK'){
|
||||
window.location.href = '/origami/'+type+'/pending_order/' + $('#sale_id').text();
|
||||
}else{
|
||||
window.location.href = "/origami/sale/"+result.data["sale_id"]+"/"+type+"/payment";
|
||||
if(result.current_user_role == 'foodcourt_cashier'){
|
||||
window.location.href = "/foodcourt/sale/"+result.data["sale_id"]+"/"+type+"/payment"; }
|
||||
else{
|
||||
window.location.href = "/origami/sale/"+result.data["sale_id"]+"/"+type+"/payment";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user