From d07f25c163706ac46a83bd2c63db1e3c52715222 Mon Sep 17 00:00:00 2001
From: zhaowc <526854230@qq.com>
Date: 星期四, 27 三月 2025 15:54:25 +0800
Subject: [PATCH] 解决问题

---
 Pda/View/SoSetting/SampleOut.html |  596 ++++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 386 insertions(+), 210 deletions(-)

diff --git a/Pda/View/SoSetting/SampleOut.html b/Pda/View/SoSetting/SampleOut.html
index 4fc9be3..32faf38 100644
--- a/Pda/View/SoSetting/SampleOut.html
+++ b/Pda/View/SoSetting/SampleOut.html
@@ -169,12 +169,13 @@
 				</ul>
 			</div>
 
-			<ul>
+			<!-- <ul>
                 <li id="option1">鏍囩</li>
                 <li id="option2">鏁伴噺</li>
-            </ul>
-
-            <br />
+            </ul> -->
+			<button id="option1" class="layout-btn" type="button">鏍囩</button>
+            <button id="option2" class="layout-btn" type="button">鏁伴噺</button>
+            <br /><br />
 
 			<!-- 鏈夌爜 -->
 			<div id="content1">
@@ -243,7 +244,7 @@
                             <div id="layout-bill" class="layui-form-item layout-dropdownlist">
                                 <label class="layui-form-label lableWidth">鍏ュ簱鍗曪細</label>
                                 <div class="layui-input-block" id="selectDiv">
-                                    <select id="bar" lay-filter="getbar" lay-search>
+                                    <select id="AsnBar" lay-filter="getAsnBar" lay-search>
                                         <option value=""></option>
                                     </select>
                                     <img src="/assets/down_arraw.png">
@@ -287,8 +288,8 @@
 										<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="number" placeholder="璇疯緭鍏ユ嫞璐ф暟閲�"autocomplete="off" 
-													class="layui-input" oninput="value=value.replace(/^(0+)|[^\d]+/g,'')">
+												<input id="pickQty1" type="text" placeholder="璇疯緭鍏ユ嫞璐ф暟閲�"autocomplete="off" 
+													class="layui-input" >
 											</div>
 										</div>
 									</td>
@@ -296,7 +297,7 @@
 							</table>						
 						</div>
 						<div id="" class="layout-tab-page">
-							<table class="layout-tab-content" border="" cellspacing="" cellpadding="">
+							<table id="kuneiQty" class="layout-tab-content" border="" cellspacing="" cellpadding="">
 								<tr>
 									<td>
 										<table class="tbl-box-sim-info" border="" cellspacing="" cellpadding="">
@@ -380,63 +381,74 @@
 				
 				<div id="" class="layout-bill-info">
 					<form class="layui-form" action="" style="height: auto;">
+                        <div id="kuneilabel2" >
+                            <div id="layout-bill2" class="layui-form-item layout-dropdownlist">
+                                <label class="layui-form-label lableWidth">鍑哄簱鍗曪細</label>
+                                <div class="layui-input-block" id="selectDiv2">
+                                    <select id="bar2" lay-filter="getbar2" lay-search>
+                                        <option value=""></option>
+                                    </select>
+                                    <img src="/assets/down_arraw.png">
+                                </div>
+                            </div>
+                            <div id="layout-skuLotNo2" class="layui-form-item layout-dropdownlist">
+                                <label class="layui-form-label lableWidth">鐗╂枡 - 鎵规锛�</label>
+                                <div class="layui-input-block">
+                                    <select id="skuLotNo2" lay-filter="getSkuLotNo2" lay-search>
+                                        <option value=""></option>
+                                    </select>
+                                    <img src="/assets/down_arraw.png">
+                                </div>
+                            </div>
+                            <div id="" class="layout-tab-page">
+                                <table class="tbl-box-sim-info" border="" cellspacing="" cellpadding="">
+                                    <tr>
+                                        <td>
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label" style="width: 50%;">璁″垝鏁伴噺锛�</label>
+                                                <div class="layui-input-block" style="width: 50%;margin-left:50%;">
+                                                    <input id="planQty2" type="text" lay-verify="" disabled placeholder=""
+                                                        class="layui-input">
+                                                </div>
+                                            </div>
+                                        </td>
+                                        <td>
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label" style="width: 50%">瀹屾垚鏁伴噺锛�</label>
+                                                <div class="layui-input-block" style="width: 50%;margin-left:50%;">
+                                                    <input id="finishQty2" type="text" lay-verify="" disabled placeholder=""
+                                                        class="layui-input">
+                                                </div>
+                                            </div>
 
