From 34e3301ff24f10100dae8c9b4b98cafef1b6a653 Mon Sep 17 00:00:00 2001
From: jiazx0107@163.com <jiazx0107@163.com>
Date: 星期日, 25 六月 2023 21:17:51 +0800
Subject: [PATCH] 出入库流程优化-入库详单优化

---
 igds-inout/src/main/java/com/ld/igds/inout/view/InoutList.js |   41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/igds-inout/src/main/java/com/ld/igds/inout/view/InoutList.js b/igds-inout/src/main/java/com/ld/igds/inout/view/InoutList.js
index 393ca23..b92b4da 100644
--- a/igds-inout/src/main/java/com/ld/igds/inout/view/InoutList.js
+++ b/igds-inout/src/main/java/com/ld/igds/inout/view/InoutList.js
@@ -86,4 +86,45 @@
 //鎵撳嵃缁撶畻鍗�
 printPay = function(){
 	$alert("鎵撳嵃妯$増鏈畾涔夆�︹��");
+};
+
+
+/**
+ * 鑷姩璁$畻
+ * @param name
+ */
+deAutoByWeight = function(name){
+	
+	if(null == name) name = "1";
+	
+	var curData = view.get("#dsMain.data:#");
+	var fullWeight = curData.get("fullWeight");
+	var emptyWeight = curData.get("emptyWeight");
+	
+	if(fullWeight == 0 || emptyWeight == 0){
+		return;
+	}
+	// 鍑�閲�
+	var netWeight = Number(fullWeight) - Number(emptyWeight);
+	
+	if (netWeight <= 0){
+		$notify("鍑�閲嶅皬浜�0锛屽綋鍓嶇О閲嶅瓨鍦ㄩ�昏緫闂");
+		return;
+	}
+	
+	 //鎵i噸淇℃伅
+    var deHandle = curData.get("deHandle"), deCheck = curData.get("deCheck"), dePackage = curData.get("dePackage"), addCheck = curData.get("addCheck");
+	
+    var deSum = Number(deHandle) +  Number(deCheck) + Number(dePackage);
+    
+    
+    /** 鍏ュ簱閲嶉噺 = 鍑�閲� - 鎬绘墸閲�  */
+    recordWeight = Number(netWeight) - Number(deSum);
+	
+    /** 缁撶畻閲嶉噺 = 鍑�閲� - 鎬绘墸閲� + 澧為噸 */
+    settleWeight = Number(netWeight) - Number(deSum) + Number(addCheck);
+	
+	curData.set("netWeight",netWeight);
+	curData.set("settleWeight",settleWeight);
+	curData.set("recordWeight",recordWeight);
 };
\ No newline at end of file

--
Gitblit v1.9.3