From 753c62e44d59ea702e3c95a5a0160cfed3c05e42 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期二, 13 四月 2021 18:25:04 +0800 Subject: [PATCH] # --- src/main/webapp/static/js/order/order.js | 75 ++++++++++++++++++++++++++++++------- 1 files changed, 61 insertions(+), 14 deletions(-) diff --git a/src/main/webapp/static/js/order/order.js b/src/main/webapp/static/js/order/order.js index a295741..c30bcf6 100644 --- a/src/main/webapp/static/js/order/order.js +++ b/src/main/webapp/static/js/order/order.js @@ -153,17 +153,17 @@ cols: [[ {type: 'checkbox'} // ,{field: 'uuid', align: 'center',title: '缂栧彿'} - ,{field: 'orderNo', align: 'center',title: '璁㈠崟缂栧彿'} + ,{field: 'orderNo', align: 'center',title: '鍗曟嵁缂栧彿', minWidth: 200} ,{field: 'orderTime', align: 'center',title: '鍗曟嵁鏃ユ湡'} - ,{field: 'docType$', align: 'center',title: '鍗曟嵁绫诲瀷'} + ,{field: 'docType$', align: 'center',title: '鍗曟嵁绫诲瀷', templet: '#docTypeTpl', width: 100} ,{field: 'itemName', align: 'center',title: '椤圭洰'} ,{field: 'allotItemId$', align: 'center',title: '璋冩嫧椤圭洰缂栧彿', hide: true} ,{field: 'defNumber', align: 'center',title: '鍒濆绁ㄦ嵁鍙�', hide: true} - ,{field: 'number', align: 'center',title: '绁ㄦ嵁鍙�'} - ,{field: 'cstmrName', align: 'center',title: '瀹㈡埛', hide: true} + ,{field: 'number', align: 'center',title: '绁ㄦ嵁鍙�', hide: true} + ,{field: 'cstmrName', align: 'center',title: '瀹㈡埛'} ,{field: 'tel', align: 'center',title: '鑱旂郴鏂瑰紡', hide: true} ,{field: 'operMemb', align: 'center',title: '鎿嶄綔浜哄憳'} - ,{field: 'totalFee', align: 'center',title: '鍚堣閲戦'} + ,{field: 'totalFee', align: 'center',title: '鍚堣閲戦', hide: true} ,{field: 'discount', align: 'center',title: '浼樻儬鐜�', hide: true} ,{field: 'discountFee', align: 'center',title: '浼樻儬閲戦', hide: true} ,{field: 'otherFee', align: 'center',title: '閿�鍞垨閲囪喘璐圭敤鍚堣', hide: true} @@ -211,7 +211,7 @@ }); /* 琛ㄦ牸2閲嶇疆 */ form.on('submit(orderTbReset)', function (data) { - insTb2.reload({page: {curr: 1}}); + insTb2.reload({where: null,page: {curr: 1}}); return false; }); @@ -291,7 +291,7 @@ case 'print': layer.confirm('寮�濮嬫墦鍗�' +data.number + ' 鎷h揣鍗曪紵', {shadeClose: true}, function(){ layer.closeAll(); - printPakouts(data.number); + printPakouts(data.orderNo); }) break; // 淇敼 @@ -386,7 +386,6 @@ // 鐢熸垚鎷h揣鍗� function stockOut(orderNo) { - // layer.confirm(number + ' 璁㈠崟寮�濮嬫嫞璐э紵', {shadeClose: true}, function(){ layer.closeAll(); $.ajax({ url: baseUrl+"/work/stock/out/create", @@ -404,7 +403,7 @@ , btn: ['鎵撳嵃鎷h揣鍗�'] }, function() { layer.closeAll(); - printPakouts(number); + printPakouts(orderNo); } ) // 缂烘枡 @@ -431,11 +430,59 @@ // }); } - - - - - + // 鎵撳嵃鎷h揣鍗� + function printPakouts(orderNo) { + $.ajax({ + url: baseUrl+"/work/stock/out/print", + headers: {'token': localStorage.getItem('token')}, + data: JSON.stringify({ + orderNo: orderNo + }), + contentType:'application/json;charset=UTF-8', + method: 'POST', + success: function (res) { + if (res.code === 200){ + res.data["barcodeUrl"]=baseUrl+"/order/code/auth?type=1¶m="+res.data.docNum; + 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+"/pakout/print/auth", + headers: {'token': localStorage.getItem('token')}, + data: { + docNumber: orderNo + }, + 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 { + layer.msg(res.msg, {icon: 2}) + } + } + }) + } // // 鎼滅储鏍忔悳绱簨浠� // form.on('submit(search)', function (data) { -- Gitblit v1.9.1