From aa910d7bb5f164b1ce4782359a8eecddca103bdc Mon Sep 17 00:00:00 2001
From: Administrator <Administrator@DESKTOP-5BIMHQ3>
Date: 星期日, 04 二月 2024 09:56:27 +0800
Subject: [PATCH] 修改bug

---
 Pda/View/AsnSetting/productEnter1.html | 1351 +++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 956 insertions(+), 395 deletions(-)

diff --git a/Pda/View/AsnSetting/productEnter1.html b/Pda/View/AsnSetting/productEnter1.html
index 1157f96..caaa38d 100644
--- a/Pda/View/AsnSetting/productEnter1.html
+++ b/Pda/View/AsnSetting/productEnter1.html
@@ -110,7 +110,7 @@
             <br />
             <!-- 鏈夌爜 -->
             <div id="content1">
-                <div id="zongDiv" class="layout-bill-info" style="height: 255px;">
+                <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>
@@ -130,7 +130,7 @@
                                 <img src="/assets/down_arraw.png">
                             </div>
                         </div>
-
+    
                         <div id="" class="layui-form-item layout-input">
                             <label class="layui-form-label" lang>鎵樼洏鏉$爜锛�</label>
                             <div class="layui-input-block">
@@ -159,7 +159,7 @@
                                     class="layui-input">
                             </div>
                         </div>
-
+    
                         <table class="layout-tbl-input" border="" cellspacing="" cellpadding="">
                             <tr>
                                 <td>
@@ -180,7 +180,7 @@
                                         </div>
                                     </div>
                                 </td>
-
+    
                             </tr>
                             <tr>
                                 <td>
@@ -202,21 +202,73 @@
                                     </div>
                                 </td>
                             </tr>
-
+    
                         </table>
-                        
+    
+                        <table class="layout-tbl-submit" border="" cellspacing="" cellpadding="">
+                            <tr>
+                                <td style="width: 23%;"></td>
+                                <td>
+                                    <button class="layout-btn layout-btn-red" lang type="button" lay-submit
+                                        lay-filter="formBind">缁戝畾鍒版墭鐩�</button>
+                                </td>
+                                <td style="width: 33%;"></td>
+    
+                            </tr>
+                        </table>
                     </form>
+                </div>
+
+                <br>
+
+                <div id="" class="cut-line">
+                    <img src="/assets/fengexian.png">
+                </div>
+    
+                <div class="layout-tbl-paging" id="">
+                    <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding="">
+                        <tr>
+                            <th lang style="width: 15%;">缂栫爜</th>
+                            <th lang style="width: 35%;">鍚嶇О</th>
+                            <th lang style="width: 25%;">鎵规</th>
+                            <th lang style="width: 15%;">鏁伴噺</th>
+                            <th lang style="width: 10%;">鎿嶄綔</th>
+                        </tr>
+                        <tr id="boxCell" style="display: none;">
+                            <td name="code">AG000001</td>
+                            <td name="name">鐤嫍鍚嶇О鍚嶇О鍚嶇О</td>
+                            <td name="lotNo">鎵规鍙�</td>
+                            <td name="num">30</td>
+                            <td name="del">
+                                <div id="" class="tbl-btn-del" lang>
+                                    鍒犻櫎
+                                </div>
+                            </td>
+                        </tr>
+                    </table>
+                    <!-- 鍒嗛〉 -->
+					<table id="tableBoxPages" class="tbl-box-pages" border="" cellspacing="" cellpadding="">
+						<tr style="display: ;">
+							<td class="page-prev">涓婁竴椤�</td>
+							<td class="page-num page-num-select">1</td>
+							<td class="page-num">2</td>
+							<td class="page-num">3</td>
+							<td class="page-num">4</td>
+							<td class="page-num">5</td>
+							<td class="page-next">涓嬩竴椤�</td>
+						</tr>
+					</table>
                 </div>
 
             </div>
             <!-- 鏃犵爜 -->
             <div id="content2">
                 <div id="zongDiv" class="layout-bill-info" style="height: 255px;">
-                    <form class="layui-form" action="">
+                    <form class="layui-form" id="form2" action="">
                         <div id="" class="layui-form-item layout-dropdownlist">
                             <label class="layui-form-label" lang>鍏ュ簱鍗曪細</label>
-                            <div class="layui-input-block" id="selectDivw">
-                                <select id="barw" lay-filter="getbar" lay-search>
+                            <div class="layui-input-block" id="selectDiv1">
+                                <select id="bar1" lay-filter="getbar1" lay-search>
                                     <option value=""></option>
                                 </select>
                                 <img src="/assets/down_arraw.png">
@@ -224,8 +276,8 @@
                         </div>
                         <div class="layui-form-item layout-dropdownlist" style="margin-top: 10px;">
                             <label class="layui-form-label">鐗╂枡-鎵规锛�</label>
-                            <div class="layui-input-block" id="goodDivw">
-                                <select id="goodSelectw" lay-filter="goodSelectw" lay-search>
+                            <div class="layui-input-block" id="goodDiv1">
+                                <select id="goodSelect1" lay-filter="goodSelect1" lay-search>
                                     <option value=""></option>
                                 </select>
                                 <img src="/assets/down_arraw.png">
@@ -235,7 +287,7 @@
                         <div id="" class="layui-form-item layout-input">
                             <label class="layui-form-label" lang>鎵樼洏鏉$爜锛�</label>
                             <div class="layui-input-block">
-                                <input id="STOCKCODEw" type="text" lay-verify="stock" lang langholder placeholder="璇锋壂鎻忔墭鐩樻潯鐮�"
+                                <input id="STOCKCODE1" type="text" lay-verify="stock" lang langholder placeholder="璇锋壂鎻忔墭鐩樻潯鐮�"
                                     autocomplete="off" class="layui-input">
                             </div>
                         </div>
@@ -243,7 +295,7 @@
                         <div id="" class="layui-form-item layout-input">
                             <label class="layui-form-label" lang>鐗╂枡鏁伴噺锛�</label>
                             <div class="layui-input-block">
-                                <input id="SkuQtyw" type="text" lay-verify="stock" lang langholder placeholder="璇疯緭鍏ョ墿鏂欐暟閲�"
+                                <input id="SkuQty" type="text" lay-verify="stock" lang langholder placeholder="璇疯緭鍏ョ墿鏂欐暟閲�"
                                     autocomplete="off" class="layui-input">
                             </div>
                         </div>
@@ -254,7 +306,7 @@
                                     <div id="" class="layui-form-item layout-boxinfo">
                                         <label class="layui-form-label" lang>瑙勬牸/鍨嬪彿锛�</label>
                                         <div class="layui-input-block">
-                                            <input id="Standardw" type="text" disabled placeholder="" autocomplete="off"
+                                            <input id="Standard1" type="text" disabled placeholder="" autocomplete="off"
                                                 class="layui-input">
                                         </div>
                                     </div>
