From af73aff35be4607dd22232d5695e30ca3059c436 Mon Sep 17 00:00:00 2001
From: zhaowc <526854230@qq.com>
Date: 星期二, 01 四月 2025 15:58:21 +0800
Subject: [PATCH] PDA的2个拣货页面修改

---
 Pda/View/SoSetting/productOut.html |  204 +++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 188 insertions(+), 16 deletions(-)

diff --git a/Pda/View/SoSetting/productOut.html b/Pda/View/SoSetting/productOut.html
index 78e1a8b..b18023e 100644
--- a/Pda/View/SoSetting/productOut.html
+++ b/Pda/View/SoSetting/productOut.html
@@ -169,12 +169,14 @@
 				</ul>
 			</div>
 
-			<ul>
+			<!-- <ul>
                 <li id="option1">鏍囩</li>
                 <li id="option2">鏁伴噺</li>
-            </ul>
+            </ul> -->
 
-            <br />
+			<button id="option1" class="layout-btn" type="button">鏍囩</button>
+            <button id="option2" class="layout-btn" type="button">鏁伴噺</button>
+            <br /><br />
 
 			<!-- 鏈夌爜 -->
 			<div id="content1">
@@ -260,6 +262,11 @@
 								<input type="checkbox" name="IsZhengTuo" id="IsZhengTuo" lay-skin="switch" lay-text="鏄瘄鍚�"
 									lay-filter="IsZhengTuo">
 							</div>
+							<label class="layui-form-label" lang>鏄惁杩炵画鎷h揣锛�</label>
+							<div class="layui-input-block">
+								<input type="checkbox" name="IsCheckCon" id="IsCheckCon" lay-skin="switch" lay-text="鏄瘄鍚�"
+									lay-filter="IsCheckCon">
+							</div>
 						</div>
 						<div id="BoxDIv" class="layout-tab-page">
 							<table class="layout-tab-content" border="" cellspacing="" cellpadding="">
@@ -292,6 +299,17 @@
 											<div class="layui-input-block">
 												<input id="boxNo3" type="text" lang langholder placeholder="璇锋壂鎻忚拷婧潯鐮�"
 													autocomplete="off" class="layui-input">
+											</div>
+										</div>
+									</td>
+								</tr>
+								<tr class="divPickQty1">
+									<td>
+										<div class="layui-form-item layout-input" style="margin-top: 6px;">
+											<label class="layui-form-label lableWidth">鎷h揣鏁伴噺锛�</label>
+											<div class="layui-input-block">
+												<input id="pickQty1" type="text" placeholder="璇疯緭鍏ユ嫞璐ф暟閲�"autocomplete="off" 
+													class="layui-input" >
 											</div>
 										</div>
 									</td>
@@ -332,6 +350,17 @@
 													</div>
 												</td> -->
 											</tr>
+											<tr>
+												<td>
+												   <div class="layui-form-item ">
+													   <label class="layui-form-label lableWidth">鎵樼洏涓婃暟閲忥細</label>
+													   <div class="layui-input-block">
+														   <input id="palletNoqty" class="layui-input" style="border: 0;"
+															   type="text" lay-verify="" disabled placeholder="">
+													   </div>
+												   </div>
+											   </td> 
+										   </tr>
 										</table>
 									</td>
 								</tr>
@@ -496,9 +525,9 @@
 											<label class="layui-form-label lableWidth" >鎷h揣鏁伴噺锛�</label>
 											<div id="" class="local-input">
 												<div class="layui-input-block">
-													<input id="pickQty2" type="number" placeholder="璇疯緭鍏ユ嫞璐ф暟閲�"
+													<input id="pickQty2" type="text" placeholder="璇疯緭鍏ユ嫞璐ф暟閲�"
 														autocomplete="off" class="layui-input" style="padding-left:0.1rem;"
-														oninput="value=value.replace(/^(0+)|[^\d]+/g,'')">
+														>
 												</div>
 											</div>
 											<div id="" class="local-ok">
@@ -567,18 +596,18 @@
 
 			 var xianshiyemian = 0;
 