-						<div id="layout-bill2" class="layui-form-item layout-dropdownlist">
-							<label class="layui-form-label lableWidth">鍑哄簱鍗曪細</label>
-							<div class="layui-input-block" id="selectDiv2">
-								<select id="bar2" lay-filter="getbar2" lay-search>
-									<option value=""></option>
-								</select>
-								<img src="/assets/down_arraw.png">
-							</div>
-						</div>
-						<div id="layout-skuLotNo2" class="layui-form-item layout-dropdownlist">
-							<label class="layui-form-label lableWidth">鐗╂枡 - 鎵规锛�</label>
-							<div class="layui-input-block">
-								<select id="skuLotNo2" lay-filter="getSkuLotNo2" lay-search>
-									<option value=""></option>
-								</select>
-								<img src="/assets/down_arraw.png">
-							</div>
-						</div>
-						<div id="" class="layout-tab-page">
-							<table class="tbl-box-sim-info" border="" cellspacing="" cellpadding="">
-								<tr>
-									<td>
-										<div class="layui-form-item">
-											<label class="layui-form-label" style="width: 50%;">璁″垝鏁伴噺锛�</label>
-											<div class="layui-input-block" style="width: 50%;margin-left:50%;">
-												<input id="planQty2" type="text" lay-verify="" disabled placeholder=""
-													class="layui-input">
-											</div>
-										</div>
-									</td>
-									<td>
-										<div class="layui-form-item">
-											<label class="layui-form-label" style="width: 50%">瀹屾垚鏁伴噺锛�</label>
-											<div class="layui-input-block" style="width: 50%;margin-left:50%;">
-												<input id="finishQty2" type="text" lay-verify="" disabled placeholder=""
-													class="layui-input">
-											</div>
-										</div>
-
-									</td> 
-								</tr>
-								<tr>
-									<td colspan="3">
-										<div class="layui-form-item">
-											<label class="layui-form-label" style="width: 17%;">瑙勬牸锛�</label>
-											<div class="layui-input-block" style="width: 83%;margin-left:17%;">
-												<input id="standard2" type="text" lay-verify="" disabled placeholder=""
-													class="layui-input">
-											</div>
-										</div>
-									</td>
-									
-								</tr>
-							</table>
-						</div>
-
+                                        </td> 
+                                    </tr>
+                                    <tr>
+                                        <td colspan="3">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label" style="width: 17%;">瑙勬牸锛�</label>
+                                                <div class="layui-input-block" style="width: 83%;margin-left:17%;">
+                                                    <input id="standard2" type="text" lay-verify="" disabled placeholder=""
+                                                        class="layui-input">
+                                                </div>
+                                            </div>
+                                        </td>
+                                        
+                                    </tr>
+                                </table>
+                            </div>
+                        </div>
+                        <div id="kuqianlabel2" >
+                            <div id="layout-bill" class="layui-form-item layout-dropdownlist">
+                                <label class="layui-form-label lableWidth">鍏ュ簱鍗曪細</label>
+                                <div class="layui-input-block" id="selectDiv">
+                                    <select id="AsnBar2" lay-filter="getAsnBar2" lay-search>
+                                        <option value=""></option>
+                                    </select>
+                                    <img src="/assets/down_arraw.png">
+                                </div>
+                            </div>
+                        </div>
 						<div id="layout-pallet" class="layui-form-item layout-input">
 							<label class="layui-form-label lableWidth">鎵樼洏鏉$爜锛�</label>
 							<div class="layui-input-block">
