From 431f88fdade07a22b636714f1690cee3a55668d0 Mon Sep 17 00:00:00 2001
From: cp <513960435@qq.com>
Date: 星期三, 30 十月 2024 13:35:56 +0800
Subject: [PATCH] 完善

---
 zy-asrs-wms/src/main/webapp/static/js/locInPrintMat/locInPrintMat.js |   68 +++++++++++++++++++++++++++++----
 1 files changed, 59 insertions(+), 9 deletions(-)

diff --git a/zy-asrs-wms/src/main/webapp/static/js/locInPrintMat/locInPrintMat.js b/zy-asrs-wms/src/main/webapp/static/js/locInPrintMat/locInPrintMat.js
index 7461fd9..e017858 100644
--- a/zy-asrs-wms/src/main/webapp/static/js/locInPrintMat/locInPrintMat.js
+++ b/zy-asrs-wms/src/main/webapp/static/js/locInPrintMat/locInPrintMat.js
@@ -1,5 +1,6 @@
 var pageCurr;
 var pageCount = 0;
+var admin;
 layui.config({
     base: baseUrl + "/static/layui/lay/modules/"
 }).use(['table','laydate', 'form', 'admin', 'xmSelect'], function(){
@@ -8,7 +9,7 @@
     var layer = layui.layer;
     var layDate = layui.laydate;
     var form = layui.form;
-    var admin = layui.admin;
+    admin = layui.admin;
     var xmSelect = layui.xmSelect;
 
     // 鏁版嵁娓叉煋
@@ -28,6 +29,8 @@
             ,{field: 'uuid', align: 'center',title: '缂栧彿',hide: true}
             ,{field: 'status$', align: 'center',title: '鎵撳嵃鎯呭喌', width:100,hide: false}
             ,{field: 'matnr', align: 'center',title: '鍝佸彿', width:180,hide: false}
+            ,{field: 'orderNo', align: 'center',title: '璁㈠崟鍙�', width:180,hide: false}
+            ,{field: 'decrees', align: 'center',title: '鍒朵护', width:180,hide: false}
             // ,{field: 'batch', align: 'center',title: '鎵规', width:100,hide: false}
             // ,{field: 'anfme', align: 'center',title: '閲嶉噺(kg)', width:100,hide: false}
             // ,{field: 'locNo', align: 'center',title: '搴撲綅鍙�', width:120,hide: false}
@@ -278,16 +281,10 @@
                         var className = templateDom.attr("class");
                         if (className === 'template-barcode') {
                             res.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=1&param="
-                                +res.data[i].matnr+";" +res.data[i].batch+";"
-                                +res.data[i].anfme+";" +res.data[i].locNo+";"
-                                +res.data[i].ownerId+";"+res.data[i].maktx+";"
-                                +res.data[i].id;
+                                +res.data[i].matnr
                         } else {
                             res.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=2&param="
-                                +res.data[i].matnr+";" +res.data[i].batch+";"
-                                +res.data[i].anfme+";" +res.data[i].locNo+";"
-                                +res.data[i].ownerId+";"+res.data[i].maktx+";"
-                                +res.data[i].id;
+                                +res.data[i].matnr
                         }
                     }
                     var tpl = templateDom.html();
@@ -326,6 +323,16 @@
 
 });
 
+// excel瀵煎叆妯℃澘涓嬭浇
+function excelMouldDownload(){
+    layer.load(1, {shade: [0.1,'#fff']});
+    location.href = baseUrl + "/out/loc/box/excel/import/mould";
+    layer.closeAll('loading');
+}
+// excel瀵煎叆
+function importExcel() {
+    $("#importExcel").trigger("click");
+}
 // 鍏抽棴鍔ㄤ綔
 $(document).on('click','#data-detail-close', function () {
     parent.layer.closeAll();
@@ -341,3 +348,46 @@
         page: {curr: pageCurr}
     });
 }
+
+function upload(obj){
+    if(!obj.files) {
+        return;
+    }
+    var file = obj.files[0];
+    admin.confirm('纭鍚屾 [' + file.name +'] 鏂囦欢鍚楋紵', function (index) {
+        layer.load(1, {shade: [0.1,'#fff']});
+        var url = baseUrl + "/out/loc/box/excel/import/auth";
+        var form = new FormData();
+        form.append("file", file);
+        xhr = new XMLHttpRequest();
+        xhr.open("post", url, true); //post鏂瑰紡锛寀rl涓烘湇鍔″櫒璇锋眰鍦板潃锛宼rue 璇ュ弬鏁拌瀹氳姹傛槸鍚﹀紓姝ュ鐞嗐��
+        xhr.setRequestHeader('token', localStorage.getItem('token'));
+        xhr.onload = uploadComplete; //璇锋眰瀹屾垚
+        xhr.onerror =  uploadFailed; //璇锋眰澶辫触
+        xhr.onloadend = function () { // // 涓婁紶瀹屾垚閲嶇疆鏂囦欢娴�
+            layer.closeAll('loading');
+            $("#importExcel").val("");
+        };
+        // xhr.upload.onprogress = progressFunction;//銆愪笂浼犺繘搴﹁皟鐢ㄦ柟娉曞疄鐜般��
+        xhr.upload.onloadstart = function(){//涓婁紶寮�濮嬫墽琛屾柟娉�
+            ot = new Date().getTime();   //璁剧疆涓婁紶寮�濮嬫椂闂�
+            oloaded = 0;//璁剧疆涓婁紶寮�濮嬫椂锛屼互涓婁紶鐨勬枃浠跺ぇ灏忎负0
+        };
+        xhr.send(form);
+    }, function(index){
+        $("#importExcel").val("");
+    });
+}
+function uploadComplete(evt) {
+    var res = JSON.parse(evt.target.responseText);
+    if(res.code === 200) {
+        layer.msg(res.msg, {icon: 1});
+        loadTree("");
+    } else {
+        layer.msg(res.msg, {icon: 2});
+    }
+}
+function uploadFailed(evt) {
+    var res = JSON.parse(evt.target.responseText);
+    layer.msg(res.msg, {icon: 2});
+}

--
Gitblit v1.9.1