From 8e2e6adb68d80c9803f1fc6898f8a5aba9417f67 Mon Sep 17 00:00:00 2001
From: yuyou_x <2336760928@qq.com>
Date: 星期四, 01 二月 2024 14:18:20 +0800
Subject: [PATCH] pda托盘绑定页面

---
 Pda/View/AsnSetting/productEnter1.html |  922 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 922 insertions(+), 0 deletions(-)

diff --git a/Pda/View/AsnSetting/productEnter1.html b/Pda/View/AsnSetting/productEnter1.html
new file mode 100644
index 0000000..1157f96
--- /dev/null
+++ b/Pda/View/AsnSetting/productEnter1.html
@@ -0,0 +1,922 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+	<meta name="viewport" content="user-scalable=0,width=device-width,initial-scale=1.0" />
+	<meta charset="UTF-8" />
+	<!-- <meta name="viewport" content="width=device-width, initial-scale=0.665, minimum-scale=0.5, maximum-scale=1, user-scalable=no" /> -->
+	<!-- <meta name="viewport" content="width=device-width, initial-scale=0.665" /> -->
+	<meta http-equiv="X-UA-Compatible" content="ie=edge" />
+	<title>Boxline PDA</title>
+
+	<link rel="stylesheet" href="/layui/css/layui.css" />
+	<link rel="stylesheet" href="/css/style.css" />
+	<script src="/js/adaptive.js"></script>
+	<link rel="stylesheet" href="/css/my.css" />
+	<style type="text/css">
+		td {
+			word-break: break-all;
+			word-wrap: break-word;
+		}
+
+		.layui-form-switch {
+			margin-top: 0;
+		}
+
+        /* 鏍囩鏍峰紡 */
+        .tableyang-this a {
+            margin: 10px 10px 0px 0px;
+            line-height: 30px;
+            width: 100px;
+            color: #999;
+            text-align: center;
+            float: left;
+            background: #f7f7f7;
+            user-select: none;
+            position: relative;
+            z-index: 1;
+            cursor: pointer;
+            border-radius: 5px;
+            border: 1px solid #ccc;
+            transition: all 0.3s ease;
+        }
+        
+        .tableyang-this a.hover {
+            color: #5298ff;
+            background-color: #eff2ff;
+            border: 1px solid #5298ff;
+        }
+        /* 鍐呭灞呬腑 */
+        .tableyang-tab {
+            display: flex;
+            /* justify-content: center; */
+            /* align-items: center; */
+            flex-direction: column;
+            height: 90vh;
+        }
+        /* 蹇呯敤鏍峰紡 */
+        .tableyang-2,.tableyang-3 {
+            display: none; 
+        }
+
+        ul {
+            list-style-type: none;
+            padding: 0;
+        }
+
+        li {
+            cursor: pointer;
+            background-color: lightgray;
+            padding: 10px;
+            margin-bottom: 5px;
+        }
+
+       
+
+	</style>
+	<link rel="stylesheet" href="/css/adapter.css" />
+    <script src="../../js/jquery.js"></script>
+    <script src="../../js/jquery-3.5.1.min.js"></script>
+</head>
+
+<body>
+	<div id="" class="main-content">
+        
+		<div id="" class="layout-title">
+			<table border="" cellspacing="" cellpadding="">
+				<tr>
+					<td class="img-back"><a href="../index.html"><img src="/assets/back.jpg"></a></td>
+					<td class="title-text" lang>鎵樼洏缁戝畾</td>
+					<td class="title-menu-icon"><img id="menuImg" src="/assets/menu.jpg"></td>
+				</tr>
+			</table>
+		</div>
+        
+		<div id="" class="layout-sub-content">
+			<div id="menuList" class="menu">
+				<ul class="" style="text-align: center;">
+					<li><a href="../index.html" lang>涓婚〉</a></li>
+					<!-- <li><a href="productEnterConfirm.html">鍏ュ簱淇℃伅纭</a></li> -->
+					<li><a href="../login.html" lang>閲嶆柊鐧诲綍</a></li>
+				</ul>
+			</div>
+
+            <ul>
+                <li id="option1">鏍囩</li>
+                <li id="option2">鏁伴噺</li>
+                
+            </ul>
+            
+            <br />
+            <!-- 鏈夌爜 -->
+            <div id="content1">
+                <div id="zongDiv" class="layout-bill-info" style="height: 255px;">
+                    <form class="layui-form" action="">
+                        <div id="" class="layui-form-item layout-dropdownlist">
+                            <label class="layui-form-label" lang>鍏ュ簱鍗曪細</label>
+                            <div class="layui-input-block" id="selectDiv">
+                                <select id="bar" lay-filter="getbar" lay-search>
+                                    <option value=""></option>
+                                </select>
+                                <img src="/assets/down_arraw.png">
+                            </div>
+                        </div>
+                        <div class="layui-form-item layout-dropdownlist" style="margin-top: 10px;">
+                            <label class="layui-form-label">鐗╂枡-鎵规锛�</label>
+                            <div class="layui-input-block" id="goodDiv">
+                                <select id="goodSelect" lay-filter="goodSelect" lay-search>
+                                    <option value=""></option>
+                                </select>
+                                <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">
+                                <input id="STOCKCODE" type="text" lay-verify="stock" lang langholder placeholder="璇锋壂鎻忔墭鐩樻潯鐮�"
+                                    autocomplete="off" class="layui-input">
+                            </div>
+                        </div>
+                        <div id="BOX" class="layui-form-item layout-input">
+                            <label class="layui-form-label" lang>澶栫鏉$爜锛�</label>
+                            <div class="layui-input-block">
+                                <input id="BOXCODE" type="text" lay-verify="required" lang langholder placeholder="璇锋壂鎻忓绠辨潯鐮�"
+                                    autocomplete="off" class="layui-input">
+                            </div>
+                        </div>
+                        <div id="" class="layui-form-item layout-input">
+                            <label class="layui-form-label" lang>鏄惁杩炵粍锛�</label>
+                            <div class="layui-input-block">
+                                <input type="checkbox" name="IsLianXu" id="IsLianXu" lay-skin="switch" lay-text="鏄瘄鍚�"
+                                    lay-filter="IsLianXu">
+                            </div>
+                        </div>
+                        <div id="BOX2" class="layui-form-item layout-input" style="display: none;">
+                            <label class="layui-form-label" lang>灏剧鏉$爜锛�</label>
+                            <div class="layui-input-block">
+                                <input id="BOXCODE2" type="text" lang langholder placeholder="璇锋壂鎻忓绠辨潯鐮�" autocomplete="off"
+                                    class="layui-input">
+                            </div>
+                        </div>
+
+                        <table class="layout-tbl-input" border="" cellspacing="" cellpadding="">
+                            <tr>
+                                <td>
+                                    <div id="" class="layui-form-item layout-boxinfo">
+                                        <label class="layui-form-label" lang>瑙勬牸/鍨嬪彿锛�</label>
+                                        <div class="layui-input-block">
+                                            <input id="Standard" type="text" disabled placeholder="" autocomplete="off"
+                                                class="layui-input">
+                                        </div>
+                                    </div>
+                                </td>
+                                <td>
+                                    <div id="" class="layui-form-item layout-boxinfo">
+                                        <label class="layui-form-label" lang>璁″垝鏁伴噺锛�</label>
+                                        <div class="layui-input-block">
+                                            <input id="ImportQuantity" type="text" disabled placeholder=""
+                                                autocomplete="off" class="layui-input">
+                                        </div>
+                                    </div>
+                                </td>
+
+                            </tr>
+                            <tr>
+                                <td>
+                                    <div id="" class="layui-form-item layout-boxinfo">
+                                        <label class="layui-form-label" lang>宸茬粍鏁伴噺锛�</label>
+                                        <div class="layui-input-block">
+                                            <input id="ImportFactQuantity" type="text" disabled placeholder=""
+                                                autocomplete="off" class="layui-input">
+                                        </div>
+                                    </div>
+                                </td>
+                                <td>
+                                    <div id="" class="layui-form-item layout-boxinfo">
+                                        <label class="layui-form-label" lang>绠卞唴鏁伴噺锛�</label>
+                                        <div class="layui-input-block">
+                                            <input id="BoxQty" type="text" disabled placeholder="" autocomplete="off"
+                                                class="layui-input">
+                                        </div>
+                                    </div>
+                                </td>
+                            </tr>
+
+                        </table>
+                        
+                    </form>
+                </div>
+
+            </div>
+            <!-- 鏃犵爜 -->
+            <div id="content2">
+                <div id="zongDiv" class="layout-bill-info" style="height: 255px;">
+                    <form class="layui-form" 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>
+                                    <option value=""></option>
+                                </select>
+                                <img src="/assets/down_arraw.png">
+                            </div>
+                        </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>
+                                    <option value=""></option>
+                                </select>
+                                <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">
+                                <input id="STOCKCODEw" type="text" lay-verify="stock" lang langholder placeholder="璇锋壂鎻忔墭鐩樻潯鐮�"
+                                    autocomplete="off" class="layui-input">
+                            </div>
+                        </div>
+
+                        <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="璇疯緭鍏ョ墿鏂欐暟閲�"
+                                    autocomplete="off" class="layui-input">
+                            </div>
+                        </div>
+                       
+                        <table class="layout-tbl-input" border="" cellspacing="" cellpadding="">
+                            <tr>
+                                <td>
+                                    <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"
+                                                class="layui-input">
+                                        </div>
+                                    </div>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td>
+                                    <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=""
+                                                autocomplete="off" class="layui-input">
+                                        </div>
+                                    </div>
+                                </td>
+
+                            </tr>
+                            <tr>
+                                <td>
+                                    <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=""
+                                                autocomplete="off" class="layui-input">
+                                        </div>
+                                    </div>
+                                </td>
+                            </tr>
+
+                        </table>
+
+                    </form>
+                </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>
+	<script src="/js/jquery-3.5.1.min.js"></script>
+	<script src="/layui/layui.js"></script>
+	<script src="/js/public.js"></script>
+	<script src="/js/language.js"></script>
+	<script src="/js/jquery.cookie.js"></script>
+	<script>
+		layui.use(['form', 'jquery'], function () {
+			var form = layui.form
+
+            /* 鏍囩鍒囨崲浠g爜 */
+            
+            var xianshiyemian = 0;
+            
+            $('#option1').attr("style", "background-color: aqua;width: 45.77%;float: left;text-align: center;"); //閫変腑鍚庨鑹�
+            $('#option2').attr("style", "background-color: #999;width: 45.77%;float: right;text-align: center;"); //榛樿棰滆壊
+            $('#content2').hide();
+            $(document).ready(function() {
+                $('#option1').click(function() {
+                    xianshiyemian = 0;
+                    $('#content1').show();
+                    $('#option1').attr("style", "background-color: aqua;width: 45.77%;float: left;text-align: center;"); //閫変腑鍚庨鑹�
+
+                    $('#content2').hide();
+                    $('#option2').attr("style", "background-color: #999;width: 45.77%;float: right;text-align: center;"); //榛樿棰滆壊
+                });
+
+                $('#option2').click(function() {
+                    xianshiyemian = 1;
+                    $('#content1').hide();
+                    $('#option1').attr("style", "background-color: #999;width: 45.77%;float: left;text-align: center;"); //榛樿棰滆壊
+
+                    $('#content2').show();
+                    $('#option2').attr("style", "background-color: aqua;width: 45.77%;float: right;text-align: center;"); //閫変腑鍚庨鑹�
+                    
+                });
+            });
+        
+
+			initLanguage()
+			setLanguage()
+
+			//褰撳墠鍒嗛〉
+			var curPageIndex = 1;
+			//鏄惁杩炵画缁勬墭
+			isContinue = "0";
+			//娓呮鏂囨湰妗嗕腑鏁版嵁
+			function clear() {
+				$("#ImportQuantity").val("");
+				$("#GoodsCode").val("");
+				$("#Standard").val("");
+				$("#ImportFactQuantity").val("");
+				$("#ImportQty").val("");
+				$("#BoxQty").val("");
+			}
+
+			// 鎵樼洏鐮佹枃鏈敼鍙樻椂瑙﹀彂
+			$("#STOCKCODE").on('input', function () {
+
+				if ($("#STOCKCODE").val() == "" || $("#STOCKCODE").val().length < 8) {
+					return
+				}
+				if ($("#STOCKCODE").val().length >= 8) {
+					$("#STOCKCODE").val($("#STOCKCODE").val().substr(-8))
+				}
+				checkPalletStat()
+			})
+
+            // 鎵樼洏鐮佹枃鏈敼鍙樻椂瑙﹀彂-鏁伴噺
+			$("#STOCKCODEw").on('input', function () {
+
+                if ($("#STOCKCODEw").val() == "" || $("#STOCKCODEw").val().length < 8) {
+                    return
+                }
+                if ($("#STOCKCODEw").val().length >= 8) {
+                    $("#STOCKCODEw").val($("#STOCKCODEw").val().substr(-8))
+                }
+                checkPalletStat()
+            })
+
+			//绠辩爜鍥炶溅浜嬩欢
+			$("#BOXCODE").keydown(function (e) {
+				if (e.keyCode === 13) {
+					if ($("#BOXCODE").val() == "") {
+						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)
+				})
+			})
+            //鐐瑰嚮鍏ュ簱鍗曟嵁涓嬫媺妗嗕簨浠�-鏁伴噺
+			$("#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)
+				})
+			})
+
+			//鐐瑰嚮鐗╂枡涓嬫媺妗嗕簨浠�
+			$("#goodDiv").click(function () {
+				if ($("#bar").val() == null || $("#bar").val() == "" || $("#bar").val() == undefined) {
+					layer.msg("璇峰厛閫夋嫨鍏ュ簱鍗�", {
+						icon: 2,
+						time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+					}, function () { });
+				}
+			})
+            //鐐瑰嚮鐗╂枡涓嬫媺妗嗕簨浠�-鏁伴噺
+			$("#goodDivw").click(function () {
+				if ($("#barw").val() == null || $("#barw").val() == "" || $("#barw").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(goodSelect)', function (data) {
+				setOrderGoods();
+			});
+            //閫変腑鐗╂枡浜嬩欢-鏁伴噺
+            form.on('select(goodSelectw)', 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 = {
+					AsnNo: $("#bar").val(),
+					PalletNo: $("#STOCKCODE").val(),
+					AsnDetailId: parseInt($("#goodSelect").val()),
+					BoxNo: $("#BOXCODE").val(),
+					IsContinue: isContinue,
+					TailBoxNo: $("#BOXCODE2").val(),
+					Origin:"PDA"
+				}
+				//缁勭洏
+				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();
+							$("#BOXCODE").val("");
+							$("#BOXCODE2").val("");
+							$("#QTY").val("");
+						});
+					} else { //涓嶆垚鍔�
+						layer.msg(res.msg, {
+							icon: 2,
+							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						}, function () {
+							//鍥炶皟
+						});
+					}
+				});
+				return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆�
+			});
+
+
+			// 鏍规嵁鍏ュ簱鏄庣粏ID 鑾峰彇璇︾粏淇℃伅
+			function setOrderGoods() {
+				$("#ImportQuantity").val("");
+				$("#Standard").val("");
+				$("#ImportFactQuantity").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 + "");
+					}
+				});
+			}
+            // 鏍规嵁鍏ュ簱鏄庣粏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()
+
+				$("#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>');
+							}
+
+						}
+						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 {
+					}
+				});
+			}
+            // 缁戝畾鍏ュ簱鍗曠墿鏂欏強鎵规-鏁伴噺
+			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
+
+				for (i = len - 1; i >= 2; i--) {
+					trs[i].remove();
+				}
+
+				//璁剧疆鎵樼洏鍙�
+				$("#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 = {
+											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
+						}
+
+
+					} else { //涓嶆垚鍔�
+						layer.msg("鏃犳暟鎹�", {
+							icon: 2,
+							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						}, function () { });
+						$("#boxNum").val(0)
+					}
+				});
+			}
+
+			// 鍒ゆ柇鎵樼洏鐮佹槸鍚﹀彲鐢�
+			function checkPalletStat() {
+				var param = {
+					"PalletNo": $("#STOCKCODE").val()
+				}
+				sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) {
+					if (res.code == 0) {
+
+						$.cookie('stockCode', $("#STOCKCODE").val());
+						refreshTable()
+						$("#BOXCODE").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) {
+					if (res.code == 0) { //鎴愬姛
+						var bl = false; console.log(res.data);
+						if (res.data.length == 0) {
+							layer.msg("鏈煡璇㈠埌姝ょ鐗╂枡淇℃伅锛岃鏍稿疄!", {
+								icon: 2,
+								time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+							});
+							return;
+						}
+						asnDetails.forEach(element => {
+							console.log(element);
+
+							if (element.SkuNo == res.data[0].SkuNo && element.LotNo == res.data[0].LotNo) {
+								var sel = 'dd[lay-value=' + element.id + ']';
+								$('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this');
+								bl = true;
+							}
+						});
+						if (!bl) {
+							layer.msg("姝ょ鐗╂枡涓嶇鍚堣鍏ュ簱鍗曪紝璇锋牳瀹�!", {
+								icon: 2,
+								time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+							});
+						} else {
+							$("#BoxQty").val(res.data[0].Qty);
+						}
+
+					} else { //涓嶆垚鍔�
+						layer.msg(res.msg, {
+							icon: 2,
+							time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+						});
+					}
+				});
+
+			}
+
+          
+
+			form.on('switch(IsLianXu)', function (obj) {
+				if (obj.elem.checked) {
+					$('#BOX2').attr("style", "display:block")
+					$('#zongDiv').attr("style", "height: 285px;")
+					isContinue = "1";
+				} else {
+					$('#BOX2').attr("style", "display:none")
+					$('#zongDiv').attr("style", "height: 255px;")
+					isContinue = "0";
+				}
+				$('#BOXCODE2').val("");
+			});
+
+			$("#menuImg").click(function (e) {
+				//console.log("menuImg")
+				e.stopPropagation()
+
+				if ($("#menuList").is(":hidden")) {
+					$("#menuList").show()
+				} else {
+					$("#menuList").hide()
+				}
+			})
+			$('body').click(function () {
+				// //console.log("body")
+				$("#menuList").hide()
+			})
+		})
+	</script>
+</body>
+
+</html>
\ No newline at end of file

--
Gitblit v1.8.0