From 2a9bf520f65e85777fff0f20f4c84ba9a810eef5 Mon Sep 17 00:00:00 2001
From: yyk <2336760928@qq.com>
Date: 星期四, 29 八月 2024 13:54:46 +0800
Subject: [PATCH] Merge branch 'yyk'

---
 Pda/View/SoSetting/pingKuOut.html |   96 ++++++++++++++++++++++++++++++++++-------------
 1 files changed, 69 insertions(+), 27 deletions(-)

diff --git a/Pda/View/SoSetting/pingKuOut.html b/Pda/View/SoSetting/pingKuOut.html
index e8c5d73..3f8ed4a 100644
--- a/Pda/View/SoSetting/pingKuOut.html
+++ b/Pda/View/SoSetting/pingKuOut.html
@@ -175,37 +175,71 @@
 				}
 				GetBoxInfo();
 			});
+
+			$("#selectDiv").click(function () {
+				var input = $('select[id="bar"]').next().find('.layui-select-title input')
+				var val = input.val()
+				//鍏堟洿鏂颁竴涓嬪嚭搴撳崟
+				updateBillList(function (data) {
+					$('select[id="bar"]').next().addClass('layui-form-selected')
+
+					$('select[id="bar"]').next().find('.layui-select-title input').val(val)
+				})
+			})
 			//鍒濆鍖栨覆鏌� 鍑哄簱鍗�
 			function updateBillList() {
 				$("#bar").empty()
 				$("#bar").append('<option value =>' + '</option>');
 				form.render('select');
-
-				var param = {
-					PalletNo: $("#PalletNo").val(),
-					Type: "1",
-				};
-				synData(IP + "/PdaSo/GetRunSoNoticeList", param, 'post', function (res) {
-					console.log(res);
-
-					if (res.code == 0) { //鎴愬姛
-						console.log(res.data);
-						for (var i = 0; i < res.data.length; i++) {
-							if (i == 0) {
-								$("#bar").append('<option value =' + res.data[i] + ' selected>' + res.data[i] + '</option>');
-							} else {
-								$("#bar").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>');
+				var PalletNo =  $("#PalletNo").val();
+				if(PalletNo == null && PalletNo == ""){ //涓嬫媺妗嗚幏鍙栧钩搴撳嚭搴撳崟
+					synData(IP + "/PdaSo/GetSoNoticeList", 'post', function (res) {
+						console.log(res);
+						if (res.code == 0) { //鎴愬姛
+							console.log(res.data);
+							for (var i = 0; i < res.data.length; i++) {
+								if (i == 0) {
+									$("#bar").append('<option value =' + res.data[i] + ' selected>' + res.data[i] + '</option>');
+								} else {
+									$("#bar").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>');
+								}
 							}
-						}
-						form.render('select');
+							form.render('select');
 
-					} else { //涓嶆垚鍔�
-						layer.msg(res.msg, {
-							icon: 2,
-							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-						});
-					}
-				});
+						} else { //涓嶆垚鍔�
+							layer.msg(res.msg, {
+								icon: 2,
+								time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+							});
+						}
+					});
+				}else{//鏍规嵁鎵樼洏鍙疯幏鍙栧嚭搴撳崟
+					var param = {
+						PalletNo: $("#PalletNo").val(),
+						Type: "1",
+					};
+					synData(IP + "/PdaSo/GetRunSoNoticeList", param, 'post', function (res) {
+						console.log(res);
+
+						if (res.code == 0) { //鎴愬姛
+							console.log(res.data);
+							for (var i = 0; i < res.data.length; i++) {
+								if (i == 0) {
+									$("#bar").append('<option value =' + res.data[i] + ' selected>' + res.data[i] + '</option>');
+								} else {
+									$("#bar").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>');
+								}
+							}
+							form.render('select');
+
+						} else { //涓嶆垚鍔�
+							layer.msg(res.msg, {
+								icon: 2,
+								time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+							});
+						}
+					});
+				}
 			}
 
 			//鑾峰彇鎵樼洏鐗╂枡鍚嶇粏
@@ -277,12 +311,10 @@
 
 			//妫�鏌ユ墭鐩樼姸鎬�
 			function checkPalletState() {
-
 				var param = {
 					"PalletNo": $("#PalletNo").val()
 				}
 				synData(IP + "/PdaSo/IsEnableOkPalletNo", param, 'post', function (res) {
-					console.log("AAA");
 					console.log(res);
 
 					if (res.code == 0) { //鎴愬姛 
@@ -304,11 +336,21 @@
 
 			//褰撴墭鐩樻潯鐮佽緭鍏ユ澶卞幓鐒︾偣鏃�,妫�鏌ヤ竴涓嬫墭鐩樼姸鎬�
 			$("#PalletNo").blur(function () {
-				checkPalletState()
+				if ($("#PalletNo").val().length == 8) {
+					checkPalletState()
+				}
+				
 			})
 
 			$("#PalletNo").keydown(function (e) {
 				if (e.keyCode === 13) {
+					if ($("#PalletNo").val().length != 8) {
+						layer.msg('璇疯緭鍏ユ纭殑鎵樼洏鏉$爜', {
+							icon: 2,
+							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						});
+						return;
+					}
 					checkPalletState();
 				}
 			});

--
Gitblit v1.8.0