From 1d5b60515b80cf400b214a5f565792c212fe6f2e Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期四, 28 三月 2024 13:52:12 +0800
Subject: [PATCH] Merge branch 'demo' of http://47.97.1.152:5880/r/wms_app into demo

---
 static/js/util.js |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/static/js/util.js b/static/js/util.js
new file mode 100644
index 0000000..7e655f6
--- /dev/null
+++ b/static/js/util.js
@@ -0,0 +1,32 @@
+/*
+*	娣诲姞鐗╂枡
+* 	mat -- 鐗╂枡璇︽儏
+* 	matList -- 宸叉坊鍔犵墿鏂�
+* 
+*/
+function matCheck(mat, matList) {
+	// console.log("matList:" + matList);
+	// console.log("mat:" + JSON.stringify(mat));
+	let newMatList = [],
+		add = true;
+	if (matList.length > 0) {
+		for (let item of matList) {
+			if (item.matnr == mat.matnr) {
+				if (item.batch == mat.batch) {
+					add = false
+					item.count = item.count + mat.count
+				} else {
+
+				}
+			}
+
+		}
+	}
+	if (add) {
+		matList.unshift(mat)
+	}
+	return matList
+}
+module.exports = {
+	matCheck: matCheck,
+}
\ No newline at end of file

--
Gitblit v1.9.1