@@ -265,7 +317,7 @@
                                     <div id="" class="layui-form-item layout-boxinfo">
                                         <label class="layui-form-label" lang>璁″垝鏁伴噺锛�</label>
                                         <div class="layui-input-block">
-                                            <input id="ImportQuantityw" type="text" disabled placeholder=""
+                                            <input id="ImportQuantity1" type="text" disabled placeholder=""
                                                 autocomplete="off" class="layui-input">
                                         </div>
                                     </div>
@@ -277,7 +329,7 @@
                                     <div id="" class="layui-form-item layout-boxinfo">
                                         <label class="layui-form-label" lang>宸茬粍鏁伴噺锛�</label>
                                         <div class="layui-input-block">
-                                            <input id="ImportFactQuantityw" type="text" disabled placeholder=""
+                                            <input id="ImportFactQuantity1" type="text" disabled placeholder=""
                                                 autocomplete="off" class="layui-input">
                                         </div>
                                     </div>
@@ -286,52 +338,63 @@
 
                         </table>
 
+                        <table class="layout-tbl-submit" border="" cellspacing="" cellpadding="">
+                            <tr>
+                                <td style="width: 23%;"></td>
+                                <td>
+                                    <button class="layout-btn layout-btn-red" lang type="button" lay-submit
+                                        lay-filter="formBind">缁戝畾鍒版墭鐩�</button>
+                                </td>
+                                <td style="width: 33%;"></td>
+            
+                            </tr>
+                        </table>
+
                     </form>
                 </div>
 
+                <br>
+
+                <div id="" class="cut-line">
+                    <img src="/assets/fengexian.png">
+                </div>
+    
+                <div class="layout-tbl-paging" id="">
+                    <table id="tableBoxList1" class="tbl-box-list" border="" cellspacing="" cellpadding="">
+                        <tr>
+                            <th lang style="width: 15%;">鐗╂枡缂栫爜</th>
+                            <th lang style="width: 35%;">鐗╂枡鍚嶇О</th>
+                            <th lang style="width: 25%;">鎵规</th>
+                            <th lang style="width: 15%;">鐗╂枡鏁伴噺</th>
+                            <th lang style="width: 10%;">鎿嶄綔</th>
+                        </tr>
+                        <tr id="boxCell" style="display: none;">
+                            <td name="code">AG000001</td>
+                            <td name="name">鐤嫍鍚嶇О鍚嶇О鍚嶇О</td>
+                            <td name="lotNo">鎵规鍙�</td>
+                            <td name="num">30</td>
+                            <td name="del">
+                                <div id="" class="tbl-btn-del" lang>
+                                    鍒犻櫎
+                                </div>
+                            </td>
+                        </tr>
+                    </table>
+                    <!-- 鍒嗛〉 -->
+					<table id="tableBoxPages1" class="tbl-box-pages" border="" cellspacing="" cellpadding="">
+						<tr style="display: ;">
+							<td class="page-prev">涓婁竴椤�</td>
+							<td class="page-num page-num-select">1</td>
+							<td class="page-num">2</td>
+							<td class="page-num">3</td>
+							<td class="page-num">4</td>
+							<td class="page-num">5</td>
+							<td class="page-next">涓嬩竴椤�</td>
+						</tr>
+					</table>
+                </div>
+
             </div>
-
-            <table class="layout-tbl-submit" border="" cellspacing="" cellpadding="">
-                <tr>
-                    <td style="width: 23%;"></td>
-                    <td>
-                        <button class="layout-btn layout-btn-red" lang type="button" lay-submit
-                            lay-filter="formBind">缁戝畾鍒版墭鐩�</button>
-                    </td>
-                    <td style="width: 33%;"></td>
-
-                </tr>
-            </table>
-            
-            <br>
-
-            <div id="" class="cut-line">
-                <img src="/assets/fengexian.png">
-            </div>
-
-            <div class="layout-tbl-paging" id="">
-                <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding="">
-                    <tr>
-                        <th lang style="width: 15%;">缂栫爜</th>
-                        <th lang style="width: 35%;">鍚嶇О</th>
-                        <th lang style="width: 25%;">鎵规</th>
-                        <th lang style="width: 15%;">鏁伴噺</th>
-                        <th lang style="width: 10%;">鎿嶄綔</th>
-                    </tr>
-                    <tr id="boxCell" style="display: none;">
-                        <td name="code">AG000001</td>
-                        <td name="name">鐤嫍鍚嶇О鍚嶇О鍚嶇О</td>
-                        <td name="lotNo">鎵规鍙�</td>
-                        <td name="num">30</td>
-                        <td name="del">
-                            <div id="" class="tbl-btn-del" lang>
-                                鍒犻櫎
-                            </div>
-                        </td>
-                    </tr>
-                </table>
-            </div>
-
 
 		</div>
 	</div>
@@ -353,6 +416,7 @@
             $('#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;"); //閫変腑鍚庨鑹�
@@ -362,6 +426,7 @@
                 });
 
                 $('#option2').click(function() {
+                    // qingkong();
                     xianshiyemian = 1;
                     $('#content1').hide();
                     $('#option1').attr("style", "background-color: #999;width: 45.77%;float: left;text-align: center;"); //榛樿棰滆壊
@@ -371,7 +436,33 @@
                     
                 });
             });
-        
+
+            //娓呮鏂囨湰妗嗕腑鏁版嵁
+			// function clear() {	
+            //     if (xianshiyemian == "0")
+            //     {
+            //         $("#BOXCODE").val("");
+            //         $("#BOXCODE2").val("");
+
+            //         $("#ImportQuantity").val("");
+            //         $("#Standard").val("");
+            //         $("#ImportFactQuantity").val("");
+            //         $("#BoxQty").val("");
+            //     }
+            //     else if (xianshiyemian == "1")
+            //     {
+            //         $("#BOXCODE").val("");
+            //         $("#BOXCODE2").val("");
+
+            //         $("#ImportQuantity").val("");
+            //         $("#Standard").val("");
+            //         $("#ImportFactQuantity").val("");
+            //         $("#BoxQty").val("");
+            //     }
+				
+			// }
+            
+            /*鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��*/
 
 			initLanguage()
 			setLanguage()
@@ -380,15 +471,6 @@
 			var curPageIndex = 1;
 			//鏄惁杩炵画缁勬墭
 			isContinue = "0";
-			//娓呮鏂囨湰妗嗕腑鏁版嵁
-			function clear() {
-				$("#ImportQuantity").val("");
-				$("#GoodsCode").val("");
-				$("#Standard").val("");
-				$("#ImportFactQuantity").val("");
-				$("#ImportQty").val("");
-				$("#BoxQty").val("");
-			}
 
 			// 鎵樼洏鐮佹枃鏈敼鍙樻椂瑙﹀彂
 			$("#STOCKCODE").on('input', function () {
@@ -401,15 +483,14 @@
 				}
 				checkPalletStat()
 			})