-			$('#option1').attr("style", "background-color: aqua;width: 45.77%;float: left;text-align: center;"); //閫変腑鍚庨鑹�
-			$('#option2').attr("style", "background-color: #999;width: 45.77%;float: right;text-align: center;"); //榛樿棰滆壊
+			$('#option1').attr("style", "background-color: red;width: 50%;float: left;text-align: center;"); //閫変腑鍚庨鑹�
+			$('#option2').attr("style", "background-color: #999;width: 50%;float: right;text-align: center;"); //榛樿棰滆壊
 			$('#content2').hide();
 			$(document).ready(function () {
 				$('#option1').click(function () {
 					// qingkong();
 					xianshiyemian = 0;
 					$('#content1').show();
-					$('#option1').attr("style", "background-color: aqua;width: 45.77%;float: left;text-align: center;"); //閫変腑鍚庨鑹�
+					$('#option1').attr("style", "background-color: red;width: 50%;float: left;text-align: center;"); //閫変腑鍚庨鑹�
 
 					$('#content2').hide();
-					$('#option2').attr("style", "background-color: #999;width: 45.77%;float: right;text-align: center;"); //榛樿棰滆壊
+					$('#option2').attr("style", "background-color: #999;width: 50%;float: right;text-align: center;"); //榛樿棰滆壊
 					$("#palletNo").focus();//鍏夋爣榛樿閫変腑
 				});
 
@@ -586,10 +615,10 @@
 					// qingkong();
 					xianshiyemian = 1;
 					$('#content1').hide();
-					$('#option1').attr("style", "background-color: #999;width: 45.77%;float: left;text-align: center;"); //榛樿棰滆壊
+					$('#option1').attr("style", "background-color: #999;width: 50%;float: left;text-align: center;"); //榛樿棰滆壊
 
 					$('#content2').show();
-					$('#option2').attr("style", "background-color: aqua;width: 45.77%;float: right;text-align: center;"); //閫変腑鍚庨鑹�
+					$('#option2').attr("style", "background-color: red;width: 50%;float: right;text-align: center;"); //閫変腑鍚庨鑹�
 					$("#palletNo2").focus();//鍏夋爣榛樿閫変腑
 				});
 			});
@@ -599,11 +628,25 @@
 			var curPageIndex = 1
 			//鏄惁鏁存墭鎷h揣
 			var isContinue = "0";
+			var isConCheck = "0";
 			var tableData = null
 			var tableData2 = null
 			var canPickBox = true
 			$("#palletNo").focus();//鍏夋爣榛樿閫変腑		
 
+
+			function clear5()
+			{
+				$('#outModel').val("");//鍑哄簱鍙�
+				$('#standard').val("");//瑙勬牸
+
+				$('#pickQty').val("");//寰呮嫞鏁伴噺
+				$('#pickedQty').val("");//宸叉嫞鏁伴噺
+				$('#palletNoqty').val("");//宸叉嫞鏁伴噺
+				
+				$('#boxNo').val("");//绠辩爜
+				$('#boxQty').val("");//鎵樼洏涓婃暟閲�
+			}
 			function clear1() {
 				$('#outModel').val("");//鍑哄簱鍙�
 				$('#standard').val("");//瑙勬牸
@@ -648,6 +691,16 @@
 				$('#boxNo').val("");
 				$('#boxNo3').val("");
 			});
+			
+			form.on('switch(IsCheckCon)', function (obj) {
+				if (obj.elem.checked) {
+					isConCheck="1";
+				} else {					
+					isConCheck="0";
+				}
+				$('#boxNo').val("");
+				$('#boxNo3').val("");
+			});
 
 			//绠辩爜鏂囨湰妗嗗洖杞︿簨浠�
 			$("#boxNo").blur(function () {
@@ -664,7 +717,7 @@
 
 			//妫�鏌ユ墭鐩樼姸鎬�
 			function checkPalletState() {
-
+				
 				var param = {
 					"PalletNo": $("#palletNo").val()
 				}
@@ -761,9 +814,22 @@
 							icon: 2,
 							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
 						});
+						clear5;
+						
+						$("#palletNo").val("");//鎵樼洏鍙�
+						$("#pickQty1").val("");//鎵樼洏鍙�
+						
+						$("#planQty").val("");  //璁″垝鏁伴噺
+						$("#finishQty").val("");//瀹屾垚鏁伴噺
+						//鐗╂枡鎵规
+						$("#skuLotNo").empty();
+						$("#skuLotNo").append('<option value =>' + '</option>');
+						form.render('select');
 					}
 				});
 			}
