From 61d59de6417d4109b9b4b857705a90ac8d165d74 Mon Sep 17 00:00:00 2001
From: Administrator <Administrator@DESKTOP-5BIMHQ3>
Date: 星期一, 11 三月 2024 16:57:56 +0800
Subject: [PATCH] 编写AGV转运选择区域时分配储位功能

---
 Pda/View/AsnSetting/productEnter.html |  128 ++++++++++++++++++------------------------
 1 files changed, 55 insertions(+), 73 deletions(-)

diff --git a/Pda/View/AsnSetting/productEnter.html b/Pda/View/AsnSetting/productEnter.html
index f4c2b73..4f60afb 100644
--- a/Pda/View/AsnSetting/productEnter.html
+++ b/Pda/View/AsnSetting/productEnter.html
@@ -46,7 +46,7 @@
 				</ul>
 			</div>
 
-			<div id="zongDiv" class="layout-bill-info" style="height: 335px;">
+			<div id="zongDiv" class="layout-bill-info" style="height: 285px;">
 				<form class="layui-form" action="">
 					<div id="" class="layui-form-item layout-dropdownlist">
 						<label class="layui-form-label" lang>鍏ュ簱鍗曪細</label>
@@ -92,28 +92,6 @@
 						<label class="layui-form-label" lang>灏剧鏉$爜锛�</label>
 						<div class="layui-input-block">
 							<input id="BOXCODE2" type="text" lang langholder placeholder="璇锋壂鎻忓绠辨潯鐮�" autocomplete="off"
-								class="layui-input">
-						</div>
-					</div>
-
-					<div id="" class="layui-form-item layout-input BOX01">
-						<label class="layui-form-label" lang>浜岀骇鏉$爜锛�</label>
-						<div class="layui-input-block">
-							<input id="BOXCODE01" type="text" lang langholder placeholder="璇锋壂鎻忎簩绾ф潯鐮�" autocomplete="off"
-								class="layui-input">
-						</div>
-					</div>
-					<div id="" class="layui-form-item layout-input BOX01">
-						<label class="layui-form-label" lang>浜岀骇杩炵粍锛�</label>
-						<div class="layui-input-block">
-							<input type="checkbox" name="IsLianXu2" id="IsLianXu2" lay-skin="switch" lay-text="鏄瘄鍚�"
-								lay-filter="IsLianXu2">
-						</div>
-					</div>
-					<div id="" class="layui-form-item layout-input BOX02" style="display: none;">
-						<label class="layui-form-label" lang>浜岀骇灏剧爜锛�</label>
-						<div class="layui-input-block">
-							<input id="BOXCODE02" type="text" lang langholder placeholder="璇锋壂鎻忎簩绾ф潯鐮佸熬鐮�" autocomplete="off"
 								class="layui-input">
 						</div>
 					</div>
@@ -201,7 +179,7 @@
 				</div>
 				<table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding="">
 					<tr>
-						<th lang style="width: 15%;">缂栫爜</th>
+						<th lang style="width: 15%;">绠辩爜</th>
 						<th lang style="width: 35%;">鍚嶇О</th>
 						<th lang style="width: 25%;">鎵规</th>
 						<th lang style="width: 15%;">鏁伴噺</th>
@@ -238,15 +216,14 @@
 			var curPageIndex = 1;
 			//鏄惁杩炵画澶栫缁勬墭
 			isContinue = "0";
-			//鏄惁杩炵画浜岀骇鐮佺粍鎵�
-			isContinue2 = "0";
 			//娓呮鏂囨湰妗嗕腑鏁版嵁
-			function clear() {
+			function clear() {				
+				$("#BOXCODE").val("");
+				$("#BOXCODE2").val("");
+
 				$("#ImportQuantity").val("");
-				$("#GoodsCode").val("");
 				$("#Standard").val("");
 				$("#ImportFactQuantity").val("");
-				$("#ImportQty").val("");
 				$("#BoxQty").val("");
 			}
 
@@ -269,15 +246,15 @@
 						return
 					}
 
-					if ($("#STOCKCODE").val() == "") {
-						layer.msg('璇峰厛鎵弿鎵樼洏鐮�', {
-							icon: 2,
-							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-						});
-						$("#BOXCODE").val("");
-						$("#STOCKCODE").focus();
-						return;
-					}
+					// if ($("#STOCKCODE").val() == "") {
+					// 	layer.msg('璇峰厛鎵弿鎵樼洏鐮�', {
+					// 		icon: 2,
+					// 		time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+					// 	});
+					// 	$("#BOXCODE").val("");
+					// 	$("#STOCKCODE").focus();
+					// 	return;
+					// }
 					checkBoxInfo()
 				}
 			});
@@ -305,12 +282,14 @@
 
 			//閫変腑鍏ュ簱鍗曚簨浠�
 			form.on('select(getbar)', function (data) {
+				clear();
 				updateGoodList()
 				setOrderGoods();
 			});
 
 			//閫変腑鐗╂枡浜嬩欢
 			form.on('select(goodSelect)', function (data) {
+				clear();
 				setOrderGoods();
 			});
 