-
             // 鎵樼洏鐮佹枃鏈敼鍙樻椂瑙﹀彂-鏁伴噺
-			$("#STOCKCODEw").on('input', function () {
+			$("#STOCKCODE1").on('input', function () {
 
-                if ($("#STOCKCODEw").val() == "" || $("#STOCKCODEw").val().length < 8) {
+                if ($("#STOCKCODE1").val() == "" || $("#STOCKCODE1").val().length < 8) {
                     return
                 }
-                if ($("#STOCKCODEw").val().length >= 8) {
-                    $("#STOCKCODEw").val($("#STOCKCODEw").val().substr(-8))
+                if ($("#STOCKCODE1").val().length >= 8) {
+                    $("#STOCKCODE1").val($("#STOCKCODE1").val().substr(-8))
                 }
                 checkPalletStat()
             })
@@ -418,42 +499,136 @@
 			$("#BOXCODE").keydown(function (e) {
 				if (e.keyCode === 13) {
 					if ($("#BOXCODE").val() == "") {
-						return
-					}
-
-					if ($("#STOCKCODE").val() == "") {
-						layer.msg('璇峰厛鎵弿鎵樼洏鐮�', {
+                        layer.msg('璇峰厛鎵弿绠辩爜', {
 							icon: 2,
 							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
 						});
-						$("#BOXCODE").val("");
-						$("#STOCKCODE").focus();
-						return;
+						return
 					}
+
+					// if ($("#STOCKCODE").val() == "") {
+					// 	layer.msg('璇峰厛鎵弿鎵樼洏鐮�', {
+					// 		icon: 2,
+					// 		time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+					// 	});
+					// 	$("#BOXCODE").val("");
+					// 	$("#STOCKCODE").focus();
+					// 	return;
+					// }
 					checkBoxInfo()
 				}
 			});
 
+            /* 鍏ュ簱鍗曟嵁涓嬫媺妗� */
 			//鐐瑰嚮鍏ュ簱鍗曟嵁涓嬫媺妗嗕簨浠�
 			$("#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)
-				})
+                if (xianshiyemian == 0)
+                {
+                    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)
+                    })
+                }
 			})
-            //鐐瑰嚮鍏ュ簱鍗曟嵁涓嬫媺妗嗕簨浠�-鏁伴噺
-			$("#selectDivw").click(function () {
-				var input = $('select[id="barw"]').next().find('.layui-select-title input')
-				var val = input.val()
-				//鍏堟洿鏂颁竴涓嬪叆搴撳崟
-				updateBillList(function (data) {
-					$('select[id="barw"]').next().addClass('layui-form-selected')
-					$('select[id="barw"]').next().find('.layui-select-title input').val(val)
-				})
+            //鐐瑰嚮鍏ュ簱鍗曟嵁涓嬫媺妗嗕簨浠�
+			$("#selectDiv1").click(function () {
+                if (xianshiyemian == 1)
+                {
+                    var input = $('select[id="bar1"]').next().find('.layui-select-title input')
+                    var val = input.val()
+                    //鍏堟洿鏂颁竴涓嬪叆搴撳崟
+                    updateBillList(function (data) {
+                        $('select[id="bar1"]').next().addClass('layui-form-selected')
+                        $('select[id="bar1"]').next().find('.layui-select-title input').val(val)
+                    })
+                }
 			})
+
+            /*鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��*/
+
+
+            /* 缁戝畾鍏ュ簱鍗曚俊鎭� */ 
+
+			function updateBillList(callback) {
+                if (xianshiyemian == 0)
+                {
+                    var input = $('select[id="bar"]').next().find('.layui-select-title input')
+                    var val = input.val()
+                    $("#bar").empty()
+                    $("#bar").append('<option value =>' + '</option>');
+                    form.render('select');
+
+                    var param = {
+                        Type: "0,1,3"
+                    };
+                    sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) {
+                        if (res.code == 0) { //鎴愬姛
+                            for (var i = 0; i < res.data.length; i++) {
+                                $("#bar").append('<option value =' + res.data[i].ASNNo + '>' + res.data[i]
+                                    .ASNNo +
+                                    '</option>');
+                            }
+                            form.render('select');
+
+                            if (!val) {
+                                $('#bar').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this')
+                            } else {
+                                var sel = 'dd[lay-value=' + val + ']';
+                                $('#bar').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this')
+                            }
+
+                            callback(res.data)
+                        } else { //涓嶆垚鍔�
+                            // layer.msg(res.msg, {
+                            // 	icon: 2,
+                            // 	time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                            // }, function() {});
+                        }
+                    });
+                }
+                else if (xianshiyemian == 1)
+                {
+                    var input = $('select[id="bar1"]').next().find('.layui-select-title input')
+                    var val = input.val()
+                    $("#bar1").empty()
+                    $("#bar1").append('<option value =>' + '</option>');
+                    form.render('select');
+
+                    var param = {
+                        Type: "2,5,6"
+                    };
+                    sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) {
+                        if (res.code == 0) { //鎴愬姛
+                            for (var i = 0; i < res.data.length; i++) {
+                                $("#bar1").append('<option value =' + res.data[i].ASNNo + '>' + res.data[i]
+                                    .ASNNo +
+                                    '</option>');
+                            }
+                            form.render('select');
+
+                            if (!val) {
+                                $('#bar1').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this')
+                            } else {
+                                var sel = 'dd[lay-value=' + val + ']';
+                                $('#bar1').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this')
+                            }
+
+                            callback(res.data)
+                        } else { //涓嶆垚鍔�
+                            // layer.msg(res.msg, {
+                            // 	icon: 2,
+                            // 	time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                            // }, function() {});
+                        }
+                    });
+                }
+				
+			}
+           
+            /*鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��*/
 
 			//鐐瑰嚮鐗╂枡涓嬫媺妗嗕簨浠�
 			$("#goodDiv").click(function () {
@@ -465,69 +640,68 @@
 				}
 			})
             //鐐瑰嚮鐗╂枡涓嬫媺妗嗕簨浠�-鏁伴噺
