From 3f31d6aa87063f91fd3c2678d32638b3cb3000f6 Mon Sep 17 00:00:00 2001 From: mrzhssss <pro6@qq.com> Date: 星期五, 25 三月 2022 16:53:28 +0800 Subject: [PATCH] # --- src/main/webapp/static/js/pickout/pickout.js | 76 +++++++++++++++++++++++++++++++++++++- 1 files changed, 74 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/static/js/pickout/pickout.js b/src/main/webapp/static/js/pickout/pickout.js index 95be0cb..aca4626 100644 --- a/src/main/webapp/static/js/pickout/pickout.js +++ b/src/main/webapp/static/js/pickout/pickout.js @@ -41,6 +41,7 @@ ,{field: 'userId', align: 'center',title: '鐢ㄦ埛ID', hide: true} ,{field: 'wrkSts$', align: 'center',title: '宸ヤ綔鐘舵��' ,templet: '#wrkStsTpl' , width: 100} + ,{field: 'printTimes', align: 'center', title: '鎵撳嵃娆℃暟',width: 90} ,{field: 'zpallet', align: 'center',title: '鏉″舰鐮�' , hide:true} ,{field: 'createTime$', align: 'center',title: '', hide:true} ,{field: 'createBy', align: 'center',title: '', hide:true} @@ -57,6 +58,9 @@ // 鐩戝惉琛屽伐鍏蜂簨浠� table.on('tool(leftTable)', function(obj){ var data = obj.data; + + + switch (obj.event) { case 'printOrder': printPick(data); @@ -64,6 +68,9 @@ case "del": var ids = [data.id]; del(ids); + break; + case "complete": + donePickOut(data); break; } }); @@ -121,8 +128,73 @@ tableReload(false); }); - function printPick(data){ + function donePickOut(data) { + $.ajax({ + url:baseUrl + "/pickout/done/auth", + headers : {'token' : localStorage.getItem('token')}, + data: JSON.stringify(data), + contentType:'application/json;charset=UTF-8', + method: 'POST', + success: function (res) { + leftTB.reload(); + } + }) + } + + function printPick(data){ + $.ajax({ + url:baseUrl + "/work/pick/out/print", + headers : {'token' : localStorage.getItem('token')}, + data: JSON.stringify(data), + contentType:'application/json;charset=UTF-8', + method: 'POST', + success: function (res) { + if (res.code === 200){ + console.log(res); + res.data["barcodeUrl"]=baseUrl+"/order/code/auth?type=1¶m="+res.data.pickout.wrkNo; + var tpl = $('#pakoutPrintTpl').html(); + var template = Handlebars.compile(tpl); + var html = template(res); + var box = $("#pakoutPrintBox"); + box.html(html);box.show(); + box.print({ + mediaPrint:true, + deferred: $.Deferred().done(function () { + layer.confirm('[閲嶈] 鎵撳嵃鏄惁鎴愬姛锛�', {btn: ['Yes', 'No']}, function(){ + $.ajax({ + url: baseUrl+"/pickout/print/auth", + headers: {'token': localStorage.getItem('token')}, + data: JSON.stringify(res.data.pickout), + contentType:'application/json;charset=UTF-8', + 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}) + } + leftTB.reload(); + } + }) + }); + }) + }); + box.hide(); + } + else if (res.code === 403){ + top.location.href = baseUrl+"/"; + }else { + layer.msg(res.msg, {icon: 2}) + } + + } + + }) } @@ -158,7 +230,7 @@ ,{field: 'price', align: 'center',title: '浠锋牸', hide:true} ,{field: 'weight', align: 'center',title: '閲嶉噺', hide:true} ,{field: 'status', align: 'center',title: '鐘舵��' , hide:true} - ,{field: 'pickStaff', align: 'center',title: '鎷h揣鍛業D'} + ,{field: 'pickStaff$', align: 'center',title: '鎷h揣鍛業D'} ,{field: 'pickStart$', align: 'center',title: '鎷h揣寮�濮嬫椂闂�'} ,{field: 'pickEnd$', align: 'center',title: '鎷h揣缁撴潫鏃堕棿'} ,{field: 'createTime$', align: 'center',title: '鍒涘缓鏃堕棿', hide:true} -- Gitblit v1.9.1