bklLiudl
2024-10-17 265fa2b9f6816f62fffac3db611fcb1fc9dfe1a6
修改问题
15个文件已修改
2个文件已添加
7173 ■■■■ 已修改文件
HTML/views/StatisticalReport/BoxInfor.html 1382 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/View/HouseDataSetting/agvTransport.html 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/View/HouseDataSetting/boxQuery.html 462 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/View/HouseDataSetting/changebox.html 1144 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/View/HouseDataSetting/pingkuQuery.html 776 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/View/HouseDataSetting/returnGoodOut.html 1688 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/View/HouseDataSetting/stockCheck.html 137 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/View/HouseDataSetting/stockQuery.html 890 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/View/index.html 416 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/ModelDto/PdaDto/PdaBoxInfoDto.cs 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/DataServer/DataBoxInfoServer.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.Entity/DataEntity/DataBoxInfo.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/PdaCrController.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/StatisticalReport/BoxInfor.html
@@ -1,85 +1,92 @@
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>托盘明细列表</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
        <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
        <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
        <link rel="stylesheet" href="../../css/public.css" media="all">
        <style type="text/css">
            .layui-form-item .layui-inline {
                margin-bottom: 1px;
                margin-right: 1px;
            }
        </style>
        <script>
            // 这里是需要在页面渲染之前执行的代码
            document.addEventListener("DOMContentLoaded", function() {
                //获取table默认显示数
                pageCntFirst();
                //判断是否开启table列表列宽调整功能。
                GetIsSetColW();
            });
          </script>
    </head>
    <body id="body">
        <div class="layui-fluid" style="padding-bottom: 0;">
            <div class="layui-card">
                <div class="layui-form layui-card-header layuiadmin-card-header-auto" id="top">
                    <div class="layui-form-item" style="margin-bottom: 0px;">
                        <div class="layui-inline zongdan" >
                            <label class="layui-form-label" style="width: 60px;">物料编码</label>
                            <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                                <input type="text" id="SkuNo"  name="SkuNo" placeholder="物料编码" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline zongdan" >
                            <label class="layui-form-label" style="width: 60px;">物料名称</label>
                            <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                                <input type="text" id="SkuName"  name="SkuName" placeholder="物料名称" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline zongdan" >
                            <label class="layui-form-label" style="width: 60px;">托盘号</label>
                            <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                                <input type="text" id="PalletNo"  name="PalletNo" placeholder="托盘号" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline mingxi">
                            <label class="layui-form-label" style="width: 60px;">货主编码</label>
                            <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                                <input type="text" id="OwnerNo" name="OwnerNo" placeholder="货主编码" autocomplete="off"
                                    class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline mingxi">
                            <label class="layui-form-label" style="width: 60px;">货主名称</label>
                            <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                                <input type="text" id="OwnerName" name="OwnerName" placeholder="货主名称" autocomplete="off"
                                    class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline mingxi">
                            <label class="layui-form-label" style="width: 60px;">进厂编号</label>
                            <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                                <input type="text" id="LotNo"  name="LotNo" placeholder="进厂编号" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <!-- 箱码 箱支状态 检验标记 零箱标记 质量状态 -->
<head>
    <meta charset="utf-8">
    <title>托盘明细列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="../../css/public.css" media="all">
    <style type="text/css">
        .layui-form-item .layui-inline {
            margin-bottom: 1px;
            margin-right: 1px;
        }
    </style>
    <script>
        // 这里是需要在页面渲染之前执行的代码
        document.addEventListener("DOMContentLoaded", function () {
            //获取table默认显示数
            pageCntFirst();
            //判断是否开启table列表列宽调整功能。
            GetIsSetColW();
        });
    </script>
                        <div class="layui-inline zongdan" >
                            <label class="layui-form-label" style="width: 60px;">箱码</label>
                            <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                                <input type="text" id="BoxNo"  name="BoxNo" placeholder="箱码" autocomplete="off" class="layui-input">
                            </div>
</head>
<body id="body">
    <div class="layui-fluid" style="padding-bottom: 0;">
        <div class="layui-card">
            <div class="layui-form layui-card-header layuiadmin-card-header-auto" id="top">
                <div class="layui-form-item" style="margin-bottom: 0px;">
                    <div class="layui-inline zongdan">
                        <label class="layui-form-label" style="width: 60px;">物料编码</label>
                        <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                            <input type="text" id="SkuNo" name="SkuNo" placeholder="物料编码" autocomplete="off"
                                class="layui-input">
                        </div>
                        <!-- <div class="layui-inline zhijian">
                    </div>
                    <div class="layui-inline zongdan">
                        <label class="layui-form-label" style="width: 60px;">物料名称</label>
                        <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                            <input type="text" id="SkuName" name="SkuName" placeholder="物料名称" autocomplete="off"
                                class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline zongdan">
                        <label class="layui-form-label" style="width: 60px;">托盘号</label>
                        <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                            <input type="text" id="PalletNo" name="PalletNo" placeholder="托盘号" autocomplete="off"
                                class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline mingxi">
                        <label class="layui-form-label" style="width: 60px;">货主编码</label>
                        <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                            <input type="text" id="OwnerNo" name="OwnerNo" placeholder="货主编码" autocomplete="off"
                                class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline mingxi">
                        <label class="layui-form-label" style="width: 60px;">货主名称</label>
                        <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                            <input type="text" id="OwnerName" name="OwnerName" placeholder="货主名称" autocomplete="off"
                                class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline mingxi">
                        <label class="layui-form-label" style="width: 60px;">进厂编号</label>
                        <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                            <input type="text" id="LotNo" name="LotNo" placeholder="进厂编号" autocomplete="off"
                                class="layui-input">
                        </div>
                    </div>
                    <!-- 箱码 箱支状态 检验标记 零箱标记 质量状态 -->
                    <div class="layui-inline zongdan">
                        <label class="layui-form-label" style="width: 60px;">箱码</label>
                        <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                            <input type="text" id="BoxNo" name="BoxNo" placeholder="箱码" autocomplete="off"
                                class="layui-input">
                        </div>
                    </div>
                    <!-- <div class="layui-inline zhijian">
                            <label class="layui-form-label" style="width: 60px;">箱支状态</label>
                            <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                                <select name="Status" id="Status" lay-search>
