edit addorder loading to oqs_loading

This commit is contained in:
Yan
2017-11-17 18:27:48 +06:30
parent c56fb1b0f4
commit e95562ad20
3 changed files with 23 additions and 23 deletions

View File

@@ -1,9 +1,8 @@
$(function(){
$(function() {
//click menu sidebar menu category
$(".product").on("click", function(){
var url = $(this).attr('data-ref');
show_product_list(url);
console.log(url)
});
//show menu item list when click menu category
function show_product_list(url_item){
@@ -635,8 +634,9 @@ $(function(){
// Pay Discount for Payment
$("#create_order").on('click', function(e){
$(this).attr('disabled', 'disabled');
e.preventDefault();
$("#loading_wrapper").show();
$("#oqs_loading_wrapper").show();
var table_id = $('#table_id').text();
var booking_id = $('#booking_id').text();
if (!booking_id.length > 0) {
@@ -651,32 +651,32 @@ $(function(){
var ajax_url = '../addorders/create';
var params = {'order_source': "cashier", 'order_type': "dine_in",
'customer_id': "", 'guest_info': "",
'table_id': table_id,
'order_items': order_items };
$.ajax({
type: "POST",
url: ajax_url,
data: params,
dataType: "json",
success:function(result){
$("#loading_wrapper").hide();
success:function(result){
$("#oqs_loading_wrapper").hide();
swal({
title: "Information !",
text: 'Order has been successfully created',
confirmButtonColor: "green",
confirmButtonText: "Yes!",
closeOnConfirm: false,
}, function () {
if(table_type == "Table"){
window.location.href = "/origami/table/" + table_id
}
else {
window.location.href = "/origami/room/" + table_id
}
}, function (isConfirm) {
if (isConfirm) {
if(table_type == "Table"){
window.location.href = "/origami/table/" + table_id
}
else {
window.location.href = "/origami/room/" + table_id
}
}
});
}
});