From 1df6f4e9ab81da3212cffc126bece65350b6d09f Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期五, 05 三月 2021 14:59:49 +0800 Subject: [PATCH] # --- src/main/webapp/static/js/custOrder/custOrder.js | 31 ++++++++++++++++++++++++++++++- 1 files changed, 30 insertions(+), 1 deletions(-) diff --git a/src/main/webapp/static/js/custOrder/custOrder.js b/src/main/webapp/static/js/custOrder/custOrder.js index 603ed8e..0a6917f 100644 --- a/src/main/webapp/static/js/custOrder/custOrder.js +++ b/src/main/webapp/static/js/custOrder/custOrder.js @@ -267,7 +267,36 @@ success: function (res) { console.log(res) if (res.code === 200){ - alert(JSON.stringify(res.data)); + var tpl = $('#pakoutPrintTpl').html(); + var template = Handlebars.compile(tpl); + var html = template(res); + var box = $("#box"); + box.html(html);box.show(); + box.print({ + mediaPrint:true, + deferred: $.Deferred().done(function () { + layer.confirm('[閲嶈] 鎵撳嵃鏄惁鎴愬姛锛�', {btn: ['Yes', 'No']}, function(){ + $.ajax({ + url: baseUrl+"/trayCode/print/auth", + headers: {'token': localStorage.getItem('token')}, + data: data.field, + method: 'POST', + success: function (res) { + if (res.code === 200){ + layer.closeAll(); + $(".layui-laypage-btn")[0].click(); + layer.msg(res.msg, {icon: 1}) + } else if (res.code === 403){ + top.location.href = baseUrl+"/"; + } else { + layer.msg(res.msg, {icon: 2}) + } + } + }) + }); + }) + }); + box.hide(); } else if (res.code === 403){ top.location.href = baseUrl+"/"; } else { -- Gitblit v1.9.1