@@ -91,102 +98,99 @@
                                </select>
                            </div>
                        </div> -->
                        <div class="layui-inline zhijian">
                            <label class="layui-form-label" style="width: 60px;">抽检标记</label>
                            <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                                <select name="InspectMark" id="InspectMark" lay-filter="InspectMark"
                                    lay-search>
                                    <option value=""></option>
                                    <option value="0">否</option>
                                    <option value="1">是</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline zhijian">
                            <label class="layui-form-label" style="width: 60px;">零托标记</label>
                            <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                                <select name="BitPalletMark" id="BitPalletMark" lay-filter="BitPalletMark"
                                    lay-search>
                                    <option value=""></option>
                                    <option value="0">否</option>
                                    <option value="1">是</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline zhijian">
                            <label class="layui-form-label" style="width: 60px;">零箱标记</label>
                            <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                                <select name="BitBoxMark" id="BitBoxMark" lay-filter="BitBoxMark"
                                    lay-search>
                                    <option value=""></option>
                                    <option value="0">否</option>
                                    <option value="1">是</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline zhijian">
                            <label class="layui-form-label" style="width: 60px;">质检状态</label>
                            <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                                <select name="InspectStatus" id="InspectStatus" lay-filter="InspectStatus"
                                    lay-search>
                                    <option value=""></option>
                                    <option value="0">待质检</option><!-- 待检验 -->
                                    <option value="1">检验合格</option><!-- 合格品 -->
                                    <option value="2">不合格</option><!-- 不合格 -->
                                    <option value="3">放置期</option><!-- 不合格 -->
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline sousuo">
                            <button class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit lay-filter="LAY-app-contlist-search">
                                <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>搜索
                            </button>
                            <button class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit
                                lay-filter="daochu">
                                <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>导出
                            </button>
                    <div class="layui-inline zhijian">
                        <label class="layui-form-label" style="width: 60px;">抽检标记</label>
                        <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                            <select name="InspectMark" id="InspectMark" lay-filter="InspectMark" lay-search>
                                <option value=""></option>
                                <option value="0">否</option>
                                <option value="1">是</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline zhijian">
                        <label class="layui-form-label" style="width: 60px;">零托标记</label>
                        <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                            <select name="BitPalletMark" id="BitPalletMark" lay-filter="BitPalletMark" lay-search>
                                <option value=""></option>
                                <option value="0">否</option>
                                <option value="1">是</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline zhijian">
                        <label class="layui-form-label" style="width: 60px;">零箱标记</label>
                        <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                            <select name="BitBoxMark" id="BitBoxMark" lay-filter="BitBoxMark" lay-search>
                                <option value=""></option>
                                <option value="0">否</option>
                                <option value="1">是</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline zhijian">
                        <label class="layui-form-label" style="width: 60px;">质检状态</label>
                        <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                            <select name="InspectStatus" id="InspectStatus" lay-filter="InspectStatus" lay-search>
                                <option value=""></option>
                                <option value="0">待质检</option><!-- 待检验 -->
                                <option value="1">检验合格</option><!-- 合格品 -->
                                <option value="2">不合格</option><!-- 不合格 -->
                                <option value="3">放置期</option><!-- 不合格 -->
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline sousuo">
                        <button class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit
                            lay-filter="LAY-app-contlist-search">
                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>搜索
                        </button>
                        <button class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit lay-filter="daochu">
                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>导出
                        </button>
                    </div>
                </div>
            </div>
                <div class="layui-card-body">
                    <div style="position: relative;">
                        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                            <ul class="layui-tab-title" id="tab">
                                <li  class="layui-this">托盘明细</li>
                                <li >箱码明细</li>
                            </ul>
            <div class="layui-card-body">
                <div style="position: relative;">
                    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                        <ul class="layui-tab-title" id="tab">
                            <li class="layui-this">托盘明细</li>
                            <li>箱码明细</li>
                        </ul>
                            <div id="center">
                            </div>
                        <div id="center">
                        </div>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <div class="position-relative"><!-- class="position-relative" --><!-- 自定义表头加上 -->
                                        <table id="LAY-app-content-list" lay-filter="LAY-app-content-list"></table>
                                        <!-- #region 自定义表头 -->
                                        <div class="headerSetIcon">
                                            <button class="layui-btn layui-btn-primary layui-btn-sm" data-type="customCols">
                                                <i class="layui-icon">&#xe610;</i>
                                            </button>
                                        </div>
                                        <!-- #endregion -->
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show">
                                <div class="position-relative"><!-- class="position-relative" --><!-- 自定义表头加上 -->
                                    <table id="LAY-app-content-list" lay-filter="LAY-app-content-list"></table>
                                    <!-- #region 自定义表头 -->
                                    <div class="headerSetIcon">
                                        <button class="layui-btn layui-btn-primary layui-btn-sm" data-type="customCols">
                                            <i class="layui-icon">&#xe610;</i>
                                        </button>
                                    </div>
                                    <!-- #endregion -->
                                </div>
                                <div class="layui-tab-item">
                                    <div class="position-relative"><!-- class="position-relative" --><!-- 自定义表头加上 -->
                                        <table id="LAY-app-content-list2" lay-filter="LAY-app-content-list2"></table>
                                        <!-- #region 自定义表头 -->
                                        <div class="headerSetIcon">
                                            <button class="layui-btn layui-btn-primary layui-btn-sm" data-type="customCols2">
                                                <i class="layui-icon">&#xe610;</i>
                                            </button>
                                        </div>
                                        <!-- #endregion -->
                            </div>
                            <div class="layui-tab-item">
                                <div class="position-relative"><!-- class="position-relative" --><!-- 自定义表头加上 -->
                                    <table id="LAY-app-content-list2" lay-filter="LAY-app-content-list2"></table>
                                    <!-- #region 自定义表头 -->
                                    <div class="headerSetIcon">
                                        <button class="layui-btn layui-btn-primary layui-btn-sm"
                                            data-type="customCols2">
                                            <i class="layui-icon">&#xe610;</i>
                                        </button>
                                    </div>
                                    <!-- #endregion -->
                                        <!-- #region 自定义表头 -->
                                        <script type="text/html" id="templetProductionTime">
                                    <!-- #region 自定义表头 -->
                                    <script type="text/html" id="templetProductionTime">
                                            {{# function GetBtn(d){
                                                    return formatDate(d.ProductionTime);
                                                }    
@@ -194,22 +198,30 @@
                                            {{ GetBtn(d) }}
                                        </script>
                                        <script type="text/html" id="templetInspectTime">
                                    <script type="text/html" id="templetInspectTime">
                                            {{# function GetBtn1(d){
                                                    return formatDate(d.InspectTime);
                                                }    
                                            }}
                                            {{ GetBtn1(d) }}
                                        </script>
                                        <!-- #endregion -->
                                    </div>
                                    <script type="text/html" id="templetExpirationTime">
                                            {{# function GetBtn1(d){
                                                    return formatDate(d.ExpirationTime);
                                                }
                                            }}
                                            {{ GetBtn1(d) }}
                                        </script>
                                    <!-- #endregion -->
                                </div>
                            </div>
                        </div>
                    </div>
                    <script type="text/html" id="BoxStatus">
                </div>
                <script type="text/html" id="BoxStatus">
                        {{#  if(d.Status=='0'){ }}
                            <p>未组托</p>
                        {{#  } else if(d.Status == '1') { }}
@@ -225,14 +237,14 @@
                        {{#  } }}
                        
                    </script>
                    <script type="text/html" id="InspectMarkStatus">
                <script type="text/html" id="InspectMarkStatus">
                        {{#  if(d.InspectMark=='0'){ }}
                            <p>否</p>
                        {{#  } else if(d.InspectMark == '1') { }}
                            <p>是</p>
                        {{# } }}
                    </script>
                    <script type="text/html" id="BitPalletMarkStatus">
                <script type="text/html" id="BitPalletMarkStatus">
                        {{#  if(d.BitPalletMark=='0'){ }}
                            <p>否</p>
                        {{#  } else if(d.BitPalletMark == '1') { }}
@@ -240,7 +252,7 @@
                        {{# } }}
                    </script>
                    <script type="text/html" id="InspectStatus1">
                <script type="text/html" id="InspectStatus1">
                        {{#  if(d.InspectStatus == '0') { }}
                            <p>待检验</p>
                        {{#  } else if(d.InspectStatus == '1'){ }}
@@ -251,618 +263,490 @@
                            <p>放置期</p>
                        {{#  } }}
                    </script>
                    <script type="text/html" id="BitPalletMarkStatus1">
                <script type="text/html" id="BitPalletMarkStatus1">
                        {{#  if(d.BitBoxMark=='0'){ }}
                            <p>否</p>
                        {{#  } else if(d.BitBoxMark == '1') { }}
                            <p>是</p>
                        {{# } }}
                    </script>
                    <script type="text/html" id="table-content-list">
                <script type="text/html" id="table-content-list">
                        <button class="layui-btn layui-btn-normal layui-btn-xs approvalBtnupt" id="approvalBtnupt" lay-event="edit">
                            <i class="layui-icon layui-icon-edit"></i>详情
                        </button>
                    </script>
                </div>
            </div>
        </div>
    </div>
        <script src="../../layuiadmin/layui/layui.js"></script>
        <script src="../../js/public.js"></script>
        <script src="../../js/jquery-3.5.1.min.js"></script>
        <script src="../../js/jquery.cookie.js"></script>
        <script>
            var uid = $.cookie('userId');
            layui.config({
                base: '../../layuiadmin/' //静态资源所在路径
            }).extend({
                index: 'lib/index' //主入口模块
            }).use(['index', 'table', 'laypage', 'layer','element','laydate'], function() {
                var table = layui.table,
                    form = layui.form,
                    laypage = layui.laypage,
                    layer = layui.layer;
                    element = layui.element;
                    laydate = layui.laydate;
    <script src="../../layuiadmin/layui/layui.js"></script>
    <script src="../../js/public.js"></script>
    <script src="../../js/jquery-3.5.1.min.js"></script>
    <script src="../../js/jquery.cookie.js"></script>
    <script>
        var uid = $.cookie('userId');
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'table', 'laypage', 'layer', 'element', 'laydate'], function () {
            var table = layui.table,
                form = layui.form,
                laypage = layui.laypage,
                layer = layui.layer;
            element = layui.element;
            laydate = layui.laydate;
                var h1 = GetTableTabHeight();
                // var h1 =  GetTkableTopHeight();
                // console.log(h1)
            var h1 = GetTableTabHeight();
            // var h1 =  GetTkableTopHeight();
            // console.log(h1)
                laydate.render({
                    elem: '#StartTime',
                    format: 'yyyy-MM-dd' //可任意组合
                });
                laydate.render({
                    elem: '#EndTime',
                    format: 'yyyy-MM-dd' //可任意组合
                });
                //获取当前时间
                function getNowTime() {
                    var date = new Date();
                    //年 getFullYear():四位数字返回年份
                    var year = date.getFullYear(); //getFullYear()代替getYear()
                    //月 getMonth():0 ~ 11
                    var month = date.getMonth() + 1;
                    //日 getDate():(1 ~ 31)
                    var day = date.getDate();
                    //时 getHours():(0 ~ 23)
                    var hour = date.getHours();
                    //分 getMinutes(): (0 ~ 59)
                    var minute = date.getMinutes();
                    //秒 getSeconds():(0 ~ 59)
                    var second = date.getSeconds();
                    var time = year + addZero(month) + addZero(day) + addZero(hour) + addZero(minute) + addZero(second);
                    return time;
                    //小于10的拼接上0字符串
                };
                function addZero(s) {
                    return s < 10 ? ('0' + s) : s;
                };
            laydate.render({
                elem: '#StartTime',
                format: 'yyyy-MM-dd' //可任意组合
            });
            laydate.render({
                elem: '#EndTime',
                format: 'yyyy-MM-dd' //可任意组合
            });
            //获取当前时间
            function getNowTime() {
                var date = new Date();
                //年 getFullYear():四位数字返回年份
                var year = date.getFullYear(); //getFullYear()代替getYear()
                //月 getMonth():0 ~ 11
                var month = date.getMonth() + 1;
                //日 getDate():(1 ~ 31)
                var day = date.getDate();
                //时 getHours():(0 ~ 23)
                var hour = date.getHours();
                //分 getMinutes(): (0 ~ 59)
                var minute = date.getMinutes();
                //秒 getSeconds():(0 ~ 59)
                var second = date.getSeconds();
                var $ = layui.$;
                var yemianid =0;
                refreshTable("","","","","","","","","","","","");
                var time = year + addZero(month) + addZero(day) + addZero(hour) + addZero(minute) + addZero(second);
                return time;
                // 表单需要的变量
                var infoOptions;
                //#region 原始非自定义列
                // infoOptions = {
                //     elem: '#LAY-app-content-list',
                //     height: 'full-206',
                //     id: 'LAY-app-content-list',
                //     page: true,
                //     limit: pageCnt,
                //     limits: pageLimits,
                //     even: true,
                //     cellMinWidth: 80, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
                //     cols:
                //     [[
                //         {
                //             title: '序号',  type: 'numbers',  fixed: 'left'
                //         },
                //         {
                //             field: 'AreaNo', title: '所属区域', align: 'center',
                //         },
                //         {
                //             field: 'LocatNo', title: '储位地址', align: 'center'
                //         },
                //         {
                //             field: 'PalletNo', title: '托盘号', align: 'center',
                //         },
                //         {
                //             field: 'SkuNo', title: '物料编码', align: 'center'
                //         },
                //         {
                //             field: 'SkuName', title: '物料名称', align: 'center',
                //         },
                //         {
                //             field: 'LotNo', title: '批次号', align: 'center',
                //         },
                //         {
                //             field: 'LotText', title: '批次描述', align: 'center'
                //         },
                //         {
                //             field: 'SupplierLot', title: '供货批次', align: 'center',
                //         },
                //         {
                //             field: 'Qty', title: '数量', align: 'center'
                //         },
                //         {
                //             field: 'LockQty', title: '锁定数量', align: 'center',
                //         },
                //         {
                //             field: 'FrozenQty', title: '冻结数量', align: 'center'
                //         },
                //         {
                //             field: 'InspectMark', title: '抽检标记', align: 'center', templet: '#InspectMarkStatus'
                //         },
                //         {
                //             field: 'BitPalletMark', title: '零托标记', align: 'center', templet: '#BitPalletMarkStatus'
                //         },
                //        //{
                //        //    field: 'Status', title: '托盘状态', align: 'center', templet: '#PalletStatus',
                //        //},
                //     ]]
                // };
                //#endregion
                //小于10的拼接上0字符串
            };
            function addZero(s) {
                return s < 10 ? ('0' + s) : s;
            };
            var $ = layui.$;
            var yemianid = 0;
            refreshTable("", "", "", "", "", "", "", "", "", "", "", "");
            // 表单需要的变量
            var infoOptions;
            //#region 自定义表头
            var TotalColsArr = [[
                { field: '', title: '序号', type: 'numbers', align: 'center', fixed: 'left', "disabled": true },
                { field: 'WareHouseName', title: '所属仓库', align: 'center' },
                { field: 'RoadwayName', title: '所属巷道', align: 'center' },
                { field: 'AreaName', title: '所属区域', align: 'center' },
                { field: 'LocatNo', title: '储位地址', align: 'center' },
                { field: 'PalletNo', title: '托盘号', align: 'center' },
                { field: 'SkuNo', title: '物料编码', align: 'center' },
                { field: 'SkuName', title: '物料名称', align: 'center' },
                { field: 'OwnerNo', title: '货主编码', align: 'center' },
                { field: 'OwnerName', title: '货主名称', align: 'center' },
                { field: 'SupplierNo', title: '生产商编码', align: 'center' },
                { field: 'SupplierName', title: '生产商名称', align: 'center' },
                { field: 'LotNo', title: '进厂编号', align: 'center' },
                { field: 'LotText', title: '批次描述', align: 'center' },
                { field: 'SupplierLot', title: '原厂批号', align: 'center' },
                { field: 'Qty', title: '数量', align: 'center' },
                { field: 'LockQty', title: '锁定数量', align: 'center', },
                { field: 'FrozenQty', title: '冻结数量', align: 'center' },
                { field: 'InspectMark', title: '抽检标记', align: 'center', templet: '#InspectMarkStatus' },
                { field: 'BitPalletMark', title: '零托标记', align: 'center', templet: '#BitPalletMarkStatus' },
                { field: 'Demo', title: '寄存备注', align: 'center' },
            ]];
            var TotalColsSysArr = encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//将表头数据进行url编码
            //#endregion
            //获取托盘明细
            function refreshTable(SkuNo, SkuName, PalletNo, LotNo, BoxNo, Status, InspectMark, BitPalletMark, BitBoxMark, InspectStatus, OwnerNo, OwnerName) {
                //#region 自定义表头
                var TotalColsArr = [[
                    {field: '',title: '序号',type:'numbers',align: 'center',fixed: 'left', "disabled": true},
                    {field: 'WareHouseName', title: '所属仓库', align: 'center'},
                    {field: 'RoadwayName', title: '所属巷道', align: 'center'},
                    {field: 'AreaName', title: '所属区域', align: 'center'},
                    {field: 'LocatNo', title: '储位地址', align: 'center'},
                    {field: 'PalletNo', title: '托盘号', align: 'center'},
                    {field: 'SkuNo', title: '物料编码', align: 'center'},
                    {field: 'SkuName', title: '物料名称', align: 'center'},
                    {field: 'OwnerNo',title: '货主编码',align: 'center'},
                    {field: 'OwnerName',title: '货主名称',align: 'center'},
                    {field: 'SupplierNo',title: '生产商编码',align: 'center'},
                    {field: 'SupplierName',title: '生产商名称',align: 'center'},
                    {field: 'LotNo', title: '进厂编号', align: 'center'},
                    {field: 'LotText', title: '批次描述', align: 'center'},
                    {field: 'SupplierLot', title: '原厂批号', align: 'center'},
                    {field: 'Qty', title: '数量', align: 'center'},
                    {field: 'LockQty', title: '锁定数量', align: 'center',},
                    {field: 'FrozenQty', title: '冻结数量', align: 'center'},
                    {field: 'InspectMark', title: '抽检标记', align: 'center', templet: '#InspectMarkStatus'},
                    {field: 'BitPalletMark', title: '零托标记', align: 'center', templet: '#BitPalletMarkStatus'},
                    {field: 'Demo', title: '寄存备注', align: 'center'},
                ]];
                var TotalColsSysArr=encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//将表头数据进行url编码
                //#endregion
                //获取托盘明细
                function refreshTable(SkuNo,SkuName,PalletNo,LotNo,BoxNo,Status,InspectMark,BitPalletMark,BitBoxMark,InspectStatus,OwnerNo,OwnerName) {
                    //#region 自定义表头
                    var colsJson
                    var param1={
                        Href:'Statistical/GetBindList'
                    };
                    sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function(res) {
                        if (res.code == 0){
                            if(res.data=='' || res.data==undefined || res.data==null){
                                colsJson=TotalColsArr
                            }else{
                                colsJson= eval(res.data);
                            }
                        }else{
                            colsJson=TotalColsArr
                var colsJson
                var param1 = {
                    Href: 'Statistical/GetBindList'
                };
                sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function (res) {
                    if (res.code == 0) {
                        if (res.data == '' || res.data == undefined || res.data == null) {
                            colsJson = TotalColsArr
                        } else {
                            colsJson = eval(res.data);
                        }
                        infoOptions = {
                            elem: '#LAY-app-content-list',
                            height: h1,
                            id: 'LAY-app-content-list',
                            page: true,
                            limit: pageCnt,
                            limits: pageLimits,
                            even: true,
                            cellMinWidth: 80, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
                            done: function(){
                                //自定义列宽
                                SetTableColW('LAY-app-content-list','Statistical/GetBindList',TotalColsSysArr);
                            },
                            cols:colsJson
                    } else {
                        colsJson = TotalColsArr
                    }
                    infoOptions = {
                        elem: '#LAY-app-content-list',
                        height: h1,
                        id: 'LAY-app-content-list',
                        page: true,
                        limit: pageCnt,
                        limits: pageLimits,
                        even: true,
                        cellMinWidth: 80, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
                        done: function () {
                            //自定义列宽
                            SetTableColW('LAY-app-content-list', 'Statistical/GetBindList', TotalColsSysArr);
                        },
                        cols: colsJson
                    };
                    var param = {
                        SkuNo: SkuNo, //物料号
                        SkuName: SkuName, //物料名称
                        palletNo: PalletNo, //托盘号
                        LotNo: LotNo, //批次号
                        BoxNo: BoxNo, //箱码
                        Status: Status, //箱支状态
                        InspectMark: InspectMark, //检验标记
                        BitPalletMark: BitPalletMark, //零托标记
                        BitBoxMark: BitBoxMark, //零箱标记
                        InspectStatus: InspectStatus, //质量状态
                        OwnerNo: OwnerNo, //货主编码
                        OwnerName: OwnerName //货主名称
                    };
                    sendData(IP + "/Statistical/GetBindList", param, 'get', function (res) {
                        console.log(res)
                        if (res.code == 0) { //成功
                            var list = res.data;
                            $.extend(infoOptions, {
                                data: list
                            });
                            infoOptions.page = {
                                curr: 1
                            }
                            tableIns = table.render(infoOptions);
                        }
                        else { //不成功
                            layer.msg('获取总量列表信息失败!', {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function () { });
                        }
                    });
                });
                //#endregion
            }
            // 表单需要的变量
            var infoOptions2;
            //获取明细信息
            //#region 自定义表头
            var DetailColsArr = [[
                { field: '', title: '序号', type: 'numbers', fixed: 'left', "disabled": true },
                { field: 'SkuNo', title: '物料编码', align: 'center' },
                { field: 'SkuName', title: '物料名称', align: 'center' },
                { field: 'PalletNo', title: '托盘号', align: 'center', width: 110 },
                { field: 'BoxNo', title: '箱码', align: 'center', width: 100 },
                { field: 'Status', title: '箱支状态', align: 'center', templet: '#BoxStatus' },
                { field: 'LotNo', title: '进厂编号', align: 'center' },
                { field: 'LotText', title: '批次描述', align: 'center' },
                { field: 'Qty', title: '数量', width: 90, align: 'center' },
                { field: 'FullQty', title: '整箱数量', width: 100, align: 'center' },
                { field: 'ProductionTime', title: '生产日期', align: 'center', templet: '#templetProductionTime' },
                { field: 'InspectMark', title: '抽检标记', align: 'center', templet: '#InspectMarkStatus' },
                { field: 'BitBoxMark', templet: '#BitPalletMarkStatus1', title: '零箱标记', align: 'center' },
                { field: 'InspectStatus', templet: '#InspectStatus1', title: '质检状态', align: 'center' },
                { field: 'InspectTime', title: '复检时间', align: 'center', templet: '#templetInspectTime' },
                { field: 'ExpirationTime', title: '有效期至', align: 'center', templet: '#templetExpirationTime' },
                { field: 'caozuo', title: '操作', fixed: 'right', align: 'center', toolbar: '#table-content-list', "disabled": true }
            ]];
            var DetailColsSysArr = encodeURIComponent(encodeURIComponent(JSON.stringify(DetailColsArr)))//将表头数据进行url编码
            //#endregion
            function refreshTable2(Id, SkuNo, SkuName, LotNo, PalletNo, BoxNo, Status, InspectMark, BitBoxMark, InspectStatus) {
                //#region 自定义表头
                var colsJson2
                var param1 = {
                    Href: 'Statistical/GetBoxInfo'
                };
                sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function (res) {
                    if (res.code == 0) {
                        if (res.data == '' || res.data == undefined || res.data == null) {
                            colsJson2 = DetailColsArr
                        } else {
                            colsJson2 = eval(res.data);
                        }
                    } else {
                        colsJson2 = DetailColsArr
                    }
                    infoOptions2 = {
                        elem: '#LAY-app-content-list2',
                        height: h1,
                        id: 'LAY-app-content-list2',
                        page: true,
                        limit: pageCnt,
                        limits: pageLimits,
                        even: true,
                        cellMinWidth: 80, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
                        done: function () {
                            //自定义列宽
                            SetTableColW('LAY-app-content-list2', 'Statistical/GetBoxInfo', DetailColsSysArr);
                        },
                        cols: colsJson2
                    };
                    var param = {
                        Id: Id,
                        SkuNo: SkuNo,
                        SkuName: SkuName,
                        LotNo: LotNo,
                        PalletNo: PalletNo,
                        BoxNo: BoxNo,
                        Status: Status,
                        InspectMark: InspectMark,
                        BitBoxMark: BitBoxMark,
                        InspectStatu: InspectStatus
                    }
                    sendData(IP + "/Statistical/GetBoxInfo", param, 'get', function (res) {
                        if (res.code == 0) //成功
                        {
                            var list = res.data;
                            $.extend(infoOptions2, {
                                data: list
                            });
                            infoOptions2.page = {
                                curr: 1
                            }
                            tableIns2 = table.render(infoOptions2);
                        }
                        else //不成功
                        {
                            layer.msg('获取明细列表信息失败!', {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function () { });
                        }
                    })
                });
                //#endregion
            }
            //var url = IP + "/Statistical/GetInventoryList1";
            //接受全局变量
            let quanid = '';
            //监听搜索
            form.on('submit(LAY-app-contlist-search)', function (data) {
                var SkuNo = $("#SkuNo").val();
                var SkuName = $("#SkuName").val();
                var LotNo = $("#LotNo").val();
                var PalletNo = $("#PalletNo").val();
                var BoxNo = $("#BoxNo").val();
                var Status = $("#Status").val();
                var InspectMark = $("#InspectMark").val();
                var BitPalletMark = $("#BitPalletMark").val();
                var BitBoxMark = $("#BitBoxMark").val();
                var InspectStatus = $("#InspectStatus").val();
                var OwnerNo = $("#OwnerNo").val();
                var OwnerName = $("#OwnerName").val();
                if (yemianid == 0) {
                    console.log("总单");
                    refreshTable(SkuNo, SkuName, PalletNo, LotNo, BoxNo, Status, InspectMark, BitPalletMark, BitBoxMark, InspectStatus, OwnerNo, OwnerName);
                } else if (yemianid == 1) {
                    quanid = '';
                    console.log("明细");
                    refreshTable2(quanid, SkuNo, SkuName, LotNo, PalletNo, BoxNo, Status, InspectMark, BitBoxMark, InspectStatus);
                }
            });
            //触发行双击事件
            table.on('rowDouble(LAY-app-content-list)', function (obj) {
                $(".layui-tab-title>li").attr("class", "");
                $('.layui-tab-title>li').eq(1).attr('class', 'layui-this');
                $('.layui-tab-content .layui-tab-item').attr('class', 'layui-tab-item')
                $('.layui-tab-content .layui-tab-item').eq(1).attr('class', 'layui-tab-item layui-show')
                console.log(obj.data.Id);
                quanid = obj.data.Id;
                refreshTable2(obj.data.Id);
                yemianid = 1;
            });
            //监听Tab切换,以改变地址hash值
            element.on('tab(docDemoTabBrief)', function (data) {
                var SkuNo = $("#SkuNo").val();
                var SkuName = $("#SkuName").val();
                var LotNo = $("#LotNo").val();
                var PalletNo = $("#PalletNo").val();
                var BoxNo = $("#BoxNo").val();
                var Status = $("#Status").val();
                var InspectMark = $("#InspectMark").val();
                var BitPalletMark = $("#BitPalletMark").val();
                var BitBoxMark = $("#BitBoxMark").val();
                var InspectStatus = $("#InspectStatus").val();
                var OwnerNo = $("#OwnerNo").val();
                var OwnerName = $("#OwnerName").val();
                console.log(data.index);
                yemianid = data.index
                if (yemianid == 0) {
                    console.log("总单");
                    refreshTable(SkuNo, SkuName, PalletNo, LotNo, BoxNo, Status, InspectMark, BitPalletMark, BitBoxMark, InspectStatus, OwnerNo, OwnerName);
                } else if (yemianid == 1) {
                    console.log("明细");
                    refreshTable2(quanid, SkuNo, SkuName, LotNo, PalletNo, BoxNo, Status, InspectMark, BitBoxMark, InspectStatus);
                }
            });
            var doing = true;
            // ------------------------------------详情---------------------------------------------------
            table.on('tool(LAY-app-content-list2)', function (obj) {
                console.log(obj)
                var data = obj.data;
                //详情
                if (obj.event === 'edit') {
                    BoxNo = data.BoxNo;
                    console.log(data)
                    layer.open({
                        type: 2,
                        title: '箱支详情信息',
                        content: 'BoxSupportInfor.html?BoxNo=' + BoxNo,
                        maxmin: true,
                        area: ['80%', '85%'],
                        btn: ['关闭'],
                        yes: function (index, layero) {
                            var iframeWindow = window['layui-layer-iframe' + index],
                                submitID = 'layuiadmin-app-form-edit',
                                submit = layero.find('iframe').contents().find('#' + submitID);
                            if (doing) {
                                doing = false;
                                layer.close(index); //关闭弹层
                                refreshTable();
                                doing = true;
                            }
                        }
                    });
                }
            });
            form.on('submit(daochu)', function () {
                layer.confirm('确定导出当前数据吗?', function (index) {
                    if (yemianid == 0) {
                        console.log("托盘明细");
                        var param = {
                            SkuNo: $("#SkuNo").val(),
                            SkuName: $("#SkuName").val(),
                            LotNo: $("#LotNo").val(),
                            PalletNo: $("#PalletNo").val(),
                            BoxNo: $("#BoxNo").val(),
                            Status: $("#Status").val(),
                            InspectMark: $("#InspectMark").val(),
                            BitPalletMark: $("#BitPalletMark").val(),
                            BitBoxMark: $("#BitBoxMark").val(),
                            InspectStatus: $("#InspectStatus").val()
                        };
                        var param = {
                            SkuNo:SkuNo, //物料号
                            SkuName:SkuName, //物料名称
                            palletNo:PalletNo, //托盘号
                            LotNo:LotNo, //批次号
                            BoxNo:BoxNo, //箱码
                            Status:Status, //箱支状态
                            InspectMark:InspectMark, //检验标记
                            BitPalletMark:BitPalletMark, //零托标记
                            BitBoxMark:BitBoxMark, //零箱标记
                            InspectStatus:InspectStatus, //质量状态
                            OwnerNo:OwnerNo, //货主编码
                            OwnerName:OwnerName //货主名称
                        };
                        sendData(IP + "/Statistical/GetBindList", param, 'get', function(res) {
                            console.log(res)
                        sendData(IP + "/Statistical/GetBindListDaoChu", param, 'get', function (res) {
                            console.log(res);
                            if (res.code == 0) { //成功
                                var list = res.data;
                                $.extend(infoOptions, {
                                    data: list
                                table.exportFile(tableIns.config.id, list, 'xls', "托盘明细信息" + getNowTime(),); //data 为该实例中的任意数量的数据
                                layer.msg('导出成功!', {
                                    icon: 1,
                                    time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                }, function () {
                                });
                                infoOptions.page = {
                                    curr: 1
                                }
                                tableIns = table.render(infoOptions);
                            }
                            else { //不成功
                                layer.msg('获取总量列表信息失败!', {
                            } else { //不成功
                                layer.msg('获取信息失败!', {
                                    icon: 2,
                                    time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                }, function() {});
                                }, function () { });
                            }
                        });
                    });
                    //#endregion
                }
                // 表单需要的变量
                var infoOptions2;
                //#region 原始非自定义列
                // infoOptions2 = {
                //     elem: '#LAY-app-content-list2',
                //     height: 'full-206',
                //     id: 'LAY-app-content-list2',
                //     page: true,
                //     limit: pageCnt,
                //     limits: pageLimits,
                //     even: true,
                //     cellMinWidth: 80, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
                //     cols:
                //     [[
                //         {
                //             title: '序号',  type: 'numbers',  fixed: 'left'
                //         },
                //         {
                //             field: 'SkuNo', title: '物料编码', align: 'center',
                //         },
                //         {
                //             field: 'SkuName', title: '物料名称', align: 'center',
                //         },
                //         {
                //             field: 'PalletNo', title: '托盘号', align: 'center', width: 110,
                //         },
                //         {
                //             field: 'BoxNo', title: '箱码', align: 'center', width: 100,
                //         },
                //         {
                //             field: 'Status', title: '箱支状态', align: 'center', templet: '#BoxStatus',
                //         },
                //         {
                //             field: 'LotNo', title: '批次号', align: 'center',
                //         },
                //         {
                //             field: 'LotText', title: '批次描述', align: 'center',
                //         },
                //         {
                //             field: 'Qty', title: '数量', width: 90, align: 'center',
                //         },
                //         {
                //             field: 'FullQty', title: '整箱数量', width: 100, align: 'center',
                //         },
                //         {
                //             field: 'ProductionTime', title: '生产日期', align: 'center',
                //             templet: function(d) {
                //                 return formatDate(d.ProductionTime);
                //             },
                //         },
                //         {
                //             field: 'InspectMark', title: '抽检标记', align: 'center', templet: '#InspectMarkStatus',
                //         },
                //         {
                //             field: 'BitBoxMark', templet: '#BitPalletMarkStatus1', title: '零箱标记', align: 'center',
                //         },
                //         {
                //             field: 'InspectStatus', templet: '#InspectStatus1', title: '质检状态', align: 'center',
                //         },
                //         {
                //             field: 'InspectTime', title: '复检时间', align: 'center',
                //             templet: function(d) {
                //                 return formatDate(d.InspectTime);
                //             },
                //         },
                //         {
                //             title: '操作', fixed: 'right', align: 'center', toolbar: '#table-content-list'
                //         }
                //     ]]
                // };
                //#endregion
                //获取明细信息
                //#region 自定义表头
                var DetailColsArr = [[
                    {field: '',title: '序号',type:'numbers',fixed: 'left', "disabled": true},
                    {field: 'SkuNo', title: '物料编码', align: 'center'},
                    {field: 'SkuName', title: '物料名称', align: 'center'},
                    {field: 'PalletNo', title: '托盘号', align: 'center', width: 110},
                    {field: 'BoxNo', title: '箱码', align: 'center', width: 100},
                    {field: 'Status', title: '箱支状态', align: 'center', templet: '#BoxStatus'},
                    {field: 'LotNo', title: '进厂编号', align: 'center'},
                    {field: 'LotText', title: '批次描述', align: 'center'},
                    {field: 'Qty', title: '数量', width: 90, align: 'center'},
                    {field: 'FullQty', title: '整箱数量', width: 100, align: 'center'},
                    {field: 'ProductionTime', title: '生产日期', align: 'center',templet: '#templetProductionTime'},
                    {field: 'InspectMark', title: '抽检标记', align: 'center', templet: '#InspectMarkStatus'},
                    {field: 'BitBoxMark', templet: '#BitPalletMarkStatus1', title: '零箱标记', align: 'center'},
                    {field: 'InspectStatus', templet: '#InspectStatus1', title: '质检状态', align: 'center'},
                    {field: 'InspectTime', title: '复检时间', align: 'center',templet: '#templetInspectTime'},
                    {field: 'caozuo',title: '操作', fixed: 'right', align: 'center', toolbar: '#table-content-list', "disabled": true}
                ]];
                var DetailColsSysArr=encodeURIComponent(encodeURIComponent(JSON.stringify(DetailColsArr)))//将表头数据进行url编码
                //#endregion
                function refreshTable2(Id,SkuNo,SkuName,LotNo,PalletNo,BoxNo,Status,InspectMark,BitBoxMark,InspectStatus) {
                    //#region 自定义表头
                    var colsJson2
                    var param1={
                        Href:'Statistical/GetBoxInfo'
                    };
                    sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function(res) {
                        if (res.code == 0){
                            if(res.data=='' || res.data==undefined || res.data==null){
                                colsJson2=DetailColsArr
                            }else{
                                colsJson2= eval(res.data);
                            }
                        }else{
                                colsJson2=DetailColsArr
                        }
                        infoOptions2 = {
                            elem: '#LAY-app-content-list2',
                            height: h1,
                            id: 'LAY-app-content-list2',
                            page: true,
                            limit: pageCnt,
                            limits: pageLimits,
                            even: true,
                            cellMinWidth: 80, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
                            done: function(){
                                //自定义列宽
                                SetTableColW('LAY-app-content-list2','Statistical/GetBoxInfo',DetailColsSysArr);
                            },
                            cols:colsJson2
                        };
                    } else if (yemianid == 1) {
                        console.log("箱码明细");
                        var param = {
                            Id:Id,
                            SkuNo:SkuNo,
                            SkuName:SkuName,
                            LotNo:LotNo,
                            PalletNo:PalletNo,
                            BoxNo:BoxNo,
                            Status:Status,
                            InspectMark:InspectMark,
                            BitBoxMark:BitBoxMark,
                            InspectStatu:InspectStatus
                        }
                        sendData(IP + "/Statistical/GetBoxInfo", param, 'get', function(res) {
                            if (res.code == 0) //成功
                            {
                            Id: quanid,
                            SkuNo: $("#SkuNo").val(),
                            SkuName: $("#SkuName").val(),
                            LotNo: $("#LotNo").val(),
                            LocatNo: $("#LocatNo").val(),
                            PalletNo: $("#PalletNo").val(),
                            Status: $("#Status").val(),
                            InspectStatus: $("#InspectStatus").val(),
                            IsSamolingTray: $("#IsSamolingTray").val(),
                            StartTime: $("#StartTime").val(),
                            EndTime: $("#EndTime").val(),
                        };
                        sendData(IP + "/Statistical/GetBoxInfoDaoChu", param, 'get', function (res) {
                            console.log(res);
                            if (res.code == 0) { //成功
                                var list = res.data;
                                $.extend(infoOptions2, {
                                    data: list
                                table.exportFile(tableIns2.config.id, list, 'xls', "箱码明细信息" + getNowTime(),); //data 为该实例中的任意数量的数据
                                layer.msg('导出成功!', {
                                    icon: 1,
                                    time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                }, function () {
                                });
                                infoOptions2.page = {
                                    curr: 1
                                }
                                tableIns2 = table.render(infoOptions2);
                            }
                            else //不成功
                            {
                                layer.msg('获取明细列表信息失败!', {
                            } else { //不成功
                                layer.msg('获取信息失败!', {
                                    icon: 2,
                                    time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                }, function() {});
                            }
                        })
                    });
                    //#endregion
                }
                //var url = IP + "/Statistical/GetInventoryList1";
                //接受全局变量
                let quanid = '';
                //监听搜索
                form.on('submit(LAY-app-contlist-search)', function(data) {
                    var SkuNo = $("#SkuNo").val();
                    var SkuName = $("#SkuName").val();
                    var LotNo = $("#LotNo").val();
                    var PalletNo = $("#PalletNo").val();
                    var BoxNo = $("#BoxNo").val();
                    var Status = $("#Status").val();
                    var InspectMark = $("#InspectMark").val();
                    var BitPalletMark = $("#BitPalletMark").val();
                    var BitBoxMark = $("#BitBoxMark").val();
                    var InspectStatus = $("#InspectStatus").val();
                    var OwnerNo = $("#OwnerNo").val();
                    var OwnerName = $("#OwnerName").val();
                    if(yemianid == 0){
                        console.log("总单");
                        refreshTable(SkuNo,SkuName,PalletNo,LotNo,BoxNo,Status,InspectMark,BitPalletMark,BitBoxMark,InspectStatus,OwnerNo,OwnerName);
                    }else if(yemianid == 1){
                        quanid = '';
                        console.log("明细");
                        refreshTable2(quanid,SkuNo,SkuName,LotNo,PalletNo,BoxNo,Status,InspectMark,BitBoxMark,InspectStatus);
                    }
                });
                //触发行双击事件
                table.on('rowDouble(LAY-app-content-list)', function(obj) {
                    $(".layui-tab-title>li").attr("class", "");
                    $('.layui-tab-title>li').eq(1).attr('class', 'layui-this');
                    $('.layui-tab-content .layui-tab-item').attr('class', 'layui-tab-item')
                    $('.layui-tab-content .layui-tab-item').eq(1).attr('class', 'layui-tab-item layui-show')
                    console.log(obj.data.Id);
                    quanid = obj.data.Id;
                    refreshTable2(obj.data.Id);
                    yemianid=1;
                });
                //监听Tab切换,以改变地址hash值
                element.on('tab(docDemoTabBrief)', function(data){
                    var SkuNo = $("#SkuNo").val();
                    var SkuName = $("#SkuName").val();
                    var LotNo = $("#LotNo").val();
                    var PalletNo = $("#PalletNo").val();
                    var BoxNo = $("#BoxNo").val();
                    var Status = $("#Status").val();
                    var InspectMark = $("#InspectMark").val();
                    var BitPalletMark = $("#BitPalletMark").val();
                    var BitBoxMark = $("#BitBoxMark").val();
                    var InspectStatus = $("#InspectStatus").val();
                    var OwnerNo = $("#OwnerNo").val();
                    var OwnerName = $("#OwnerName").val();
                    console.log(data.index);
                    yemianid = data.index
                    if(yemianid == 0){
                        console.log("总单");
                        refreshTable(SkuNo,SkuName,PalletNo,LotNo,BoxNo,Status,InspectMark,BitPalletMark,BitBoxMark,InspectStatus,OwnerNo,OwnerName);
                    }else if(yemianid == 1){
                        console.log("明细");
                        refreshTable2(quanid,SkuNo,SkuName,LotNo,PalletNo,BoxNo,Status,InspectMark,BitBoxMark,InspectStatus);
                    }
                });
                var doing = true;
                // ------------------------------------详情---------------------------------------------------
                table.on('tool(LAY-app-content-list2)', function(obj) {
                    console.log(obj)
                    var data = obj.data;
                    //详情
                    if (obj.event === 'edit') {
                        BoxNo = data.BoxNo;
                        console.log(data)
                        layer.open({
                            type: 2,
                            title: '箱支详情信息',
                            content: 'BoxSupportInfor.html?BoxNo=' + BoxNo,
                            maxmin: true,
                            area: ['80%', '85%'],
                            btn: ['关闭'],
                            yes: function(index, layero) {
                                var iframeWindow = window['layui-layer-iframe' + index],
                                    submitID = 'layuiadmin-app-form-edit',
                                    submit = layero.find('iframe').contents().find('#' + submitID);
                                    if(doing)
                                    {
                                        doing = false;
                                        layer.close(index); //关闭弹层
                                        refreshTable();
                                        doing = true;
                                    }
                                }, function () { });
                            }
                        });
                    }
                });
                form.on('submit(daochu)', function () {
                    layer.confirm('确定导出当前数据吗?', function(index) {
                        if(yemianid == 0){
                            console.log("托盘明细");
                            var param = {
                                SkuNo : $("#SkuNo").val(),
                                SkuName : $("#SkuName").val(),
                                LotNo : $("#LotNo").val(),
                                PalletNo : $("#PalletNo").val(),
                                BoxNo : $("#BoxNo").val(),
                                Status : $("#Status").val(),
                                InspectMark : $("#InspectMark").val(),
                                BitPalletMark : $("#BitPalletMark").val(),
                                BitBoxMark : $("#BitBoxMark").val(),
                                InspectStatus : $("#InspectStatus").val()
                            };
                            sendData(IP + "/Statistical/GetBindListDaoChu", param, 'get', function (res) {
                                console.log(res);
                                if (res.code == 0) { //成功
                                    var list = res.data;
                                    table.exportFile(tableIns.config.id, list,'xls',"托盘明细信息"+getNowTime(),); //data 为该实例中的任意数量的数据
                                    layer.msg('导出成功!', {
                                        icon: 1,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                    }, function () {
                                    });
                                } else { //不成功
                                    layer.msg('获取信息失败!', {
                                        icon: 2,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                    }, function () { });
                                }
                            });
                        }else if(yemianid == 1){
                            console.log("箱码明细");
                            var param = {
                                Id:quanid,
                                SkuNo: $("#SkuNo").val(),
                                SkuName: $("#SkuName").val(),
                                LotNo:$("#LotNo").val(),
                                LocatNo:$("#LocatNo").val(),
                                PalletNo:$("#PalletNo").val(),
                                Status:$("#Status").val(),
                                InspectStatus:$("#InspectStatus").val(),
                                IsSamolingTray:$("#IsSamolingTray").val(),
                                StartTime: $("#StartTime").val(),
                                EndTime: $("#EndTime").val(),
                            };
                            sendData(IP + "/Statistical/GetBoxInfoDaoChu", param, 'get', function (res) {
                                console.log(res);
                                if (res.code == 0) { //成功
                                    var list = res.data;
                                    table.exportFile(tableIns2.config.id, list,'xls',"箱码明细信息"+getNowTime(),); //data 为该实例中的任意数量的数据
                                    layer.msg('导出成功!', {
                                        icon: 1,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                    }, function () {
                                    });
                                } else { //不成功
                                    layer.msg('获取信息失败!', {
                                        icon: 2,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                    }, function () { });
                                }
                            });
                        }
                    });
                });
                //#region 自定义表头
                //自定义表头
                active = {
                    customCols: function(){
                        layer.open({
                            type: 2,
                            title: '自定义列',
                            content: '../SystemSettings/HeaderSetting.html?Href=Statistical/GetBindList&ColsSysArr='+TotalColsSysArr,
                            maxmin: false,
                            resize: false,
                            area: ['970px', '650px']
                        });
                    },
                    customCols2: function(){
                        layer.open({
                            type: 2,
                            title: '自定义列',
                            content: '../SystemSettings/HeaderSetting.html?Href=Statistical/GetBoxInfo&ColsSysArr='+DetailColsSysArr,
                            maxmin: false,
                            resize: false,
                            area: ['970px', '650px']
                        });
                    }
                };
                $('.layui-btn').on('click', function() {
                    var type = $(this).data('type');
                    active[type] ? active[type].call(this) : '';
                });
                //#endregion
            });
        </script>
    </body>
</html>
            //#region 自定义表头
            //自定义表头
            active = {
                customCols: function () {
                    layer.open({
                        type: 2,
                        title: '自定义列',
                        content: '../SystemSettings/HeaderSetting.html?Href=Statistical/GetBindList&ColsSysArr=' + TotalColsSysArr,
                        maxmin: false,
                        resize: false,
                        area: ['970px', '650px']
                    });
                },
                customCols2: function () {
                    layer.open({
                        type: 2,
                        title: '自定义列',
                        content: '../SystemSettings/HeaderSetting.html?Href=Statistical/GetBoxInfo&ColsSysArr=' + DetailColsSysArr,
                        maxmin: false,
                        resize: false,
                        area: ['970px', '650px']
                    });
                }
            };
            $('.layui-btn').on('click', function () {
                var type = $(this).data('type');
                active[type] ? active[type].call(this) : '';
            });
            //#endregion
        });
    </script>
</body>
</html>
Pda/View/HouseDataSetting/agvTransport.html
@@ -7,7 +7,7 @@
    <!-- <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>
    <title>AGV转运</title>
    <link rel="stylesheet" href="/layui/css/layui.css" />
    <link rel="stylesheet" href="/css/style.css" />
@@ -232,7 +232,7 @@
                                </select>
                                <img src="/assets/down_arraw.png">
                            </div>
                        </div>
                        </div>
                        <table class="layout-tbl-submit" border="" cellspacing="" cellpadding="">
                            <tr>
@@ -334,7 +334,7 @@
            //当前分页
            var curPageIndex = 1;
            // 托盘码文本改变时触发
            $("#STOCKCODE").on('input', function () {
                if ($("#STOCKCODE").val() == "" || $("#STOCKCODE").val().length < 8) {
@@ -385,7 +385,7 @@
                    });
                }
                else if (xianshiyemian == 1) {
                }
            }
@@ -429,7 +429,7 @@
                    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+
                                .AreaNo + '-' + res.data[i].AreaName +
                                '</option>');
                        }
                        form.render('select');
@@ -444,9 +444,9 @@
                        callback(res.data)
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {});
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            }
@@ -476,7 +476,7 @@
                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]+
                            $("#OutNo").append('<option value =' + res.data[i] + '>' + res.data[i] +
                                '</option>');
                        }
                        form.render('select');
@@ -497,8 +497,8 @@
                    }
                });
            }
             //选中出库单事件
             form.on('select(getOutNo)', function (data) {
            //选中出库单事件
            form.on('select(getOutNo)', function (data) {
                $("#PalletNo").empty()
                $("#PalletNo").append('<option value =>' + '</option>');
                form.render('select');
@@ -537,12 +537,12 @@
                form.render('select');
                var param = {
                    soNo:$("#OutNo").val()
                    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]+
                            $("#PalletNo").append('<option value =' + res.data[i] + '>' + res.data[i] +
                                '</option>');
                        }
                        form.render('select');
@@ -606,7 +606,7 @@
                    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+
                                .AreaNo + '-' + res.data[i].AreaName +
                                '</option>');
                        }
                        form.render('select');
@@ -621,9 +621,9 @@
                        callback(res.data)
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {});
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            }
@@ -664,7 +664,7 @@
                                icon: 1,
                                time: 1000 //2秒关闭(如果不配置,默认是3秒)
                            }, function () {
                            });
                        } else { //不成功
                            layer.msg(res.msg, {
@@ -683,7 +683,7 @@
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                        return;
                    }
                    }
                    // if ($("#PalletNo").val() == "") {
                    //     layer.msg('请扫描托盘条码', {
                    //         icon: 2,
@@ -710,7 +710,7 @@
                                icon: 1,
                                time: 1000 //2秒关闭(如果不配置,默认是3秒)
                            }, function () {
                            });
                        } else { //不成功
                            layer.msg(res.msg, {
@@ -737,13 +737,13 @@
                    for (i = len - 1; i >= 2; i--) {
                        trs[i].remove();
                    }
                    if($("#STOCKCODE").val()==''){
                    if ($("#STOCKCODE").val() == '') {
                        return;
                    }
                    var param = {
                        PalletNo: $("#STOCKCODE").val(),
                        IsHuiKu:1
                        IsHuiKu: 1
                    };
                    //  根据托盘号获取箱码信息
                    sendData(IP + "/PdaCr/GetSkuInfoByPalletNo", param, 'get', function (res) {
@@ -762,7 +762,7 @@
                                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='num']").html(res.data[i].Qty);
                                tr.show();
                                arrTrs[i] = tr
                            }
@@ -785,7 +785,7 @@
                    for (i = len - 1; i >= 2; i--) {
                        trs[i].remove();
                    }
                    if($("#PalletNo").val()==''){
                    if ($("#PalletNo").val() == '') {
                        return;
                    }
                    var param = {
@@ -808,7 +808,7 @@
                                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='num']").html(res.data[i].Qty);
                                tr.show();
                                arrTrs[i] = tr
                            }
Pda/View/HouseDataSetting/boxQuery.html
New file
@@ -0,0 +1,462 @@
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>箱码查询</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">
        .layui-form-label {
            width: 20%;
        }
        .layui-input-block {
            width: 80%;
            margin-left: 20%;
        }
        .div-tbl-title {
            width: 98%;
            margin: auto;
            /* background-color: #4476A7; */
            height: 30px;
            margin-top: 20px;
        }
        .div-tbl-title table {
            width: 100%;
            height: 30px;
        }
        .div-tbl-title td {
            width: 50%;
            height: 30px;
            line-height: 30px;
        }
        .div-tbl-title span {
            float: left;
            width: 60%;
            height: 30px;
            line-height: 30px;
        }
        .div-tbl-title input {
            float: left;
            width: 40%;
            height: 30px;
            line-height: 30px;
            border: none;
        }
        .layout-tbl-paging {
            margin-top: 0;
        }
        .layout-bill-info {
            height: auto;
        }
        .btn-ok {
            border: none;
            color: #FFFFFF;
            background-color: #0a93e3;
            width: 48%;
            height: 36px;
            border-radius: 5px;
            float: left;
            margin: 0 1%;
            margin-left: 25%;
        }
        .btn-ok:active {
            opacity: 0.8;
        }
        td {
            word-break: break-all;
            word-wrap: break-word;
        }
    </style>
    <link rel="stylesheet" href="/css/adapter.css" />
</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">箱码查询</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">主页</a></li>
                    <li><a href="../login.html">重新登录</a></li>
                </ul>
            </div>
            <div id="" class="layout-bill-info">
                <form class="layui-form" action="" style="height: auto;">
                    <div id="" class="layui-form-item layout-input" style="margin-top: 5px;">
                        <label class="layui-form-label">外箱条码</label>
                        <div class="layui-input-block">
                            <input id="BoxNo" type="text" placeholder="请扫描箱码" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div id="" class="layui-form-item layout-input" style="margin-top: 5px;">
                        <label class="layui-form-label">物料编码</label>
                        <div class="layui-input-block">
                            <input id="SkuNo" type="text" autocomplete="off" class="layui-input" style="border: 0px; "
                                disabled>
                        </div>
                    </div>
                    <div id="" class="layui-form-item layout-input" style="margin-top: 5px;">
                        <label class="layui-form-label">物料名称</label>
                        <div class="layui-input-block">
                            <input id="SkuName" type="text" autocomplete="off" class="layui-input" style="border: 0px;"
                                disabled>
                        </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="LotNo" 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="SupplierLot" 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="Qty" 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="InspectStatus" type="text" disabled placeholder="" autocomplete="off"
                                            class="layui-input">
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </table>
                    <div id="" class="" style="width: 100%;height: 36px;margin-top: 15px;">
                        <button id="btnQuery" class="btn-ok" type="button">查询</button>
                    </div>
                </form>
            </div>
            <div id="" class="layout-tbl-paging" style="margin-top: 5px;">
                <!-- 箱内支信息 -->
                <table id="tableBoxList" class="tbl-box-list" border="1px">
                    <tr>
                        <th>支码</th>
                        <th>数量</th>
                    </tr>
                    <tr id="boxCell" style="display: none;">
                        <td name="BoxNo">支码</td>
                        <td name="Qty">数量</td>
                    </tr>
                </table>
                <!-- 分页 -->
                <table id="tableBoxPages" class="tbl-box-pages" 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>
    <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/jquery.cookie.js"></script>
    <script>
        layui.use(['form', 'jquery'], function () {
            var form = layui.form
            //当前分页
            var curPageIndex = 1
            var tableData = null
            // 功能列隐藏
            $("#menuImg").click(function (e) {
                e.stopPropagation()
                if ($("#menuList").is(":hidden")) {
                    $("#menuList").show()
                } else {
                    $("#menuList").hide()
                }
            })
            $('body').click(function () {
                $("#menuList").hide()
            })
            // 清空文本框信息
            function clear() {
                $("#BoxNo").val('');
                $("#SkuNo").val("");
                $("#SkuName").val("");
                $("#LotNo").val("");
                $("#SupplierLot").val("");
                $("#Qty").val("");
                $("#InspectStatus").val("");
                // 清空table列表
                let trs = $("#tableBoxList tr")
                let len = trs.length
                for (i = len - 1; i >= 2; i--) {
                    trs[i].remove();
                }
            }
            $("#btnQuery").click(function () {
                if ($('#BoxNo').val() == '') {
                    layer.msg("请扫描外箱条码", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () { });
                    clear();
                    return
                }
                // 获取查询参数
                var param = {
                    BoxNo: $('#BoxNo').val(),
                };
                // 查询-根据箱码获取详细信息
                sendData(IP + "/PdaCr/GetBoxQueryList", param, 'get', function (res) {
                    console.log("箱码查询:", res)
                    if (res.code == 0) { //成功
                        clear();
                        $("#BoxNo").val(res.data.BoxNo);
                        $("#SkuNo").val(res.data.SkuNo);
                        $("#SkuName").val(res.data.SkuName);
                        $("#LotNo").val(res.data.LotNo);
                        $("#SupplierLot").val(res.data.SupplierLot);
                        $("#Qty").val(res.data.Qty);
                        $("#InspectStatus").val(res.data.InspectStatus);
                        tableData = deepCopy(res.data.InfoList)
                        refreshTable()
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
                            clear();
                            let trs = $("#tableBoxList tr")
                            let len = trs.length
                            for (i = len - 1; i >= 2; i--) {
                                trs[i].remove();
                            }
                        });
                    }
                });
            })
            function refreshTable() {
                //先清空一下箱子列表
                let trs = $("#tableBoxList tr")
                let len = trs.length
                for (i = len - 1; i >= 2; i--) {
                    trs[i].remove();
                }
                if (tableData.length > 0) { //成功
                    var list = tableData
                    var arrTrs = new Array()
                    let idx = 0
                    for (var i in list) {
                        var tr = $("#boxCell").eq(0).clone();
                        tr.appendTo("#tableBoxList");
                        idx++;
                        tr.attr('index', idx)
                        tr.find("td[name='BoxNo']").html(list[i].BoxNo2);
                        tr.find("td[name='Qty']").html(list[i].Qty2);
                        tr.show();
                        arrTrs[i] = tr
                    }
                    //设置分页
                    setPages(1, list.length)
                } else { //不成功
                    // $("#boxNum").val(0)
                    layer.msg("无数据", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () { });
                    setPages(1, 0)
                }
            }
            //设置分页
            function setPages(pageIndex, boxNum) {
                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")
                $("<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++) {
                    $("<td class='page-num'>" + i + "</td>").appendTo("#tableBoxPages tr")
                }
                $("<td id='nextPage' class='page-next'>下一页</td>").appendTo("#tableBoxPages tr")
                $("#tableBoxPages tr").eq(0).find("td[id^='nextPage']").click(function () {
                    onClickNextPage()
                })
                $("#tableBoxPages").show()
                setCurPage(1)
            }
            //设置当前分页
            function setCurPage(pageIndex) {
                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) {
                        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")
                    }
                }
            }
            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)
            }
            function getBoxPageNum() {
                let num = $("#tableBoxList tr").length
                if (num <= 2) {
                    return 0
                }
                let pageNum = Math.floor(num / 10);
                if (num % 10 > 0) {
                    pageNum += 1;
                }
                return pageNum
            }
        })
    </script>
</body>
</html>
Pda/View/HouseDataSetting/changebox.html
@@ -1,271 +1,285 @@
<!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">
            .layui-form-label {
                width: 20%;
            }
            .layui-input-block {
                width: 80%;
                margin-left: 20%;
            }
            .div-tbl-title {
                width: 98%;
                margin: auto;
                /* background-color: #4476A7; */
                height: 30px;
                margin-top: 20px;
            }
            .div-tbl-title table {
                width: 100%;
                height: 30px;
            }
            .div-tbl-title td {
                width: 50%;
                height: 30px;
                line-height: 30px;
            }
            .div-tbl-title span {
                float: left;
                width: 60%;
                height: 30px;
                line-height: 30px;
            }
            .div-tbl-title input {
                float: left;
                width: 40%;
                height: 30px;
                line-height: 30px;
                border: none;
            }
            .layout-tbl-paging {
                margin-top: 0;
            }
            .layout-bill-info {
                height: auto;
            }
            .btn-ok {
                border: none;
                color: #FFFFFF;
                background-color: #0a93e3;
                width: 48%;
                height: 36px;
                border-radius: 5px;
                float: left;
                margin: 0 1%;
                margin-left: 20%;
            }
            .btn-ok:active {
                opacity: 0.8;
            }
            .layout-tab-page {
                height: auto;
            }
            .layui-form-switch{
                margin-top: 0;
            }
        </style>
        <link rel="stylesheet" href="/css/adapter.css" />
    </head>
    <body>
        <div id="" class="main-content">
            <div id="" class="layout-title"  >
                <table border="" cellspacing="" cellpadding="">
<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>托盘变更</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">
        .layui-form-label {
            width: 20%;
        }
        .layui-input-block {
            width: 80%;
            margin-left: 20%;
        }
        .div-tbl-title {
            width: 98%;
            margin: auto;
            /* background-color: #4476A7; */
            height: 30px;
            margin-top: 20px;
        }
        .div-tbl-title table {
            width: 100%;
            height: 30px;
        }
        .div-tbl-title td {
            width: 50%;
            height: 30px;
            line-height: 30px;
        }
        .div-tbl-title span {
            float: left;
            width: 60%;
            height: 30px;
            line-height: 30px;
        }
        .div-tbl-title input {
            float: left;
            width: 40%;
            height: 30px;
            line-height: 30px;
            border: none;
        }
        .layout-tbl-paging {
            margin-top: 0;
        }
        .layout-bill-info {
            height: auto;
        }
        .btn-ok {
            border: none;
            color: #FFFFFF;
            background-color: #0a93e3;
            width: 48%;
            height: 36px;
            border-radius: 5px;
            float: left;
            margin: 0 1%;
            margin-left: 20%;
        }
        .btn-ok:active {
            opacity: 0.8;
        }
        .layout-tab-page {
            height: auto;
        }
        .layui-form-switch {
            margin-top: 0;
        }
    </style>
    <link rel="stylesheet" href="/css/adapter.css" />
</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">托盘变更</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">主页</a></li>
                    <li><a href="../login.html">重新登录</a></li>
                </ul>
            </div>
            <div id="" class="layout-bill-info">
                <form class="layui-form" action="" style="height: auto;">
                    <div id="" class="layui-form-item layout-input" style="margin-top: 10px;">
                        <label class="layui-form-label">原托盘条码:</label>
                        <div class="layui-input-block">
                            <input id="PalletNo" type="text" lay-verify="stock" placeholder="托盘条码" autocomplete="off"
                                class="layui-input">
                        </div>
                    </div>
                    <div id="" class="layui-form-item layout-input" style="margin-top: 10px;">
                        <div id="layout-boxcode" class="layui-form-item layout-input">
                            <label class="layui-form-label" lang>是否整托变更:</label>
                            <div class="layui-input-block">
                                <input type="checkbox" name="IsZhengTuo" id="IsZhengTuo" lay-skin="switch"
                                    lay-text="是|否" lay-filter="IsZhengTuo">
                            </div>
                        </div>
                    </div>
                    <div id="BoxDIv" class="layui-form-item layout-input" style="margin-top: 10px;">
                        <div id="layout-boxcode" class="layui-form-item layout-input">
                            <label class="layui-form-label">外箱条码:</label>
                            <div class="layui-input-block">
                                <input id="BoxNo" type="text" placeholder="请扫描外箱条码" autocomplete="off"
                                    class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div id="BoxDIv2" class="layout-tab-page">
                        <table class="tbl-box-sim-info" border="" cellspacing="" cellpadding="">
                            <tr>
                                <td>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label" style="width: 50%;">物料编号:</label>
                                        <div class="layui-input-block" style="width: 50%;margin-left:50%;">
                                            <input id="SkuNo" type="text" lay-verify="" disabled placeholder=""
                                                class="layui-input" style="font-size: 12px;padding-left: 0;">
                                        </div>
                                    </div>
                                </td>
                                <td>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label" style="width: 25%">批次:</label>
                                        <div class="layui-input-block" style="width: 75%;margin-left:25%;">
                                            <input id="LotNo" type="text" lay-verify="" disabled placeholder=""
                                                class="layui-input" style="font-size: 12px;padding-left: 0;">
                                        </div>
                                    </div>
                                </td>
                                <td>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label" style="width: 34%;">数量:</label>
                                        <div class="layui-input-block" style="width: 66%;margin-left:34%;">
                                            <input id="BoxQty" type="text" lay-verify="" disabled placeholder=""
                                                class="layui-input" style="font-size: 12px;padding-left: 0;">
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="3">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label" style="width: 17%;">物料名称:</label>
                                        <div class="layui-input-block" style="width: 83%;margin-left:17%;">
                                            <input id="SkuName" type="text" lay-verify="" disabled placeholder=""
                                                class="layui-input" style="font-size: 12px; padding-left: 0;">
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="" class="layui-form-item layout-input" style="margin-top: 10px;">
                        <label class="layui-form-label">新托盘条码:</label>
                        <div class="layui-input-block">
                            <input id="PalletNo2" type="text" lay-verify="stock" placeholder="托盘条码" autocomplete="off"
                                class="layui-input">
                        </div>
                    </div>
                    <div id="" class="" style="width: 100%;height: 36px;margin-top: 15px;">
                        <button id="btnQuery" class="btn-ok" type="button">确认</button>
                    </div>
                </form>
            </div>
            <div id="" class="layout-tbl-paging" style="margin-top: 15px;">
                <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding="">
                    <tr>
                        <td class="img-back"><a href="../index.html"><img src="/assets/back.jpg" ></a></td>
                        <td class="title-text">托盘变更</td>
                        <td class="title-menu-icon"><img id="menuImg" src="/assets/menu.jpg" ></td>
                        <th>箱码</th>
                        <th>库存<br>数量</th>
                    </tr>
                    <tr id="boxCell" style="display: none;">
                        <td name="boxNo">000001</td>
                        <td name="qty">30</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">主页</a></li>
                        <li><a href="../login.html">重新登录</a></li>
                    </ul>
                </div>
                <div id="" class="layout-bill-info">
                    <form class="layui-form" action="" style="height: auto;">
                        <div id="" class="layui-form-item layout-input" style="margin-top: 10px;">
                            <label class="layui-form-label">原托盘条码:</label>
                            <div class="layui-input-block">
                                <input id="PalletNo" type="text" lay-verify="stock" placeholder="托盘条码"
                                    autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div id="" class="layui-form-item layout-input" style="margin-top: 10px;">
                            <div id="layout-boxcode" class="layui-form-item layout-input">
                                <label class="layui-form-label" lang>是否整托变更:</label>
                                <div class="layui-input-block">
                                    <input type="checkbox" name="IsZhengTuo" id="IsZhengTuo" lay-skin="switch" lay-text="是|否"
                                        lay-filter="IsZhengTuo">
                                </div>
                            </div>
                        </div>
                        <div id="BoxDIv" class="layui-form-item layout-input" style="margin-top: 10px;">
                            <div id="layout-boxcode" class="layui-form-item layout-input">
                                <label class="layui-form-label">外箱条码:</label>
                                <div class="layui-input-block">
                                    <input id="BoxNo" type="text" placeholder="请扫描外箱条码"
                                        autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <div id="BoxDIv2" class="layout-tab-page">
                            <table class="tbl-box-sim-info" border="" cellspacing="" cellpadding="" >
                                <tr>
                                    <td>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label" style="width: 50%;">物料编号:</label>
                                            <div class="layui-input-block" style="width: 50%;margin-left:50%;">
                                                <input id="SkuNo" type="text" lay-verify="" disabled placeholder=""
                                                    class="layui-input" style="font-size: 12px;padding-left: 0;">
                                            </div>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label" style="width: 25%">批次:</label>
                                            <div class="layui-input-block" style="width: 75%;margin-left:25%;">
                                                <input id="LotNo" type="text" lay-verify="" disabled placeholder=""
                                                    class="layui-input" style="font-size: 12px;padding-left: 0;">
                                            </div>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label" style="width: 34%;">数量:</label>
                                            <div class="layui-input-block" style="width: 66%;margin-left:34%;">
                                                <input id="BoxQty" type="text" lay-verify="" disabled placeholder=""
                                                    class="layui-input" style="font-size: 12px;padding-left: 0;">
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="3">
                                        <div class="layui-form-item">
                                            <label class="layui-form-label" style="width: 17%;">物料名称:</label>
                                            <div class="layui-input-block" style="width: 83%;margin-left:17%;">
                                                <input id="SkuName" type="text" lay-verify="" disabled placeholder=""
                                                    class="layui-input" style="font-size: 12px; padding-left: 0;">
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div id="" class="layui-form-item layout-input" style="margin-top: 10px;">
                            <label class="layui-form-label">新托盘条码:</label>
                            <div class="layui-input-block">
                                <input id="PalletNo2" type="text" lay-verify="stock" placeholder="托盘条码"
                                    autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div id="" class="" style="width: 100%;height: 36px;margin-top: 15px;">
                            <button id="btnQuery" class="btn-ok"   type="button">确认</button>
                        </div>
                    </form>
                </div>
                <div id="" class="layout-tbl-paging" style="margin-top: 15px;">
                    <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding=""  >
                        <tr>
                            <th>箱码</th>
                            <th>库存<br>数量</th>
                        </tr>
                        <tr id="boxCell" style="display: none;">
                            <td name="boxNo">000001</td>
                            <td name="qty">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>
                <!-- 分页 -->
                <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>
        <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/jquery.cookie.js"></script>
        <script>
            layui.use(['form', 'jquery'], function() {
                var form = layui.form
                //当前分页
                var curPageIndex = 1;
                //是否整托换绑
                var isContinue = "0";
                $("#PalletNo").keydown(function(e) {
                    if (e.keyCode === 13) {
                        var bl = checkPalletState();
                        if (bl) {
                            ReaderTable();
                        }
                    }
                });
    </div>
                $("#BoxNo").keydown(function(e) {
                    if (e.keyCode === 13) {
                        readerBoxInfo();
                    }
                });
                $("#PalletNo2").keydown(function(e) {
                    if (e.keyCode === 13) {
                        var bl = checkPalletState();
                        if (bl) {
                            ReaderTable2();
                        }
                    }
                });
                form.on('switch(IsZhengTuo)', function (obj) {
    <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/jquery.cookie.js"></script>
    <script>
        layui.use(['form', 'jquery'], function () {
            var form = layui.form
            //当前分页
            var curPageIndex = 1;
            //是否整托换绑
            var isContinue = "0";
            $("#PalletNo").keydown(function (e) {
                if (e.keyCode === 13) {
                    var bl = checkPalletState();
                    if (bl) {
                        ReaderTable();
                    }
                }
            });
            $("#BoxNo").keydown(function (e) {
                if (e.keyCode === 13) {
                    readerBoxInfo();
                }
            });
            $("#PalletNo2").keydown(function (e) {
                if (e.keyCode === 13) {
                    var bl = checkPalletState();
                    if (bl) {
                        ReaderTable2();
                    }
                }
            });
            form.on('switch(IsZhengTuo)', function (obj) {
                if (obj.elem.checked) {
                    $('#BoxDIv').attr("style", "display:none")
                    $('#BoxDIv2').attr("style", "display:none")
                    isContinue="1";
                } else {
                    isContinue = "1";
                } else {
                    $('#BoxDIv').attr("style", "display:block")
                    $('#BoxDIv2').attr("style", "display:block")
                    isContinue="0";
                    isContinue = "0";
                }
                $('#BoxNo').val("");
                $('#SkuNo').val("");
@@ -274,326 +288,326 @@
                $('#SkuName').val("");
            });
                $("#btnQuery").click(function(){
                    if($('#PalletNo').val() == '' ){
                        layer.msg("请输入原托盘号", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {});
                        return;
                    }
                    if(isContinue == "0" && $('#BoxNo').val() == '' ){
                        layer.msg("请输入箱码", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {});
                        return;
                    }
                    if($('#PalletNo').val() == '' ){
                        layer.msg("请输入新托盘号", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {});
                        return;
                    }
                    var param = {
                        PalletNo: $('#PalletNo').val(),
                        BoxNo: $('#BoxNo').val(),
                        PalletNoNew: $('#PalletNo2').val()
                    };
                    sendData(IP + "/PdaCr/SaveUnbind", param, 'post', function(res) {
                        if (res.code == 0) { //成功
                            layer.msg("换绑成功", {
                                icon: 1,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function() {
                                $('#BoxNo').val('');
                                $("#SkuNo").val('');
                                $("#LotNo").val('');
                                $("#BoxQty").val('');
                                $("#SkuName").val('');
                                refreshTable();
                            });
                        } else { //不成功
                            layer.msg(res.msg, {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function() {});
                        }
                    });
                })
                function ReaderTable() {
                    var param = {
                        "PalletNo": $("#PalletNo").val()
                    }
                    synData(IP + "/PdaCr/GetDataDetailList", param, 'get', function (res) {
                        if (res.code == 0) { //成功
                            refreshTable(res.data);
                        } else { //不成功
                            layer.msg(res.msg, {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function () { });
                        }
                    });
            $("#btnQuery").click(function () {
                if ($('#PalletNo').val() == '') {
                    layer.msg("请输入原托盘号", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () { });
                    return;
                }
                function ReaderTable2() {
                    var param = {
                        "PalletNo": $("#PalletNo2").val()
                    }
                    synData(IP + "/PdaCr/GetDataDetailList", param, 'get', function (res) {
                        if (res.code == 0) { //成功
                            refreshTable(res.data);
                        } else { //不成功
                            layer.msg(res.msg, {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function () { });
                        }
                    });
                if (isContinue == "0" && $('#BoxNo').val() == '') {
                    layer.msg("请输入箱码", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () { });
                    return;
                }
                function readerBoxInfo() {
                    $("#SkuNo").val('');
                    $("#SkuName").val('');
                    $("#LotNo").val('');
                    $("#BoxQty").val('');
                    var param = {
                        "boxNo": $("#BoxNo").val()
                    }
                    synData(IP + "/PdaCr/GetBoxInfoByBox", param, 'get', function (res) {
                        console.log(res);
                        if (res.code == 0) { //成功
                            $("#SkuNo").val(res.data.SkuNo);
                            $("#SkuName").val(res.data.SkuName);
                            $("#LotNo").val(res.data.LotNo);
                            $("#BoxQty").val(res.data.Qty);
                        } else { //不成功
                            layer.msg(res.msg, {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function () { });
                        }
                    });
                if ($('#PalletNo').val() == '') {
                    layer.msg("请输入新托盘号", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () { });
                    return;
                }
                var param = {
                    PalletNo: $('#PalletNo').val(),
                    BoxNo: $('#BoxNo').val(),
                    PalletNoNew: $('#PalletNo2').val()
                };
                sendData(IP + "/PdaCr/SaveUnbind", param, 'post', function (res) {
                    if (res.code == 0) { //成功
                function refreshTable(tableData) {
                    //先清空一下箱子列表
                    let trs = $("#tableBoxList tr")
                    let len = trs.length
                    //console.log("tr 数量 + " + trs.length)
                    for(i=len - 1; i >=2; i--){
                        trs[i].remove();
                    }
                    if (tableData.length > 0) { //成功
                        $("#boxNum").val(tableData.length)
                        var list = tableData
                        var arrTrs = new Array()
                        let idx = 0
                        for(var i in list) {
                            // list[i].BoxCode
                            var tr = $("#boxCell").eq(0).clone();
                            tr.appendTo("#tableBoxList");
                            idx++;
                            tr.attr('index', idx) ;
                            tr.find("td[name='boxNo']").html(list[i].BoxNo);
                            tr.find("td[name='qty']").html(list[i].Qty);
                            tr.show();
                            arrTrs[i] = tr
                        }
                        //设置分页
                        setPages(1, list.length)
                        layer.msg("换绑成功", {
                            icon: 1,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
                            $('#BoxNo').val('');
                            $("#SkuNo").val('');
                            $("#LotNo").val('');
                            $("#BoxQty").val('');
                            $("#SkuName").val('');
                            refreshTable();
                        });
                    } else { //不成功
                        layer.msg("无数据", {
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {});
                        setPages(1, 0)
                        }, function () { });
                    }
                }
                //检查托盘状态
                function checkPalletState(){
                    var bl = false;
                    var param = {
                        "PalletNo": $("#PalletNo").val()
                    }
                    synData(IP + "/PdaSo/IsEnableOkPalletNo", param, 'post', function (res) {
                        if (res.code == 0) { //成功
                            bl = true;
                        } else { //不成功
                            layer.msg(res.msg, {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function () { });
                        }
                    });
                    return bl;
                 }
                form.verify({
                    stock: [/^[\S]{8}$/, '托盘条码必须为八位字符']
                });
                //-----------------------------------------------------------------------------------------
                $("#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()
                })
                //设置分页
                function setPages(pageIndex, boxNum){
                    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)
                }
                //设置当前分页
                function setCurPage(pageIndex){
                    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
                    }
                    //console.log("startIndex is "+startIndex)
                    //console.log("endIndex is "+endIndex)
                    //startIndex =2
                    //endIndex = 2
                    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")
                        }
                    }
                    //console.log("totalTrNum is " + totalTrNum)
                }
                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)
                }
                function getBoxPageNum()
                {
                    let num = $("#tableBoxList tr").length
                    if(num <= 2 ){
                        return 0
                    }
                    let pageNum = Math.floor(num / 10);
                    if(num % 10 > 0){
                        pageNum += 1;
                    }
                    return pageNum
                }
            })
        </script>
    </body>
</html>
            function ReaderTable() {
                var param = {
                    "PalletNo": $("#PalletNo").val()
                }
                synData(IP + "/PdaCr/GetDataDetailList", param, 'get', function (res) {
                    if (res.code == 0) { //成功
                        refreshTable(res.data);
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            }
            function ReaderTable2() {
                var param = {
                    "PalletNo": $("#PalletNo2").val()
                }
                synData(IP + "/PdaCr/GetDataDetailList", param, 'get', function (res) {
                    if (res.code == 0) { //成功
                        refreshTable(res.data);
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            }
            function readerBoxInfo() {
                $("#SkuNo").val('');
                $("#SkuName").val('');
                $("#LotNo").val('');
                $("#BoxQty").val('');
                var param = {
                    "boxNo": $("#BoxNo").val()
                }
                synData(IP + "/PdaCr/GetBoxInfoByBox", param, 'get', function (res) {
                    console.log(res);
                    if (res.code == 0) { //成功
                        $("#SkuNo").val(res.data.SkuNo);
                        $("#SkuName").val(res.data.SkuName);
                        $("#LotNo").val(res.data.LotNo);
                        $("#BoxQty").val(res.data.Qty);
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            }
            function refreshTable(tableData) {
                //先清空一下箱子列表
                let trs = $("#tableBoxList tr")
                let len = trs.length
                //console.log("tr 数量 + " + trs.length)
                for (i = len - 1; i >= 2; i--) {
                    trs[i].remove();
                }
                if (tableData.length > 0) { //成功
                    $("#boxNum").val(tableData.length)
                    var list = tableData
                    var arrTrs = new Array()
                    let idx = 0
                    for (var i in list) {
                        // list[i].BoxCode
                        var tr = $("#boxCell").eq(0).clone();
                        tr.appendTo("#tableBoxList");
                        idx++;
                        tr.attr('index', idx);
                        tr.find("td[name='boxNo']").html(list[i].BoxNo);
                        tr.find("td[name='qty']").html(list[i].Qty);
                        tr.show();
                        arrTrs[i] = tr
                    }
                    //设置分页
                    setPages(1, list.length)
                } else { //不成功
                    layer.msg("无数据", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () { });
                    setPages(1, 0)
                }
            }
            //检查托盘状态
            function checkPalletState() {
                var bl = false;
                var param = {
                    "PalletNo": $("#PalletNo").val()
                }
                synData(IP + "/PdaSo/IsEnableOkPalletNo", param, 'post', function (res) {
                    if (res.code == 0) { //成功
                        bl = true;
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
                return bl;
            }
            form.verify({
                stock: [/^[\S]{8}$/, '托盘条码必须为八位字符']
            });
            //-----------------------------------------------------------------------------------------
            $("#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()
            })
            //设置分页
            function setPages(pageIndex, boxNum) {
                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)
            }
            //设置当前分页
            function setCurPage(pageIndex) {
                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
                }
                //console.log("startIndex is "+startIndex)
                //console.log("endIndex is "+endIndex)
                //startIndex =2
                //endIndex = 2
                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")
                    }
                }
                //console.log("totalTrNum is " + totalTrNum)
            }
            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)
            }
            function getBoxPageNum() {
                let num = $("#tableBoxList tr").length
                if (num <= 2) {
                    return 0
                }
                let pageNum = Math.floor(num / 10);
                if (num % 10 > 0) {
                    pageNum += 1;
                }
                return pageNum
            }
        })
    </script>
</body>
</html>
Pda/View/HouseDataSetting/pingkuQuery.html
@@ -1,398 +1,412 @@
<!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">
            .layui-form-label {
                width: 20%;
            }
            .layui-input-block {
                width: 80%;
                margin-left: 20%;
            }
            .div-tbl-title {
                width: 98%;
                margin: auto;
                /* background-color: #4476A7; */
                height: 30px;
                margin-top: 20px;
            }
            .div-tbl-title table {
                width: 100%;
                height: 30px;
            }
            .div-tbl-title td {
                width: 50%;
                height: 30px;
                line-height: 30px;
            }
            .div-tbl-title span {
                float: left;
                width: 60%;
                height: 30px;
                line-height: 30px;
            }
            .div-tbl-title input {
                float: left;
                width: 40%;
                height: 30px;
                line-height: 30px;
                border: none;
            }
            .layout-tbl-paging {
                margin-top: 0;
            }
            .layout-bill-info {
                height: auto;
            }
            .btn-ok {
                border: none;
                color: #FFFFFF;
                background-color: #0a93e3;
                width: 48%;
                height: 36px;
                border-radius: 5px;
                float: left;
                margin: 0 1%;
                margin-left: 25%;
            }
            .btn-ok:active {
                opacity: 0.8;
            }
            td{
                word-break: break-all;
                word-wrap:break-word;
            }
            .LotInfo{
                text-align: left;
                line-height: 1.5;
                padding: 5px;
            }
        </style>
        <link rel="stylesheet" href="/css/adapter.css" />
    </head>
    <body>
        <div id="" class="main-content">
            <div id="" class="layout-title" >
                <table border="" cellspacing="" cellpadding="">
<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>平库查询</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">
        .layui-form-label {
            width: 20%;
        }
        .layui-input-block {
            width: 80%;
            margin-left: 20%;
        }
        .div-tbl-title {
            width: 98%;
            margin: auto;
            /* background-color: #4476A7; */
            height: 30px;
            margin-top: 20px;
        }
        .div-tbl-title table {
            width: 100%;
            height: 30px;
        }
        .div-tbl-title td {
            width: 50%;
            height: 30px;
            line-height: 30px;
        }
        .div-tbl-title span {
            float: left;
            width: 60%;
            height: 30px;
            line-height: 30px;
        }
        .div-tbl-title input {
            float: left;
            width: 40%;
            height: 30px;
            line-height: 30px;
            border: none;
        }
        .layout-tbl-paging {
            margin-top: 0;
        }
        .layout-bill-info {
            height: auto;
        }
        .btn-ok {
            border: none;
            color: #FFFFFF;
            background-color: #0a93e3;
            width: 48%;
            height: 36px;
            border-radius: 5px;
            float: left;
            margin: 0 1%;
            margin-left: 25%;
        }
        .btn-ok:active {
            opacity: 0.8;
        }
        td {
            word-break: break-all;
            word-wrap: break-word;
        }
        .LotInfo {
            text-align: left;
            line-height: 1.5;
            padding: 5px;
        }
    </style>
    <link rel="stylesheet" href="/css/adapter.css" />
</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">平库查询</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">主页</a></li>
                    <li><a href="../login.html">重新登录</a></li>
                </ul>
            </div>
            <div id="" class="layout-bill-info">
                <form class="layui-form" action="" style="height: auto;">
                    <div id="" class="layui-form-item layout-input" style="margin-top: 5px;">
                        <label class="layui-form-label">托盘条码</label>
                        <div class="layui-input-block">
                            <input id="PalletNo" type="text" lay-verify="stock" placeholder="托盘条码" autocomplete="off"
                                class="layui-input">
                        </div>
                    </div>
                    <div id="" class="" style="width: 100%;height: 36px;margin-top: 15px;">
                        <button id="btnQuery" class="btn-ok" type="button">查询</button>
                    </div>
                </form>
            </div>
            <div id="" class="layout-tbl-paging" style="margin-top: 5px;">
                <table id="tableBoxList" class="tbl-box-list" border="1px">
                    <tr>
                        <td class="img-back"><a href="../index.html"><img src="/assets/back.jpg" ></a></td>
                        <td class="title-text">平库查询</td>
                        <td class="title-menu-icon"><img id="menuImg" src="/assets/menu.jpg" ></td>
                        <th>物品信息</th>
                        <th>库存<br>数量</th>
                        <th>锁定<br>数量</th>
                        <th>冻结<br>数量</th>
                    </tr>
                    <tr id="boxCell" style="display: none;">
                        <td name="LotNo" class="LotInfo">物料信息</td>
                        <td name="Qty">剩余数量</td>
                        <td name="LockQty">锁定数量</td>
                        <td name="FrozenQty">冻结数量</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">主页</a></li>
                        <li><a href="../login.html">重新登录</a></li>
                    </ul>
                </div>
                <div id="" class="layout-bill-info">
                    <form class="layui-form" action="" style="height: auto;">
                        <div id="" class="layui-form-item layout-input" style="margin-top: 5px;">
                            <label class="layui-form-label">托盘条码</label>
                            <div class="layui-input-block">
                                <input id="PalletNo" type="text" lay-verify="stock" placeholder="托盘条码"
                                    autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div id="" class="" style="width: 100%;height: 36px;margin-top: 15px;">
                            <button id="btnQuery" class="btn-ok"  type="button">查询</button>
                        </div>
                    </form>
                </div>
                <div id="" class="layout-tbl-paging" style="margin-top: 5px;">
                    <table id="tableBoxList" class="tbl-box-list"  border="1px"    >
                        <tr>
                            <th >物品信息</th>
                            <th >库存<br>数量</th>
                            <th >锁定<br>数量</th>
                            <th >冻结<br>数量</th>
                        </tr>
                        <tr id="boxCell" style="display: none;">
                            <td name="LotNo" class="LotInfo">物料信息</td>
                            <td name="Qty">剩余数量</td>
                            <td name="LockQty">锁定数量</td>
                            <td name="FrozenQty">冻结数量</td>
                        </tr>
                    </table>
                    <!-- 分页 -->
                    <table id="tableBoxPages" class="tbl-box-pages"  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>
                <!-- 分页 -->
                <table id="tableBoxPages" class="tbl-box-pages" 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>
        <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/jquery.cookie.js"></script>
        <script>
            layui.use(['form', 'jquery'], function() {
                var form = layui.form
                //当前分页
                var curPageIndex = 1
                var tableData = null
                $("#menuImg").click(function(e){
                    //console.log("menuImg")
                    e.stopPropagation()
                    if($("#menuList").is(":hidden")){
                        $("#menuList").show()
                    }else{
                        $("#menuList").hide()
                    }
                })
                $('body').click(function(){
    </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/jquery.cookie.js"></script>
    <script>
        layui.use(['form', 'jquery'], function () {
            var form = layui.form
            //当前分页
            var curPageIndex = 1
            var tableData = null
            $("#menuImg").click(function (e) {
                //console.log("menuImg")
                e.stopPropagation()
                if ($("#menuList").is(":hidden")) {
                    $("#menuList").show()
                } else {
                    $("#menuList").hide()
                })
                $("#btnQuery").click(function(){
                    if($('#PalletNo').val() == ''){
                        layer.msg("请输入托盘条码", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {
                            let trs = $("#tableBoxList tr")
                            let len = trs.length
                            for(i=len - 1; i >=2; i--){
                                trs[i].remove();
                            }
                        });
                        return
                    }
                    var param = {
                        PalletNo: $('#PalletNo').val(),
                    };
                    sendData(IP + "/PdaCr/GetStockQueryList", param, 'get', function(res) {
                        console.log("库存查询:",res)
                        if (res.code == 0) { //成功
                            tableData = deepCopy(res.data)
                            refreshTable()
                        } else { //不成功
                            layer.msg(res.msg, {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function() {
                                let trs = $("#tableBoxList tr")
                                let len = trs.length
                                for(i=len - 1; i >=2; i--){
                                    trs[i].remove();
                                }
                            });
                }
            })
            $('body').click(function () {
                $("#menuList").hide()
            })
            $("#btnQuery").click(function () {
                if ($('#PalletNo').val() == '') {
                    layer.msg("请输入托盘条码", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () {
                        let trs = $("#tableBoxList tr")
                        let len = trs.length
                        for (i = len - 1; i >= 2; i--) {
                            trs[i].remove();
                        }
                    });
                })
                function refreshTable() {
                    //先清空一下箱子列表
                    let trs = $("#tableBoxList tr")
                    let len = trs.length
                    //console.log("tr 数量 + " + trs.length)
                    for(i=len - 1; i >=2; i--){
                        trs[i].remove();
                    }
                    if (tableData.length > 0) { //成功
                        // $("#boxNum").val(tableData.length)
                        var list = tableData
                        var arrTrs = new Array()
                        let idx = 0
                        for(var i in list) {
                            // list[i].BoxCode
                            var tr = $("#boxCell").eq(0).clone();
                            tr.appendTo("#tableBoxList");
                            // tr.attr('id', list[i].BoxCode)
                            idx++;
                            tr.attr('index', idx)
                            tr.find("td[name='LotNo']").html('物料编码:'+list[i].SkuNo+'<br/>物料名称:'+list[i].SkuName+'<br/>规&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格:'+list[i].Standard+'<br/>物料批次:'+list[i].LotNo);
                            tr.find("td[name='Qty']").html(list[i].Qty);
                            tr.find("td[name='LockQty']").html(list[i].LockQty);
                            tr.find("td[name='FrozenQty']").html(list[i].FrozenQty);
                            // tr.find("td[name='InspectQty']").html(list[i].InspectQty);
                            // //console.log("boxcode is "+tr.find("td[name='boxcode']").html())
                            tr.show();
                            arrTrs[i] = tr
                        }
                        //设置分页
                        setPages(1, list.length)
                    return
                }
                var param = {
                    PalletNo: $('#PalletNo').val(),
                };
                sendData(IP + "/PdaCr/GetStockQueryList", param, 'get', function (res) {
                    console.log("库存查询:", res)
                    if (res.code == 0) { //成功
                        tableData = deepCopy(res.data)
                        refreshTable()
                    } else { //不成功
                        // $("#boxNum").val(0)
                        layer.msg("无数据", {
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {});
                        setPages(1, 0)
                        }, function () {
                            let trs = $("#tableBoxList tr")
                            let len = trs.length
                            for (i = len - 1; i >= 2; i--) {
                                trs[i].remove();
                            }
                        });
                    }
                }
                //设置分页
                function setPages(pageIndex, boxNum){
                    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)
                }
                //设置当前分页
                function setCurPage(pageIndex){
                    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
                    }
                    //console.log("startIndex is "+startIndex)
                    //console.log("endIndex is "+endIndex)
                    //startIndex =2
                    //endIndex = 2
                    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")
                        }
                    }
                    //console.log("totalTrNum is " + totalTrNum)
                }
                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)
                }
                function getBoxPageNum()
                {
                    let num = $("#tableBoxList tr").length
                    if(num <= 2 ){
                        return 0
                    }
                    let pageNum = Math.floor(num / 10);
                    if(num % 10 > 0){
                        pageNum += 1;
                    }
                    return pageNum
                }
                form.verify({
                    stock: [/^[\S]{6}$/, '托盘条码必须为六位字符']
                });
            })
        </script>
    </body>
</html>
            function refreshTable() {
                //先清空一下箱子列表
                let trs = $("#tableBoxList tr")
                let len = trs.length
                //console.log("tr 数量 + " + trs.length)
                for (i = len - 1; i >= 2; i--) {
                    trs[i].remove();
                }
                if (tableData.length > 0) { //成功
                    // $("#boxNum").val(tableData.length)
                    var list = tableData
                    var arrTrs = new Array()
                    let idx = 0
                    for (var i in list) {
                        // list[i].BoxCode
                        var tr = $("#boxCell").eq(0).clone();
                        tr.appendTo("#tableBoxList");
                        // tr.attr('id', list[i].BoxCode)
                        idx++;
                        tr.attr('index', idx)
                        tr.find("td[name='LotNo']").html('物料编码:' + list[i].SkuNo + '<br/>物料名称:' + list[i].SkuName + '<br/>规&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格:' + list[i].Standard + '<br/>物料批次:' + list[i].LotNo);
                        tr.find("td[name='Qty']").html(list[i].Qty);
                        tr.find("td[name='LockQty']").html(list[i].LockQty);
                        tr.find("td[name='FrozenQty']").html(list[i].FrozenQty);
                        // tr.find("td[name='InspectQty']").html(list[i].InspectQty);
                        // //console.log("boxcode is "+tr.find("td[name='boxcode']").html())
                        tr.show();
                        arrTrs[i] = tr
                    }
                    //设置分页
                    setPages(1, list.length)
                } else { //不成功
                    // $("#boxNum").val(0)
                    layer.msg("无数据", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () { });
                    setPages(1, 0)
                }
            }
            //设置分页
            function setPages(pageIndex, boxNum) {
                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)
            }
            //设置当前分页
            function setCurPage(pageIndex) {
                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
                }
                //console.log("startIndex is "+startIndex)
                //console.log("endIndex is "+endIndex)
                //startIndex =2
                //endIndex = 2
                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")
                    }
                }
                //console.log("totalTrNum is " + totalTrNum)
            }
            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)
            }
            function getBoxPageNum() {
                let num = $("#tableBoxList tr").length
                if (num <= 2) {
                    return 0
                }
                let pageNum = Math.floor(num / 10);
                if (num % 10 > 0) {
                    pageNum += 1;
                }
                return pageNum
            }
            form.verify({
                stock: [/^[\S]{6}$/, '托盘条码必须为六位字符']
            });
        })
    </script>
</body>
</html>
Pda/View/HouseDataSetting/returnGoodOut.html
@@ -1,867 +1,887 @@
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="user-scalable=0,width=device-width,initial-scale=1.0" />
        <!-- <meta name="viewport" content="width=device-width, initial-scale=0.665, minimum-scale=0.5, maximum-scale=2.0, user-scalable=no" /> -->
        <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">
            .layout-bill-info {
                height: auto;
                /* background-color: #009E94; */
            }
            .layout-tbl-submit {
                margin-top: 10px;
            }
            .out-scatter-num .local-input {
                width: 40%;
                height: 25px;
                float: left;
            }
            .out-scatter-num .local-ok button {
                height: 25px;
                border: 0;
                color: #FFFFFF;
                background-color: #0a93e3;
                border-radius: 3px;
                padding: 2px;
                margin-left: 10px;
                width: 100%;
            }
            .out-scatter-num .layui-form-label {
                width: 30%;
                /* background-color: #007BFF; */
            }
            .out-scatter-num .layui-input-block {
                width: 100%;
                /* background-color: #009E94; */
                margin-left: 0;
            }
            .out-scatter-num .local-ok {
                width: 20%;
                height: 25px;
                float: left;
            }
            .layout-tbl-paging {
                margin-top: 20px;
            }
            .layout-tab-page {
                height: auto;
            }
            .layui-form-checkbox {
                margin: auto;
                /* padding-left: 2px; */
                /* padding-right: 2px; */
            }
            .div-tbl-title {
                width: 98%;
                margin: auto;
                /* background-color: #4476A7; */
                height: 30px;
            }
            .div-tbl-title table {
                width: 100%;
                height: 30px;
            }
            .layui-form-radio{
                margin: 0;
                padding-right: 0;
            }
            td{
                word-break: break-all; word-wrap:break-word;
            }
        </style>
        <link rel="stylesheet" href="/css/adapter.css" />
    </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">质检变更</td>
                        <td class="title-menu-icon"><img id="menuImg" src="/assets/menu.jpg" ></td>
                    </tr>
                </table>
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="user-scalable=0,width=device-width,initial-scale=1.0" />
    <!-- <meta name="viewport" content="width=device-width, initial-scale=0.665, minimum-scale=0.5, maximum-scale=2.0, user-scalable=no" /> -->
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>退货入库单</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">
        .layout-bill-info {
            height: auto;
            /* background-color: #009E94; */
        }
        .layout-tbl-submit {
            margin-top: 10px;
        }
        .out-scatter-num .local-input {
            width: 40%;
            height: 25px;
            float: left;
        }
        .out-scatter-num .local-ok button {
            height: 25px;
            border: 0;
            color: #FFFFFF;
            background-color: #0a93e3;
            border-radius: 3px;
            padding: 2px;
            margin-left: 10px;
            width: 100%;
        }
        .out-scatter-num .layui-form-label {
            width: 30%;
            /* background-color: #007BFF; */
        }
        .out-scatter-num .layui-input-block {
            width: 100%;
            /* background-color: #009E94; */
            margin-left: 0;
        }
        .out-scatter-num .local-ok {
            width: 20%;
            height: 25px;
            float: left;
        }
        .layout-tbl-paging {
            margin-top: 20px;
        }
        .layout-tab-page {
            height: auto;
        }
        .layui-form-checkbox {
            margin: auto;
            /* padding-left: 2px; */
            /* padding-right: 2px; */
        }
        .div-tbl-title {
            width: 98%;
            margin: auto;
            /* background-color: #4476A7; */
            height: 30px;
        }
        .div-tbl-title table {
            width: 100%;
            height: 30px;
        }
        .layui-form-radio {
            margin: 0;
            padding-right: 0;
        }
        td {
            word-break: break-all;
            word-wrap: break-word;
        }
    </style>
    <link rel="stylesheet" href="/css/adapter.css" />
</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">质检变更</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">主页</a></li>
                    <li><a href="../login.html">重新登录</a></li>
                </ul>
            </div>
            <div id="" class="layout-sub-content">
                <div id="menuList" class="menu">
                    <ul class="" style="text-align: center;">
                        <li><a href="../index.html">主页</a></li>
                        <li><a href="../login.html">重新登录</a></li>
                    </ul>
                </div>
                <div id="" class="layout-bill-info">
                    <form class="layui-form" action="" style="height: auto;">
                        <div id="layout-bill" class="layui-form-item layout-dropdownlist" >
                            <label class="layui-form-label">退货入库单:</label>
                            <div class="layui-input-block" id="selectDiv">
                                <select id="bar" lay-filter="getbar" lay-search>
            <div id="" class="layout-bill-info">
                <form class="layui-form" action="" style="height: auto;">
                    <div id="layout-bill" class="layui-form-item layout-dropdownlist">
                        <label class="layui-form-label">退货入库单:</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 id="layout-pallet" class="layui-form-item layout-input">
                        <label class="layui-form-label">出库口:</label>
                        <div class="layui-input-block">
                            <input id="exitDesc" style="border: none;" type="text" lay-verify="stock" disabled
                                placeholder="" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div id="layout-pallet" class="layui-form-item layout-input">
                        <label class="layui-form-label">托盘条码:</label>
                        <div class="layui-input-block">
                            <input id="STOCKCODE" type="text" lay-verify="stock" placeholder="请扫描托盘条码"
                                autocomplete="off" class="layui-input" style="height:24px">
                        </div>
                    </div>
                    <div id="" class="layout-tab-page">
                        <div class="layui-form-item layout-dropdownlist" style="margin-top: 10px;">
                            <label class="layui-form-label">物料名称:</label>
                            <div class="layui-input-block">
                                <select id="goodSelect" lay-filter="goodSelect" lay-search>
                                    <option value=""></option>
                                </select>
                                <img src="/assets/down_arraw.png" >
                                <img src="/assets/down_arraw.png">
                            </div>
                        </div>
                        <div id="layout-pallet" class="layui-form-item layout-input">
                            <label class="layui-form-label">出库口:</label>
                        <div class="layui-form-item layout-dropdownlist" style="margin-top: 10px;">
                            <label class="layui-form-label">物料批次:</label>
                            <div class="layui-input-block">
                                <input id="exitDesc"  style="border: none;" type="text" lay-verify="stock" disabled placeholder=""
                                    autocomplete="off" class="layui-input">
                                <select id="lotNoSelect" lay-filter="lotNoSelect" lay-search>
                                    <option value=""></option>
                                </select>
                                <img src="/assets/down_arraw.png">
                            </div>
                        </div>
                        <div id="layout-pallet" class="layui-form-item layout-input">
                            <label class="layui-form-label">托盘条码:</label>
                        <div class="layui-form-item layout-input" style="margin-top: 10px;">
                            <label class="layui-form-label">新托盘条码:</label>
                            <div class="layui-input-block">
                                <input id="STOCKCODE" type="text" lay-verify="stock" placeholder="请扫描托盘条码"
                                <input id="NEWSTOCKCODE" type="text" lay-verify="stock" placeholder="请扫描新托盘条码"
                                    autocomplete="off" class="layui-input" style="height:24px">
                            </div>
                        </div>
                        <div id="" class="layout-tab-page">
                            <div class="layui-form-item layout-dropdownlist" style="margin-top: 10px;">
                                <label class="layui-form-label">物料名称:</label>
                                <div class="layui-input-block" >
                                    <select id="goodSelect" lay-filter="goodSelect" 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" >
                                    <select id="lotNoSelect" lay-filter="lotNoSelect" lay-search>
                                        <option value=""></option>
                                    </select>
                                    <img src="/assets/down_arraw.png" >
                                </div>
                            </div>
                            <div class="layui-form-item layout-input" style="margin-top: 10px;">
                                <label class="layui-form-label">新托盘条码:</label>
                                <div class="layui-input-block">
                                    <input id="NEWSTOCKCODE" type="text" lay-verify="stock" placeholder="请扫描新托盘条码"
                                        autocomplete="off" class="layui-input" style="height:24px">
                                </div>
                            </div>
                            <table id="outHalf" class="layout-tab-content" border="" cellspacing="" cellpadding="">
                                <tr>
                                    <td>
                                        <div class="layui-form-item out-scatter-num" >
                                            <label class="layui-form-label" style="width: 21%;">质检状态:</label>
                                            <div class="local-input">
                                                <div class="layui-input-block local-input" style="line-height: 28px;">
                                                    <input type="radio" name="status" value = "1" class="layui-input" checked="checked" style="padding-left:0.1rem;">合格
                                                    <input type="radio" name="status" value = "2" class="layui-input" style="padding-left:0.1rem;">不合格
                                                </div>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                                <tr id="outScatter">
                                    <td>
                                        <div id="layout-boxcode" class="layui-form-item out-scatter-num" style="margin-top: 10px;">
                                            <label class="layui-form-label" style="width: 21%;">拣货数量:</label>
                                            <div id="" class="local-input" >
                                                <div class="layui-input-block" >
                                                    <input id="outScatterQty" type="number" placeholder="请输入拣货数量"
                                                        autocomplete="off" class="layui-input" style="padding-left:0.1rem;" oninput="value=value.replace(/^(0+)|[^\d]+/g,'')">
                                                </div>
                                            </div>
                                            <div id="" class="local-ok" >
                                                <button type="button" lay-submit lay-filter="formPickScatter">确认</button>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <div id="" style="text-align: right;margin-top: 10px;">
                                <div id="" class="cut-line" >
                                    <img src="/assets/fengexian.png" >
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="layout-tbl-paging" id="" >
                    <div id="" class="div-tbl-title">
                        <table border="0" cellspacing="" cellpadding="" style="height: 30px;">
                        <table id="outHalf" class="layout-tab-content" border="" cellspacing="" cellpadding="">
                            <tr>
                                <td style="height: 30px;line-height: 30px;color: red;width: 50%;">
                                    <span id="" style="width: 50%;height: 30px;float: left;">
                                        箱子数量
                                    </span>
                                    <input id="boxNum" type="text" disabled placeholder=""
                                        autocomplete="off" style="border: none;float: left; width: 40%;height: 30px; line-height: 30px;background-color: #FFFFFF;">
                                <td>
                                    <div class="layui-form-item out-scatter-num">
                                        <label class="layui-form-label" style="width: 21%;">质检状态:</label>
                                        <div class="local-input">
                                            <div class="layui-input-block local-input" style="line-height: 28px;">
                                                <input type="radio" name="status" value="1" class="layui-input"
                                                    checked="checked" style="padding-left:0.1rem;">合格
                                                <input type="radio" name="status" value="2" class="layui-input"
                                                    style="padding-left:0.1rem;">不合格
                                            </div>
                                        </div>
                                    </div>
                                </td>
                                <td style="height: 30px;line-height: 30px;color: red;width: 50%;">
                                    <span id="" style="width: 50%;height: 30px;float: left;">
                                        待拣箱数
                                    </span>
                                    <input id="pickingBoxNum" type="text" disabled placeholder=""
                                        autocomplete="off"  style="border: none; width: 50%;float: left;height: 30px; line-height: 30px; background-color: #FFFFFF;">
                            </tr>
                            <tr id="outScatter">
                                <td>
                                    <div id="layout-boxcode" class="layui-form-item out-scatter-num"
                                        style="margin-top: 10px;">
                                        <label class="layui-form-label" style="width: 21%;">拣货数量:</label>
                                        <div id="" class="local-input">
                                            <div class="layui-input-block">
                                                <input id="outScatterQty" type="number" placeholder="请输入拣货数量"
                                                    autocomplete="off" class="layui-input" style="padding-left:0.1rem;"
                                                    oninput="value=value.replace(/^(0+)|[^\d]+/g,'')">
                                            </div>
                                        </div>
                                        <div id="" class="local-ok">
                                            <button type="button" lay-submit lay-filter="formPickScatter">确认</button>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                        <div id="" style="text-align: right;margin-top: 10px;">
                            <div id="" class="cut-line">
                                <img src="/assets/fengexian.png">
                            </div>
                        </div>
                    </div>
                    <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding="">
                        <tr id="tableHead">
                            <th style="width: 15%;">编码</th>
                            <th style="width: 31%;">名称</th>
                            <th style="width: 22%;">批次</th>
                            <th name="hpicknum" style="width: 12%;">待拣<br>数量</th>
                            <th name="hpickednum" style="width: 12%;">已拣<br>数量</th>
                            <th style="width: 8%;">拣货</th>
                        </tr>
                        <tr id="boxCell" style="display: none;">
                            <td name="goodCode">AG000001</td>
                            <td name="goodName">疫苗名称名称名称</td>
                            <td name="lotNo">30</td>
                            <td name="picknum">30</td>
                            <td name="pickednum">30</td>
                            <td name="check" style="text-align: center;">
                                <!-- <div id="" style="width:100%;margin: auto;"> -->
                                <input  type="checkbox" id="cbox2" value="second_checkbox" onclick="return false;" checked="checked" >
                                <!-- </div> -->
                </form>
            </div>
            <div class="layout-tbl-paging" id="">
                <div id="" class="div-tbl-title">
                    <table border="0" cellspacing="" cellpadding="" style="height: 30px;">
                        <tr>
                            <td style="height: 30px;line-height: 30px;color: red;width: 50%;">
                                <span id="" style="width: 50%;height: 30px;float: left;">
                                    箱子数量
                                </span>
                                <input id="boxNum" type="text" disabled placeholder="" autocomplete="off"
                                    style="border: none;float: left; width: 40%;height: 30px; line-height: 30px;background-color: #FFFFFF;">
                            </td>
                            <td style="height: 30px;line-height: 30px;color: red;width: 50%;">
                                <span id="" style="width: 50%;height: 30px;float: left;">
                                    待拣箱数
                                </span>
                                <input id="pickingBoxNum" type="text" disabled placeholder="" autocomplete="off"
                                    style="border: none; width: 50%;float: left;height: 30px; line-height: 30px; background-color: #FFFFFF;">
                            </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>
                <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding="">
                    <tr id="tableHead">
                        <th style="width: 15%;">编码</th>
                        <th style="width: 31%;">名称</th>
                        <th style="width: 22%;">批次</th>
                        <th name="hpicknum" style="width: 12%;">待拣<br>数量</th>
                        <th name="hpickednum" style="width: 12%;">已拣<br>数量</th>
                        <th style="width: 8%;">拣货</th>
                    </tr>
                    <tr id="boxCell" style="display: none;">
                        <td name="goodCode">AG000001</td>
                        <td name="goodName">疫苗名称名称名称</td>
                        <td name="lotNo">30</td>
                        <td name="picknum">30</td>
                        <td name="pickednum">30</td>
                        <td name="check" style="text-align: center;">
                            <!-- <div id="" style="width:100%;margin: auto;"> -->
                            <input type="checkbox" id="cbox2" value="second_checkbox" onclick="return false;"
                                checked="checked">
                            <!-- </div> -->
                        </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>
        <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/jquery.cookie.js"></script>
        <script>
            layui.use(['form', 'jquery'], function() {
                var form = layui.form
                //当前分页
                var curPageIndex = 1
                var tableData = null
                var canPickBox = true
                $("#STOCKCODE").focus();
                //下拉单据选中后事件
                form.on('select(getbar)', function(data) {
                    getBar(data.value);
                    updateGoodList();
                    updateLotNoList();
                    GetOutInfo();
                });
                $("#STOCKCODE").on('input',function(){
                    if($("#STOCKCODE").val() == "" || $("#STOCKCODE").val().length<10){
                        return
                    }
                    if ($("#STOCKCODE").val().length>=10) {
                        $("#STOCKCODE").val($("#STOCKCODE").val().substr(-10))
                    }
                    checkPalletStat()
                })
                $("#NEWSTOCKCODE").on('input',function(){
                    if($("#NEWSTOCKCODE").val() == "" || $("#NEWSTOCKCODE").val().length<10){
                        return
                    }
                    if ($("#NEWSTOCKCODE").val().length>=10) {
                        $("#NEWSTOCKCODE").val($("#NEWSTOCKCODE").val().substr(-10))
                    }
                })
                // //点击单据下拉框事件
                // $("#selectDiv").click(function(){
                //     getBar(data.value,$("#wavebar").val());
                //     updateGoodList();
                //     updateLotNoList();
                //     GetOutInfo();
                // })
                //初始化渲染出库单
                function updateBillList(){
                    $("#bar").empty()
                    $("#bar").append('<option value =>' + '</option>');
                    form.render('select');
                    var param = {
                        lpn:$("#STOCKCODE").val()
                    };
                    synData(IP + "/PdaInterface/GetImReturnGoodList",param, 'post', function(res) {
                        if (res.code == 1) { //成功
                            for (var i = 0; i < res.data.length; i++) {
                                if (i==0) {
                                    $("#bar").append('<option value =' + res.data[i] + ' selected>' + res.data[i] + '</option>');
                                } else {
                                    $("#bar").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>');
                                }
                            }
                            form.render('select');
                        } else { //不成功
                            layer.msg(res.msg, {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function() {});
                        }
                    });
                }
                //初始化渲染物料
                function updateGoodList(){
                    $("#goodSelect").empty()
                    $("#goodSelect").append('<option value =>' + '</option>');
                    form.render('select');
                    var param = {
                        palNo: $("#STOCKCODE").val(),
                        ordNo: $("#bar").val(),
                    };
                    synData(IP + "/PdaInterface/GetReturnGoodOutGoodInfo", param, 'post', function(res) {
                        console.log("物料"+JSON.stringify(res))
                        if (res.code == 1) { //成功
                            for (var i = 0; i < res.data.length; i++) {
                                if (i==0) {
                                    $("#goodSelect").append('<option value =' + res.data[i].GoodCode + ' selected>' + res.data[i].GoodName + '</option>');
                                } else {
                                    $("#goodSelect").append('<option value =' + res.data[i].GoodCode + '>' + res.data[i]
                                    .GoodName + '</option>');
                                }
                            }
                            form.render('select');
                        } else { //不成功
                            layer.msg(res.msg, {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function() {});
                        }
                    });
                }
                //初始化渲染批次
                function updateLotNoList(){
                    $("#lotNoSelect").empty()
                    $("#lotNoSelect").append('<option value =>' + '</option>');
                    form.render('select');
                    var param = {
                        palNo: $("#STOCKCODE").val(),
                        ordNo: $("#bar").val(),
                    };
                    synData(IP + "/PdaInterface/GetReturnGoodOutLotNoInfo", param, 'post', function(res) {
                        console.log("批次:"+JSON.stringify(res))
                        if (res.code == 1) { //成功
                            for (var i = 0; i < res.data.length; i++) {
                                console.log("批次2:"+ res.data[i].LotNo)
                                if (i == 0) {
                                    $("#lotNoSelect").append('<option value =' + res.data[i].LotNo + ' selected>' + res.data[i].LotNo + '</option>');
                                } else {
                                    $("#lotNoSelect").append('<option value =' + res.data[i].LotNo + '>' + res.data[i].LotNo + '</option>');
                                }
                            }
                            form.render('select');
                        } else { //不成功
                            layer.msg(res.msg, {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function() {});
                        }
                    });
                }
                //根据单据获取出库口
                function getBar(selectedvalue) {
                    if (selectedvalue) {
                        var param = {
                            "orderNo": selectedvalue
                        }
                        synData(IP + "/PdaInterface/GetReturnGoodOutlets", param, 'post', function(res) {
                            console.log("出库口:"+JSON.stringify(res))
                            if (res.code == 1) { //成功
                                let data = res.data
                                $('#exitDesc').val(data)
                            } else { //不成功
                                layer.msg(res.msg, {
                                    icon: 2,
                                    time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                }, function() {});
                            }
                        });
                    } else {
                    }
                }
                function GetOutInfo(){
                    let param2 = {
                        "palNo": $("#STOCKCODE").val(),
                        "ordNo": $("#bar").val(),
                    }
                    synData(IP + "/PdaInterface/GetReturnGoodOutInfo", param2, 'post', function(res) {
                        console.log("根据托盘号获取待检货信息 res is "+JSON.stringify(res))
                        if(res.code == 1){
                            tableData = deepCopy(res.data)
                            refreshTable(tableData)
                        }else{
                            layer.msg(res.msg, {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function() {});
                        }
                    });
                }
                //当托盘条码输入框失去焦点时,检查一下托盘状态 勿删
                // $("#STOCKCODE").blur(function(){
                //     if($("#STOCKCODE").val() == ""){
                //         return
                //     }
                //     if ($("#STOCKCODE").val().length>=10) {
                //         console.log($("#STOCKCODE").val().substr(-10));
                //         $("#STOCKCODE").val($("#STOCKCODE").val().substr(-10))
                //     }
                //     checkPalletStat()
                // })
                //键盘Enter按下事件(检查托盘状态)
                // $("#STOCKCODE").keydown(function(e) {
                //     if (e.keyCode === 13) {
                //         if($("#STOCKCODE").val() == ""){
                //             layer.msg("请输入托盘条码", {
                //                 icon: 2,
                //                 time: 2000 //2秒关闭(如果不配置,默认是3秒)
                //             });
                //             return
                //         }
                //         console.log("111111111111111")
                //         //检查托盘状态
                //         checkPalletStat();
                //     }
                // });
                //渲染表格数据
                function refreshTable(list) {
                    //先清空一下箱子列表
                    let trs = $("#tableBoxList tr")
                    let len = trs.length
                    //console.log("tr 数量 + " + trs.length)
                    for(i=len - 1; i >=2; i--){
                            trs[i].remove();
                    }
                    //设置托盘号
                    // $("#palletCode").val($.cookie('stockCode'))
                    console.log(list != null);
                    console.log(list );
                    if (list != null && list.length > 0) { //成功
                        $("#boxNum").val(list.length)
                        $("#pickingBoxNum").val(tableData.WholeBoxNum)
                        var arrTrs = new Array()
                        let idx = 0
                        for(var i in list) {
                            // list[i].BoxCode
                            var tr = $("#boxCell").eq(0).clone();
                            tr.appendTo("#tableBoxList");
                            tr.attr('id', list[i].BoxCode)
                            idx++;
                            tr.attr('index', idx)
                            tr.find("td[name='goodCode']").html(list[i].ExportGoodsCode);
                            tr.find("td[name='goodName']").html(list[i].ExportGoodsName);
                            tr.find("td[name='lotNo']").html(list[i].ExportLotNo);
                            tr.find("td[name='picknum']").html(list[i].PickNum);
                            tr.find("td[name='pickednum']").html(list[i].PickedNum);
                            if(list[i].ExportExecuteFlag == "3"){
                                //已拣
                                tr.find("td[name='check']").find('input').attr('checked', 'checked')
                            } else{
                                //未拣
                                //console.log("Status "+list[i].Status)
                                tr.find("td[name='check']").find('input').removeAttr('checked')
                            }
                            tr.show();
                            arrTrs[i] = tr
                        }
                        //设置分页
                        setPages(1, list.length)
                        canPickBox = true
                    } else { //不成功
                        layer.msg("无数据", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {});
                        $("#boxNum").val(0)
                        setPages(1, 0)
                    }
                    // $("#boxCnt").html("当前托盘上的箱子数量:"+res.length)
                }
                //检查托盘状态\根据托盘号获取待检货信息\渲染物料\渲染批次
                function checkPalletStat(){
                    // var list = tmpBoxs
                    if($("#STOCKCODE").val() == ""){
                        layer.msg("托盘号为空", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {});
                        return
                    }
                    var param = {
                        "palNo": $("#STOCKCODE").val()
                    }
                    synData(IP + "/PdaInterface/GetPalnoStatus", param, 'post', function(res) {
                        if (res.msg == "有效托盘") { //成功
                            $.cookie('stockCode', $("#STOCKCODE").val());
                            updateBillList();
                            getBar($("#bar").val());
                            updateGoodList();
                            updateLotNoList();
                            GetOutInfo();
                        } else { //不成功
                            layer.msg("无效托盘", {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function() {});
                        }
                    });
                }
                //获取选中的物料批次对应的拣货出库ID
                function getBoxInfoByBoxCode(exportGoodsCode,exportLotNo){
                    let list = tableData
                    for(let i = 0; i < list.length; i++){
                        if(list[i].ExportGoodsCode == exportGoodsCode && list[i].ExportLotNo == exportLotNo){
                            return list[i]
                        }
                    }
                    return null
                }
                //确认拣货(不是整托)
                function reqPickScatter(){
                    if($("#BOXCODE").val() == ""){
                        return
                    }
                    let boxinfo = getBoxInfoByBoxCode($("#goodSelect").val(),$("#lotNoSelect").val())
                    var param = {
                        "billCode": boxinfo.ExportRemark,
                        "orderId": boxinfo.Id,
                        "pickNum": $('#outScatterQty').val(),
                        "status":$("input[type='radio']:checked").val(),
                        "newStockCode":$('#NEWSTOCKCODE').val()
                    }
                    sendData(IP + "/PdaInterface/SetReturnGoodPickFlag", param, 'post', function(res) {
                        //console.log(res);
                        checkPalletStat()
                        if (res.code == 1) { //成功
                            layer.msg(res.msg, {
                                icon: 1,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function() {
                                canPickBox = true//回调
                            });
                        } else { //不成功
                            layer.msg(res.msg, {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function() {
                                canPickBox = true//回调
                            });
                        }
                    });
                }
                //单拣货(确认按钮)
                form.on('submit(formPickScatter)', function(data) {
                    // if (!$.cookie('userId')) {
                    //     layer.msg('登陆失效,请重新登陆', {
                    //         icon: 2,
                    //         time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    //     }, function() {
                    //         location.href = "login.html";
                    //         //回调
                    //     });
                    // }
                    if($('#outScatterQty').val() == ""){
                        layer.msg("请输入拣货数量", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {
                            //回调
                        });
                        return
                    }
                    if($('#NEWSTOCKCODE').val() == ""){
                        layer.msg("请输入新托盘条码", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {
                            //回调
                        });
                        return
                    }
                    if($('#goodSelect').val() == ""){
                        layer.msg("请选择物料", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {
                            //回调
                        });
                        return
                    }
                    if($('#lotNoSelect').val() == ""){
                        layer.msg("请选择批次", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {
                            //回调
                        });
                        return
                    }
                    let boxinfo = getBoxInfoByBoxCode($("#goodSelect").val(),$("#lotNoSelect").val())
                    if(!boxinfo){
                        layer.msg("未查询到物料批次信息", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {
                            //回调
                        });
                        return
                    }
                    let pn = boxinfo.PickNum
                    if($.isPlainObject(boxinfo.PickNum) || pn == 0){
                        pn = boxinfo.Qty
                    }
                    if(!$("#outScatterQty").val()){
                        layer.msg("请输入拣货数量", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {
                            //回调
                        });
                        return
                    }
                    let qty = parseInt($('#outScatterQty').val())
                    if(qty <= 0 || qty > pn){
                        layer.msg("拣货数量需大于0,并且不能超过待拣数量", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {
                            //回调
                        });
                        return
                    }
                    if(canPickBox == false){
                        //console.log("请求未完成,不要重复请求, canPickBox is "+canPickBox)
                        return
                    }
                    canPickBox = false
                    reqPickScatter()
                    return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
                });
                // form.verify({
                //     stock: [/^[\S]{6}$/, '托盘条码必须为六位字符']
                // });
    </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/jquery.cookie.js"></script>
    <script>
        layui.use(['form', 'jquery'], function () {
            var form = layui.form
            //当前分页
            var curPageIndex = 1
            var tableData = null
            var canPickBox = true
            $("#STOCKCODE").focus();
                //主页及重新登录
                $("#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()
                })
                //设置分页
                function setPages(pageIndex, boxNum){
                    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)
            //下拉单据选中后事件
            form.on('select(getbar)', function (data) {
                getBar(data.value);
                updateGoodList();
                updateLotNoList();
                GetOutInfo();
            });
            $("#STOCKCODE").on('input', function () {
                if ($("#STOCKCODE").val() == "" || $("#STOCKCODE").val().length < 10) {
                    return
                }
                //设置当前分页
                function setCurPage(pageIndex){
                    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
                    }
                    //console.log("startIndex is "+startIndex)
                    //console.log("endIndex is "+endIndex)
                    //startIndex =2
                    //endIndex = 2
                    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")
                        }
                    }
                    //console.log("totalTrNum is " + totalTrNum)
                if ($("#STOCKCODE").val().length >= 10) {
                    $("#STOCKCODE").val($("#STOCKCODE").val().substr(-10))
                }
                //上一页按钮被点击
                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)
                }
                function getBoxPageNum()
                {
                    let num = $("#tableBoxList tr").length
                    if(num <= 2 ){
                        return 0
                    }
                    let pageNum = Math.floor(num / 10);
                    if(num % 10 > 0){
                        pageNum += 1;
                    }
                    return pageNum
                }
                checkPalletStat()
            })
        </script>
    </body>
</html>
            $("#NEWSTOCKCODE").on('input', function () {
                if ($("#NEWSTOCKCODE").val() == "" || $("#NEWSTOCKCODE").val().length < 10) {
                    return
                }
                if ($("#NEWSTOCKCODE").val().length >= 10) {
                    $("#NEWSTOCKCODE").val($("#NEWSTOCKCODE").val().substr(-10))
                }
            })
            // //点击单据下拉框事件
            // $("#selectDiv").click(function(){
            //     getBar(data.value,$("#wavebar").val());
            //     updateGoodList();
            //     updateLotNoList();
            //     GetOutInfo();
            // })
            //初始化渲染出库单
            function updateBillList() {
                $("#bar").empty()
                $("#bar").append('<option value =>' + '</option>');
                form.render('select');
                var param = {
                    lpn: $("#STOCKCODE").val()
                };
                synData(IP + "/PdaInterface/GetImReturnGoodList", param, 'post', function (res) {
                    if (res.code == 1) { //成功
                        for (var i = 0; i < res.data.length; i++) {
                            if (i == 0) {
                                $("#bar").append('<option value =' + res.data[i] + ' selected>' + res.data[i] + '</option>');
                            } else {
                                $("#bar").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>');
                            }
                        }
                        form.render('select');
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            }
            //初始化渲染物料
            function updateGoodList() {
                $("#goodSelect").empty()
                $("#goodSelect").append('<option value =>' + '</option>');
                form.render('select');
                var param = {
                    palNo: $("#STOCKCODE").val(),
                    ordNo: $("#bar").val(),
                };
                synData(IP + "/PdaInterface/GetReturnGoodOutGoodInfo", param, 'post', function (res) {
                    console.log("物料" + JSON.stringify(res))
                    if (res.code == 1) { //成功
                        for (var i = 0; i < res.data.length; i++) {
                            if (i == 0) {
                                $("#goodSelect").append('<option value =' + res.data[i].GoodCode + ' selected>' + res.data[i].GoodName + '</option>');
                            } else {
                                $("#goodSelect").append('<option value =' + res.data[i].GoodCode + '>' + res.data[i]
                                    .GoodName + '</option>');
                            }
                        }
                        form.render('select');
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            }
            //初始化渲染批次
            function updateLotNoList() {
                $("#lotNoSelect").empty()
                $("#lotNoSelect").append('<option value =>' + '</option>');
                form.render('select');
                var param = {
                    palNo: $("#STOCKCODE").val(),
                    ordNo: $("#bar").val(),
                };
                synData(IP + "/PdaInterface/GetReturnGoodOutLotNoInfo", param, 'post', function (res) {
                    console.log("批次:" + JSON.stringify(res))
                    if (res.code == 1) { //成功
                        for (var i = 0; i < res.data.length; i++) {
                            console.log("批次2:" + res.data[i].LotNo)
                            if (i == 0) {
                                $("#lotNoSelect").append('<option value =' + res.data[i].LotNo + ' selected>' + res.data[i].LotNo + '</option>');
                            } else {
                                $("#lotNoSelect").append('<option value =' + res.data[i].LotNo + '>' + res.data[i].LotNo + '</option>');
                            }
                        }
                        form.render('select');
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            }
            //根据单据获取出库口
            function getBar(selectedvalue) {
                if (selectedvalue) {
                    var param = {
                        "orderNo": selectedvalue
                    }
                    synData(IP + "/PdaInterface/GetReturnGoodOutlets", param, 'post', function (res) {
                        console.log("出库口:" + JSON.stringify(res))
                        if (res.code == 1) { //成功
                            let data = res.data
                            $('#exitDesc').val(data)
                        } else { //不成功
                            layer.msg(res.msg, {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function () { });
                        }
                    });
                } else {
                }
            }
            function GetOutInfo() {
                let param2 = {
                    "palNo": $("#STOCKCODE").val(),
                    "ordNo": $("#bar").val(),
                }
                synData(IP + "/PdaInterface/GetReturnGoodOutInfo", param2, 'post', function (res) {
                    console.log("根据托盘号获取待检货信息 res is " + JSON.stringify(res))
                    if (res.code == 1) {
                        tableData = deepCopy(res.data)
                        refreshTable(tableData)
                    } else {
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            }
            //当托盘条码输入框失去焦点时,检查一下托盘状态 勿删
            // $("#STOCKCODE").blur(function(){
            //     if($("#STOCKCODE").val() == ""){
            //         return
            //     }
            //     if ($("#STOCKCODE").val().length>=10) {
            //         console.log($("#STOCKCODE").val().substr(-10));
            //         $("#STOCKCODE").val($("#STOCKCODE").val().substr(-10))
            //     }
            //     checkPalletStat()
            // })
            //键盘Enter按下事件(检查托盘状态)
            // $("#STOCKCODE").keydown(function(e) {
            //     if (e.keyCode === 13) {
            //         if($("#STOCKCODE").val() == ""){
            //             layer.msg("请输入托盘条码", {
            //                 icon: 2,
            //                 time: 2000 //2秒关闭(如果不配置,默认是3秒)
            //             });
            //             return
            //         }
            //         console.log("111111111111111")
            //         //检查托盘状态
            //         checkPalletStat();
            //     }
            // });
            //渲染表格数据
            function refreshTable(list) {
                //先清空一下箱子列表
                let trs = $("#tableBoxList tr")
                let len = trs.length
                //console.log("tr 数量 + " + trs.length)
                for (i = len - 1; i >= 2; i--) {
                    trs[i].remove();
                }
                //设置托盘号
                // $("#palletCode").val($.cookie('stockCode'))
                console.log(list != null);
                console.log(list);
                if (list != null && list.length > 0) { //成功
                    $("#boxNum").val(list.length)
                    $("#pickingBoxNum").val(tableData.WholeBoxNum)
                    var arrTrs = new Array()
                    let idx = 0
                    for (var i in list) {
                        // list[i].BoxCode
                        var tr = $("#boxCell").eq(0).clone();
                        tr.appendTo("#tableBoxList");
                        tr.attr('id', list[i].BoxCode)
                        idx++;
                        tr.attr('index', idx)
                        tr.find("td[name='goodCode']").html(list[i].ExportGoodsCode);
                        tr.find("td[name='goodName']").html(list[i].ExportGoodsName);
                        tr.find("td[name='lotNo']").html(list[i].ExportLotNo);
                        tr.find("td[name='picknum']").html(list[i].PickNum);
                        tr.find("td[name='pickednum']").html(list[i].PickedNum);
                        if (list[i].ExportExecuteFlag == "3") {
                            //已拣
                            tr.find("td[name='check']").find('input').attr('checked', 'checked')
                        } else {
                            //未拣
                            //console.log("Status "+list[i].Status)
                            tr.find("td[name='check']").find('input').removeAttr('checked')
                        }
                        tr.show();
                        arrTrs[i] = tr
                    }
                    //设置分页
                    setPages(1, list.length)
                    canPickBox = true
                } else { //不成功
                    layer.msg("无数据", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () { });
                    $("#boxNum").val(0)
                    setPages(1, 0)
                }
                // $("#boxCnt").html("当前托盘上的箱子数量:"+res.length)
            }
            //检查托盘状态\根据托盘号获取待检货信息\渲染物料\渲染批次
            function checkPalletStat() {
                // var list = tmpBoxs
                if ($("#STOCKCODE").val() == "") {
                    layer.msg("托盘号为空", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () { });
                    return
                }
                var param = {
                    "palNo": $("#STOCKCODE").val()
                }
                synData(IP + "/PdaInterface/GetPalnoStatus", param, 'post', function (res) {
                    if (res.msg == "有效托盘") { //成功
                        $.cookie('stockCode', $("#STOCKCODE").val());
                        updateBillList();
                        getBar($("#bar").val());
                        updateGoodList();
                        updateLotNoList();
                        GetOutInfo();
                    } else { //不成功
                        layer.msg("无效托盘", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            }
            //获取选中的物料批次对应的拣货出库ID
            function getBoxInfoByBoxCode(exportGoodsCode, exportLotNo) {
                let list = tableData
                for (let i = 0; i < list.length; i++) {
                    if (list[i].ExportGoodsCode == exportGoodsCode && list[i].ExportLotNo == exportLotNo) {
                        return list[i]
                    }
                }
                return null
            }
            //确认拣货(不是整托)
            function reqPickScatter() {
                if ($("#BOXCODE").val() == "") {
                    return
                }
                let boxinfo = getBoxInfoByBoxCode($("#goodSelect").val(), $("#lotNoSelect").val())
                var param = {
                    "billCode": boxinfo.ExportRemark,
                    "orderId": boxinfo.Id,
                    "pickNum": $('#outScatterQty').val(),
                    "status": $("input[type='radio']:checked").val(),
                    "newStockCode": $('#NEWSTOCKCODE').val()
                }
                sendData(IP + "/PdaInterface/SetReturnGoodPickFlag", param, 'post', function (res) {
                    //console.log(res);
                    checkPalletStat()
                    if (res.code == 1) { //成功
                        layer.msg(res.msg, {
                            icon: 1,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
                            canPickBox = true//回调
                        });
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
                            canPickBox = true//回调
                        });
                    }
                });
            }
            //单拣货(确认按钮)
            form.on('submit(formPickScatter)', function (data) {
                // if (!$.cookie('userId')) {
                //     layer.msg('登陆失效,请重新登陆', {
                //         icon: 2,
                //         time: 2000 //2秒关闭(如果不配置,默认是3秒)
                //     }, function() {
                //         location.href = "login.html";
                //         //回调
                //     });
                // }
                if ($('#outScatterQty').val() == "") {
                    layer.msg("请输入拣货数量", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () {
                        //回调
                    });
                    return
                }
                if ($('#NEWSTOCKCODE').val() == "") {
                    layer.msg("请输入新托盘条码", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () {
                        //回调
                    });
                    return
                }
                if ($('#goodSelect').val() == "") {
                    layer.msg("请选择物料", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () {
                        //回调
                    });
                    return
                }
                if ($('#lotNoSelect').val() == "") {
                    layer.msg("请选择批次", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () {
                        //回调
                    });
                    return
                }
                let boxinfo = getBoxInfoByBoxCode($("#goodSelect").val(), $("#lotNoSelect").val())
                if (!boxinfo) {
                    layer.msg("未查询到物料批次信息", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () {
                        //回调
                    });
                    return
                }
                let pn = boxinfo.PickNum
                if ($.isPlainObject(boxinfo.PickNum) || pn == 0) {
                    pn = boxinfo.Qty
                }
                if (!$("#outScatterQty").val()) {
                    layer.msg("请输入拣货数量", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () {
                        //回调
                    });
                    return
                }
                let qty = parseInt($('#outScatterQty').val())
                if (qty <= 0 || qty > pn) {
                    layer.msg("拣货数量需大于0,并且不能超过待拣数量", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () {
                        //回调
                    });
                    return
                }
                if (canPickBox == false) {
                    //console.log("请求未完成,不要重复请求, canPickBox is "+canPickBox)
                    return
                }
                canPickBox = false
                reqPickScatter()
                return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
            });
            // form.verify({
            //     stock: [/^[\S]{6}$/, '托盘条码必须为六位字符']
            // });
            //主页及重新登录
            $("#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()
            })
            //设置分页
            function setPages(pageIndex, boxNum) {
                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)
            }
            //设置当前分页
            function setCurPage(pageIndex) {
                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
                }
                //console.log("startIndex is "+startIndex)
                //console.log("endIndex is "+endIndex)
                //startIndex =2
                //endIndex = 2
                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")
                    }
                }
                //console.log("totalTrNum is " + totalTrNum)
            }
            //上一页按钮被点击
            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)
            }
            function getBoxPageNum() {
                let num = $("#tableBoxList tr").length
                if (num <= 2) {
                    return 0
                }
                let pageNum = Math.floor(num / 10);
                if (num % 10 > 0) {
                    pageNum += 1;
                }
                return pageNum
            }
        })
    </script>
</body>
</html>
Pda/View/HouseDataSetting/stockCheck.html
@@ -7,7 +7,7 @@
    <!-- <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>
    <title>库存盘点</title>
    <link rel="stylesheet" href="/layui/css/layui.css" />
    <link rel="stylesheet" href="/css/style.css" />
@@ -158,16 +158,20 @@
        .cut-line {
            margin-top: 10px;
        }
        .show{
        .show {
            display: block;
        }
        .noshow{
        .noshow {
            display: none;
        }
        td {
            word-break: break-all;
            word-wrap: break-word;
        }
        .layui-form-switch {
            margin-top: 0;
        }
@@ -221,27 +225,27 @@
                                autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layout-tab-page">
                        <div id="" class="layui-form-item layout-input"  >
                        <div id="" class="layui-form-item layout-input">
                            <label class="layui-form-label">是否数量盘点:</label>
                            <div class="layui-input-block" style="position: absolute;top: 100;">
                                <input type="checkbox" name="IsZhengTuo" id="IsZhengTuo" lay-skin="switch" lay-text="是|否"
                                    lay-filter="IsZhengTuo" class="layui-input" >
                                <input type="checkbox" name="IsZhengTuo" id="IsZhengTuo" lay-skin="switch"
                                    lay-text="是|否" lay-filter="IsZhengTuo" class="layui-input">
                            </div>
                        </div>
                        <div id="boxno1" class="layui-form-item layout-input" style="margin-top: 10px;">
                            <label class="layui-form-label">箱码:</label>
                            <div class="layui-input-block">
                                <input id="boxNo" type="text" lay-verify="boxNo" placeholder="请扫描外箱条码"
                                autocomplete="off" class="layui-input">
                                    autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div id="boxno3" class="layui-form-item layout-input noshow" style="margin-top: 10px;">
                            <label class="layui-form-label">支码:</label>
                            <div class="layui-input-block">
                                <input id="boxNo3" type="text" lay-verify="boxNo3" placeholder="请扫描支码"
                                autocomplete="off" class="layui-input">
                                    autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item layout-dropdownlist" style="margin-top: 10px;">
@@ -286,13 +290,21 @@
                </form>
            </div>
            <div id="tableid" class="layout-tbl-paging">
            <div id="tableid" class="layout-tbl-paging">
                <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding="">
                    <tr>
                        <th style="width: 40%;"><p id="a">箱码</p></th>
                        <th style="width: 30%;"><p id="b">支码</p></th>
                        <th style="width: 15%;"><p id="c">箱内数量</p></th>
                        <th style="width: 15%;"><p id="d">结果</p></th>
                        <th style="width: 40%;">
                            <p id="a">箱码</p>
                        </th>
                        <th style="width: 30%;">
                            <p id="b">支码</p>
                        </th>
                        <th style="width: 15%;">
                            <p id="c">箱内数量</p>
                        </th>
                        <th style="width: 15%;">
                            <p id="d">结果</p>
                        </th>
                    </tr>
                    <tr id="boxCell" style="display: none;">
                        <td name="boxNo"></td>
@@ -301,7 +313,7 @@
                        <td name="result"></td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
@@ -315,7 +327,7 @@
        layui.use(['form', 'jquery'], function () {
            var form = layui.form
            var tableData = null;
            var canPickBox = true;
            $("#palletNo").focus();
@@ -327,20 +339,20 @@
                $("#a").html('');
                $("#b").html('');
                $("#c").html('');
                if (obj.elem.checked) {
                    $('#boxno1').attr("style", "display:none")
                    $('#boxno3').attr("style", "display:none")
                    isContinue="1";
                    isContinue = "1";
                    $("#a").html('物料编码');
                    $("#b").html('托盘条码');
                    $("#c").html('托盘数量');
                } else {
                } else {
                    $('#boxno1').attr("style", "display:block")
                    $('#boxno3').attr("style", "display:block")
                    isContinue="0";
                    isContinue = "0";
                    $("#a").html('箱码');
                    $("#b").html('支码');
@@ -349,15 +361,15 @@
                    if ($("#Result").val() != "0") {
                        $('#boxno3').addClass("show");
                        $('#boxno3').removeClass("noshow");
                    }else{
                    } else {
                        $('#boxno3').addClass("noshow");
                        $('#boxno3').removeClass("show");
                    }
                    if($("#Result").val() == "2"){
                    if ($("#Result").val() == "2") {
                        $('#factNum').removeAttr("disabled");
                    }
                    else{
                        $('#factNum').attr("disabled","disabled");
                    else {
                        $('#factNum').attr("disabled", "disabled");
                    }
                }
                $('#boxNo').val("");
@@ -390,7 +402,7 @@
            //     checkPalletState()
            // })
            //当托盘条码输入库回车时            
            $("#palletNo").keydown(function(e) {
            $("#palletNo").keydown(function (e) {
                if (e.keyCode === 13) {
                    //检查托盘状态
                    checkPalletState();
@@ -419,7 +431,7 @@
                    if (res.code == 0) { //成功
                        updateBillList();
                        updateGoodList();
                        updateGoodList();
                        GetOutInfo();
                    } else { //不成功
                        layer.msg("无效托盘", {
@@ -430,9 +442,9 @@
                });
            }
            //更新盘点单
            function updateBillList() {
            function updateBillList() {
                $("#bar").empty()
                $("#bar").append('<option value =>' + '</option>');
                form.render('select');
@@ -441,7 +453,7 @@
                    PalletNo: $("#palletNo").val(),
                };
                synData(IP + "/PdaCr/GetStockCheckNoList", param, 'post', function (res) {
                    if (res.code == 0) { //成功
                        for (var i = 0; i < res.data.length; i++) {
                            if (i == 0) {
@@ -452,7 +464,7 @@
                                    + res.data[i] + '</option>');
                            }
                        }
                        form.render('select');
                        form.render('select');
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
@@ -463,7 +475,7 @@
            }
            //初始化渲染物料
            function updateGoodList() {
                $("#skuLotNo").empty()
                $("#skuLotNo").append('<option value =>' + '</option>');
                form.render('select');
@@ -475,16 +487,16 @@
                synData(IP + "/PdaCr/GetStockCheckDetailList", param, 'post', function (res) {
                    if (res.code == 0) { //成功
                        for (var i = 0; i < res.data.length; i++) {
                            var vl = res.data[i].SkuNo+'-'+ res.data[i].LotNo;
                            var vl2 = res.data[i].SkuName+'-'+ res.data[i].LotNo;
                            var vl = res.data[i].SkuNo + '-' + res.data[i].LotNo;
                            var vl2 = res.data[i].SkuName + '-' + res.data[i].LotNo;
                            if (i == 0) {
                                $("#skuLotNo").append('<option value =' + vl + ' selected>'+ vl2 + '</option>');
                                $("#skuLotNo").append('<option value =' + vl + ' selected>' + vl2 + '</option>');
                            } else {
                                $("#skuLotNo").append('<option value =' + vl + '>'+ vl2 + '</option>');
                                $("#skuLotNo").append('<option value =' + vl + '>' + vl2 + '</option>');
                            }
                        }
                        form.render('select');
                    } else { //不成功
                        // layer.msg(res.msg, {
                        //     icon: 2,
@@ -540,14 +552,14 @@
                    return
                }
                if ($("#Result").val() == "2" && isContinue == "0") {
                    if ($("#boxNo").val() == "" ||$("#boxNo3").val() == "") {
                    if ($("#boxNo").val() == "" || $("#boxNo3").val() == "") {
                        layer.msg("请扫描外箱条码和支码", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                        return;
                    }
                    if($("#factNum").val()<=0){
                    }
                    if ($("#factNum").val() <= 0) {
                        layer.msg("盘盈时数量不能为空且需大于0", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
@@ -555,9 +567,9 @@
                        return;
                    }
                }
                if (canPickBox == true) {
                    canPickBox = false;
                    canPickBox = false;
                    var param = {
                        "CrNo": $("#bar").val(),
                        "CrDetail": $("#skuLotNo").val(),
@@ -569,7 +581,7 @@
                        "isContinue": isContinue,
                    }
                    sendData(IP + "/PdaCr/CrSetCheck", param, 'post', function (res) {
                        if (res.code == 0) { //成功
                            layer.msg(res.msg, {
                                icon: 1,
@@ -600,21 +612,21 @@
                }
                return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
            });
            //选中结果下拉事件
            form.on('select(Result)', function (data) {
                if (data.value != "0") {
                    $('#boxno3').addClass("show");
                    $('#boxno3').removeClass("noshow");
                }else{
                } else {
                    $('#boxno3').addClass("noshow");
                    $('#boxno3').removeClass("show");
                }
                if(data.value == "2" || isContinue == "1"){
                if (data.value == "2" || isContinue == "1") {
                    $('#factNum').removeAttr("disabled");
                }
                else if(isContinue != "1"){
                    $('#factNum').attr("disabled","disabled");
                else if (isContinue != "1") {
                    $('#factNum').attr("disabled", "disabled");
                }
                $('#boxNo3').val("");
            });
@@ -623,7 +635,7 @@
                let data = tableData
                //先清空一下箱子列表
                let trs = $("#tableBoxList tr")
                let len = trs.length ;
                let len = trs.length;
                for (i = len - 1; i >= 2; i--) {
                    trs[i].remove();
                }
@@ -646,29 +658,28 @@
                        idx++;
                        tr.attr('index', idx)
                        //判断是否为数量
                        if(isContinue == "1")
                        {
                        if (isContinue == "1") {
                            tr.find("td[name='boxNo']").html(list[i].SkuNo);
                            tr.find("td[name='boxNo3']").html(list[i].PalletNo);
                        }
                        else{
                        else {
                            tr.find("td[name='boxNo']").html(list[i].BoxNo);
                            tr.find("td[name='boxNo3']").html(list[i].BoxNo3);
                        }
                        tr.find("td[name='qty']").html(list[i].Qty);
                        var CheckResultStr='';
                        if(list[i].CheckResult=='0'){
                            CheckResultStr='正常';
                        } else if(list[i].CheckResult=='1'){
                            CheckResultStr='盘亏';
                        }else if(list[i].CheckResult=='2'){
                            CheckResultStr='盘盈';
                        }else if(list[i].CheckResult=='3'){
                            CheckResultStr='实物不符';
                        }else if(list[i].CheckResult=='4'){
                            CheckResultStr='数量盘点';
                        var CheckResultStr = '';
                        if (list[i].CheckResult == '0') {
                            CheckResultStr = '正常';
                        } else if (list[i].CheckResult == '1') {
                            CheckResultStr = '盘亏';
                        } else if (list[i].CheckResult == '2') {
                            CheckResultStr = '盘盈';
                        } else if (list[i].CheckResult == '3') {
                            CheckResultStr = '实物不符';
                        } else if (list[i].CheckResult == '4') {
                            CheckResultStr = '数量盘点';
                        }
                        tr.find("td[name='result']").html(CheckResultStr);
Pda/View/HouseDataSetting/stockQuery.html
@@ -1,144 +1,158 @@
<!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">
            .layui-form-label {
                width: 20%;
            }
            .layui-input-block {
                width: 80%;
                margin-left: 20%;
            }
            .div-tbl-title {
                width: 98%;
                margin: auto;
                /* background-color: #4476A7; */
                height: 30px;
                margin-top: 20px;
            }
            .div-tbl-title table {
                width: 100%;
                height: 30px;
            }
            .div-tbl-title td {
                width: 50%;
                height: 30px;
                line-height: 30px;
            }
            .div-tbl-title span {
                float: left;
                width: 60%;
                height: 30px;
                line-height: 30px;
            }
            .div-tbl-title input {
                float: left;
                width: 40%;
                height: 30px;
                line-height: 30px;
                border: none;
            }
            .layout-tbl-paging {
                margin-top: 0;
            }
            .layout-bill-info {
                height: auto;
            }
            .btn-ok {
                border: none;
                color: #FFFFFF;
                background-color: #0a93e3;
                width: 48%;
                height: 36px;
                border-radius: 5px;
                float: left;
                margin: 0 1%;
                margin-left: 25%;
            }
            .btn-ok:active {
                opacity: 0.8;
            }
            td{
                word-break: break-all; word-wrap:break-word;
            }
        </style>
        <link rel="stylesheet" href="/css/adapter.css" />
    </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">库存查询</td>
                        <td class="title-menu-icon"><img id="menuImg" src="/assets/menu.jpg" ></td>
                    </tr>
                </table>
<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>库存查询</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">
        .layui-form-label {
            width: 20%;
        }
        .layui-input-block {
            width: 80%;
            margin-left: 20%;
        }
        .div-tbl-title {
            width: 98%;
            margin: auto;
            /* background-color: #4476A7; */
            height: 30px;
            margin-top: 20px;
        }
        .div-tbl-title table {
            width: 100%;
            height: 30px;
        }
        .div-tbl-title td {
            width: 50%;
            height: 30px;
            line-height: 30px;
        }
        .div-tbl-title span {
            float: left;
            width: 60%;
            height: 30px;
            line-height: 30px;
        }
        .div-tbl-title input {
            float: left;
            width: 40%;
            height: 30px;
            line-height: 30px;
            border: none;
        }
        .layout-tbl-paging {
            margin-top: 0;
        }
        .layout-bill-info {
            height: auto;
        }
        .btn-ok {
            border: none;
            color: #FFFFFF;
            background-color: #0a93e3;
            width: 48%;
            height: 36px;
            border-radius: 5px;
            float: left;
            margin: 0 1%;
            margin-left: 25%;
        }
        .btn-ok:active {
            opacity: 0.8;
        }
        td {
            word-break: break-all;
            word-wrap: break-word;
        }
    </style>
    <link rel="stylesheet" href="/css/adapter.css" />
</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">库存查询</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">主页</a></li>
                    <li><a href="../login.html">重新登录</a></li>
                </ul>
            </div>
            <div id="" class="layout-sub-content">
                <div id="menuList" class="menu">
                    <ul class="" style="text-align: center;">
                        <li><a href="../index.html">主页</a></li>
                        <li><a href="../login.html">重新登录</a></li>
                    </ul>
                </div>
                <div id="" class="layout-bill-info">
                    <form class="layui-form" action="" style="height: auto;">
                        <div id="" class="layui-form-item layout-input" style="margin-top: 5px;">
                            <label class="layui-form-label">储位地址</label>
                            <div class="layui-input-block">
                                <input id="LocatNo" type="text" lay-verify="stock" placeholder="储位地址"
                                    autocomplete="off" class="layui-input">
                            </div>
            <div id="" class="layout-bill-info">
                <form class="layui-form" action="" style="height: auto;">
                    <div id="" class="layui-form-item layout-input" style="margin-top: 5px;">
                        <label class="layui-form-label">储位地址</label>
                        <div class="layui-input-block">
                            <input id="LocatNo" type="text" lay-verify="stock" placeholder="储位地址" autocomplete="off"
                                class="layui-input">
                        </div>
                        <div id="" class="layui-form-item layout-input" style="margin-top: 5px;">
                            <label class="layui-form-label">托盘条码</label>
                            <div class="layui-input-block">
                                <input id="PalletNo" type="text" lay-verify="stock" placeholder="托盘条码"
                                    autocomplete="off" class="layui-input">
                            </div>
                    </div>
                    <div id="" class="layui-form-item layout-input" style="margin-top: 5px;">
                        <label class="layui-form-label">托盘条码</label>
                        <div class="layui-input-block">
                            <input id="PalletNo" type="text" lay-verify="stock" placeholder="托盘条码" autocomplete="off"
                                class="layui-input">
                        </div>
                        <div id="" class="layui-form-item layout-input" style="margin-top: 5px;">
                            <label class="layui-form-label">物料编码</label>
                            <div class="layui-input-block">
                                <input id="SkuNo" type="text" lay-verify="stock"
                                    autocomplete="off" class="layui-input" style="border: 0px; " disabled>
                            </div>
                    </div>
                    <div id="" class="layui-form-item layout-input" style="margin-top: 5px;">
                        <label class="layui-form-label">物料编码</label>
                        <div class="layui-input-block">
                            <input id="SkuNo" type="text" lay-verify="stock" autocomplete="off" class="layui-input"
                                style="border: 0px; " disabled>
                        </div>
                        <div id="" class="layui-form-item layout-input" style="margin-top: 5px;">
                            <label class="layui-form-label">物料名称</label>
                            <div class="layui-input-block">
                                <input id="SkuName" type="text" lay-verify="stock"
                                    autocomplete="off" class="layui-input" style="border: 0px;" disabled>
                            </div>
                    </div>
                    <div id="" class="layui-form-item layout-input" style="margin-top: 5px;">
                        <label class="layui-form-label">物料名称</label>
                        <div class="layui-input-block">
                            <input id="SkuName" type="text" lay-verify="stock" autocomplete="off" class="layui-input"
                                style="border: 0px;" disabled>
                        </div>
                        <div id="" class="layui-form-item layout-input" style="margin-top: 5px;">
                            <label class="layui-form-label">物料规格</label>
                            <div class="layui-input-block">
                                <input id="Standard" type="text" lay-verify="stock"
                                    autocomplete="off" class="layui-input" style="border: 0px;" disabled>
                            </div>
                    </div>
                    <div id="" class="layui-form-item layout-input" style="margin-top: 5px;">
                        <label class="layui-form-label">物料规格</label>
                        <div class="layui-input-block">
                            <input id="Standard" type="text" lay-verify="stock" autocomplete="off" class="layui-input"
                                style="border: 0px;" disabled>
                        </div>
                        <div id="" class="" style="width: 100%;height: 36px;margin-top: 15px;">
                            <button id="btnQuery" class="btn-ok"  type="button">查询</button>
                        </div>
                    </form>
                </div>
                <!-- <div id="" class="div-tbl-title">
                    </div>
                    <div id="" class="" style="width: 100%;height: 36px;margin-top: 15px;">
                        <button id="btnQuery" class="btn-ok" type="button">查询</button>
                    </div>
                </form>
            </div>
            <!-- <div id="" class="div-tbl-title">
                    <table border="0" cellspacing="" cellpadding="" style="width: 100%;">
                        <tr>
                            <td>
@@ -158,320 +172,320 @@
                        </tr>
                    </table>
                </div> -->
                <div id="" class="layout-tbl-paging" style="margin-top: 5px;">
                    <!-- <p class="box-list-title">已绑定箱子列表</p> -->
                    <table id="tableBoxList" class="tbl-box-list"  border="1px"    >
                        <tr>
                            <th >物品批次</th>
                            <th >库存<br>数量</th>
                            <th >锁定<br>数量</th>
                            <th >冻结<br>数量</th>
                        </tr>
                        <tr id="boxCell" style="display: none;">
                            <td name="LotNo">物料批次</td>
                            <td name="Qty">剩余数量</td>
                            <td name="LockQty">锁定数量</td>
                            <td name="FrozenQty">冻结数量</td>
                        </tr>
                    </table>
                    <!-- 分页 -->
                    <table id="tableBoxPages" class="tbl-box-pages"  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 id="" class="layout-tbl-paging" style="margin-top: 5px;">
                <!-- <p class="box-list-title">已绑定箱子列表</p> -->
                <table id="tableBoxList" class="tbl-box-list" border="1px">
                    <tr>
                        <th>物品批次</th>
                        <th>库存<br>数量</th>
                        <th>锁定<br>数量</th>
                        <th>冻结<br>数量</th>
                    </tr>
                    <tr id="boxCell" style="display: none;">
                        <td name="LotNo">物料批次</td>
                        <td name="Qty">剩余数量</td>
                        <td name="LockQty">锁定数量</td>
                        <td name="FrozenQty">冻结数量</td>
                    </tr>
                </table>
                <!-- 分页 -->
                <table id="tableBoxPages" class="tbl-box-pages" 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>
        <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/jquery.cookie.js"></script>
        <script>
            layui.use(['form', 'jquery'], function() {
                var form = layui.form
                //当前分页
                var curPageIndex = 1
                var tableData = null
                //所选入库单的详细信息
                //console.log($.cookie('userId'));
                // if (!$.cookie('userId')) {
                //     layer.msg('登陆失效,请重新登陆', {
                //         icon: 2,
                //         time: 2000 //2秒关闭(如果不配置,默认是3秒)
                //     }, function() {
                //         location.href = "login.html";
                //         //回调
                //     });
                // }
                $("#menuImg").click(function(e){
                    //console.log("menuImg")
                    e.stopPropagation()
                    if($("#menuList").is(":hidden")){
                        $("#menuList").show()
                    }else{
                        $("#menuList").hide()
                    }
                })
                $('body').click(function(){
                    // //console.log("body")
    </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/jquery.cookie.js"></script>
    <script>
        layui.use(['form', 'jquery'], function () {
            var form = layui.form
            //当前分页
            var curPageIndex = 1
            var tableData = null
            //所选入库单的详细信息
            //console.log($.cookie('userId'));
            // if (!$.cookie('userId')) {
            //     layer.msg('登陆失效,请重新登陆', {
            //         icon: 2,
            //         time: 2000 //2秒关闭(如果不配置,默认是3秒)
            //     }, function() {
            //         location.href = "login.html";
            //         //回调
            //     });
            // }
            $("#menuImg").click(function (e) {
                //console.log("menuImg")
                e.stopPropagation()
                if ($("#menuList").is(":hidden")) {
                    $("#menuList").show()
                } else {
                    $("#menuList").hide()
                })
                function clear(){
                    $("#LocatNo").val('');
                    $("#PalletNo").val('');
                    $("#SkuNo").val("");
                    $("#SkuName").val("");
                    $("#Standard").val("");
                    //先清空一下箱子列表
                    let trs = $("#tableBoxList tr")
                    let len = trs.length
                    //console.log("tr 数量 + " + trs.length)
                    for(i=len - 1; i >=2; i--){
                        trs[i].remove();
                    }
                }
                $("#btnQuery").click(function(){
                    if($('#LocatNo').val() == '' && $('#PalletNo').val() == ''){
                        layer.msg("请输入储位地址或托盘条码", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {});
            })
            $('body').click(function () {
                // //console.log("body")
                $("#menuList").hide()
            })
            function clear() {
                $("#LocatNo").val('');
                $("#PalletNo").val('');
                $("#SkuNo").val("");
                $("#SkuName").val("");
                $("#Standard").val("");
                //先清空一下箱子列表
                let trs = $("#tableBoxList tr")
                let len = trs.length
                //console.log("tr 数量 + " + trs.length)
                for (i = len - 1; i >= 2; i--) {
                    trs[i].remove();
                }
            }
            $("#btnQuery").click(function () {
                if ($('#LocatNo').val() == '' && $('#PalletNo').val() == '') {
                    layer.msg("请输入储位地址或托盘条码", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () { });
                    clear();
                    return
                }
                var param = {
                    LocatNo: $('#LocatNo').val(),
                    PalletNo: $('#PalletNo').val(),
                };
                sendData(IP + "/PdaCr/GetStockQueryList", param, 'get', function (res) {
                    console.log("库存查询:", res)
                    if (res.code == 0) { //成功
                        clear();
                        return
                    }
                    var param = {
                        LocatNo: $('#LocatNo').val(),
                        PalletNo: $('#PalletNo').val(),
                    };
                    sendData(IP + "/PdaCr/GetStockQueryList", param, 'get', function(res) {
                        console.log("库存查询:",res)
                        if (res.code == 0) { //成功
                            clear();
                            $("#LocatNo").val(res.data[0].LocatNo);
                            $("#PalletNo").val(res.data[0].PalletNo);
                            $("#SkuNo").val(res.data[0].SkuNo);
                            $("#SkuName").val(res.data[0].SkuName);
                            $("#Standard").val(res.data[0].Standard);
                            tableData = deepCopy(res.data)
                            refreshTable()
                        } else { //不成功
                            layer.msg(res.msg, {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function() {
                                clear();
                                let trs = $("#tableBoxList tr")
                                let len = trs.length
                                //console.log("tr 数量 + " + trs.length)
                                for(i=len - 1; i >=2; i--){
                                    trs[i].remove();
                                }
                            });
                        }
                    });
                })
                function refreshTable() {
                    //先清空一下箱子列表
                    let trs = $("#tableBoxList tr")
                    let len = trs.length
                    //console.log("tr 数量 + " + trs.length)
                    for(i=len - 1; i >=2; i--){
                        trs[i].remove();
                    }
                    //设置托盘号
                    // $("#palletCode").val($.cookie('stockCode'))
                    if (tableData.length > 0) { //成功
                        // $("#boxNum").val(tableData.length)
                        var list = tableData
                        var arrTrs = new Array()
                        let idx = 0
                        for(var i in list) {
                            // list[i].BoxCode
                            var tr = $("#boxCell").eq(0).clone();
                            tr.appendTo("#tableBoxList");
                            // tr.attr('id', list[i].BoxCode)
                            idx++;
                            tr.attr('index', idx)
                            tr.find("td[name='LotNo']").html(list[i].LotNo);
                            tr.find("td[name='Qty']").html(list[i].Qty);
                            tr.find("td[name='LockQty']").html(list[i].LockQty);
                            tr.find("td[name='FrozenQty']").html(list[i].FrozenQty);
                            // tr.find("td[name='InspectQty']").html(list[i].InspectQty);
                            // //console.log("boxcode is "+tr.find("td[name='boxcode']").html())
                            tr.show();
                            arrTrs[i] = tr
                        }
                        //设置分页
                        setPages(1, list.length)
                        $("#LocatNo").val(res.data[0].LocatNo);
                        $("#PalletNo").val(res.data[0].PalletNo);
                        $("#SkuNo").val(res.data[0].SkuNo);
                        $("#SkuName").val(res.data[0].SkuName);
                        $("#Standard").val(res.data[0].Standard);
                        tableData = deepCopy(res.data)
                        refreshTable()
                    } else { //不成功
                        // $("#boxNum").val(0)
                        layer.msg("无数据", {
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {});
                        setPages(1, 0)
                        }, function () {
                            clear();
                            let trs = $("#tableBoxList tr")
                            let len = trs.length
                            //console.log("tr 数量 + " + trs.length)
                            for (i = len - 1; i >= 2; i--) {
                                trs[i].remove();
                            }
                        });
                    }
                }
                //设置分页
                function setPages(pageIndex, boxNum){
                    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)
                }
                //设置当前分页
                function setCurPage(pageIndex){
                    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
                    }
                    //console.log("startIndex is "+startIndex)
                    //console.log("endIndex is "+endIndex)
                    //startIndex =2
                    //endIndex = 2
                    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")
                        }
                    }
                    //console.log("totalTrNum is " + totalTrNum)
                }
                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)
                }
                function getBoxPageNum()
                {
                    let num = $("#tableBoxList tr").length
                    if(num <= 2 ){
                        return 0
                    }
                    let pageNum = Math.floor(num / 10);
                    if(num % 10 > 0){
                        pageNum += 1;
                    }
                    return pageNum
                }
                form.verify({
                    stock: [/^[\S]{6}$/, '托盘条码必须为六位字符']
                });
            })
        </script>
    </body>
</html>
            function refreshTable() {
                //先清空一下箱子列表
                let trs = $("#tableBoxList tr")
                let len = trs.length
                //console.log("tr 数量 + " + trs.length)
                for (i = len - 1; i >= 2; i--) {
                    trs[i].remove();
                }
                //设置托盘号
                // $("#palletCode").val($.cookie('stockCode'))
                if (tableData.length > 0) { //成功
                    // $("#boxNum").val(tableData.length)
                    var list = tableData
                    var arrTrs = new Array()
                    let idx = 0
                    for (var i in list) {
                        // list[i].BoxCode
                        var tr = $("#boxCell").eq(0).clone();
                        tr.appendTo("#tableBoxList");
                        // tr.attr('id', list[i].BoxCode)
                        idx++;
                        tr.attr('index', idx)
                        tr.find("td[name='LotNo']").html(list[i].LotNo);
                        tr.find("td[name='Qty']").html(list[i].Qty);
                        tr.find("td[name='LockQty']").html(list[i].LockQty);
                        tr.find("td[name='FrozenQty']").html(list[i].FrozenQty);
                        // tr.find("td[name='InspectQty']").html(list[i].InspectQty);
                        // //console.log("boxcode is "+tr.find("td[name='boxcode']").html())
                        tr.show();
                        arrTrs[i] = tr
                    }
                    //设置分页
                    setPages(1, list.length)
                } else { //不成功
                    // $("#boxNum").val(0)
                    layer.msg("无数据", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () { });
                    setPages(1, 0)
                }
            }
            //设置分页
            function setPages(pageIndex, boxNum) {
                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)
            }
            //设置当前分页
            function setCurPage(pageIndex) {
                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
                }
                //console.log("startIndex is "+startIndex)
                //console.log("endIndex is "+endIndex)
                //startIndex =2
                //endIndex = 2
                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")
                    }
                }
                //console.log("totalTrNum is " + totalTrNum)
            }
            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)
            }
            function getBoxPageNum() {
                let num = $("#tableBoxList tr").length
                if (num <= 2) {
                    return 0
                }
                let pageNum = Math.floor(num / 10);
                if (num % 10 > 0) {
                    pageNum += 1;
                }
                return pageNum
            }
            form.verify({
                stock: [/^[\S]{6}$/, '托盘条码必须为六位字符']
            });
        })
    </script>
</body>
</html>
Pda/View/index.html
@@ -1,146 +1,161 @@
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="user-scalable=0,width=device-width,initial-scale=1.0" />
        <!-- <meta name="viewport" content="width=device-width, initial-scale=0.665, minimum-scale=0.5, maximum-scale=2.0, user-scalable=no" /> -->
        <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>
        <!--更改桌面icon 仅Android支持-->
        <link rel="shortcut icon" href="../assets/icon.png">
        <!-- <meta name="mobile-web-app-capable" content="yes"> -->
        <link rel="stylesheet" href="../css/my.css" />
        <style type="text/css">
            .layout-bill-info {
                height: 255px;
            }
            .layout-tbl-submit {
                margin-top: 10px;
            }
            .menu {
                height: 40px;
            }
            .sub-title-bg {
                background-image: url(../assets/subtitle_bg.png);
                /* margin:20px 10px 5px 10px; */
                /* background-color: #009688; */
                height: 26px;
                line-height: 26px;
                margin: auto;
                margin-top: 20px;
                width: 96%;
            }
            .sub-title-bg span {
                font-size: 16px;
                color: #FFFFFF;
                margin-left: 4px;
                /* background-color: #0000FF; */
                margin-top: 0px;
            }
            .layout-btn-container {
                width: 96%;
                /* margin:5px 10px 5px 10px; */
                margin: auto;
            }
            .layout-btn-container table {
                width: 100%;
                border-collapse: separate;
                border-spacing: 0px 10px;
            }
            .layout-btn-container table td {
                width: 50%;
            }
            .btn{
                width: 95%;
                height: 50px;
                font-size: 0.8rem;
            }
            .btn:active{
                opacity: 0.5;
            }
            .mybtn-primary {
                color: #fff;
                background-color: #007bff;
                border-color: #007bff;
                border: 1px solid transparent;
                font-size: 16px;
                border-radius: 5px;
                line-height: 16px;
                font-weight:normal;
                height: 50px;
                width: 98%;
            }
            .mybtn-primary:active {
                opacity: 0.8;
            }
            .show{
                display: block;
            }
            .noshow{
                display: none;
            }
        </style>
        <link rel="stylesheet" href="../css/adapter.css" />
    </head>
    <body>
        <div id="" class="main-content">
            <div id="" class="layout-title" >
                <table border="" cellspacing="" cellpadding="">
                    <tr>
                        <td class="img-back"><a href="/View/login.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>
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="user-scalable=0,width=device-width,initial-scale=1.0" />
    <!-- <meta name="viewport" content="width=device-width, initial-scale=0.665, minimum-scale=0.5, maximum-scale=2.0, user-scalable=no" /> -->
    <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>
    <!--更改桌面icon 仅Android支持-->
    <link rel="shortcut icon" href="../assets/icon.png">
    <!-- <meta name="mobile-web-app-capable" content="yes"> -->
    <link rel="stylesheet" href="../css/my.css" />
    <style type="text/css">
        .layout-bill-info {
            height: 255px;
        }
        .layout-tbl-submit {
            margin-top: 10px;
        }
        .menu {
            height: 40px;
        }
        .sub-title-bg {
            background-image: url(../assets/subtitle_bg.png);
            /* margin:20px 10px 5px 10px; */
            /* background-color: #009688; */
            height: 26px;
            line-height: 26px;
            margin: auto;
            margin-top: 20px;
            width: 96%;
        }
        .sub-title-bg span {
            font-size: 16px;
            color: #FFFFFF;
            margin-left: 4px;
            /* background-color: #0000FF; */
            margin-top: 0px;
        }
        .layout-btn-container {
            width: 96%;
            /* margin:5px 10px 5px 10px; */
            margin: auto;
        }
        .layout-btn-container table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0px 10px;
        }
        .layout-btn-container table td {
            width: 50%;
        }
        .btn {
            width: 95%;
            height: 50px;
            font-size: 0.8rem;
        }
        .btn:active {
            opacity: 0.5;
        }
        .mybtn-primary {
            color: #fff;
            background-color: #007bff;
            border-color: #007bff;
            border: 1px solid transparent;
            font-size: 16px;
            border-radius: 5px;
            line-height: 16px;
            font-weight: normal;
            height: 50px;
            width: 98%;
        }
        .mybtn-primary:active {
            opacity: 0.8;
        }
        .show {
            display: block;
        }
        .noshow {
            display: none;
        }
    </style>
    <link rel="stylesheet" href="../css/adapter.css" />
</head>
<body>
    <div id="" class="main-content">
        <div id="" class="layout-title">
            <table border="" cellspacing="" cellpadding="">
                <tr>
                    <td class="img-back"><a href="/View/login.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 lang href="/View/login.html">重新登录</a></li>
                </ul>
            </div>
            <div id="" class="layout-sub-content">
                <div id="menuList" class="menu">
                    <ul class="" style="text-align: center;">
                        <li><a lang href="/View/login.html">重新登录</a></li>
                    </ul>
                </div>
                <div class="" >
                    <section>
                        <div class="sub-title-bg" >
                            <span lang>入库作业区</span>
                        </div>
                        <div class="layout-btn-container" >
                            <div style="display: flex; flex-direction: row; flex-wrap: wrap;" id="ruKu">
                                <!-- <a href="/View/AsnSetting/materialEnter.html"><button type="button" class="mybtn-primary" lang>采购入库</button></a>
            <div class="">
                <section>
                    <div class="sub-title-bg">
                        <span lang>入库作业区</span>
                    </div>
                    <div class="layout-btn-container">
                        <div style="display: flex; flex-direction: row; flex-wrap: wrap;" id="ruKu">
                            <!-- <a href="/View/AsnSetting/materialEnter.html"><button type="button" class="mybtn-primary" lang>采购入库</button></a>
                                    
                                <a href="/View/AsnSetting/returnEnter.html"><button type="button" class="mybtn-primary" lang>退货入库</button></a>
                                    -->
                            </div>
                        </div>
                    </section>
                    <section>
                        <div class="sub-title-bg" >
                            <span lang>出库作业区</span>
                        </div>
                        <div class="layout-btn-container">
                            <div style="display: flex; flex-direction: row; flex-wrap: wrap;" id="chuKu">
                    </div>
                </section>
                <section>
                    <div class="sub-title-bg">
                        <span lang>出库作业区</span>
                    </div>
                            </div>
                    <div class="layout-btn-container">
                        <div style="display: flex; flex-direction: row; flex-wrap: wrap;" id="chuKu">
                        </div>
                    </section>
                    <section>
                        <div class="sub-title-bg" >
                            <span lang>库内作业区</span>
                    </div>
                </section>
                <section>
                    <div class="sub-title-bg">
                        <span lang>库内作业区</span>
                    </div>
                    <div class="layout-btn-container">
                        <div style="display: flex; flex-direction: row; flex-wrap: wrap;" id="kuNei">
                        </div>
                        <div class="layout-btn-container" >
                            <div style="display: flex; flex-direction: row; flex-wrap: wrap;" id="kuNei">
                            </div>
                        </div>
                    </section>
                    <!-- <section>
                    </div>
                </section>
                <!-- <section>
                        <div class="sub-title-bg" >
                            <span lang>单据操作区</span>
                        </div>
@@ -157,83 +172,84 @@
                            </table>
                        </div>
                    </section> -->
                </div>
            </div>
        </div>
        <script src="../js/jquery-3.5.1.min.js"></script>
        <script src="../js/jquery.cookie.js"></script>
        <script src="../layui/layui.js"></script>
        <script src="../js/public.js"></script>
        <script src="../js/language.js"></script>
        <script>
            layui.use([], function() {
                // var carousel = layui.carousel;
                initLanguage()
                setLanguage()
                sendData(IP + "/Basis/GetRoleRightList", {}, 'get', function(res) {
                    if (res.code == 0) { //成功
                        var list = res.data.filter(item => item.level == "0");
                        if (list) {
                            for (var i = 0; i < list.length; i++) {
                                if (list[i].MenuNo != "9000") { //判断是否是pda的权限 是:跳过
                                    continue;
                                }
                                list[i].MenuName
                                list[i].MenuNo
                                //查询有无子菜单
                                var list2 = res.data.filter(item => item.ParentNo == list[i].MenuNo);
                                console.log(list2);
                                list2.forEach(element => {
                                    var html =
                                        `<a href="`+element.Url+`" style="width: 50%; margin-top: 10px;">
                                            <button type="button" class="mybtn-primary"  lang>`+ element.MenuName+`</button>
                                        </a>`;
                                    if (element.Url.includes("AsnSetting")) {
                                        $("#ruKu").append(html);
                                    }
                                    if (element.Url.includes("SoSetting")) {
                                        $("#chuKu").append(html);
                                    }
                                    if (element.Url.includes("HouseDataSetting")) {
                                        $("#kuNei").append(html);
                                    }
                                });
    </div>
    <script src="../js/jquery-3.5.1.min.js"></script>
    <script src="../js/jquery.cookie.js"></script>
    <script src="../layui/layui.js"></script>
    <script src="../js/public.js"></script>
    <script src="../js/language.js"></script>
    <script>
        layui.use([], function () {
            // var carousel = layui.carousel;
            initLanguage()
            setLanguage()
            sendData(IP + "/Basis/GetRoleRightList", {}, 'get', function (res) {
                if (res.code == 0) { //成功
                    var list = res.data.filter(item => item.level == "0");
                    if (list) {
                        for (var i = 0; i < list.length; i++) {
                            if (list[i].MenuNo != "9000") { //判断是否是pda的权限 是:跳过
                                continue;
                            }
                        }
                    } else { //不成功
                        layer.msg('获取当前登录人权限信息失败', {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {
                            //回调
                        });
                            list[i].MenuName
                            list[i].MenuNo
                            //查询有无子菜单
                            var list2 = res.data.filter(item => item.ParentNo == list[i].MenuNo);
                            console.log(list2);
                            list2.forEach(element => {
                                var html =
                                    `<a href="` + element.Url + `" style="width: 50%; margin-top: 10px;">
                                            <button type="button" class="mybtn-primary"  lang>`+ element.MenuName + `</button>
                                        </a>`;
                                if (element.Url.includes("AsnSetting")) {
                                    $("#ruKu").append(html);
                                }
                                if (element.Url.includes("SoSetting")) {
                                    $("#chuKu").append(html);
                                }
                                if (element.Url.includes("HouseDataSetting")) {
                                    $("#kuNei").append(html);
                                }
                            });
                        }
                    }
                });
                } else { //不成功
                    layer.msg('获取当前登录人权限信息失败', {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () {
                        //回调
                    });
                }
            });
                $("#menuImg").click(function(e){
                    //console.log("menuImg")
                    e.stopPropagation()
                    if($("#menuList").is(":hidden")){
                        $("#menuList").show()
                    }else{
                        $("#menuList").hide()
                    }
                })
                $('body').click(function(){
                    // //console.log("body")
            $("#menuImg").click(function (e) {
                //console.log("menuImg")
                e.stopPropagation()
                if ($("#menuList").is(":hidden")) {
                    $("#menuList").show()
                } else {
                    $("#menuList").hide()
                })
                }
            })
        </script>
    </body>
</html>
            $('body').click(function () {
                // //console.log("body")
                $("#menuList").hide()
            })
        })
    </script>
</body>
</html>
Wms/Model/ModelDto/PdaDto/PdaBoxInfoDto.cs
New file
@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SqlSugar;
namespace WMS.Entity.DataEntity
{
    public class DataBoxDto
    {
        /// <summary>
        /// Desc:箱号
        /// Default:
        /// Nullable:True
        /// </summary>
        public string BoxNo { get; set; }
        /// <summary>
        /// Desc:批次号
        /// Default:
        /// Nullable:True
        /// </summary>
        public string LotNo { get; set; }
        /// <summary>
        /// Desc:供货批次
        /// Default:
        /// Nullable:True
        /// </summary>
        public string SupplierLot { get; set; }
        /// <summary>
        /// Desc:物料编码
        /// Default:
        /// Nullable:True
        /// </summary>
        public string SkuNo { get; set; }
        /// <summary>
        /// Desc:物料名称
        /// Default:
        /// Nullable:True
        /// </summary>
        public string SkuName { get; set; }
        /// <summary>
        /// Desc:箱内数量
        /// Default:
        /// Nullable:True
        /// </summary>
        public decimal Qty { get; set; }
        /// <summary>
        /// Desc:质量状态
        /// Default:
        /// Nullable:True
        /// </summary>
        public string InspectStatus { get; set; }
        public List<DataBoxInfoDto> InfoList { get; set; }
    }
    public class DataBoxInfoDto
    {
        public string BoxNo2 { get; set; }
        public decimal Qty2 { get; set; }
    }
}
Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs
@@ -2522,6 +2522,7 @@
                                SkuName = boxInfo.SkuName,
                                Standard = sku.Standard,
                                ProductionTime = boxInfo.ProductionTime,
                                ExpirationTime = boxInfo.ExpirationTime,
                                SupplierLot = boxInfo.SupplierLot,
                                InspectStatus = boxInfo.InspectStatus,
                                InspectMark = boxInfo.InspectMark,
@@ -2695,6 +2696,7 @@
                                    SkuName = demo.SkuName,
                                    Standard = noticeDetail.Standard,
                                    ProductionTime = demo.ProductionTime,
                                    ExpirationTime = demo.ExpirationTime,
                                    SupplierLot = demo.SupplierLot,
                                    InspectStatus = demo.InspectStatus,
                                    InspectMark = demo.InspectMark,
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -2650,6 +2650,7 @@
                            SkuName = item.SkuName,
                            Standard = sku.Standard,
                            ProductionTime = item.ProductionTime,
                            ExpirationTime = item.ExpirationTime,
                            SupplierLot = item.SupplierLot,
                            InspectMark = item.InspectMark,
                            BitBoxMark = item.BitBoxMark,
Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
@@ -5,6 +5,7 @@
using Model.InterFaceModel;
using Model.ModelDto.BllCheckDto;
using Model.ModelDto.PdaDto;
using Model.ModelVm;
using Newtonsoft.Json;
using SqlSugar;
using Utility.Tools;
@@ -1332,5 +1333,110 @@
        }
        #endregion
        #region 箱码查询
        /// <summary>
        /// 箱码查询
        /// </summary>
        /// <param name="boxNo">箱码</param>
        /// <returns></returns>
        public DataBoxDto GetBoxQueryList(string boxNo)
        {
            // 实例化返回类
            DataBoxDto boxModel = new DataBoxDto();
            List<DataBoxInfoDto> list = new List<DataBoxInfoDto>();
            // 根据箱码获取箱信息
            var boxData = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.BoxNo == boxNo);
            if (boxData.Count() == 0)
            {
                // 根据盒码获取箱信息
                boxData = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.BoxNo2 == boxNo);
                if (boxData.Count() == 0)
                {
                    boxModel = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.BoxNo3 == boxNo).Select(it => new DataBoxDto() { Qty = it.Qty }, true).First();
                    return boxModel;
                }
                list = boxData.Select(it => new DataBoxInfoDto()
                {
                    BoxNo2 = it.BoxNo3,
                    Qty2 = it.Qty
                }).ToList();
                boxData = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.BoxNo2 == boxNo);
                boxModel = boxData.GroupBy(m => new
                {
                    m.BoxNo,
                    m.SkuName,
                    m.SkuNo,
                    m.LotNo,
                    m.SupplierLot,
                    m.InspectStatus
                }).Select(it => new DataBoxDto()
                {
                    BoxNo = it.BoxNo,
                    SkuName = it.SkuName,
                    SkuNo = it.SkuNo,
                    LotNo = it.LotNo,
                    SupplierLot = it.SupplierLot,
                    InspectStatus = it.InspectStatus == "0" ? "待检" : it.InspectStatus == "1" ? "合格":"不合格",
                    Qty = SqlFunc.AggregateSum(it.Qty)
                }).First();
                boxModel.InfoList = list;
                return boxModel;
            }
            else  //箱码内数据
            {
                // 处理多级码
                var num = boxData.Count(m => !string.IsNullOrWhiteSpace(m.BoxNo2));
                if (num > 0)
                {
                    list = boxData.GroupBy(m => new
                    {
                        m.BoxNo2
                    }).Select(it => new DataBoxInfoDto()
                    {
                        BoxNo2 = it.BoxNo2,
                        Qty2 = SqlFunc.AggregateSum(it.Qty)
                    }).ToList();
                }
                else
                {
                    list = boxData.Select(it => new DataBoxInfoDto()
                    {
                        BoxNo2 = SqlFunc.IsNull(it.BoxNo3,""),
                        Qty2 = it.Qty
                    }).ToList();
                }
                // 箱码信息赋值
                boxData = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.BoxNo == boxNo);
                boxModel = boxData.GroupBy(m => new
                {
                    m.BoxNo,
                    m.SkuName,
                    m.SkuNo,
                    m.LotNo,
                    m.SupplierLot,
                    m.InspectStatus
                }).Select(it => new DataBoxDto()
                {
                    BoxNo = it.BoxNo,
                    SkuName = it.SkuName,
                    SkuNo = it.SkuNo,
                    LotNo = it.LotNo,
                    SupplierLot = it.SupplierLot,
                    InspectStatus = it.InspectStatus == "0" ? "待检" : it.InspectStatus == "1" ? "合格" : "不合格",
                    Qty = SqlFunc.AggregateSum(it.Qty)
                }).First();
                boxModel.InfoList = list;
                return boxModel;
            }
        }
        #endregion
    }
}
Wms/WMS.BLL/DataServer/DataBoxInfoServer.cs
@@ -34,9 +34,11 @@
        /// <param name="bitBoxMark">零箱标记</param>
        /// <param name="inspectStatus">质量状态</param>
        /// <returns></returns>
        public List<DataBoxInfo> GetDataBoxInfo(string id, string skuNo, string skuName, string palletNo, string lotNo, string boxNo, string status, string inspectMark, string bitBoxMark, string inspectStatus)
        public List<DataBoxInfo> GetDataBoxInfo(string id, string skuNo, string skuName, string palletNo, string lotNo,
            string boxNo, string status, string inspectMark, string bitBoxMark, string inspectStatus)
        {
            string str = "select PalletNo,PalletNo2,PalletNo3,BoxNo,BoxNo2,BoxNo3,Status,LotNo,Qty,FullQty,SkuNo,SkuName,LotText,ProductionTime,InspectMark,BitBoxMark,InspectStatus,InspectTime from DataBoxInfo Where IsDel = @isdel";
            string str = "select PalletNo,PalletNo2,PalletNo3,BoxNo,BoxNo2,BoxNo3,Status,LotNo,Qty,FullQty,SkuNo,SkuName,LotText,ProductionTime," +
                "ExpirationTime,InspectMark,BitBoxMark,InspectStatus,InspectTime from DataBoxInfo Where IsDel = @isdel";
            //判断id是否为空
            if (!string.IsNullOrEmpty(id))
            {
@@ -142,7 +144,8 @@
        /// <returns></returns>
        public List<DataBoxInfo> GetBoxInfoByBoxNo(string boxNo, string boxNo3)
        {
            string str = "select PalletNo,PalletNo2,PalletNo3,BoxNo,BoxNo2,BoxNo3,Status,LotNo,Qty,FullQty,SkuNo,SkuName,LotText,ProductionTime,InspectMark,BitBoxMark,InspectStatus,InspectTime from DataBoxInfo Where IsDel = @isdel";
            string str = "select PalletNo,PalletNo2,PalletNo3,BoxNo,BoxNo2,BoxNo3,Status,LotNo,Qty,FullQty,SkuNo,SkuName,LotText," +
                "ProductionTime,ExpirationTime,InspectMark,BitBoxMark,InspectStatus,InspectTime from DataBoxInfo Where IsDel = @isdel";
            //判断箱码是否为空
            if (!string.IsNullOrEmpty(boxNo))
            {
Wms/WMS.Entity/DataEntity/DataBoxInfo.cs
@@ -131,6 +131,11 @@
        public DateTime? ProductionTime {get;set;}
        /// <summary>
        /// 过期时间
        /// </summary>
        public DateTime? ExpirationTime { get; set; }
        /// <summary>
        /// Desc:供货批次
        /// Default:
        /// Nullable:True
Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs
@@ -139,5 +139,15 @@
        /// <param name="userId"></param>
        List<string> AgvTransport2(string soNo, string palletNo, string areaNo, int userId, string url);
        #endregion
        #region 箱码查询
        /// <summary>
        /// pda库存查询
        /// </summary>
        /// <param name="boxNo">储位编号</param>
        /// <param name="palletNo">托盘号</param>
        /// <returns></returns>
        DataBoxDto GetBoxQueryList(string boxNo);
        #endregion
    }
}
Wms/Wms/Controllers/PdaCrController.cs
@@ -416,5 +416,31 @@
        }
        #endregion
        #region 箱码查询
        /// <summary>
        /// pda箱码查询
        /// </summary>
        /// <param name="boxNo">箱码</param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetBoxQueryList(string boxNo)
        {
            try
            {
                DataBoxDto stockList = _pdaCrSvc.GetBoxQueryList(boxNo);
                if (stockList == null)
                {
                    return Ok(new { data = stockList, code = 1, msg = "无数据" });
                }
                return Ok(new { data = stockList, code = 0, msg = "成功" });
            }
            catch (Exception e)
            {
                return Ok(new { data = "", code = 1, msg = $"异常:{e.Message}" });
            }
        }
        #endregion
    }
}