@@ -470,9 +482,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">
@@ -538,23 +550,29 @@
 			var form = layui.form;
 
 			/* 鏍囩鍒囨崲浠g爜 */
-
 			var xianshiyemian = 0;
+            /* 鏍囩鍒囨崲浠g爜 */
+			var sampleType = "";  //0 搴撳唴鍙栨牱锛� 1 搴撳墠鍙栨牱
             
             $('#kuneilabel').hide();
             $('#kuqianlabel').hide();
-			$('#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;"); //榛樿棰滆壊
+            $('#kuneilabel2').hide();
+            $('#kuqianlabel2').hide();
+            
+            $('#kuneiQty').hide();
+
+			$('#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();
+					// qingkong();aqua
 					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();//鍏夋爣榛樿閫変腑
 				});
 
@@ -562,10 +580,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();//鍏夋爣榛樿閫変腑
 				});
 			});
@@ -637,22 +655,30 @@
                             if (res.code == 0){
                                 if (res.data == "0") {//搴撳唴鍙栨牱
                                     $('#kuneilabel').show();
+                                    $('#kuneiQty').show();
                                     $('#kuqianlabel').hide();
+                                    updateBillList();
+                                    if ($('#bar').val() == "") {
+                                        clear1();
+                                        return;
+                                    } else {
+                                        updateSkuLotNoList();
+                                        updateQtyList();
+                                        getBar();
+                                        GetBoxInfo();
+                                    }
+                                    sampleType = "0";
                                 }
                                 if (res.data == "1") {//搴撳墠鍙栨牱
                                     $('#kuqianlabel').show();
                                     $('#kuneilabel').hide();
+                                    $('#kuneiQty').hide();
+                                    
+                                    updateAsnBillList();
+                                    GetBoxInfo();
+                                    sampleType = "1";
                                 }
-                                // updateBillList();
-                                // if ($('#bar').val() == "") {
-                                //     clear1();
-                                //     return;
-                                // } else {
-                                //     updateSkuLotNoList();
-                                //     updateQtyList();
-                                //     getBar();
-                                //     GetBoxInfo();
-                                // }
+                               
                             }else { //涓嶆垚鍔�
                                 layer.msg(res.msg, {
                                     icon: 2,
@@ -672,21 +698,21 @@
             //鍒濆鍖栨覆鏌� 鍏ュ簱鍗�
 			function updateAsnBillList() {
 
-                $("#bar").empty()
-                $("#bar").append('<option value =>' + '</option>');
+                $("#AsnBar").empty()
+                $("#AsnBar").append('<option value =>' + '</option>');
                 form.render('select');
 
                 var param = {
-                    PalletNo: $("#palletNo").val(),
+                    palletNo: $("#palletNo").val(),
                 };
-                synData(IP + "/PdaSo/GetRunSoNoticeList", param, 'post', function (res) {
+                synData(IP + "/PdaSo/GetAsnNoByPallet", param, 'get', function (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>');
+                                $("#AsnBar").append('<option value =' + res.data[i] + ' selected>' + res.data[i] + '</option>');
                             } else {
-                                $("#bar").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>');
+                                $("#AsnBar").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>');
                             }
                         }
                         form.render('select');
@@ -921,101 +947,150 @@
 			//鍗曟嫞璐э紙纭鎸夐挳锛�
 			form.on('submit(formPickScatter)', function (data) {
 
-				if ($('#bar').val() == "") {
-					layer.msg("璇烽�夋嫨鍑哄簱鍗�", {
-						icon: 2,
-						time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-					}); return;
-				}
-				if ($('#bar').val() == "") {
-					layer.msg("璇烽�夋嫨鐗╂枡-鎵规", {
-						icon: 2,
-						time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-					}); return;
-				}
-				if ($('#palletNo').val() == "") {
-					layer.msg("璇疯緭鍏ユ墭鐩樼爜", {
-						icon: 2,
-						time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-					}); return;
-				}
-				if(isContinue=="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()>parseInt($('#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) {
-				// 	layer.msg("鎷h揣鏁伴噺闇�澶т簬0锛屽苟涓斾笉鑳借秴杩囧緟鎷g鍐呮暟閲�", {
-				// 		icon: 2,
-				// 		time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-				// 	});
-				// 	return;
-				// }
+                if (sampleType == "0") {
+                    if ($('#bar').val() == "") {
+                        layer.msg("璇烽�夋嫨鍑哄簱鍗�", {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        }); return;
+                    }
+                    if ($('#bar').val() == "") {
+                        layer.msg("璇烽�夋嫨鐗╂枡-鎵规", {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        }); return;
+                    }
+                    if ($('#palletNo').val() == "") {
+                        layer.msg("璇疯緭鍏ユ墭鐩樼爜", {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        }); return;
+                    }
+                    if(isContinue=="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;
+                        }
+                    }	
+                    
+                   
+                }
+                else if (sampleType == "1") {
+                    if ($('#AsnBar').val() == "") {
+                        layer.msg("璇烽�夋嫨鍏ュ簱鍗�", {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        }); return;
+                    }
+                    if ($('#boxNo').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;
+                    }
+                }
+                else {
+                    layer.msg("绫诲瀷閿欒锛岃鍒锋柊椤甸潰閲嶈瘯", {
+                        icon: 2,
+                        time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                    });
+                    return;
+                }
+							
+                if (canPickBox == false) {
 
-				if (canPickBox == false) {
+                    layer.msg("璇锋眰鏈畬鎴愶紝涓嶈閲嶅璇锋眰", {
+                        icon: 2,
+                        time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                    });
+                    return;
+                }
 
-					layer.msg("璇锋眰鏈畬鎴愶紝涓嶈閲嶅璇锋眰", {
-						icon: 2,
-						time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-					});
-					return;
-				}
-
-				reqPickScatter()
+                reqPickScatter()
 
 				return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆�
 			});
 
 			//纭鎷h揣 
 			function reqPickScatter() {
+                canPickBox = false//鍥炶皟
+				if($('#pickQty1').val()!= "" && $('#pickQty1').val()!= undefined){
+					console.log("111111111111111111"+$('#pickQty1').val());
+					
+					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;
+					}
+				}
 				var param = {
 					"SoNo": $("#bar").val(),
 					"SoDetailId": $("#skuLotNo").val(),
 					"PalletNo": $('#palletNo').val(),
 					"BoxNo": $('#boxNo').val(),
 					"BoxNo3": $('#boxNo3').val(),
-					"PickQty":$('#pickQty1').val()
+					"PickQty":$('#pickQty1').val(),
+					"AsnNo":$('#AsnBar').val(),
+                    "Type":sampleType
 				}
-				sendData(IP + "/PdaSo/SoSetPick", param, 'post', function (res) {
-					//console.log(res);
+				
+				sendData(IP + "/PdaSo/SampleSoSetPick", param, 'post', function (res) {
 					
 					if (res.code == 0) { //鎴愬姛
 						layer.msg(res.msg, {
 							icon: 1,
 							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
 						}, function () {
-							canPickBox = true//鍥炶皟
-							$("#boxNo").val('');
-							$("#boxNo3").val('');
-							updateQtyList();
-							getBar();
-							GetBoxInfo();
+                            if (sampleType == "0") {
+                                canPickBox = true//鍥炶皟
+                                $("#boxNo").val('');
+                                $("#boxNo3").val('');
+                                updateQtyList();
+                                getBar();
+                                GetBoxInfo();
+                            }
+                            if (sampleType == "1") {
+                                canPickBox = true//鍥炶皟
+                                $("#boxNo").val('');
+                                $("#boxNo3").val('');
+                                $("#pickQty1").val('');
+                                GetBoxInfo();
+                            }
+							
 						});
 					} else { //涓嶆垚鍔�
 						layer.msg(res.msg, {
@@ -1209,27 +1284,80 @@
 				}
 				checkPalletState2()
 			})
+             //鍒濆鍖栨覆鏌� 鍏ュ簱鍗�
+			function updateAsnBillList2() {
+
+                $("#AsnBar2").empty()
+                $("#AsnBar2").append('<option value =>' + '</option>');
+                form.render('select');
+                console.log("afdsaf")
+                var param = {
+                    palletNo: $("#palletNo2").val(),
+                };
+                synData(IP + "/PdaSo/GetAsnNoByPallet", param, 'get', function (res) {
+                    if (res.code == 0) { //鎴愬姛
+                        console.log(res.data);
+                        for (var i = 0; i < res.data.length; i++) {
+                            if (i == 0) {
+                                $("#AsnBar2").append('<option value =' + res.data[i] + ' selected>' + res.data[i] + '</option>');
+                            } else {
+                                $("#AsnBar2").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>');
+                            }
+                        }
+                        form.render('select');
+
+                    } else { //涓嶆垚鍔�
+                        layer.msg(res.msg, {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        });
+                    }
+                });
+            }
+
 			//妫�鏌ユ墭鐩樼姸鎬�
 			function checkPalletState2() {
 				var param = {
 					"PalletNo": $("#palletNo2").val()
-				}
+				} 
 				synData(IP + "/PdaSo/IsEnableOkPalletNo", param, 'post', function (res) {
+                     
 					if (res.code == 0) { //鎴愬姛 
-						updateBillList2();
-						console.log($('#bar2').val())
-						if ($('#bar2').val() == "") {
-							console.log(1)
-							clear21();
-							return;
-						} else {
-							console.log(2)
-							updateSkuLotNoList2();
-							updateQtyList2();
-							getBar2();
-							GetDataInfo();
-						}
-
+                        synData(IP + "/PdaSo/GetSampleType", param, 'get', function (res) {
+                            if (res.code == 0){
+                                if (res.data == "0") {//搴撳唴鍙栨牱
+                                    $('#kuneilabel2').show();
+                                    $('#kuqianlabel2').hide();
+									updateBillList2();
+									console.log($('#bar2').val())
+									if ($('#bar2').val() == "") {
+										console.log(1)
+										clear21();
+										return;
+									} else {
+										console.log(2)
+										updateSkuLotNoList2();
+										updateQtyList2();
+										getBar2();
+										GetDataInfo();
+									}
+									sampleType = "0";
+                                }
+                                if (res.data == "1") {//搴撳墠鍙栨牱
+                                    $('#kuqianlabel2').show();
+                                    $('#kuneilabel2').hide();
+                                    updateAsnBillList2();
+									GetDataInfo();
+                                    sampleType = "1";
+                                }
+                                
+                            }else { //涓嶆垚鍔�
+                                layer.msg(res.msg, {
+                                    icon: 2,
+                                    time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                                }, function () { });
+                            }
+                        });  
 					} else { //涓嶆垚鍔�
 						layer.msg(res.msg, {
 							icon: 2,
@@ -1422,33 +1550,60 @@
 			//鍗曟嫞璐э紙纭鎸夐挳锛�
 			form.on('submit(formPickScatter2)', function (data) {
 
-				if ($('#bar2').val() == "") {
-					layer.msg("璇烽�夋嫨鍑哄簱鍗�", {
-						icon: 2,
-						time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-					}); return;
+				if (sampleType == "0") {
+					if ($('#bar2').val() == "") {
+						layer.msg("璇烽�夋嫨鍑哄簱鍗�", {
+							icon: 2,
+							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						}); return;
+					}
+					if ($('#skuLotNo2').val() == "") {
+						layer.msg("璇烽�夋嫨鐗╂枡-鎵规", {
+							icon: 2,
+							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						}); return;
+					}
+					if ($('#palletNo2').val() == "") {
+						layer.msg("璇疯緭鍏ユ墭鐩樼爜", {
+							icon: 2,
+							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						}); return;
+					}			
+					let pickedQty = parseFloat($('#pickedQty2').val()) //宸叉嫞鏁伴噺
+					let pickQty = parseFloat($('#pickQty2').val())  //鎷h揣鏁伴噺
+					if (pickQty <= 0) {
+						layer.msg("鎷h揣鏁伴噺闇�澶т簬0", {
+							icon: 2,
+							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						});
+						return;
+					}
 				}
-				if ($('#skuLotNo2').val() == "") {
-					layer.msg("璇烽�夋嫨鐗╂枡-鎵规", {
-						icon: 2,
-						time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-					}); return;
-				}
-				if ($('#palletNo2').val() == "") {
-					layer.msg("璇疯緭鍏ユ墭鐩樼爜", {
-						icon: 2,
-						time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-					}); return;
-				}			
-				let pickedQty = parseInt($('#pickedQty2').val()) //宸叉嫞鏁伴噺
-				let pickQty = parseInt($('#pickQty2').val())  //鎷h揣鏁伴噺
-				if (pickQty <= 0) {
-					layer.msg("鎷h揣鏁伴噺闇�澶т簬0", {
-						icon: 2,
-						time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-					});
-					return;
-				}
+				else if (sampleType == "1") {
+                    if ($('#AsnBar').val() == "") {
+                        layer.msg("璇烽�夋嫨鍏ュ簱鍗�", {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        }); return;
+                    }
+					let pickedQty = parseFloat($('#pickedQty2').val()) //宸叉嫞鏁伴噺
+					let pickQty = parseFloat($('#pickQty2').val())  //鎷h揣鏁伴噺
+					if (pickQty <= 0) {
+						layer.msg("鎷h揣鏁伴噺闇�澶т簬0", {
+							icon: 2,
+							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						});
+						return;
+					}
+                }
+                else {
+                    layer.msg("绫诲瀷閿欒锛岃鍒锋柊椤甸潰閲嶈瘯", {
+                        icon: 2,
+                        time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                    });
+                    return;
+                }
+				
 
 				if (canPickBox == false) {
 
@@ -1466,24 +1621,45 @@
 
 			//纭鎷h揣 
 			function reqPickScatter2() {
+				canPickBox = false//鍥炶皟
+				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;
+					}
+				}
 				var param = {
 					"SoNo": $("#bar2").val(),
 					"SoDetailId": $("#skuLotNo2").val(),
 					"PalletNo": $('#palletNo2').val(),
 					"PickQty": $('#pickQty2').val(),
+					"AsnNo":$('#AsnBar').val(),
+                    "Type":sampleType
 				}
-				sendData(IP + "/PdaSo/SoSetQtyPick", param, 'post', function (res) {
+				sendData(IP + "/PdaSo/SampleSoSetQtyPick", param, 'post', function (res) {
 					//console.log(res);
 					
 					if (res.code == 0) { //鎴愬姛
+						
 						layer.msg(res.msg, {
 							icon: 1,
 							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
 						}, function () {
-							canPickBox = true//鍥炶皟
-							updateQtyList2();
-							getBar2();
-							GetDataInfo();
+							
+							if (sampleType == "0") {
+								canPickBox = true//鍥炶皟
+								updateQtyList2();
+								getBar2();
+								GetDataInfo();
+							}
+							if (sampleType == "1") {
+								canPickBox = true//鍥炶皟
+								GetDataInfo();
+							}
 						});
 					} else { //涓嶆垚鍔�
 						layer.msg(res.msg, {

--
Gitblit v1.8.0