From d47f3a55e5f7b4328ad1bd2e059f03e5c0c4151a Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期二, 19 十一月 2024 15:56:23 +0800
Subject: [PATCH] #led task

---
 src/main/webapp/static/js/order/order.js |   40 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 39 insertions(+), 1 deletions(-)

diff --git a/src/main/webapp/static/js/order/order.js b/src/main/webapp/static/js/order/order.js
index 8a807c3..7a4fab3 100644
--- a/src/main/webapp/static/js/order/order.js
+++ b/src/main/webapp/static/js/order/order.js
@@ -48,6 +48,7 @@
             {field: 'createTime$', title: '鍒涘缓鏃堕棿', minWidth: 200, width: 200},
             {field: 'settle$', align: 'center', title: '鐘舵��', templet: '#settleTpl',  minWidth: 160, width: 160},
             {field: 'shipName', align: 'center',title: '鍒跺崟浜�'},
+            {field: 'itemName', align: 'center',title: '浠撳簱'},
             {field: 'memo', align: 'center',title: '澶囨敞', hide: true},
             {align: 'center', title: '鎿嶄綔', toolbar: '#operate', width: 180}
         ]],
@@ -129,7 +130,8 @@
                             {field: 'batch', title: '鎵瑰彿'},
                             {field: 'anfme', title: '鏁伴噺'},
                             {field: 'workQty', title: '浣滀笟鏁伴噺'},
-                            {field: 'qty', title: '瀹屾垚鏁伴噺', style: 'font-weight: bold'}
+                            {field: 'qty', title: '瀹屾垚鏁伴噺', style: 'font-weight: bold'},
+                            {align: 'center', title: '鎵撳嵃', toolbar: '#printOperate', width: 80}
                             // {field: 'unit', title: '鍗曚綅'},
                             // {
                             //     field: 'createTime$', title: '鍒涘缓鏃堕棿', sort: true, templet: function (d) {
@@ -165,6 +167,42 @@
         }
     });
 
+    // 鐩戝惉琛屽伐鍏蜂簨浠�
+    table.on('tool(lookSSXMTable)', function(obj) {
+        $.ajax({
+            url: baseUrl+"/orderDetl/getPrintDetl/" + obj.data.id,
+            headers: {'token': localStorage.getItem('token'),'Content-Type' :'application/json'},
+            method: 'GET',
+            async: false,
+            success: function (res) {
+                if (res.code === 200){
+                    layer.closeAll();
+                    let data = res.data
+                        var templateDom = $("#templatePreview1");
+                        var className = templateDom.attr("class");
+                        var param = "缂栫爜:"+data.matnr+";鍚嶇О:"+data.maktx+";鎵规:"+data.batch+";瑙勬牸:"+data.specs
+                            +";鍗曚綅:"+data.unit+";鏁伴噺:"+data.anfme+";瀹㈡埛鍚嶇О:"+data.cstmrName;
+                        var encodeUrl = encodeURIComponent(param);
+                        data["barcodeUrl"]=baseUrl+"/mac/code/auth?type=2&param="+encodeUrl;
+                        console.log(data["barcodeUrl"]);
+                    let list = Array.isArray(res.data) ? res.data : [res.data];
+                    res.data = list;
+                    var tpl = templateDom.html();
+                    var template = Handlebars.compile(tpl);
+                    var html = template(res);
+                    var box = $("#box");
+                    box.html(html);box.show();
+                    box.print({mediaPrint:true});
+                    box.hide();
+                } else if (res.code === 403){
+                    top.location.href = baseUrl+"/";
+                }else {
+                    layer.msg(res.msg)
+                }
+            }
+        })
+    });
+
     // 鏄剧ず琛ㄥ崟寮圭獥
     function showEditModel(expTpe) {
         admin.open({

--
Gitblit v1.9.1