check reprint route

This commit is contained in:
phyusin
2018-06-12 14:17:52 +06:30
parent b45f6b129f
commit db1668de5e

View File

@@ -257,21 +257,21 @@ $(document).ready(function(){
var sale_id = $(this).attr("data-id"); var sale_id = $(this).attr("data-id");
window.location.href = '/origami/quick_service/completed_sale/' + sale_id; window.location.href = '/origami/quick_service/completed_sale/' + sale_id;
}) })
$('#reprint').on('click', function () { // $('#reprint').on('click', function () {
var sale_id = $('#sale_id').val(); // var sale_id = $('#sale_id').val();
var ajax_url = '/origami/'+ sale_id + "/reprint" // var ajax_url = '/origami/'+ sale_id + "/reprint"
$.ajax({ // $.ajax({
type: "GET", // type: "GET",
url: ajax_url, // url: ajax_url,
success: function (result) { // success: function (result) {
if ($("#server_mode").val() == "cloud") { // if ($("#server_mode").val() == "cloud") {
code2lab.printFile(result.filepath.substr(6), result.printer_url); // code2lab.printFile(result.filepath.substr(6), result.printer_url);
} // }
location.reload(); // location.reload();
} // }
}); // });
}); // });
$('#back').on('click', function () { $('#back').on('click', function () {
window.location.href = '/origami/quick_service/pending_order'; window.location.href = '/origami/quick_service/pending_order';
}); });
@@ -348,7 +348,18 @@ function check_emp_access_code(access_code,type) {
$('#voidModal').modal('show'); $('#voidModal').modal('show');
}else if(type=='reprint'){ }else if(type=='reprint'){
var sale_id = $('#sale_id').val(); 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{ }else{
swal("Opps",result.message,"warning") swal("Opps",result.message,"warning")