From 0e46bb0cfc8b59ad5527f0b70c49f95aeac4bbbd Mon Sep 17 00:00:00 2001
From: zyx <zyx123456>
Date: 星期五, 05 一月 2024 13:38:05 +0800
Subject: [PATCH] # 入库拣货功能添加

---
 src/main/webapp/static/js/picking/picking.js |   84 ++++++++++++++++++++++++++++++++++++------
 1 files changed, 72 insertions(+), 12 deletions(-)

diff --git a/src/main/webapp/static/js/picking/picking.js b/src/main/webapp/static/js/picking/picking.js
index 5963f04..2f1f451 100644
--- a/src/main/webapp/static/js/picking/picking.js
+++ b/src/main/webapp/static/js/picking/picking.js
@@ -1,6 +1,7 @@
 var pageCurr;
 var printMatCodeNos = [];
 var ordernoo = "123";
+var insTbCount = 0;
 layui.config({
     base: baseUrl + "/static/layui/lay/modules/"
 }).use(['table','laydate', 'form', 'admin', 'layer'], function(){
@@ -26,11 +27,11 @@
             // {type: 'checkbox'}
             {type: 'numbers'}
             ,{field: 'wrkNo', align: 'center',title: 'id', hide:true}
-            ,{field: 'docNum',title: '鎷h揣鍗曞彿' , templet: '#orderNoTpl'}
+            ,{field: 'doc_num',title: '鎷h揣鍗曞彿' }
             ,{align: 'center', title: '浜岀淮鐮�', toolbar: '#operate', width: 200 , hide:true}
             ,{align: 'center', title: '鏄庣粏', toolbar: '#tbLook', minWidth: 160, width: 160}
             ,{field: 'status$', align: 'center',title: '鐘舵��'}
-            ,{field: 'custName', align: 'center',title: '瀹㈡埛鍚嶇О', width: 160}
+            // ,{field: 'custName', align: 'center',title: '瀹㈡埛鍚嶇О', width: 160}
             ,{field: 'createTime$', align: 'center',title: '鎿嶄綔鏃堕棿'}
             ,{align: 'center', title: '鎿嶄綔', toolbar: '#operate'}
 
@@ -57,6 +58,14 @@
             }
             pageCurr=curr;
             limit();
+
+            var index = -1;
+            $("[data-field='status$']").children().each(function () {
+                index++;
+                if ($(this).text() === '鏈嚭搴�') {
+                    $('tr').eq(index).css("color", 'red');
+                }
+            });
         }
     });
 
