diff --git a/app/views/origami/pending_order/completed_sale.html.erb b/app/views/origami/pending_order/completed_sale.html.erb index 03598f38..ed0a1a76 100644 --- a/app/views/origami/pending_order/completed_sale.html.erb +++ b/app/views/origami/pending_order/completed_sale.html.erb @@ -257,21 +257,21 @@ $(document).ready(function(){ var sale_id = $(this).attr("data-id"); window.location.href = '/origami/quick_service/completed_sale/' + sale_id; }) - $('#reprint').on('click', function () { - var sale_id = $('#sale_id').val(); - var ajax_url = '/origami/'+ sale_id + "/reprint" + // $('#reprint').on('click', function () { + // var sale_id = $('#sale_id').val(); + // var ajax_url = '/origami/'+ sale_id + "/reprint" - $.ajax({ - type: "GET", - url: ajax_url, - success: function (result) { - if ($("#server_mode").val() == "cloud") { - code2lab.printFile(result.filepath.substr(6), result.printer_url); - } - location.reload(); - } - }); - }); + // $.ajax({ + // type: "GET", + // url: ajax_url, + // success: function (result) { + // if ($("#server_mode").val() == "cloud") { + // code2lab.printFile(result.filepath.substr(6), result.printer_url); + // } + // location.reload(); + // } + // }); + // }); $('#back').on('click', function () { window.location.href = '/origami/quick_service/pending_order'; }); @@ -348,7 +348,18 @@ function check_emp_access_code(access_code,type) { $('#voidModal').modal('show'); }else if(type=='reprint'){ var sale_id = $('#sale_id').val(); - window.location.href = '/origami/'+ sale_id + "/reprint" + var ajax_url = '/origami/'+ sale_id + "/reprint"; + + $.ajax({ + type: "GET", + url: ajax_url, + success: function (result) { + if ($("#server_mode").val() == "cloud") { + code2lab.printFile(result.filepath.substr(6), result.printer_url); + } + location.reload(); + } + }); } }else{ swal("Opps",result.message,"warning")