-			$("#goodDivw").click(function () {
-				if ($("#barw").val() == null || $("#barw").val() == "" || $("#barw").val() == undefined) {
+			$("#goodDiv1").click(function () {
+				if ($("#bar1").val() == null || $("#bar1").val() == "" || $("#bar1").val() == undefined) {
 					layer.msg("璇峰厛閫夋嫨鍏ュ簱鍗�", {
 						icon: 2,
 						time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
 					}, function () { });
 				}
 			})
-
 			//閫変腑鍏ュ簱鍗曚簨浠�
 			form.on('select(getbar)', function (data) {
 				updateGoodList()
 				setOrderGoods();
 			});
             //閫変腑鍏ュ簱鍗曚簨浠�-鏁伴噺
-			form.on('select(getbarw)', function (data) {
-				updateGoodListw()
-				setOrderGoodsw();
+			form.on('select(getbar1)', function (data) {
+				updateGoodList()
+				setOrderGoods();
 			});
-
+           
 			//閫変腑鐗╂枡浜嬩欢
 			form.on('select(goodSelect)', function (data) {
 				setOrderGoods();
 			});
-            //閫変腑鐗╂枡浜嬩欢-鏁伴噺
-            form.on('select(goodSelectw)', function (data) {
+           //閫変腑鐗╂枡浜嬩欢-鏁伴噺
+			form.on('select(goodSelect1)', function (data) {
 				setOrderGoods();
 			});
 
-
 			//缁戝畾鍒版墭鐩樹簨浠�
 			form.on('submit(formBind)', function (data) {
-				console.log(isContinue);
-				console.log($("#goodSelect").val());
-				if ($("#bar").val() == "") {
-					layer.msg('璇烽�夋嫨鍏ュ簱鍗�', {
-						icon: 2,
-						time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-					});
-					return;
-				}
-				if ($("#goodSelect").val() == "") {
-					layer.msg('璇烽�夋嫨鐗╂枡鍙婃槑缁�', {
-						icon: 2,
-						time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-					});
-					return;
-				}
-				if ($("#STOCKCODE").val() == "") {
-					layer.msg('璇锋壂鎻忔墭鐩樻潯鐮�', {
-						icon: 2,
-						time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-					});
-					return;
-				}
-				if ($("#BOXCODE").val() == "") {
-					layer.msg('璇锋壂鎻忓绠辨潯鐮�', {
-						icon: 2,
-						time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-					});
-					return;
-				}
-				var param = {
+                if(xianshiyemian == 0)
+                {
+				    console.log($("#goodSelect").val());
+                    if ($("#bar").val() == "") {
+                        layer.msg('璇烽�夋嫨鍏ュ簱鍗�', {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        });
+                        return;
+                    }
+                    if ($("#goodSelect").val() == "") {
+                        layer.msg('璇烽�夋嫨鐗╂枡鍙婃槑缁�', {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        });
+                        return;
+                    }
+                    if ($("#STOCKCODE").val() == "") {
+                        layer.msg('璇锋壂鎻忔墭鐩樻潯鐮�', {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        });
+                        return;
+                    }
+                    if ($("#BOXCODE").val() == "") {
+                        layer.msg('璇锋壂鎻忓绠辨潯鐮�', {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        });
+                        return;
+                    }
+                    var param = {
 					AsnNo: $("#bar").val(),
 					PalletNo: $("#STOCKCODE").val(),
 					AsnDetailId: parseInt($("#goodSelect").val()),
@@ -536,7 +710,7 @@
 					TailBoxNo: $("#BOXCODE2").val(),
 					Origin:"PDA"
 				}
-				//缁勭洏
+                //缁勭洏
 				sendData(IP + "/PdaAsn/BindPallet", param, 'post', function (res) {
 					if (res.code == 0) { //鎴愬姛 
 						layer.msg(res.msg, {
@@ -558,305 +732,451 @@
 						});
 					}
 				});
+                }
+                else if(xianshiyemian == 1)
+                {
+                    if ($("#bar1").val() == "") {
+                        layer.msg('璇烽�夋嫨鍏ュ簱鍗�', {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        });
+                        return;
+                    }
+                    if ($("#goodSelect1").val() == "") {
+                        layer.msg('璇烽�夋嫨鐗╂枡鍙婃槑缁�', {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        });
+                        return;
+                    }
+                    if ($("#STOCKCODE1").val() == "") {
+                        layer.msg('璇锋壂鎻忔墭鐩樻潯鐮�', {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        });
+                        return;
+                    }
+                    var param = {
+                        AsnNo: $("#bar1").val(), //鍑哄簱鍗曟嵁
+                        PalletNo: $("#STOCKCODE1").val(), //鎵樼洏鏉$爜
+                        AsnDetailId: parseInt($("#goodSelect1").val()), //鐗╂枡鎵规
+                        SkuQty: parseInt($("#SkuQty").val()), //鐗╂枡鏁伴噺
+                        Origin:"PDA"
+                    }
+                    
+                    console.log(param)
+                    //缁勭洏
+                    sendData(IP + "/PdaAsn/BindPallet", param, 'post', function (res) {
+                        if (res.code == 0) { //鎴愬姛 
+                            layer.msg(res.msg, {
+                                icon: 1,
+                                time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                            }, function () {
+                                setOrderGoods();
+                                refreshTable();
+                                $("#STOCKCODE").val("");
+                                $("#SkuQty").val("");
+                            });
+                        } else { //涓嶆垚鍔�
+                            layer.msg(res.msg, {
+                                icon: 2,
+                                time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                            }, function () {
+                                //鍥炶皟
+                            });
+                        }
+                    });
+                }
+				
 				return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆�
 			});
 
 
 			// 鏍规嵁鍏ュ簱鏄庣粏ID 鑾峰彇璇︾粏淇℃伅
 			function setOrderGoods() {
-				$("#ImportQuantity").val("");
-				$("#Standard").val("");
-				$("#ImportFactQuantity").val("");
+                if (xianshiyemian == 0)
+                {
+                    $("#ImportQuantity").val("");
+                    $("#Standard").val("");
+                    $("#ImportFactQuantity").val("");
 
-				var param = {
-					Id: parseInt($("#goodSelect").val())
-				};
+                    var param = {
+                        Id: parseInt($("#goodSelect").val())
+                    };
 
-				synData(IP + "/PdaAsn/GetArrivalNoticeDetail", param, 'post', function (res) {
-					console.log(JSON.stringify(res))
-					if (res.code == 0 && res.data != null) { //鎴愬姛
-						$("#ImportQuantity").val(res.data.Qty);
-						$("#Standard").val(res.data.Standard);
-						$("#ImportFactQuantity").val(res.data.FactQty + "");
-					}
-				});
+                    synData(IP + "/PdaAsn/GetArrivalNoticeDetail", param, 'post', function (res) {
+                        console.log(JSON.stringify(res))
+                        if (res.code == 0 && res.data != null) { //鎴愬姛
+                            $("#ImportQuantity").val(res.data.Qty);
+                            $("#Standard").val(res.data.Standard);
+                            $("#ImportFactQuantity").val(res.data.FactQty + "");
+                        }
+                    });
+                }
+                else if (xianshiyemian == 1)
+                {
+                    $("#ImportQuantity1").val("");
+				    $("#Standard1").val("");
+                    $("#ImportFactQuantity1").val("");
+
+                    var param = {
+                        Id: parseInt($("#goodSelect1").val())
+                    };
+
+                    synData(IP + "/PdaAsn/GetArrivalNoticeDetail", param, 'post', function (res) {
+                        console.log(JSON.stringify(res))
+                        if (res.code == 0 && res.data != null) { //鎴愬姛
+                            $("#ImportQuantity1").val(res.data.Qty);
+                            $("#Standard1").val(res.data.Standard);
+                            $("#ImportFactQuantity1").val(res.data.FactQty + "");
+                        }
+                    });
+                }
+				
 			}
-            // 鏍规嵁鍏ュ簱鏄庣粏ID 鑾峰彇璇︾粏淇℃伅-鏁伴噺
-			function setOrderGoodsw() {
-				$("#ImportQuantity").val("");
-				$("#Standard").val("");
-				$("#ImportFactQuantity").val("");
-
-				var param = {
-					Id: parseInt($("#goodSelectw").val())
-				};
-
-				synData(IP + "/PdaAsn/GetArrivalNoticeDetail", param, 'post', function (res) {
-					console.log(JSON.stringify(res))
-					if (res.code == 0 && res.data != null) { //鎴愬姛
-						$("#ImportQuantity").val(res.data.Qty);
-						$("#Standard").val(res.data.Standard);
-						$("#ImportFactQuantity").val(res.data.FactQty + "");
-					}
-				});
-			}
-
-			// 缁戝畾鍏ュ簱鍗曚俊鎭�
-			function updateBillList(callback) {
-				var input = $('select[id="bar"]').next().find('.layui-select-title input')
-				var val = input.val()
-				$("#bar").empty()
-				$("#bar").append('<option value =>' + '</option>');
-				form.render('select');
-
-				var param = {
-					Type: "0,1"
-				};
-				sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) {
-					if (res.code == 0) { //鎴愬姛
-						for (var i = 0; i < res.data.length; i++) {
-							$("#bar").append('<option value =' + res.data[i].ASNNo + '>' + res.data[i]
-								.ASNNo +
-								'</option>');
-						}
-						form.render('select');
-
-						if (!val) {
-							$('#bar').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this')
-						} else {
-							var sel = 'dd[lay-value=' + val + ']';
-							$('#bar').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this')
-						}
-
-						callback(res.data)
-					} else { //涓嶆垚鍔�
-						// layer.msg(res.msg, {
-						// 	icon: 2,
-						// 	time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-						// }, function() {});
-					}
-				});
-			}
-
+          
 			var asnDetails = "";
 
-			// 缁戝畾鍏ュ簱鍗曠墿鏂欏強鎵规
-			function updateGoodList() {
-				console.log("aaaa");
-				var input = $('select[id="goodSelect"]').next().find('.layui-select-title input')
-				var val = input.val()
+			/* 缁戝畾鍏ュ簱鍗曠墿鏂欏強鎵规 */ 
+			function updateGoodList(skuNo) {
+                if (xianshiyemian == 0)
+                {
+                    console.log("aaaa");
+                    var input = $('select[id="goodSelect"]').next().find('.layui-select-title input')
+                    var val = input.val()
 
-				$("#goodSelect").empty()
-				$("#goodSelect").append('<option value =>' + '</option>');
+                    $("#goodSelect").empty()
+                    $("#goodSelect").append('<option value =>' + '</option>');
 
-				var param = {
-					AsnNo: $("#bar").val(),
-				};
-				synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) {
-					console.log("鍑哄簱鍙o細" + JSON.stringify(res))
-					if (res.code == 0) { //鎴愬姛
-						asnDetails = res.data;
-						for (var i = 0; i < res.data.length; i++) {
-							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>');
-							}
+                    var param = {
+                        AsnNo: $("#bar").val(),
+                    };
+                    synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) {
+                        console.log("鍑哄簱鍙o細" + JSON.stringify(res))
+                        if (res.code == 0) { //鎴愬姛
+                            asnDetails = res.data;
+                            for (var i = 0; i < res.data.length; i++) {
+                                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{
+                                    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');
 
-						}
-						form.render('select');
+                            if (!val) {
+                                $('#goodSelect').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this')
+                            } else {
+                                var sel = 'dd[lay-value=' + val + ']';
+                                $('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this')
+                            }
+                        } else {
+                        }
+                    });
+                }
+                else if (xianshiyemian == 1)
+                {
+                    console.log("bbbb");
+                    var input = $('select[id="goodSelect1"]').next().find('.layui-select-title input')
+                    var val = input.val()
 
-						if (!val) {
-							$('#goodSelect').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this')
-						} else {
-							var sel = 'dd[lay-value=' + val + ']';
-							$('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this')
-						}
-					} else {
-					}
-				});
+                    $("#goodSelect1").empty()
+                    $("#goodSelect1").append('<option value =>' + '</option>');
+
+                    var param = {
+                        AsnNo: $("#bar1").val(),
+                    };
+                    synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) {
+                        console.log("鍑哄簱鍙o細" + JSON.stringify(res))
+                        if (res.code == 0) { //鎴愬姛
+                            asnDetails = res.data;
+                            for (var i = 0; i < res.data.length; i++) {
+                                if (i == 0) {
+                                    $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
+                                        .SkuName + "-" + res.data[i].LotNo +
+                                        '</option>');
+                                } else {
+                                    $("#goodSelect1").append('<option value =' + res.data[i].Id + '>' + res.data[i]
+                                        .SkuName + "-" + res.data[i].LotNo +
+                                        '</option>');
+                                }
+
+                            }
+                            form.render('select');
+
+                            if (!val) {
+                                $('#goodSelect1').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this')
+                            } else {
+                                var sel = 'dd[lay-value=' + val + ']';
+                                $('#goodSelect1').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this')
+                            }
+                        } else {
+                        }
+                    });
+                }
+				
 			}
-            // 缁戝畾鍏ュ簱鍗曠墿鏂欏強鎵规-鏁伴噺
-			function updateGoodList() {
-				console.log("aaaa");
-				var input = $('select[id="goodSelectw"]').next().find('.layui-select-title input')
-				var val = input.val()
-
-				$("#goodSelectw").empty()
-				$("#goodSelectw").append('<option value =>' + '</option>');
-
-				var param = {
-					AsnNo: $("#bar").val(),
-				};
-				synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) {
-					console.log("鍑哄簱鍙o細" + JSON.stringify(res))
-					if (res.code == 0) { //鎴愬姛
-						asnDetails = res.data;
-						for (var i = 0; i < res.data.length; i++) {
-							if (i == 0) {
-								$("#goodSelectw").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
-									.SkuName + "-" + res.data[i].LotNo +
-									'</option>');
-							} else {
-								$("#goodSelectw").append('<option value =' + res.data[i].Id + '>' + res.data[i]
-									.SkuName + "-" + res.data[i].LotNo +
-									'</option>');
-							}
-
-						}
-						form.render('select');
-
-						if (!val) {
-							$('#goodSelectw').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this')
-						} else {
-							var sel = 'dd[lay-value=' + val + ']';
-							$('#goodSelectw').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this')
-						}
-					} else {
-					}
-				});
-			}
-
+           
 			// 娓叉煋绠辩爜淇℃伅
 			function refreshTable() {
-				//鍏堟竻绌轰竴涓嬬瀛愬垪琛�
-				let trs = $("#tableBoxList tr")
-				let len = trs.length
+                if (xianshiyemian == 0)
+                {
+                    //鍏堟竻绌轰竴涓嬬瀛愬垪琛�
+                    let trs = $("#tableBoxList tr")
+                    let len = trs.length
 
-				for (i = len - 1; i >= 2; i--) {
-					trs[i].remove();
-				}
+                    for (i = len - 1; i >= 2; i--) {
+                        trs[i].remove();
+                    }
 
-				//璁剧疆鎵樼洏鍙�
-				$("#palletCode").val($.cookie('stockCode'))
+                    //璁剧疆鎵樼洏鍙�
+                    $("#palletCode").val($.cookie('stockCode'))
 
-				var param = {
-					PalletNo: $.cookie('stockCode')
-				};
-				//  鏍规嵁鎵樼洏鍙疯幏鍙栫鐮佷俊鎭�
-				sendData(IP + "/PdaAsn/GetBoxInfos", param, 'post', function (res) {
-					if (res.code == 0) { //鎴愬姛
-						var list = res
-						var arrTrs = new Array()
-						let idx = 0
-						for (var i in res.data) {
-							var tr = $("#boxCell").eq(0).clone();
-							tr.appendTo("#tableBoxList");
-							tr.attr('id', res.data[i].Id)
-							tr.attr('boxno', res.data[i].BoxNo)
-							tr.attr('BindNo', res.data[i].BindNo)
-							idx++;
-							tr.attr('index', idx)
-							tr.find("td[name='code']").html(res.data[i].BoxNo);
-							tr.find("td[name='name']").html(res.data[i].SkuName);
-							tr.find("td[name='lotNo']").html(res.data[i].LotNo);
-							tr.find("td[name='num']").html(res.data[i].Qty);
-							tr.find("td[name='del']").click(function () {
-								var elem = $(this).parent()
-								var boxno = elem.attr('boxno')
-								var BindNo = elem.attr('BindNo')
-								var Id = elem.attr('id')
-								layer.alert("纭畾瑕佷粠鎵樼洏涓婂垹闄よ繖涓鐗╂枡鍚楋紵<br>" + boxno, {
-									icon: 2,
-									time: 0, //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-									btn: ['鍒犻櫎', '鍙栨秷'],
-									yes: function () {
+                    var param = {
+                        PalletNo: $.cookie('stockCode')
+                    };
+                    //  鏍规嵁鎵樼洏鍙疯幏鍙栫鐮佷俊鎭�
+                    sendData(IP + "/PdaAsn/GetBoxInfos", param, 'post', function (res) {
+                        if (res.code == 0) { //鎴愬姛
+                            var list = res
+                            var arrTrs = new Array()
+                            let idx = 0
+                            for (var i in res.data) {
+                                var tr = $("#boxCell").eq(0).clone();
+                                tr.appendTo("#tableBoxList");
+                                tr.attr('id', res.data[i].Id)
+                                tr.attr('boxno', res.data[i].BoxNo)
+                                tr.attr('BindNo', res.data[i].BindNo)
+                                idx++;
+                                tr.attr('index', idx)
+                                tr.find("td[name='code']").html(res.data[i].BoxNo);
+                                tr.find("td[name='name']").html(res.data[i].SkuName);
+                                tr.find("td[name='lotNo']").html(res.data[i].LotNo);
+                                tr.find("td[name='num']").html(res.data[i].Qty);
+                                tr.find("td[name='del']").click(function () {
+                                    var elem = $(this).parent()
+                                    var boxno = elem.attr('boxno')
+                                    var BindNo = elem.attr('BindNo')
+                                    var Id = elem.attr('id')
+                                    layer.alert("纭畾瑕佷粠鎵樼洏涓婂垹闄よ繖涓鐗╂枡鍚楋紵<br>" + boxno, {
+                                        icon: 2,
+                                        time: 0, //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                                        btn: ['鍒犻櫎', '鍙栨秷'],
+                                        yes: function () {
 
-										var param = {
-											Id: Id,
-										};
-										sendData(IP + "/PdaAsn/DelBoxInfo", param, 'post', function (res) {
-											if (res.code == 0) { //鎴愬姛
-												layer.msg(res.msg, {
-													icon: 1,
-													time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-												});
-												elem.remove()
-												setOrderGoods();
-												refreshTable();
-											} else { //涓嶆垚鍔�
-												layer.msg(res.msg, {
-													icon: 2,
-													time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-												}, function () { });
-											}
-										});
-									}
-								})
-							})
-							tr.show();
-							arrTrs[i] = tr
-						}
+                                            var param = {
+                                                boxNo: res.data[i].BoxNo,
+                                            };
+                                            sendData(IP + "/BllAsn/DelBindBoxInfo", param, 'get', function (res) {
+                                                if (res.code == 0) { //鎴愬姛
+                                                    layer.msg(res.msg, {
+                                                        icon: 1,
+                                                        time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                                                    });
+                                                    elem.remove()
+                                                    setOrderGoods();
+                                                    refreshTable();
+                                                } else { //涓嶆垚鍔�
+                                                    layer.msg(res.msg, {
+                                                        icon: 2,
+                                                        time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                                                    }, function () { });
+                                                }
+                                            });
+                                        }
+                                    })
+                                })
+                                tr.show();
+                                arrTrs[i] = tr
+                            }
 
 
-					} else { //涓嶆垚鍔�
-						layer.msg("鏃犳暟鎹�", {
-							icon: 2,
-							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-						}, function () { });
-						$("#boxNum").val(0)
-					}
-				});
+                        } else { //涓嶆垚鍔�
+                            layer.msg("鏃犳暟鎹�", {
+                                icon: 2,
+                                time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                            }, function () { });
+                            $("#boxNum").val(0)
+                        }
+                    });
+                }
+                else if (xianshiyemian == 1)
+                {
+                    //鍏堟竻绌轰竴涓嬬瀛愬垪琛�
+                    let trs = $("#tableBoxList1 tr")
+                    let len = trs.length
+
+                    for (i = len - 1; i >= 2; i--) {
+                        trs[i].remove();
+                    }
+
+                    //璁剧疆鎵樼洏鍙�
+                    $("#palletCode").val($.cookie('stockCode1'))
+
+                    var param = {
+                        PalletNo: $.cookie('stockCode1')
+                    };
+                    //  鏍规嵁鎵樼洏鍙疯幏鍙栫鐮佷俊鎭�
+                    sendData(IP + "/PdaAsn/GetPalletBindInfo", param, 'post', function (res) {
+                        if (res.code == 0) { //鎴愬姛
+                            var list = res
+                            var arrTrs = new Array()
+                            let idx = 0
+                            for (var i in res.data) {
+                                var tr = $("#boxCell").eq(0).clone();
+                                tr.appendTo("#tableBoxList1");
+                                tr.attr('id', res.data[i].Id)
+                                tr.attr('boxno', res.data[i].BoxNo)
+                                tr.attr('BindNo', res.data[i].BindNo)
+                                idx++;
+                                tr.attr('index', idx)
+                                tr.find("td[name='code']").html(res.data[i].SkuNo);
+                                tr.find("td[name='name']").html(res.data[i].SkuName);
+                                tr.find("td[name='lotNo']").html(res.data[i].LotNo);
+                                tr.find("td[name='num']").html(res.data[i].Qty);
+                                tr.find("td[name='del']").click(function () {
+                                    var elem = $(this).parent()
+                                    // var boxno = elem.attr('boxno')
+                                    var BindNo = elem.attr('BindNo')
+                                    console.log(res)
+                                    var Id = elem.attr('id')
+                                    layer.alert("纭畾瑕佷粠鎵樼洏涓婂垹闄よ繖鎵樼墿鏂欏悧锛�<br>" + res.data[0].PalletNo, {
+                                        icon: 2,
+                                        time: 0, //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                                        btn: ['鍒犻櫎', '鍙栨秷'],
+                                        yes: function () {
+
+                                            var param = {
+                                                PalletNo: res.data[0].PalletNo,
+                                            };
+                                            console.log(Id)
+                                            console.log(param)
+                                            // sendData(IP + "/PdaAsn/DelBoxInfo", param, 'post', function (res) {
+                                            //     if (res.code == 0) { //鎴愬姛
+                                            //         layer.msg(res.msg, {
+                                            //             icon: 1,
+                                            //             time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                                            //         });
+                                            //         elem.remove()
+                                            //         setOrderGoods();
+                                            //         refreshTable();
+                                            //     } else { //涓嶆垚鍔�
+                                            //         layer.msg(res.msg, {
+                                            //             icon: 2,
+                                            //             time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                                            //         }, function () { });
+                                            //     }
+                                            // });
+                                        }
+                                    })
+                                })
+                                tr.show();
+                                arrTrs[i] = tr
+                            }
+
+                        //璁剧疆鍒嗛〉
+                        setPages(1, list.length)
+
+                        } else { //涓嶆垚鍔�
+                            layer.msg("鏃犳暟鎹�", {
+                                icon: 2,
+                                time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                            }, function () { });
+                            $("#boxNum").val(0)
+                            setPages(1, 0)
+                        }
+                    });
+                }
+				
 			}
 
 			// 鍒ゆ柇鎵樼洏鐮佹槸鍚﹀彲鐢�
 			function checkPalletStat() {
-				var param = {
-					"PalletNo": $("#STOCKCODE").val()
-				}
-				sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) {
-					if (res.code == 0) {
+                if (xianshiyemian == 0)
+                {
+                    var param = {
+                        "PalletNo": $("#STOCKCODE").val()
+                    }
+                    sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) {
+                        if (res.code == 0) {
 
-						$.cookie('stockCode', $("#STOCKCODE").val());
-						refreshTable()
-						$("#BOXCODE").focus();
+                            $.cookie('stockCode', $("#STOCKCODE").val());
+                            refreshTable()
+                            $("#BOXCODE").focus();
 
-					} else {
-						layer.msg(res.msg, {
-							icon: 2,
-							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-						}, function () { });
-					}
-				});
+                        } else {
+                            layer.msg(res.msg, {
+                                icon: 2,
+                                time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                            }, function () { });
+                        }
+                    });
+                }
+                else if (xianshiyemian == 1)
+                {
+                    var param = {
+                        "PalletNo": $("#STOCKCODE1").val()
+                    }
+                    sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) {
+                        if (res.code == 0) {
+
+                            $.cookie('stockCode1', $("#STOCKCODE1").val());
+                            refreshTable()
+                            $("#SkuQty").focus();
+
+                        } else {
+                            layer.msg(res.msg, {
+                                icon: 2,
+                                time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                            }, function () { });
+                        }
+                    });
+                }
+				
 			}
