From 04e6352d22eb928700d606bdf4e40e0eb2cfe61b Mon Sep 17 00:00:00 2001
From: mrzhssss <pro6@qq.com>
Date: 星期四, 16 十二月 2021 14:29:26 +0800
Subject: [PATCH] 更新

---
 src/main/webapp/views/pda/combProAgv.html |   40 ++++++++++++++++++++++------------------
 1 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/src/main/webapp/views/pda/combProAgv.html b/src/main/webapp/views/pda/combProAgv.html
index cf49ff0..22aaefc 100644
--- a/src/main/webapp/views/pda/combProAgv.html
+++ b/src/main/webapp/views/pda/combProAgv.html
@@ -286,22 +286,26 @@
 
     // 娣诲姞琛ㄦ牸鏁版嵁
     function addTableData(data) {
-        if (isEmpty(data.matName)){
-            tips("鎻愬彇澶辫触", true);
-            return;
-        }
-        let toPush = true;
-        for (var j=0;j<matData.length;j++){
-            if (data.matNo === matData[j].matNo) {
-                matData[j].count = Number(matData[j].count) + Number(data.count);
-                toPush  = false;
+        for (var i = 0; i < data.length; i++) {
+            var toPush = true;
+            for (var j = 0; j < matData.length; j++) {
+                if (data[i].matNo === matData[j].matNo && data[i].mnemonic === matData[j].mnemonic) {
+                    matData[j].count = Number(matData[j].count) + Number(data[i].count);
+                    toPush = false;
+                }
             }
+            if (toPush) {
+                matData.push(data[i]);
+                sourceData.push({
+                    matNo: data[i].matNo,
+                    count: data[i].count,
+                    supplier: data[i].supplier,
+                    mnemonic: data[i].mnemonic,
+                });
+            }
+            tips("鎻愬彇鎴愬姛");
+            tableIns.reload({data: matData});
         }
-        if (toPush) {
-            matData.push(data);
-        }
-        tips("鎻愬彇鎴愬姛");
-        tableIns.reload({data: matData});
     }
 
 
@@ -320,7 +324,7 @@
             return;
         }
         // 璧嬪�煎墠娓呯┖琛ㄦ牸
-//        matData = [];
+       matData = [];
         tableIns.reload({data: matData});
 
         $.ajax({
@@ -335,9 +339,9 @@
                     if (res.data != null) {
                         addTableData(res.data);
                         // 寤惰繜1绉掑悗娓呯┖閫氱煡鍗曞彿
-                        setTimeout(function () {
-                            $('#billNo').val("");
-                        }, 500);
+                        // setTimeout(function () {
+                        //     $('#billNo').val("");
+                        // }, 500);
                     }
                 } else if (res.code === 403) {
                     top.location.href = baseUrl + "/pda";

--
Gitblit v1.9.1