From 6641f2dbe3bd3d0c64cafeaafc469c34c4d54589 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期四, 31 三月 2022 09:26:19 +0800
Subject: [PATCH] #

---
 src/main/webapp/static/js/pakStore/locCheckOut.js     |   82 +++++++--------------------
 src/main/webapp/views/pakStore/locCheckOut.html       |    8 +-
 src/main/webapp/views/pakStore/locDetlCheckQuery.html |   56 ++++--------------
 src/main/webapp/static/js/common.js                   |    3 +
 src/main/webapp/static/js/pakStore/pakStore.js        |    2 
 src/main/webapp/static/js/pakStore/stockOut.js        |    2 
 6 files changed, 46 insertions(+), 107 deletions(-)

diff --git a/src/main/webapp/static/js/common.js b/src/main/webapp/static/js/common.js
index 5799bb9..17e7e8f 100644
--- a/src/main/webapp/static/js/common.js
+++ b/src/main/webapp/static/js/common.js
@@ -10,6 +10,9 @@
     return typeof obj == "undefined" || obj == null || obj === "";
 }
 
+// let loadIndex = layer.msg('璇锋眰涓�...', {icon: 16, shade: 0.01, time: false});
+//       layer.close(loadIndex);
+
 // 鏃堕棿 ==>> 瀛楃涓�
 function dateToStr(date) {
     var time = new Date(date);
diff --git a/src/main/webapp/static/js/pakStore/locCheckOut.js b/src/main/webapp/static/js/pakStore/locCheckOut.js
index bce5470..aeef93f 100644
--- a/src/main/webapp/static/js/pakStore/locCheckOut.js
+++ b/src/main/webapp/static/js/pakStore/locCheckOut.js
@@ -1,8 +1,8 @@
-var pageCurr;
+var locDetlLayerIdx;
 var tableIns;
 function getCol() {
     var cols = [
-        {field: 'locNo$', align: 'center',title: '搴撲綅鍙�'}
+        {field: 'locNo', align: 'center',title: '搴撲綅鍙�', merge: true, style: 'font-weight: bold'}
     ];
     cols.push.apply(cols, detlCols);
     return cols;
@@ -10,13 +10,14 @@
 
 layui.config({
     base: baseUrl + "/static/layui/lay/modules/"
-}).use(['table','laydate', 'form', 'admin'], function() {
+}).use(['table','laydate', 'form', 'admin', 'tableMerge'], function() {
     var table = layui.table;
     var $ = layui.jquery;
     var layer = layui.layer;
     var layDate = layui.laydate;
     var form = layui.form;
     var admin = layui.admin;
+    var tableMerge = layui.tableMerge;
 
     tableIns = table.render({
         elem: '#chooseData',
@@ -27,14 +28,10 @@
         cellMinWidth: 50,
         cols: [getCol()],
         done: function(res, curr, count) {
+            tableMerge.render(this);
             limit();
             getOutBound();
         }
-    });
-
-    // 椤甸潰淇敼
-    table.on('edit(chooseData)', function (obj) {
-        updateLocDetlData(obj.data.locNo, obj.data.matnr, Number(obj.value));
     });
 
     // 鐩戝惉澶村伐鍏锋爮浜嬩欢
@@ -82,43 +79,6 @@
         }
     });
 
-    // 鐩戝惉琛屽伐鍏蜂簨浠�
-    table.on('tool(chooseData)', function(obj){
-        var data = obj.data;
-        switch (obj.event) {
-            case 'remove':
-                for (var i = locDetlData.length - 1; i >= 0; i--) {
-                    if (locDetlData[i].locNo === data.locNo && locDetlData[i].matnr === data.matnr) {
-                        locDetlData.splice(i, 1);
-                    }
-                }
-                tableIns.reload({data: locDetlData,done:function (res) {limit();getOutBound();}});
-                break;
-        }
-    });
-
-    function updateLocDetlData(locNo, matnr, count) {
-        if (isNaN(count)) {
-            layer.msg("璇疯緭鍏ユ暟瀛�");
-        } else {
-            if (count > 0) {
-                for (var i=0;i<locDetlData.length;i++){
-                    if (locDetlData[i]["locNo"] === locNo && locDetlData[i]["matnr"] === matnr){
-                        if (count > locDetlData[i]["anfme"]) {
-                            layer.msg("涓嶈兘瓒呰繃鍘熸暟閲�");
-                        } else {
-                            locDetlData[i]["count"] = count;
-                        }
-                        break;
-                    }
-                }
-            } else {
-                layer.msg("鏁伴噺蹇呴』澶т簬闆�");
-            }
-        }
-        tableIns.reload({data: locDetlData,done:function (res) {limit(); getOutBound();}});
-    }
-
     // 鑾峰彇鍑哄簱鍙�
     function getOutBound(){
         $.ajax({
@@ -141,22 +101,24 @@
             }
         })
     }
