From ac1ddbaf2c9ecded1545eb9950bf8b6941b4c13b Mon Sep 17 00:00:00 2001
From: Demo <Demo@DESKTOP-CPA90BF>
Date: 星期二, 05 三月 2024 15:35:52 +0800
Subject: [PATCH] 修改PDA拣货

---
 Pda/View/HouseDataSetting/agvTransport.html | 1082 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 1,082 insertions(+), 0 deletions(-)

diff --git a/Pda/View/HouseDataSetting/agvTransport.html b/Pda/View/HouseDataSetting/agvTransport.html
index e69de29..5c89e82 100644
--- a/Pda/View/HouseDataSetting/agvTransport.html
+++ b/Pda/View/HouseDataSetting/agvTransport.html
@@ -0,0 +1,1082 @@
+<!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>AGV杞繍</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: 170px;">
+                    <form class="layui-form" action="">
+                        <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="" class="layui-form-item layout-input">
+                            <label class="layui-form-label" lang>璧峰鍦扮爜锛�</label>
+                            <div class="layui-input-block">
+                                <input id="LocatNo" type="text" lay-verify="stock" lang langholder placeholder="璧峰鍦扮爜"
+                                    autocomplete="off" class="layui-input" readonly>
+                            </div>
+                        </div>
+                        <div id="" class="layui-form-item layout-dropdownlist">
+                            <label class="layui-form-label" lang>鐩爣鍖哄煙锛�</label>
+                            <div class="layui-input-block" id="selectQuyu">
+                                <select id="Quyu" lay-filter="getQuyu" lay-search>
+                                    <option value=""></option>
+                                </select>
+                                <img src="/assets/down_arraw.png">
+                            </div>
+                        </div>
+                        <div id="" class="layui-form-item layout-dropdownlist">
+                            <label class="layui-form-label" lang>鍏ュ簱鍙o細</label>
+                            <div class="layui-input-block" id="selectRuku">
+                                <select id="Ruku" lay-filter="getRuku" lay-search>
+                                    <option value=""></option>
+                                    <option value="A">A</option>
+                                    <option value="B">B</option>
+                                    <option value="C">C</option>
+                                    <option value="D">D</option>
+                                </select>
+                                <img src="/assets/down_arraw.png">
+                            </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="formCall">鍙皬杞�</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>
+                        </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>
+                        </tr>
+                    </table>
+                    <!-- 鍒嗛〉 -->
+                    <table id="tableBoxPages" class="tbl-box-pages" border="" cellspacing="" cellpadding="">
+                        <tr>
+                            <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: 150px;">
+                    <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="selectOutNo">
+                                <select id="OutNo" lay-filter="getOutNo" lay-search>
+                                    <option value=""></option>
+                                </select>
+                                <img src="/assets/down_arraw.png">
+                            </div>
+                        </div>
+                        <div id="" class="layui-form-item layout-dropdownlist">
+                            <label class="layui-form-label" lang>鎵樼洏鏉$爜锛�</label>
+                            <div class="layui-input-block" id="selectPalletNo">
+                                <select id="PalletNo" lay-filter="getPalletNo" lay-search>
+                                    <option value=""></option>
+                                </select>
+                                <img src="/assets/down_arraw.png">
+                            </div>
+                        </div>
+                        <div id="" class="layui-form-item layout-dropdownlist">
+                            <label class="layui-form-label" lang>鐩爣鍖哄煙锛�</label>
+                            <div class="layui-input-block" id="selectQuyu2">
+                                <select id="Quyu2" lay-filter="getQuyu2" lay-search>
+                                    <option value=""></option>
+                                </select>
+                                <img src="/assets/down_arraw.png">
+                            </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="formCall2">鍙皬杞�</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>
+                        </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>
+                        </tr>
+                    </table>
+                    <!-- 鍒嗛〉 -->
+                    <table id="tableBoxPages1" class="tbl-box-pages" border="" cellspacing="" cellpadding="">
+                        <tr>
+                            <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>
+    </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 () {
+                    // qingkong();
+                    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 () {
+                    // qingkong();
+                    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;
+            
+            // 鎵樼洏鐮佹枃鏈敼鍙樻椂瑙﹀彂
+            $("#STOCKCODE").on('input', function () {
+                if ($("#STOCKCODE").val() == "" || $("#STOCKCODE").val().length < 8) {
+                    return
+                }
+                if ($("#STOCKCODE").val().length >= 8) {
+                    $("#STOCKCODE").val($("#STOCKCODE").val().substr(-8))
+                }
+                getPalletLocatNo()
+            })
+            //鎵樼洏鐮佸洖杞︿簨浠�
+            $("#STOCKCODE").keydown(function (e) {
+                if (e.keyCode === 13) {
+                    if ($("#STOCKCODE").val() == "") {
+                        layer.msg('璇峰厛鎵弿鎵樼洏鏉$爜', {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        });
+                        return
+                    }
+                    getPalletLocatNo()
+                }
+            });
+
+            function getPalletLocatNo() {
+                if (xianshiyemian == 0) {
+                    var param = {
+                        "PalletNo": $("#STOCKCODE").val()
+                    }
+                    sendData(IP + "/PdaCr/GetPalletLocatNo", param, 'get', function (res) {
+                        if (res.code == 0) {
+                            $("#LocatNo").val(res.data)
+                            refreshTable()
+                        } else {
+                            $("#LocatNo").val('')
+                            //鍏堟竻绌轰竴涓嬬瀛愬垪琛�
+                            let trs = $("#tableBoxList tr")
+                            let len = trs.length
+
+                            for (i = len - 1; i >= 2; i--) {
+                                trs[i].remove();
+                            }
+                            layer.msg(res.msg, {
+                                icon: 2,
+                                time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                            }, function () { });
+                        }
+                    });
+                }
+                else if (xianshiyemian == 1) {
+                    
+                }
+
+            }
+            //鐐瑰嚮鐩爣鍖哄煙涓嬫媺妗嗕簨浠�
+            $("#selectQuyu").click(function () {
+                if ($("#STOCKCODE").val() == "") {
+                    layer.msg('璇峰厛鎵弿鎵樼洏鏉$爜', {
+                        icon: 2,
+                        time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                    });
+                    return
+                }
+                if ($("#LocatNo").val() == "") {
+                    layer.msg('璇锋壂鎻忔纭殑鎵樼洏鏉$爜', {
+                        icon: 2,
+                        time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                    });
+                    return
+                }
+                var input = $('select[id="Quyu"]').next().find('.layui-select-title input')
+                var val = input.val()
+                //鍏堟洿鏂颁竴涓嬬洰鏍囧尯鍩�
+                updateQuyuList(function (data) {
+                    $('select[id="Quyu"]').next().addClass('layui-form-selected')
+                    $('select[id="Quyu"]').next().find('.layui-select-title input').val(val)
+                })
+            })
+
+            /* 缁戝畾鐩爣鍖哄煙淇℃伅 */
+            function updateQuyuList(callback) {
+                var input = $('select[id="Quyu"]').next().find('.layui-select-title input')
+                var val = input.val()
+                $("#Quyu").empty()
+                $("#Quyu").append('<option value =>' + '</option>');
+                form.render('select');
+
+                var param = {
+                    "PalletNo": $("#STOCKCODE").val()
+                };
+                sendData(IP + "/PdaCr/GetStorageArea", param, 'get', function (res) {
+                    if (res.code == 0) { //鎴愬姛
+                        for (var i = 0; i < res.data.length; i++) {
+                            $("#Quyu").append('<option value =' + res.data[i].AreaNo + '>' + res.data[i]
+                                .AreaNo + '-'+res.data[i].AreaName+
+                                '</option>');
+                        }
+                        form.render('select');
+
+                        if (!val) {
+                            $('#Quyu').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this')
+                        } else {
+                            var sel = 'dd[lay-value=' + val + ']';
+                            $('#Quyu').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() {});
+                    }
+                });
+            }
+
+            //鐐瑰嚮鍑哄簱鍗曟嵁涓嬫媺妗嗕簨浠�
+            $("#selectOutNo").click(function () {
+                var input = $('select[id="OutNo"]').next().find('.layui-select-title input')
+                var val = input.val()
+                //鍏堟洿鏂颁竴涓嬪嚭搴撳崟
+                updateBillList(function (data) {
+                    $('select[id="OutNo"]').next().addClass('layui-form-selected')
+                    $('select[id="OutNo"]').next().find('.layui-select-title input').val(val)
+                })
+            })
+
+            /* 缁戝畾鍑哄簱鍗曚俊鎭� */
+            function updateBillList(callback) {
+                var input = $('select[id="OutNo"]').next().find('.layui-select-title input')
+                var val = input.val()
+                $("#OutNo").empty()
+                $("#OutNo").append('<option value =>' + '</option>');
+                form.render('select');
+
+                var param = {
+
+                };
+                sendData(IP + "/PdaCr/GetRunSoNoticeList", param, 'get', function (res) {
+                    if (res.code == 0) { //鎴愬姛
+                        for (var i = 0; i < res.data.length; i++) {
+                            $("#OutNo").append('<option value =' + res.data[i] + '>' + res.data[i]+
+                                '</option>');
+                        }
+                        form.render('select');
+
+                        if (!val) {
+                            $('#OutNo').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this')
+                        } else {
+                            var sel = 'dd[lay-value=' + val + ']';
+                            $('#OutNo').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() {});
+                    }
+                });
+            }
+             //閫変腑鍑哄簱鍗曚簨浠�
+             form.on('select(getOutNo)', function (data) {
+                $("#PalletNo").empty()
+                $("#PalletNo").append('<option value =>' + '</option>');
+                form.render('select');
+
+                $("#Quyu2").empty()
+                $("#Quyu2").append('<option value =>' + '</option>');
+                form.render('select');
+
+                refreshTable()
+            });
+
+            //鐐瑰嚮鎵樼洏鏉$爜涓嬫媺妗嗕簨浠�
+            $("#selectPalletNo").click(function () {
+                if ($("#OutNo").val() == "") {
+                    layer.msg('璇峰厛閫夋嫨鍑哄簱鍗�', {
+                        icon: 2,
+                        time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                    });
+                    return
+                }
+                var input = $('select[id="PalletNo"]').next().find('.layui-select-title input')
+                var val = input.val()
+
+                updatePalletNoList(function (data) {
+                    $('select[id="PalletNo"]').next().addClass('layui-form-selected')
+                    $('select[id="PalletNo"]').next().find('.layui-select-title input').val(val)
+                })
+            })
+
+            /* 缁戝畾鍑哄簱鍗曚笅鎵樼洏鏉$爜淇℃伅 */
+            function updatePalletNoList(callback) {
+                var input = $('select[id="PalletNo"]').next().find('.layui-select-title input')
+                var val = input.val()
+                $("#PalletNo").empty()
+                $("#PalletNo").append('<option value =>' + '</option>');
+                form.render('select');
+
+                var param = {
+                    soNo:$("#OutNo").val()
+                };
+                sendData(IP + "/PdaCr/GetPalletNoListBySoNo", param, 'get', function (res) {
+                    if (res.code == 0) { //鎴愬姛
+                        for (var i = 0; i < res.data.length; i++) {
+                            $("#PalletNo").append('<option value =' + res.data[i] + '>' + res.data[i]+
+                                '</option>');
+                        }
+                        form.render('select');
+
+                        if (!val) {
+                            $('#PalletNo').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this')
+                        } else {
+                            var sel = 'dd[lay-value=' + val + ']';
+                            $('#PalletNo').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() {});
+                    }
+                });
+            }
+
+            //閫変腑鎵樼洏浜嬩欢
+            form.on('select(getPalletNo)', function (data) {
+                refreshTable()
+
+                $("#Quyu2").empty()
+                $("#Quyu2").append('<option value =>' + '</option>');
+                form.render('select');
+            });
+
+            //鐐瑰嚮鐩爣鍖哄煙涓嬫媺妗嗕簨浠�
+            $("#selectQuyu2").click(function () {
+                if ($("#PalletNo").val() == "") {
+                    layer.msg('璇峰厛閫夋嫨鎵樼洏鏉$爜', {
+                        icon: 2,
+                        time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                    });
+                    return
+                }
+                var input = $('select[id="Quyu2"]').next().find('.layui-select-title input')
+                var val = input.val()
+                //鍏堟洿鏂颁竴涓嬬洰鏍囧尯鍩�
+                updateQuyuList2(function (data) {
+                    $('select[id="Quyu2"]').next().addClass('layui-form-selected')
+                    $('select[id="Quyu2"]').next().find('.layui-select-title input').val(val)
+                })
+            })
+
+            /* 缁戝畾鐩爣鍖哄煙淇℃伅 */
+            function updateQuyuList2(callback) {
+                var input = $('select[id="Quyu2"]').next().find('.layui-select-title input')
+                var val = input.val()
+                $("#Quyu2").empty()
+                $("#Quyu2").append('<option value =>' + '</option>');
+                form.render('select');
+
+                var param = {
+                    "PalletNo": $("#PalletNo").val()
+                };
+                sendData(IP + "/PdaCr/GetStorageArea", param, 'get', function (res) {
+                    if (res.code == 0) { //鎴愬姛
+                        for (var i = 0; i < res.data.length; i++) {
+                            $("#Quyu2").append('<option value =' + res.data[i].AreaNo + '>' + res.data[i]
+                                .AreaNo + '-'+res.data[i].AreaName+
+                                '</option>');
+                        }
+                        form.render('select');
+
+                        if (!val) {
+                            $('#Quyu2').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this')
+                        } else {
+                            var sel = 'dd[lay-value=' + val + ']';
+                            $('#Quyu2').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() {});
+                    }
+                });
+            }
+
+            //鍛煎彨灏忚溅浜嬩欢
+            form.on('submit(formCall)', function (data) {
+                if (xianshiyemian == 0) {
+                    if ($("#STOCKCODE").val() == "") {
+                        layer.msg('璇锋壂鎻忔墭鐩樻潯鐮�', {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        });
+                        return;
+                    }
+                    if ($("#LocatNo").val() == "") {
+                        layer.msg('璇锋壂鎻忔纭殑鎵樼洏鏉$爜', {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        });
+                        return;
+                    }
+                    if ($("#Quyu").val() != "" && $("#Ruku").val() != "") {
+                        layer.msg('鐩爣鍖哄煙鍜屽叆搴撳彛涓嶈兘鍚屾椂閫夋嫨', {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        });
+                        return;
+                    }
+                    var param = {
+                        PalletNo: $("#STOCKCODE").val(),
+                        AreaNo: $("#Quyu").val(),
+                        Ruku: $("#Ruku").val()
+                    }
+                    //鍛煎彨灏忚溅
+                    sendData(IP + "/PdaCr/AgvTransport", param, 'post', function (res) {
+                        if (res.code == 0) { //鎴愬姛 
+                            layer.msg(res.msg, {
+                                icon: 1,
+                                time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                            }, function () {
+                               
+                            });
+                        } else { //涓嶆垚鍔�
+                            layer.msg(res.msg, {
+                                icon: 2,
+                                time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                            }, function () {
+                                //鍥炶皟
+                            });
+                        }
+                    });
+                }
+                else if (xianshiyemian == 1) {
+                    if ($("#OutNo").val() == "") {
+                        layer.msg('璇烽�夋嫨鍑哄簱鍗�', {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        });
+                        return;
+                    }                    
+                    if ($("#PalletNo").val() == "") {
+                        layer.msg('璇锋壂鎻忔墭鐩樻潯鐮�', {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        });
+                        return;
+                    }
+                    if ($("#Quyu2").val() == "") {
+                        layer.msg('璇烽�夋嫨鐩爣鍖哄煙', {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        });
+                        return;
+                    }
+                    var param = {
+                        SoNo: $("#OutNo").val(), //鍑哄簱鍗曟嵁
+                        PalletNo: $("#PalletNo").val(), //鎵樼洏鏉$爜
+                        AreaNo: $("#Quyu").val()//鐩爣鍖哄煙
+                    }
+                    //鍛煎彨灏忚溅
+                    sendData(IP + "/PdaCr/AgvTransport2", param, 'post', function (res) {
+                        if (res.code == 0) { //鎴愬姛 
+                            layer.msg(res.msg, {
+                                icon: 1,
+                                time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                            }, function () {
+                               
+                            });
+                        } else { //涓嶆垚鍔�
+                            layer.msg(res.msg, {
+                                icon: 2,
+                                time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                            }, function () {
+                                //鍥炶皟
+                            });
+                        }
+                    });
+                }
+
+                return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆�
+            });
+
+
+            // 娓叉煋绠辩爜淇℃伅
+            function refreshTable() {
+                if (xianshiyemian == 0) {
+                    //鍏堟竻绌轰竴涓嬬瀛愬垪琛�
+                    let trs = $("#tableBoxList tr")
+                    let len = trs.length
+
+                    for (i = len - 1; i >= 2; i--) {
+                        trs[i].remove();
+                    }
+                    if($("#STOCKCODE").val()==''){
+                        return;
+                    }
+
+                    var param = {
+                        PalletNo: $("#STOCKCODE").val(),
+                        IsHuiKu:1
+                    };
+                    //  鏍规嵁鎵樼洏鍙疯幏鍙栫鐮佷俊鎭�
+                    sendData(IP + "/PdaCr/GetSkuInfoByPalletNo", param, 'get', 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.show();
+                                arrTrs[i] = tr
+                            }
+
+
+                        } 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();
+                    }
+                    if($("#PalletNo").val()==''){
+                        return;
+                    }
+                    var param = {
+                        PalletNo: $("#PalletNo").val()
+                    };
+                    //  鏍规嵁鎵樼洏鍙疯幏鍙栫鐮佷俊鎭�
+                    sendData(IP + "/PdaCr/GetSkuInfoByPalletNo", param, 'get', 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.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 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)
+            }
+
+            /*鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��*/
+
+
+            $("#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