-            // 鍒ゆ柇鎵樼洏鐮佹槸鍚﹀彲鐢�
-			function checkPalletStatw() {
-				var param = {
-					"PalletNo": $("#STOCKCODEw").val()
-				}
-				sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) {
-					if (res.code == 0) {
-
-						$.cookie('STOCKCODEw', $("#STOCKCODEw").val());
-						refreshTable()
-						// $("#BOXCODE").focus();
-
-					} else {
-						layer.msg(res.msg, {
-							icon: 2,
-							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-						}, function () { });
-					}
-				});
-			}
+          
 
 			function checkBoxInfo() {
 				var param = {
 					"BoxNo": $("#BOXCODE").val(),
 				}
-				sendData(IP + "/PdaAsn/GetBoxInfos", param, 'post', function (res) {
+				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);
@@ -886,7 +1206,248 @@
 
 			}
 
+
+            /* 鍒嗛〉 */
+            //璁剧疆鍒嗛〉
+            function setPages(pageIndex, boxNum){
+
+                if (xianshiyemian == 0)
+                {
+                    if(boxNum <= 0){
+                        //鍒楄〃涓虹┖锛岄殣钘忓垎椤甸〉鐮�
+                        $("#tableBoxPages").hide()
+                        return
+                    }
+                    
+                    let pageNum = Math.floor(boxNum / 10);
+                    if(boxNum % 10 > 0){
+                        pageNum += 1;
+                    }
+                    //console.log("pageNum is " + pageNum)
+                    
+                    $("#tableBoxPages").find("tr").remove()
+                    let table = $("#tableBoxPages")
+                    $("<tr></tr>").appendTo("#tableBoxPages")
+                    
+                    // let newTr = table.append("<tr></tr>")
+                    // newTr.append("<td class='page-prev'>涓婁竴椤�</td>")
+                    $("<td id='prevPage' class='page-prev'>涓婁竴椤�</td>").appendTo("#tableBoxPages tr")
+                    $("#tableBoxPages tr").eq(0).find("td[id^='prevPage']").click(function(){
+                        onClickPrevPage()
+                    })
+                    for(i=1; i < pageNum + 1; i++){
+                        // newTr.append("<td class='page-num'>"+ i +"</td>")
+                        $("<td class='page-num'>"+ i +"</td>").appendTo("#tableBoxPages tr")
+                    }
+                    // newTr.append("<td class='page-next'>涓嬩竴椤�</td>")
+                    $("<td id='nextPage' class='page-next'>涓嬩竴椤�</td>").appendTo("#tableBoxPages tr")
+                    $("#tableBoxPages tr").eq(0).find("td[id^='nextPage']").click(function(){
+                        onClickNextPage()
+                    })
+                    // pages.show()
+                    $("#tableBoxPages").show()
+                    
+                    setCurPage(1)
+                }
+                else if (xianshiyemian == 1)
+                {
+                    if(boxNum <= 0){
+                        //鍒楄〃涓虹┖锛岄殣钘忓垎椤甸〉鐮�
+                        $("#tableBoxPages1").hide()
+                        return
+                    }
+                    
+                    let pageNum = Math.floor(boxNum / 10);
+                    if(boxNum % 10 > 0){
+                        pageNum += 1;
+                    }
+                    //console.log("pageNum is " + pageNum)
+                    
+                    $("#tableBoxPages1").find("tr").remove()
+                    let table = $("#tableBoxPages1")
+                    $("<tr></tr>").appendTo("#tableBoxPages1")
+                    
+                    // let newTr = table.append("<tr></tr>")
+                    // newTr.append("<td class='page-prev'>涓婁竴椤�</td>")
+                    $("<td id='prevPage' class='page-prev'>涓婁竴椤�</td>").appendTo("#tableBoxPages1 tr")
+                    $("#tableBoxPages1 tr").eq(0).find("td[id^='prevPage']").click(function(){
+                        onClickPrevPage()
+                    })
+                    for(i=1; i < pageNum + 1; i++){
+                        // newTr.append("<td class='page-num'>"+ i +"</td>")
+                        $("<td class='page-num'>"+ i +"</td>").appendTo("#tableBoxPages1 tr")
+                    }
+                    // newTr.append("<td class='page-next'>涓嬩竴椤�</td>")
+                    $("<td id='nextPage' class='page-next'>涓嬩竴椤�</td>").appendTo("#tableBoxPages1 tr")
+                    $("#tableBoxPages1 tr").eq(0).find("td[id^='nextPage']").click(function(){
+                        onClickNextPage()
+                    })
+                    // pages.show()
+                    $("#tableBoxPages1").show()
+                    
+                    setCurPage(1)
+                }
+                
+            }
+            
+            //璁剧疆褰撳墠鍒嗛〉
+            function setCurPage(pageIndex){
+                if (xianshiyemian == 0)
+                {
+                    let totalTrNum = $("#tableBoxList tr").length
+                    if(totalTrNum <= 2 ){
+                        //console.log("tableBoxList 涓虹┖ totalTrNum: " + totalTrNum)
+                        //curPageIndex = 1
+                        return
+                    }
+                    
+                    let pageNum = getBoxPageNum()
+                    if(pageIndex > pageNum){
+                        //console.log("璁剧疆鐨勯〉鐮佽秴鍑洪〉鏁�, pageIndex : " + pageIndex)
+                        //curPageIndex = 1
+                        return
+                    }
+                    
+                    let startIndex = (pageIndex - 1) * 10 + 1
+                    let n = totalTrNum - startIndex
+                    let endIndex = 0
+                    if(n > 9){
+                        endIndex = startIndex + 9
+                    }else{
+                        endIndex = startIndex + n
+                    }
+                    
+                    let trs = $("#tableBoxList tr")
+                    //console.log("琛屾暟 "+trs.length)
+                    let d = 0
+                    for(let i = 2; i < trs.length; i++){
+                        //console.log("琛岀储寮� " + trs.eq(i).attr('index'))
+                        let t = trs.eq(i)
+                        d = t.attr('index')
+                        if(d >= startIndex && d <= endIndex){
+                            //console.log("闇�瑕佹樉绀�")
+                            //鏄剧ず琛�
+                            t.show()
+                        }else{
+                            //闅愯棌琛�
+                            t.hide()
+                        }
+                    }
+                    
+                    curPageIndex = pageIndex
+                    
+                    let ptr = $("#tableBoxPages tr")
+                    for(let i = 1; i < pageNum+1; i++){
+                        ptr.eq(0).find("td").eq(i).removeClass("page-num-select")
+                        if(i == curPageIndex){
+                            ptr.eq(0).find("td").eq(i).addClass("page-num-select")
+                        }
+                    }
+                }
+                else if (xianshiyemian == 1)
+                {
+                    let totalTrNum = $("#tableBoxList1 tr").length
+                    if(totalTrNum <= 2 ){
+                        return
+                    }
+                    
+                    let pageNum = getBoxPageNum()
+                    if(pageIndex > pageNum){
+                        //console.log("璁剧疆鐨勯〉鐮佽秴鍑洪〉鏁�, pageIndex : " + pageIndex)
+                        //curPageIndex = 1
+                        return
+                    }
+                    
+                    let startIndex = (pageIndex - 1) * 10 + 1
+                    let n = totalTrNum - startIndex
+                    let endIndex = 0
+                    if(n > 9){
+                        endIndex = startIndex + 9
+                    }else{
+                        endIndex = startIndex + n
+                    }
+                    
+                    let trs = $("#tableBoxList1 tr")
+                    //console.log("琛屾暟 "+trs.length)
+                    let d = 0
+                    for(let i = 2; i < trs.length; i++){
+                        //console.log("琛岀储寮� " + trs.eq(i).attr('index'))
+                        let t = trs.eq(i)
+                        d = t.attr('index')
+                        if(d >= startIndex && d <= endIndex){
+                            //console.log("闇�瑕佹樉绀�")
+                            //鏄剧ず琛�
+                            t.show()
+                        }else{
+                            //闅愯棌琛�
+                            t.hide()
+                        }
+                    }
+                    
+                    curPageIndex = pageIndex
+                    
+                    let ptr = $("#tableBoxPages1 tr")
+                    for(let i = 1; i < pageNum+1; i++){
+                        ptr.eq(0).find("td").eq(i).removeClass("page-num-select")
+                        if(i == curPageIndex){
+                            ptr.eq(0).find("td").eq(i).addClass("page-num-select")
+                        }
+                    }
+                }
+                
+            }
+
+            function getBoxPageNum()
+            {
+                if (xianshiyemian == 0)
+                {
+                    let num = $("#tableBoxList tr").length
+                    if(num <= 2 ){
+                        return 0
+                    }
+                    
+                    let pageNum = Math.floor(num / 10);
+                    if(num % 10 > 0){
+                        pageNum += 1;
+                    }
+                    
+                    return pageNum
+                }
+                else if (xianshiyemian == 1)
+                {
+                    let num = $("#tableBoxList1 tr").length
+                    if(num <= 2 ){
+                        return 0
+                    }
+                    
+                    let pageNum = Math.floor(num / 10);
+                    if(num % 10 > 0){
+                        pageNum += 1;
+                    }
+                    
+                    return pageNum
+                }
+                
+            }
+
+            function onClickPrevPage(){
+                //console.log("涓婁竴椤垫寜閽鐐瑰嚮")
+                if(curPageIndex == 1){
+                    return
+                }
+                setCurPage(curPageIndex - 1)
+            }
+
+            function onClickNextPage(){
+                //console.log("涓嬩竴椤垫寜閽鐐瑰嚮")
+                let n = getBoxPageNum()
+                if(curPageIndex == n){
+                    return
+                }
+                setCurPage(curPageIndex + 1)
+            }
           
+            /*鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��*/
 
 			form.on('switch(IsLianXu)', function (obj) {
 				if (obj.elem.checked) {

--
Gitblit v1.8.0