add order button disable enable

This commit is contained in:
yarzar_code
2020-08-10 17:35:48 +06:30
parent 0c4a2e1761
commit d6f6e51e6f
3 changed files with 63 additions and 43 deletions

View File

@@ -124,24 +124,31 @@ function update_sale(membership_id, customer_id, customer_name, sale_id) {
confirmButtonText: "Yes!",
cancelButtonClass: 'btn btn-danger customer_assign_cancel',
closeOnConfirm: true,
}, function () {
$("#oqs_loading_wrapper").show();
$.ajax({
type: "POST",
url: "/foodcourt/"+sale_id+"/"+cashier_type+"/customers/update_sale" ,
data: {customer_id:customer_id,sale_id:sale_id},
dataType: "json",
success: function(data) {
if(data.status == true)
{
//change customer detail
$("#customer_name").html(customer_name);
$("#membership_id").html(membership_id);
window.location.href = '/foodcourt/sale/'+sale_id+'/'+cashier_type+'/payment/';
}else{
window.location.href = '/foodcourt/sale/'+sale_id+'/'+cashier_type+'/payment/';
}
}, function (inputValue) {
if (inputValue===false) {
if ($("#order-items-table tr").length > 1){
$("#create_pay_order").prop("disabled", false);
$("#create_order").prop("disabled", false);
}
});
} else {
$("#oqs_loading_wrapper").show();
$.ajax({
type: "POST",
url: "/foodcourt/"+sale_id+"/"+cashier_type+"/customers/update_sale" ,
data: {customer_id:customer_id,sale_id:sale_id},
dataType: "json",
success: function(data) {
if(data.status == true)
{
//change customer detail
$("#customer_name").html(customer_name);
$("#membership_id").html(membership_id);
window.location.href = '/foodcourt/sale/'+sale_id+'/'+cashier_type+'/payment/';
}else{
window.location.href = '/foodcourt/sale/'+sale_id+'/'+cashier_type+'/payment/';
}
}
});
}
});
}