From b9f7560cbe0e562a40e9515a0559a3e951f0fee6 Mon Sep 17 00:00:00 2001
From: zhaowc <526854230@qq.com>
Date: 星期一, 07 四月 2025 09:16:01 +0800
Subject: [PATCH] 问题修改

---
 HTML/views/SOSetting/ExportNoticeEditFrom.html |  133 ++++++++++++++++++++++++-------------------
 1 files changed, 74 insertions(+), 59 deletions(-)

diff --git a/HTML/views/SOSetting/ExportNoticeEditFrom.html b/HTML/views/SOSetting/ExportNoticeEditFrom.html
index a0d29de..8b4de4b 100644
--- a/HTML/views/SOSetting/ExportNoticeEditFrom.html
+++ b/HTML/views/SOSetting/ExportNoticeEditFrom.html
@@ -34,7 +34,7 @@
 							<option value="4">涓嶅悎鏍煎搧鍑哄簱</option>
 							<option value="5">涓棿鍝佸嚭搴�</option>
 							<option value="6">浠e偍鍑哄簱</option>
-							<option value="7">鍏朵粬鍑哄簱</option>
+							<option value="7">鍏跺畠鍑哄簱</option>
 							<option value="8">瀵勫瓨鍑哄簱</option>
 							<!-- 09 -->
 							<!-- <option value="0">鎴愬搧鍑哄簱</option>
@@ -51,7 +51,7 @@
 					</div>
 				</div>
 				<div class="layui-inline">
-					<label class="layui-form-label">瀹㈡埛鍚嶇О</label>
+					<label class="layui-form-label" id="CustomerNamep">瀹㈡埛鍚嶇О</label>
 					<div class="layui-input-inline">
 						<select name="CustomerNo" id="CustomerNo" lay-search>
 							<option value=""></option>
@@ -116,9 +116,8 @@
 				console.log(soNo);
 				console.log(id);
 				// getWareHouseList();
-				getCustomerList();
-				getLogisticsInfoList();
-				getData();
+				
+				getData();//鑾峰彇鍏ュ簱鍗曠被鍨�
 				var arr = []; 
 				window.success = function(data) {
 					refreshTable(data);
@@ -334,6 +333,7 @@
 					}
 					var DataList = [];
 					console.log(infoOptions.data);
+					var reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,4})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
 					for (var i in infoOptions.data) {
 						var exQty = infoOptions.data[i].ExQty+"";
 						console.log(exQty);
@@ -346,39 +346,47 @@
 							return;
 						}
 						