-})
 
-// 鎻愬彇鐗╂枡
-var locDetlLayerIdx;
-function getLocDetl() {
-    locDetlLayerIdx = layer.open({
-        type: 2,
-        title: '鎻愬彇鍑鸿揣鍐呭',
-        maxmin: true,
-        area: [top.detailWidth, top.detailHeight],
-        shadeClose: true,
-        content: 'locDetlCheckQuery.html',
-        success: function(layero, index){
-        }
-    });
-}
+    $(document).on('click','#mat-query', function () {
+        let loadIndex = layer.msg('璇锋眰涓�...', {icon: 16, shade: 0.01, time: false});
+        locDetlLayerIdx = layer.open({
+            type: 2,
+            title: false,
+            closeBtn: false,
+            maxmin: false,
+            area: ['90%', '85%'],
+            shadeClose: true,
+            content: 'locDetlCheckQuery.html',
+            success: function(layero, index){
+                layer.close(loadIndex);
+            }
+        });
+    })
+
+})
 
 // 娣诲姞琛ㄦ牸鏁版嵁
 function addTableData(data) {
diff --git a/src/main/webapp/static/js/pakStore/pakStore.js b/src/main/webapp/static/js/pakStore/pakStore.js
index cdfcffd..7339689 100644
--- a/src/main/webapp/static/js/pakStore/pakStore.js
+++ b/src/main/webapp/static/js/pakStore/pakStore.js
@@ -148,6 +148,7 @@
 
     // 鎻愬彇鐗╂枡
     $(document).on('click','#mat-query', function () {
+        let loadIndex = layer.msg('璇锋眰涓�...', {icon: 16, shade: 0.01, time: false});
         matCodeLayerIdx = admin.open({
             type: 2,
             title: false,
@@ -157,6 +158,7 @@
             shadeClose: true,
             content: 'matQuery.html',
             success: function(layero, index){
+                layer.close(loadIndex);
             }
         });
     })
diff --git a/src/main/webapp/static/js/pakStore/stockOut.js b/src/main/webapp/static/js/pakStore/stockOut.js
index dc21d99..dfbb2e7 100644
--- a/src/main/webapp/static/js/pakStore/stockOut.js
+++ b/src/main/webapp/static/js/pakStore/stockOut.js
@@ -137,6 +137,7 @@
 
 
     $(document).on('click','#mat-query', function () {
+        let loadIndex = layer.msg('璇锋眰涓�...', {icon: 16, shade: 0.01, time: false});
         locDetlLayerIdx = layer.open({
             type: 2,
             title: false,
@@ -146,6 +147,7 @@
             shadeClose: true,
             content: 'locDetlQuery.html',
             success: function(layero, index){
+                layer.close(loadIndex);
             }
         });
     })
diff --git a/src/main/webapp/views/pakStore/locCheckOut.html b/src/main/webapp/views/pakStore/locCheckOut.html
index 4e04c5c..b727b61 100644
--- a/src/main/webapp/views/pakStore/locCheckOut.html
+++ b/src/main/webapp/views/pakStore/locCheckOut.html
@@ -54,7 +54,7 @@
         }
         .function-btn {
             font-size: 16px;
-            padding: 1px 1px 1px 1px;
+            padding: 1px 2px;
             width: 100px;
             height: 50px;
             border-color: #2b425b;
@@ -64,7 +64,7 @@
             border-style: solid;
             transition: 0.4s;
             cursor: pointer;
-            letter-spacing: 3px;
+            letter-spacing: 1.5px;
         }
         .function-btn:hover {
             background-color: #2b425b;
@@ -83,7 +83,7 @@
 
 <!-- 鍔熻兘鍖� -->
 <div class="function-area">
-    <button id="mat-query" class="function-btn" onclick="getLocDetl()">鏂板</button>
+    <button id="mat-query" class="function-btn">鎻愬彇搴撳瓨</button>
 </div>
 
 <hr>
@@ -96,7 +96,7 @@
         <div class="layui-form">
             <div class="layui-btn-container">
                 <!-- 1.閫夋嫨鍑哄簱鍙� -->
-                <span id="staNoSpan">鍑哄簱鍙o細</span>
+                <span id="staNoSpan">鐩樼偣绔欙細</span>
                 <select id="staNoSelect" lay-verify="required">
                     <option value="">璇烽�夋嫨绔欑偣</option>
                 </select>
diff --git a/src/main/webapp/views/pakStore/locDetlCheckQuery.html b/src/main/webapp/views/pakStore/locDetlCheckQuery.html
index 95fd76a..71fcf1f 100644
--- a/src/main/webapp/views/pakStore/locDetlCheckQuery.html
+++ b/src/main/webapp/views/pakStore/locDetlCheckQuery.html
@@ -7,6 +7,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
     <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all">
     <link rel="stylesheet" href="../../static/css/cool.css" media="all">
     <link rel="stylesheet" href="../../static/css/common.css" media="all">
     <style>
@@ -93,11 +94,10 @@
 </body>
 <script>
 
-    var pageCurr;
     function getCol() {
-        var cols = [
-            {type: 'checkbox'}
-            ,{field: 'locNo$', align: 'center',title: '搴撲綅鍙�'}
+        let cols = [
+            {type: 'checkbox', merge: ['locNo']}
+            ,{field: 'locNo', align: 'center',title: '搴撲綅鍙�', merge: true, style: 'font-weight: bold'}
         ];
         cols.push.apply(cols, detlCols);
         cols.push({field: 'modiUser$', align: 'center',title: '淇敼浜哄憳', hide: true}
@@ -105,12 +105,17 @@
         return cols;
     }
 
-    layui.use(['table','laydate', 'form'], function() {
+    layui.config({
+        base: baseUrl + "/static/layui/lay/modules/"
+    }).use(['table','laydate', 'form', 'admin', 'tableMerge'], function() {
         var table = layui.table;
         var $ = layui.jquery;
         var layer = layui.layer;
         var layDate = layui.laydate;
         var form = layui.form;
+        var admin = layui.admin;
+        var tableMerge = layui.tableMerge;
+
         // 鏁版嵁娓叉煋
         locDetlTableIns = table.render({
             elem: '#stockOut',
@@ -139,12 +144,10 @@
                 statusCode: 200
             },
             done: function(res, curr, count) {
+                tableMerge.render(this);
                 if (res.code === 403) {
                     top.location.href = baseUrl+"/";
                 }
-                pageCurr=curr;
-                $('.layui-form-checkbox').css("pointer-events", "none");
-                $('td[data-field="0').css("cursor", "pointer")
             }
         });
 
@@ -185,14 +188,6 @@
 
         // 鎼滅储鏍忔悳绱簨浠�
         form.on('submit(search)', function (data) {
-            pageCurr = 1;
-            tableReload();
-        });
-
-        // 鎼滅储鏍忛噸缃簨浠�
-        form.on('submit(reset)', function (data) {
-            pageCurr = 1;
-            clearFormVal($('#search-box'));
             tableReload();
         });
 
@@ -203,38 +198,13 @@
         });
     })
 
-    var b = true;
-    $(function(){
-        $(document.body).on('click','td[data-field="0"]',function(){
-            var locNo = $(this).next().children("div").html();
-            if (b) {
-                b = false;
-                $("tr td[data-field=locNo\\$] div:contains("+ locNo +")").parent().prev().children().children("div").click();
-                setTimeout(function () {
-                    b = true;
-                }, 200)
-            }
-        });
-    })
-
-    function tableReload(child) {
+    function tableReload() {
         var searchData = {};
         $.each($('#search-box [name]').serializeArray(), function() {
             searchData[this.name] = this.value;
         });
         locDetlTableIns.reload({
-            where: searchData,
-            page: {
-                curr: pageCurr
-            },
-            done: function (res, curr, count) {
-                if (res.code === 403) {
-                    top.location.href = baseUrl+"/";
-                }
-                pageCurr=curr;
-                $('.layui-form-checkbox').css("pointer-events", "none");
-                $('td[data-field="0').css("cursor", "pointer")
-            }
+            where: searchData
         });
     }
 

--
Gitblit v1.9.1