From b7e08df5a07b3fa832a46ecc31983e16f2bccc8c Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期一, 24 七月 2023 14:56:01 +0800
Subject: [PATCH] # 出库作业,和库存明细管理 排序

---
 src/main/webapp/views/pda/comb.html |   35 +++++++++++++++++++++++------------
 1 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/src/main/webapp/views/pda/comb.html b/src/main/webapp/views/pda/comb.html
index 4f06e8f..5a324f5 100644
--- a/src/main/webapp/views/pda/comb.html
+++ b/src/main/webapp/views/pda/comb.html
@@ -19,8 +19,8 @@
 <!-- 澶撮儴 -->
 <header>
     <div class="layui-input-inline">
-        <label class="layui-form-label">鏉$爜</label>
-        <input class="layui-input" type="text" id="code" placeholder="鎵爜 / 杈撳叆" autocomplete="off">
+        <label class="layui-form-label">鎵樼洏鐮�</label>
+        <input class="layui-input" type="number" id="code" onkeyup="findCode(this)" oninput="if(value.length>8)value=value.slice(0,8)" placeholder="鎵爜 / 杈撳叆" autocomplete="off">
     </div>
     <div style="margin: 5px 5px">
         <button id="mat-btn" type="button" class="layui-btn layui-btn-normal" onclick="getMat()"><i class="layui-icon">+</i>鎻愬彇</button>
@@ -55,8 +55,11 @@
             cellMinWidth: 50,
             cols: [[
                 {fixed: 'left', align: 'center', field: 'count', title: '鏁伴噺', style:'color: blue', width:50},
-                {field: 'matNo', align: 'center', title: '鐗╂枡缂栫爜'},
-                {field: 'matName', align: 'center', title: '鐗╂枡鍚嶇О'}
+                {field: 'matNo', align: 'center', title: '浜у搧浠e彿'},
+                {field: 'matName', align: 'center', title: '浜у搧鍚嶇О'},
+                {field: 'supplier', align: 'center', title: '鎵瑰彿'},
+                {field: 'memo', align: 'center', title: '鐢熶骇鏃ユ湡'}
+                
             ]],
             done: function (res, curr, count) {
             }
@@ -66,11 +69,18 @@
 
     window.onload = function(){document.getElementById("code").focus();}
 
+    function findCode(el) {
+        if (el.value.length === 8) {
+            $('#mat-btn').focus();
+            getMat();
+        }
+    }
+
     var matCodeLayerIdx;
     function getMat() {
         matCodeLayerIdx = layer.open({
             type: 2,
-            title: '鎻愬彇鐗╂枡',
+            title: '鎻愬彇浜у搧',
             shade: [0.3,'#000'],
             area: ['90%', '80%'],
             content: 'matQuery.html',
@@ -87,12 +97,12 @@
     var matData = [];
     function addTableData(data) {
         if (isEmpty(data.matName)){
-            tips("鎻愬彇澶辫触");
+            tips("鎻愬彇澶辫触", true);
             return;
         }
         let toPush = true;
         for (var j=0;j<matData.length;j++){
-            if (data.matNo === matData[j].matNo) {
+            if (data.matNo === matData[j].matNo && data.supplier === matData[j].supplier) {
                 matData[j].count = Number(matData[j].count) + Number(data.count);
                 toPush  = false;
             }
@@ -109,7 +119,6 @@
         $('#code').val("");
         matData = [];
         tableIns.reload({data: matData});
-        tips("");
     }
 
     // 缁勬墭
@@ -125,7 +134,7 @@
             return;
         }
         if (matData.length === 0) {
-            tips("璇锋彁鍙栫墿鏂�", true);
+            tips("璇锋彁鍙栦骇鍝�", true);
             return;
         }
         $.ajax({
@@ -157,9 +166,10 @@
      * @param warn true锛氱孩鑹插瓧浣�
      */
     function tips(msg, warn) {
-        let tips = $('#tips');
-        tips.html(msg);
-        tips.css("color", warn?"red":'#666');
+        // var tips = $('#tips');
+        // tips.html(msg);
+        // tips.css("color", warn?"red":'#666');
+        layer.msg(msg, {icon: warn?2:1})
     }
 
     document.onkeyup = function (e) {
@@ -170,6 +180,7 @@
             $("#comb-btn").focus();
             comb();
         } else if (key === 113) {
+            $("#code").val("");
             $("#code").focus();
         }
     }

--
Gitblit v1.9.1