+
+			
 
 			//鍒濆鍖栨覆鏌� 鐗╂枡-鎵规
 			function updateSkuLotNoList() {
@@ -832,6 +898,10 @@
 						$('#pickQty').val(res.data.PickQty);
 						$('#pickedQty').val(res.data.PickedQty);
 					} else { //涓嶆垚鍔�
+						if($("#planQty").val() == $("#finishQty").val() || $('#pickQty').val() == $('#pickedQty').val())
+						{
+							return;
+						}
 						layer.msg(res.msg, {
 							icon: 2,
 							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
@@ -853,6 +923,7 @@
 
 				console.log(list != null);
 				console.log(list);
+				let pallnono = 0;
 				if (list != null && list.length > 0) { //鎴愬姛
 
 					var arrTrs = new Array()
@@ -869,6 +940,7 @@
 						tr.find("td[name='boxNo']").html(list[i].BoxNo); 
 						tr.find("td[name='qty']").html(list[i].Qty);
 						tr.find("td[name='pickedQty']").html(list[i].PickedQty);
+						pallnono = pallnono + list[i].Qty;
 
 						tr.show();
 						arrTrs[i] = tr
@@ -884,10 +956,15 @@
 					// $("#boxNum").val(0)
 					setPages(1, 0)
 				}
+				$("#palletNoqty").val(pallnono)
 			}
 
 			//鑾峰彇鎵樼洏鐗╂枡鍚嶇粏
 			function GetBoxInfo() { 
+				if ($('#pickQty').val() == $('#pickedQty').val())
+				{
+					return;
+				}
 				let param2 = {
 					"SoDetailId": $("#skuLotNo").val(),
 					"PalletNo": $("#palletNo").val(),
@@ -900,6 +977,10 @@
 
 						refreshTable(tableData)
 					} else {
+						// $("#planQty").val();  //璁″垝鏁伴噺
+						// $("#finishQty").val();//瀹屾垚鏁伴噺
+						// console.info($("#planQty").val(),$("#finishQty").val())
+						
 						layer.msg(res.msg, {
 							icon: 2,
 							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
@@ -943,7 +1024,50 @@
 						});
 						return;
 					}
-				}				
+					if(($('#boxNo3').val() != "" && ($('#pickQty1').val() != "" || $('#pickQty1').val() != 0))){
+						layer.msg("杩芥函鏉$爜鍜屾嫞璐ф暟閲忎笉鑳藉悓鏃惰緭鍏ワ紒", {
+							icon: 2,
+							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						});
+						return;
+					}
+					if($('#pickQty1').val() != "" && $('#pickQty1').val()>parseFloat($('#pickQty').val())){
+						layer.msg("鎷h揣鏁伴噺涓嶈兘澶т簬寰呮嫞鏁伴噺锛�", {
+							icon: 2,
+							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						});
+						return;
+					}
+				}	
+				if(isConCheck=="0"){
+					if ($('#boxNo').val() == "") {
+						layer.msg("璇疯緭鍏ョ鐮�", {
+							icon: 2,
+							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						}); return;
+					}
+					if ($('#boxQty').val() == "") {
+						layer.msg("绠卞唴鏁伴噺涓虹┖锛屼笉鑳芥嫞璐�", {
+							icon: 2,
+							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						});
+						return;
+					}
+					if(($('#boxNo3').val() != "" && ($('#pickQty1').val() != "" || $('#pickQty1').val() != 0))){
+						layer.msg("杩芥函鏉$爜鍜屾嫞璐ф暟閲忎笉鑳藉悓鏃惰緭鍏ワ紒", {
+							icon: 2,
+							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						});
+						return;
+					}
+					if($('#pickQty1').val() != "" && $('#pickQty1').val()>parseFloat($('#pickQty').val())){
+						layer.msg("鎷h揣鏁伴噺涓嶈兘澶т簬寰呮嫞鏁伴噺锛�", {
+							icon: 2,
+							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						});
+						return;
+					}
+				}			
 				// let boxQty = parseInt($('#boxQty').val())
 				// let qty = parseInt($('#qty').val()) 
 				// if (qty <= 0 || qty > boxQty) {
@@ -970,12 +1094,30 @@
 
 			//纭鎷h揣 
 			function reqPickScatter() {
+				if($('#pickQty1').val()!= "" && $('#pickQty1').val()!= undefined){
+					// var reg = /^[1-9]\d*(\.\d{1,4})?$|^0\.\d{1,4}[1-9]\d*$/;
+					// if (!reg.test($("#pickQty1").val())) {
+					// 	layer.msg("鏁伴噺蹇呴』澶т簬0(鍙繚鐣�4浣嶅皬鏁�)", {
+					// 		icon: 2,
+					// 		time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+					// 	});
+					// 	return -1;
+					// }
+					if (!($('#pickQty1').val()>0)) {
+						layer.msg("鏁伴噺蹇呴』澶т簬0(鍙繚鐣�4浣嶅皬鏁�)", {
+							icon: 2,
+							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						});
+						return -1;
+					}
+				}
 				var param = {
 					"SoNo": $("#bar").val(),
 					"SoDetailId": $("#skuLotNo").val(),
 					"PalletNo": $('#palletNo').val(),
 					"BoxNo": $('#boxNo').val(),
 					"BoxNo3": $('#boxNo3').val(),
+					"PickQty":$('#pickQty1').val()
 				}
 				sendData(IP + "/PdaSo/SoSetPick", param, 'post', function (res) {
 					//console.log(res);
@@ -1222,6 +1364,7 @@
 				var param = {
 					PalletNo: $("#palletNo2").val(),
 				};
+				
 				synData(IP + "/PdaSo/GetRunSoNoticeList", param, 'post', function (res) {
 					if (res.code == 0) { //鎴愬姛
 						console.log(res.data);
@@ -1234,11 +1377,15 @@
 						}
 						form.render('select');
 
-					} else { //涓嶆垚鍔�
+					}
+					else
+					 { //涓嶆垚鍔�
+						
 						layer.msg(res.msg, {
 							icon: 2,
 							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
 						});
+						
 					}
 				});
 			}
@@ -1319,6 +1466,10 @@
 						$('#pickQty2').val(res.data.PickQty - res.data.PickedQty);
 						$('#pickedQty2').val(res.data.PickedQty);
 					} else { //涓嶆垚鍔�
+						if($("#planQty").val() == $("#finishQty").val() || $('#pickQty').val() == $('#pickedQty').val())
+						{
+							return;
+						}
 						layer.msg(res.msg, {
 							icon: 2,
 							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
@@ -1330,6 +1481,10 @@
 
 			//鑾峰彇鎵樼洏鐗╂枡鍚嶇粏
 			function GetDataInfo() { 
+				if ($("#planQty").val() == $("#finishQty").val())
+				{
+					return;
+				}
 				let param2 = {
 					"SoDetailId": $("#skuLotNo2").val(),
 					"PalletNo": $("#palletNo2").val(),
@@ -1415,8 +1570,8 @@
 						time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
 					}); return;
 				}			
-				let pickedQty = parseInt($('#pickedQty2').val()) //宸叉嫞鏁伴噺
-				let pickQty = parseInt($('#pickQty2').val())  //鎷h揣鏁伴噺
+				let pickedQty = parseFloat($('#pickedQty2').val()) //宸叉嫞鏁伴噺
+				let pickQty = parseFloat($('#pickQty2').val())  //鎷h揣鏁伴噺
 				if (pickQty <= 0) {
 					layer.msg("鎷h揣鏁伴噺闇�澶т簬0", {
 						icon: 2,
@@ -1441,6 +1596,23 @@
 
 			//纭鎷h揣 
 			function reqPickScatter2() {
+				if($('#pickQty2').val()!= "" && $('#pickQty2').val()!= undefined){
+					// var reg = /^[1-9]\d*(\.\d{1,4})?$|^0\.\d{1,4}[1-9]\d*$/;
+					// if (!reg.test($("#pickQty2").val())) {
+					// 	layer.msg("鏁伴噺蹇呴』澶т簬0(鍙繚鐣�4浣嶅皬鏁�)", {
+					// 		icon: 2,
+					// 		time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+					// 	});
+					// 	return -1;
+					// }
+					if (!($('#pickQty2').val()>0)) {
+						layer.msg("鏁伴噺蹇呴』澶т簬0(鍙繚鐣�4浣嶅皬鏁�)", {
+							icon: 2,
+							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						});
+						return -1;
+					}
+				}
 				var param = {
 					"SoNo": $("#bar2").val(),
 					"SoDetailId": $("#skuLotNo2").val(),

--
Gitblit v1.8.0