-						if(exQty.indexOf('.')>=0){
-							layer.msg("鍑哄簱鏁伴噺蹇呴』鏄ぇ浜�0鐨勬暣鏁�", {
+						if (!reg.test(exQty)) {
+							layer.msg("鍑哄簱鏁伴噺蹇呴』澶т簬0(鍙繚鐣�4浣嶅皬鏁�)", {
 								icon: 2,
 								time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-							}, function() {});
+							});
 							isrun = 0;
-							return;
+							return ;
 						}
-						if(exQty.indexOf('-')>=0){
-							layer.msg("鍑哄簱鏁伴噺蹇呴』鏄ぇ浜�0鐨勬暣鏁�", {
-								icon: 2,
-								time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-							}, function() {});
-							isrun = 0;
-							return;
-						}
-						if(exQty.charAt(0)=='0'){
-							layer.msg("鍑哄簱鏁伴噺蹇呴』鏄ぇ浜�0鐨勬暣鏁�", {
-								icon: 2,
-								time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-							}, function() {});
-							isrun = 0;
-							return;
-						}
+						// if(exQty.indexOf('.')>=0){
+						// 	layer.msg("鍑哄簱鏁伴噺蹇呴』鏄ぇ浜�0鐨勬暣鏁�", {
+						// 		icon: 2,
+						// 		time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						// 	}, function() {});
+						// 	isrun = 0;
+						// 	return;
+						// }
+						// if(exQty.indexOf('-')>=0){
+						// 	layer.msg("鍑哄簱鏁伴噺蹇呴』鏄ぇ浜�0鐨勬暣鏁�", {
+						// 		icon: 2,
+						// 		time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						// 	}, function() {});
+						// 	isrun = 0;
+						// 	return;
+						// }
+						// if(exQty.charAt(0)=='0'){
+						// 	layer.msg("鍑哄簱鏁伴噺蹇呴』鏄ぇ浜�0鐨勬暣鏁�", {
+						// 		icon: 2,
+						// 		time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						// 	}, function() {});
+						// 	isrun = 0;
+						// 	return;
+						// }
 						
-						if (exQty <= 0) {
-							layer.msg("鍑哄簱鏁伴噺蹇呴』澶т簬0锛�", {
-								icon: 2,
-								time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-							}, function() {});
-							isrun = 0;
-							return;
-						}
+						// if (exQty <= 0) {
+						// 	layer.msg("鍑哄簱鏁伴噺蹇呴』澶т簬0锛�", {
+						// 		icon: 2,
+						// 		time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						// 	}, function() {});
+						// 	isrun = 0;
+						// 	return;
+						// }
 						if (exQty > infoOptions.data[i].Qty) {
 							layer.msg("鍑哄簱鏁伴噺涓嶈兘澶т簬搴撳瓨鏁伴噺锛�", {
 								icon: 2,
@@ -390,7 +398,7 @@
 						var item = {
 							SkuNo: infoOptions.data[i].SkuNo,
 							LotNo: infoOptions.data[i].LotNo,
-							Qty: parseInt(exQty),
+							Qty: parseFloat(exQty),
 							IsBale:infoOptions.data[i].IsBale,
 							IsBelt:infoOptions.data[i].IsBelt,
 						};
@@ -437,11 +445,16 @@
 						if(res.code == 0){
 							console.log(res.data); 
 							$("#Type option[value='"+ res.data.Type+"']").attr("selected", "selected")
-							$("#CustomerNo option[value='"+ res.data.CustomerNo+"']").attr("selected", "selected")
-							$("#LogisticsId option[value='"+ res.data.LogisticsId+"']").attr("selected", "selected")
+							
+							
 							 
 							form.render('select');
 							refreshTable(res.data.Detail);
+
+							//鑾峰彇瀹㈡埛/璐т富
+							getCustomerList(res.data.CustomerNo);
+							//鑾峰彇渚涘簲鍟�
+							getLogisticsInfoList(res.data.LogisticsId);
 						} 
 						else{
 							layer.msg(res.msg, {
@@ -488,32 +501,32 @@
 				// 	});
 				// }
 				//鑾峰彇瀹㈡埛涓嬫媺妗嗕俊鎭�
-				function getCustomerList() {
+				function getCustomerList(customerNo) {
 					sendData(IP + "/Basis/GetCustomerSelect", {}, 'get', function(res) {
 						if (res.code == 0) { //鎴愬姛
+							var TypeNum = 0;
+								
+							switch($("#Type").val())
+							{									
+								case "0": //鎴愬搧鍑哄簱
+									TypeNum = 0;
+									console.log(TypeNum)
+									break;
+								case "1": //棰嗘枡鍑哄簱
+								case "2": //鎶芥鍑哄簱
+								case "3": //鐗╂枡鍙栨牱鍑哄簱
+								case "4": //涓嶅悎鏍煎搧鍑哄簱
+								case "5": //涓棿鍝佸嚭搴�
+								case "6": //浠e偍鍑哄簱
+								case "7": //鍏朵粬鍑哄簱
+								case "8": //瀵勫瓨鍑哄簱
+									TypeNum = 2;
+									console.log('TypeNum:'+ TypeNum)
+									break;
+							}
 							$("#CustomerNo").empty();
 							$("#CustomerNo").append('<option value =""></option>');
-							for (var i = 0; i < res.data.length; i++) {
-								var TypeNum = 0;
-								
-								switch($("#Type").val())
-								{									
-									case "0": //鎴愬搧鍑哄簱
-										TypeNum = 0;
-										console.log(TypeNum)
-										break;
-									case "1": //棰嗘枡鍑哄簱
-									case "2": //鎶芥鍑哄簱
-									case "3": //鐗╂枡鍙栨牱鍑哄簱
-									case "4": //涓嶅悎鏍煎搧鍑哄簱
-									case "5": //涓棿鍝佸嚭搴�
-									case "6": //浠e偍鍑哄簱
-									case "7": //鍏朵粬鍑哄簱
-									case "8": //瀵勫瓨鍑哄簱
-										TypeNum = 2;
-										console.log(TypeNum)
-										break;
-								}
+							for (var i = 0; i < res.data.length; i++) {								
 								//鍒ゆ柇鍗曟嵁绫诲瀷
 								if (TypeNum == 0)
 								{
@@ -543,6 +556,7 @@
 									}
 								}
 							}
+							$("#CustomerNo option[value='"+ customerNo +"']").attr("selected", "selected")
 							form.render('select');
 						} else { //涓嶆垚鍔�
 							layer.msg(res.msg, {
@@ -553,7 +567,7 @@
 					});
 				}
 				//鑾峰彇鐗╂祦鎵胯繍鍟嗕笅鎷夋淇℃伅
-				function getLogisticsInfoList() {
+				function getLogisticsInfoList(logisticsId) {
 					sendData(IP + "/Basis/GetLogisticsInfoSelect", {}, 'get', function(res) {
 						if (res.code == 0) { //鎴愬姛
 							$("#LogisticsId").empty();
@@ -562,6 +576,7 @@
 								$("#LogisticsId").append('<option value =' + res.data[i].Id + '>' + 
 									res.data[i].CarrierName + '</option>');
 							} 
+							$("#LogisticsId option[value='"+logisticsId +"']").attr("selected", "selected")
 							form.render('select');
 						} else { //涓嶆垚鍔�
 							layer.msg(res.msg, {

--
Gitblit v1.8.0