@@ -76,15 +85,19 @@
     // 鐩戝惉琛屽伐鍏蜂簨浠�
     table.on('tool(saasLog)', function(obj){
         var data = obj.data;
+        console.log(data);
         switch (obj.event) {
             case "btnPrint":
-                btnPrint(data.wrkNo, data.docNum, 4);
+                btnPrint(data.wrkNo, data.doc_num, 4);
                 break;
             case "wrkTrace":
-                btnPrint(data.wrkNo, data.docNum, 4);
+                btnPrint(data.wrkNo, data.doc_num, 4);
                 break;
             case "btnPrint2":
-                btnPrint2(data.wrkNo, data.docNum, 4);
+                btnPrint2(data.wrkNo, data.doc_num, 4);
+                break;
+            case "del":
+                doDel(data);
                 break;
             case "look":
                 var $a = $(obj.tr).find('a[lay-event="look"]');
@@ -95,18 +108,20 @@
                     type: 1,
                     title: false,
                     area: '1200px',
-                    offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'],
+                    offset: [top + 'px', (left - 450 + $a.outerWidth()) + 'px'],
                     shade: .01,
                     shadeClose: true,
                     fixed: false,
                     content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>',
                     success: function (layero) {
                         table.render({
+                            id:'lookSSXMTable',
                             elem: '#lookSSXMTable',
                             headers: {token: localStorage.getItem('token')},
                             url: baseUrl+'/ManPakOut/list/auth',
                             where: {
-                                doc_num: data.docNum
+                                doc_num: data.doc_num,
+                                uuid: data.uuid
                             },
                             page: true,
                             cellMinWidth: 100,
@@ -114,9 +129,12 @@
                                 {type: 'numbers'}
                                 ,{field: 'id', align: 'center',title: 'id', hide:true}
                                 ,{field: 'docNum', align: 'center',title: '鎷h揣鍗曞彿'}
+                                ,{field: 'uuid', align: 'center',title: 'uuid'}
                                 ,{field: 'locNo', align: 'center',title: '搴撲綅'}
-                                ,{field: 'matnr', align: 'center',title: '鐗╂枡鍙�'}
-                                ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О'}
+                                ,{field: 'batch', align: 'center',title: '鎵瑰彿'}
+                                ,{field: 'barcode', align: 'center',title: '鍖呭彿'}
+                                // ,{field: 'matnr', align: 'center',title: '鐗╂枡鍙�'}
+                                // ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О'}
                                 ,{field: 'anfme', align: 'center',title: '鏁伴噺'}
                                 ,{field: 'createTime$', align: 'center',title: '鎿嶄綔鏃堕棿'}
                                 ,{field: 'count', align: 'center',title: '瀹屾垚鏁�'}
@@ -139,8 +157,18 @@
                             response: {
                                 statusCode: 200
                             },
-                            done: function () {
+                            done: function (res) {
                                 $(layero).find('.layui-table-view').css('margin', '0');
+
+                                var index = -1;
+                                $("[data-field='status$']").children().each(function () {
+                                    index++;
+                                    if ($(this).text() === '鏈嚭搴�') {
+                                        $('tr').eq(index).css("color", 'red');
+                                    }
+                                });
+
+
                             },
                             size: ''
                         });
@@ -270,9 +298,9 @@
                             var className = templateDom.attr("class");
 
                             if (className === 'template-barcode') {
-                                json.data[i]["barcodeUrl"] = baseUrl + "/ManPakOut/code/auth?type=2&param=" + (json.data[i].docNum+";"+json.data[i].matnr+";"+json.data[i].maktx+";"+json.data[i].anfme+";"+json.data[i].locNo+";");
+                                json.data[i]["barcodeUrl"] = baseUrl + "/ManPakOut/code/auth?type=2&param=" + (json.data[i].docNum+";"+json.data[i].matnr+";"+json.data[i].batch+";"+json.data[i].anfme+";"+json.data[i].locNo+";"+json.data[i].barcode+";"+json.data[i].nodeId+";"+json.data[i].wrkNo+";");
                             } else {
-                                json.data[i]["barcodeUrl"] = baseUrl + "/ManPakOut/code/auth?type=2&param=" + (json.data[i].docNum+";"+json.data[i].matnr+";"+json.data[i].maktx+";"+json.data[i].anfme+";"+json.data[i].locNo+";");
+                                json.data[i]["barcodeUrl"] = baseUrl + "/ManPakOut/code/auth?type=2&param=" + (json.data[i].docNum+";"+json.data[i].matnr+";"+json.data[i].batch+";"+json.data[i].anfme+";"+json.data[i].locNo+";"+json.data[i].barcode+";"+json.data[i].nodeId+";"+json.data[i].wrkNo+";");
                             }
                         }
                         var tpl = templateDom.html();
@@ -292,6 +320,38 @@
             })
         }
 
+    function doDel(data) {
+        console.log(data)
+        layer.confirm('纭畾瑕佸垹闄ゅ悧锛�', {
+            shade: .1,
+            skin: 'layui-layer-admin'
+        }, function (i) {
+            layer.close(i);
+            layer.load(2);
+            $.ajax({
+                url: baseUrl+"/pakout/delete/auth",
+                headers: {'token': localStorage.getItem('token')},
+                data:{
+                    docNum:data.doc_num
+                },
+                method: 'GET',
+                success: function (res) {
+                    layer.closeAll('loading');
+                    if (res.code === 200){
+                        tableIns.reload({page: {curr: 1}});
+                        layer.msg(res.msg, {icon: 1});
+                    } else if (res.code === 403){
+                        top.location.href = baseUrl+"/";
+                    }else {
+                        layer.msg(res.msg, {icon: 2});
+                    }
+                }
+            })
+        });
+    }
+
+
+
 
 
 });

--
Gitblit v1.9.1