@@ -410,7 +389,7 @@
 				form.render('select');
 
 				var param = {
-					Type: "0,1"
+					Type: "0,1,2,3,4,5,6"
 				};
 				sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) {
 					if (res.code == 0) { //鎴愬姛
@@ -441,8 +420,7 @@
 			var asnDetails = "";
 
 			// 缁戝畾鍏ュ簱鍗曠墿鏂欏強鎵规
-			function updateGoodList() {
-				console.log("aaaa");
+			function updateGoodList(skuNo) {
 				var input = $('select[id="goodSelect"]').next().find('.layui-select-title input')
 				var val = input.val()
 
@@ -457,16 +435,21 @@
 					if (res.code == 0) { //鎴愬姛
 						asnDetails = res.data;
 						for (var i = 0; i < res.data.length; i++) {
-							if (i == 0) {
+							if(skuNo!='' && skuNo==res.data[i].SkuNo){
 								$("#goodSelect").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
 									.SkuName + "-" + res.data[i].LotNo +
 									'</option>');
-							} else {
-								$("#goodSelect").append('<option value =' + res.data[i].Id + '>' + res.data[i]
-									.SkuName + "-" + res.data[i].LotNo +
-									'</option>');
-							}
-
+							}else{
+								if (i == 0) {
+									$("#goodSelect").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
+										.SkuName + "-" + res.data[i].LotNo +
+										'</option>');
+									} else {
+										$("#goodSelect").append('<option value =' + res.data[i].Id + '>' + res.data[i]
+											.SkuName + "-" + res.data[i].LotNo +
+											'</option>');
+									}
+							}							
 						}
 						form.render('select');
 
@@ -525,11 +508,11 @@
 									time: 0, //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
 									btn: ['鍒犻櫎', '鍙栨秷'],
 									yes: function () {
-
+										console.log(Id);
 										var param = {
-											Id: Id,
+											boxNo: res.data[i].BoxNo,
 										};
-										sendData(IP + "/PdaAsn/DelBoxInfo", param, 'post', function (res) {
+										sendData(IP + "/BllAsn/DelBindBoxInfo", param, 'get', function (res) {
 											if (res.code == 0) { //鎴愬姛
 												layer.msg(res.msg, {
 													icon: 1,
@@ -586,18 +569,35 @@
 
 			function checkBoxInfo() {
 				var param = {
-					"ASNNo":$("#bar").val(),
 					"BoxNo": $("#BOXCODE").val(),
 				}
 				sendData(IP + "/PdaAsn/GetBindBoxInfos", param, 'post', function (res) {
 					if (res.code == 0) { //鎴愬姛
-						var bl = false; console.log(res.data);
+						var bl = false;
 						if (res.data.length == 0) {
 							layer.msg("鏈煡璇㈠埌姝ょ鐗╂枡淇℃伅锛岃鏍稿疄!", {
 								icon: 2,
 								time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
 							});
 							return;
+						}
+						if(res.data[0].ASNNo!='' && res.data[0].ASNNo!=null){
+							$("#bar").empty()
+							$("#bar").append('<option value =>' + '</option>');
+							form.render('select');
+
+							$("#bar").append('<option value =' + res.data[0].ASNNo + ' selected>' + res.data[0].ASNNo +'</option>');
+
+							updateGoodList(res.data[0].SkuNo)
+							setOrderGoods();
+						}else{
+							if(asnDetails==''){
+								layer.msg("璇峰厛閫夋嫨鍏ュ簱鍗曟嵁!", {
+									icon: 2,
+									time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+								});
+								return;
+							}
 						}
 						asnDetails.forEach(element => {
 							console.log(element);
@@ -630,7 +630,7 @@
 			form.on('switch(IsLianXu)', function (obj) {
 				if (obj.elem.checked) {
 					$('#BOX2').attr("style", "display:block")
-					$('#zongDiv').attr("style", "height: 335px;")
+					$('#zongDiv').attr("style", "height: 305px;")
 					isContinue = "1";		
 					
 					$('.BOX01').attr("style", "display:none")
@@ -638,30 +638,12 @@
 					
 				} else {
 					$('#BOX2').attr("style", "display:none")
-					$('#zongDiv').attr("style", "height: 315px;")
+					$('#zongDiv').attr("style", "height: 285px;")
 					isContinue = "0";
 
 					$('.BOX01').attr("style", "display:block");
 				}				
 				$('#BOXCODE2').val("");
-
-				$('#BOXCODE01').val("");
-				$('#BOXCODE02').val("");
-				$('#IsLianXu2').attr("checked", false);
-				isContinue2 = "0";
-			});
-
-			form.on('switch(IsLianXu2)', function (obj) {
-				if (obj.elem.checked) {
-					$('.BOX02').attr("style", "display:block")
-					$('#zongDiv').attr("style", "height: 345px;")
-					isContinue = "1";
-				} else {
-					$('.BOX02').attr("style", "display:none")
-					$('#zongDiv').attr("style", "height: 315px;")
-					isContinue2 = "0";
-				}
-				$('#BOXCODE02').val("");
 			});
 
 			$("#menuImg").click(function (e) {

--
Gitblit v1.8.0