Administrator
2024-02-21 87d55df7b7446d7c4c3532a2dd2e78f72574e34b
Merge branch 'master' into wxw
23个文件已修改
3122 ■■■■■ 已修改文件
HTML/views/ASNSetting/ArrivalNotice.html 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/ASNSetting/ArrivalNoticeDetail.html 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/ASNSetting/LabelBoxBuDa.html 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/ASNSetting/LabelPrint.html 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/ASNSetting/LabelPrintSelect.html 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/ASNSetting/PalletBind.html 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/StatisticalReport/BoxInfor.html 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/StatisticalReport/InventoryStatistics.html 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/View/AsnSetting/pingKuEnter.html 1163 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/View/AsnSetting/productEnterQuantity.html 956 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllAsnServer/AuditLogServer.cs 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs 153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs 348 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs 94 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/DataServer/StockDetailServer.cs 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/DataServer/StockServer.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/Logic/AllotLocation.cs 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/IBllAsnServer/IPalletBindServer.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/IDataServer/IStockDetailServer.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/IPdaServer/IPdaAsnServer.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/PdaAsnController.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/StatisticalController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/ASNSetting/ArrivalNotice.html
@@ -310,9 +310,13 @@
                                    html = `<a class="layui-btn layui-btn-danger layui-btn-xs delClass" lay-event="del"> 
                                        <i class="layui-icon layui-icon-delete"></i>删除</a>`; 
                                }
                                if((d.AsnType =="1" || d.AsnType == "4") && (d.Status == "0" || d.Status == "1")){
                                if(d.AsnType =="1" && (d.Status == "0" || d.Status == "1")){
                                    html += `<a class="layui-btn layui-btn-normal layui-btn-xs addLabelClass" lay-event="Addlabel"> 
                                        <i class="layui-icon layui-icon-edit"></i>生成标签</a>`; 
                                }
                                if(d.AsnType == "4"&& (d.Status == "0" || d.Status == "1")){
                                    html += `<a class="layui-btn layui-btn-normal layui-btn-xs addLabelClass" lay-event="Addlabel2">
                                        <i class="layui-icon layui-icon-edit"></i>生成标签</a>`;
                                }
                                return html;
                            } 
@@ -1201,7 +1205,44 @@
                                    console.log(field);
                                    //提交 Ajax 成功后,静态更新表格中的数据
                                    //"&Level="+field.level+"&Type="+field.type+"&BoxType="+field.boxType+"&Qty="+field.qty+
                                    var str = "Id="+id+"&Reset="+field.reset+"&ArriveQty="+field.arriveQty+"&ProductionTime="+field.productionTime+"&ExpirationTime="+field.expirationTime+"&StoreTime="+field.storeTime;
                                    var str = "Id="+id+"&IsReset="+field.reset+"&ArriveQty="+field.arriveQty+"&ProductionTime="+field.productionTime+"&ExpirationTime="+field.expirationTime+"&StoreTime="+field.storeTime;
                                    layer.open({
                                        type: 2,
                                        title: '生成标签',
                                        content: 'LabelPrint.html?'+str,
                                        maxmin: true,
                                        area: ['660px', '660px'],
                                        btn: ['取消'],
                                    });
                                });
                                submit.trigger('click');
                            }
                        });
                        break;
                    case "Addlabel2" :
                        layer.open({
                            type: 2,
                            title: '生成标签',
                            content: 'LabelPrintSelect.html?Id='+id+'&Type=4',
                            maxmin: true,
                            area: ['480px', '615px'],
                            btn: ['确定','取消'],
                            yes: function(index, layero){
                                var iframeWindow = window['layui-layer-iframe'+ index]
                                ,submitID = 'layuiadmin-app-form-edit'
                                ,submit = layero.find('iframe').contents().find('#'+ submitID);
                                //监听提交
                                iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
                                    var field = data.field; //获取提交的字段
                                    console.log(field);
                                    //提交 Ajax 成功后,静态更新表格中的数据
                                    //"&Level="+field.level+"&Type="+field.type+"&BoxType="+field.boxType+"&Qty="+field.qty+
                                    var str = "Id="+id+"&IsReset="+field.reset+"&ArriveQty="+field.arriveQty+"&ProductionTime="+field.productionTime+"&ExpirationTime="+field.expirationTime+"&StoreTime="+field.storeTime;
                                    
                                    layer.open({
                                        type: 2,
HTML/views/ASNSetting/ArrivalNoticeDetail.html
@@ -116,7 +116,15 @@
                    </script>
                    <script type="text/html" id="table-content-list">
                            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"> <i class="layui-icon layui-icon-delete"></i>删除</a>
                        </script>
                    </script>
                    <script type="text/html" id="table-content-Packlist">
                        {{#
                            function GetPack(d){
                                return d.PackagNo + '-' + d.PackagName;
                            }
                        }}
                        {{ GetPack(d) }}
                    </script>
                </div>
            </div>
        </div>
@@ -161,7 +169,7 @@
                        {field: 'UnitName',title: '计量单位',align: 'center',width: 70}, 
                        {field: 'Standard',title: '规格',width: 160,align: 'center'}, 
                        {field: 'LotText',title: '批次描述',align: 'center',edit: 'text',width: 160}, 
                        {field: 'PackagNo',title: '包装名称',width: 160},
                        {field: 'PackagNo',title: '包装名称',width: 160, templet: "#table-content-Packlist"},
                        {field: 'Price',title: '单价',align: 'center',width: 80}, 
                        {field: 'Money',title: '金额',align: 'center',width: 100}, 
                        {field: 'UDF1',title: '自定义列1',align: 'center',edit: 'text',width: 140}, 
@@ -681,12 +689,14 @@
                    }
                    arr.push(data[i]); //属性
                }
                $.extend(infoOptions, {
                    data: arr
                });
                infoOptions.page = {
                    curr: 1
                }
                console.log(infoOptions)
                table.render(infoOptions);
            }
            
HTML/views/ASNSetting/LabelBoxBuDa.html
@@ -190,7 +190,7 @@
                GetImportId();
            });
            form.on('select(Type)', function (data) {
                console.log(data.value); //得到被选中的值
                // console.log(data.value); //得到被选中的值
                if (data.value == "1") {
                    $("#LabelStream").removeAttr("readonly")
                    $("#EndBoxCode").removeAttr("readonly")
@@ -226,14 +226,14 @@
                synData(IP + "/BllAsn/GetBuDaLabelList", param1, 'post', function (res) {
                    if (res.code == 0) { //成功    
                        var labels = "";
                        console.log(res.data);
                        // console.log(res.data);
                        for (var z = 0; z < res.data.length; z++) {
                            var idd = "";
                            if (z - 1 >= 0) {
                                idd = (z - 1).toString();
                            }
                            console.log(res.data[z]);
                            console.log(z);
                            // console.log(res.data[z]);
                            // console.log(z);
                            $("#SkuNo").attr("id", "SkuNo" + z.toString());
                            $("#SkuNo" + z.toString()).html(res.data[z].SkuNo);
                             
@@ -303,7 +303,7 @@
                            $("#imgBar" + z.toString()).attr("id", "imgBar");
                            $("#imgBar").attr("src", "");
                        }
                        console.log(labels);
                        // console.log(labels);
                        document.getElementById('print2').innerHTML = "";
                        document.getElementById('print2').innerHTML = labels;
                        $("#print2").removeClass("hideCls");
HTML/views/ASNSetting/LabelPrint.html
@@ -112,45 +112,54 @@
            var laydate = layui.laydate;
            
            var id = getQueryString('Id');
            var reset = getQueryString('Reset');
            var reset = getQueryString('IsReset');
            var arriveQty = getQueryString('ArriveQty');
            
            var productionTime = getQueryString('ProductionTime');
            var expirationTime = getQueryString('ExpirationTime');
            var storeTime = getQueryString('StoreTime');  
            
            console.log(productionTime);
            console.log(expirationTime);
            console.log(storeTime);
            var doing = true;
            // console.log(productionTime);
            // console.log(expirationTime);
            // console.log(storeTime);
            //生成
            $('#btnAdd').on('click', function () {
                var param = {
                    Id: parseInt(id),
                    IsReset:reset,
                    ArriveQty:arriveQty,
                    ProductionTime:productionTime,
                    ExpirationTime:expirationTime,
                    StoreTime:storeTime
                };
                console.log(param);
                synData(IP + "/BllAsn/AddLabelBox", param , 'post', function (res) {
                    if (res.code == 0) { //成功
                        layer.msg(res.msg, {
                            icon: 1,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
                            parent.location.reload();
                            parent.layer.close(layer.index);
                        });
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
                if(doing){
                    doing= false;
                    var param = {
                        Id: parseInt(id),
                        IsReset:reset,
                        ArriveQty:arriveQty,
                        ProductionTime:productionTime,
                        ExpirationTime:expirationTime,
                        StoreTime:storeTime
                    };
                    // console.log(param);
                    synData(IP + "/BllAsn/AddLabelBox", param , 'post', function (res) {
                        if (res.code == 0) { //成功
                            layer.msg(res.msg, {
                                icon: 1,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function () {
                                parent.location.reload();
                                parent.layer.close(layer.index);
                                doing = true;
                            });
                        } else { //不成功
                            layer.msg(res.msg, {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function () {
                                doing = true;
                            });
                        }
                    });
                }
            });
            //打印
            $('#btnPrint').on('click', function () {
@@ -189,7 +198,7 @@
            }
            // 循环加载标签
            // 加载标签
            function div(i, isprint, bqNum) {
                             
                var param1 = {
HTML/views/ASNSetting/LabelPrintSelect.html
@@ -32,7 +32,7 @@
            <div class="layui-form-item">
                <label class="layui-form-label">重置批号</label>
                <div class="layui-input-block">
                    <select name="reset" id="reset" lay-verify="required">
                    <select name="reset" id="reset" lay-filter="reset" lay-verify="required">
                        <option value="1">是</option>
                        <option value="0">否</option>
                    </select>
@@ -116,7 +116,16 @@
                    });
                    var id = getQueryString('Id');
                    var asnType = getQueryString('Type');
                    console.log(asnType);
                    console.log(asnType == 4);
                    if(asnType == 4){
                        $("#reset option[value='0']").attr("selected","selected"); //性别
                        $("#reset").attr("disabled","disabled");
                        form.render('select');
                    }
                    var param = {
                        id: parseInt(id),
                    };
HTML/views/ASNSetting/PalletBind.html
@@ -62,22 +62,40 @@
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width: 60px;">所属仓库</label>
                        <div class="layui-input-inline">
                            <select name="WareHouseNo" id="WareHouseNo" lay-filter="ImportExecuteFlag" lay-search>
                                <option value=""></option>
                                <option value="W01">力诺立体库</option>
                                <option value="W02">力诺平库</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width: 60px;">所属巷道</label>
                        <div class="layui-input-inline">
                            <select name="RoadwayNo" id="RoadwayNo" lay-filter="ImportExecuteFlag" lay-search>
                                <option value=""></option>
                                <option value="R01">01巷道</option>
                                <option value="R02">02巷道</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width: 60px;">所属仓库</label>
                        <div class="layui-input-inline">
                            <select name="WareHouseNo" id="WareHouseNo" lay-filter="ImportExecuteFlag" lay-search>
                                <option value=""></option>
                                <option value="W01">09仓库</option>
                                <option value="W02">09零箱库</option>
                                <option value="R03">03巷道</option>
                                <option value="R04">04巷道</option>
                                <option value="R05">05巷道</option>
                                <option value="R06">06巷道</option>
                                <option value="R07">07巷道</option>
                                <option value="R08">08巷道</option>
                                <option value="R09">09巷道</option>
                                <option value="R10">10巷道</option>
                                <option value="R11">11巷道</option>
                                <option value="R12">12巷道</option>
                                <option value="R13">13巷道</option>
                                <option value="R14">14巷道</option>
                                <option value="R15">15巷道</option>
                                <option value="R16">16巷道</option>
                                <option value="R17">17巷道</option>
                                <option value="R18">18巷道</option>
                                <option value="R19">19巷道</option>
                                <option value="R20">20巷道</option>
                            </select>
                        </div>
                    </div>
@@ -340,6 +358,24 @@
                        switch (d.RoadwayNo) {
                            case "R01": return '01巷道';
                            case "R02": return '02巷道';
                            case "R03": return '03巷道';
                            case "R04": return '04巷道';
                            case "R05": return '05巷道';
                            case "R06": return '06巷道';
                            case "R07": return '07巷道';
                            case "R08": return '08巷道';
                            case "R09": return '09巷道';
                            case "R10": return '10巷道';
                            case "R11": return '11巷道';
                            case "R12": return '12巷道';
                            case "R13": return '13巷道';
                            case "R14": return '14巷道';
                            case "R15": return '15巷道';
                            case "R16": return '16巷道';
                            case "R17": return '17巷道';
                            case "R18": return '18巷道';
                            case "R19": return '19巷道';
                            case "R20": return '20巷道';
                            default: return "";
                        }
                        
HTML/views/StatisticalReport/BoxInfor.html
@@ -371,8 +371,9 @@
                //#region 自定义表头
                var TotalColsArr = [[
                    {field: '',title: '序号',type:'numbers',align: 'center',fixed: 'left', "disabled": true},
                    {field: 'WareHouseNo', title: '所属仓库', align: 'center'},
                    {field: 'AreaNo', title: '所属区域', align: 'center'},
                    {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'},
@@ -433,7 +434,8 @@
                            BitBoxMark:BitBoxMark, //零箱标记
                            InspectStatus:InspectStatus //质量状态
                        };
                        sendData(IP + "/Statistical/GetBindList", param, 'get', function(res) {
                        sendData(IP + "/Statistical/GetBindList", param, 'get', function(res) {
                            console.log(res)
                            if (res.code == 0) { //成功
                                var list = res.data;
                                $.extend(infoOptions, {
HTML/views/StatisticalReport/InventoryStatistics.html
@@ -495,8 +495,9 @@
            var DetailColsArr = [[
                        {field: 'PalletNo',title: '托盘号',align: 'center',width: 110,}, 
                        {field: 'LocatNo',title: '储位地址',align: 'center',width: 100,}, 
                        {field: 'RoadwayName',title: '所属巷道',width: 90,align: 'center'},
                        {field: 'WareHouseName',title: '所属仓库',width: 90,align: 'center'}, 
                        {field: 'RoadwayName',title: '所属巷道',width: 90,align: 'center'},
                        {field: 'AreaName',title: '所属区域',width: 90,align: 'center'},
                        {field: 'SkuNo',title: '物料编码',width: 100,align: 'center'}, 
                        {field: 'SkuName',title: '物料名称',align: 'center'}, 
                        {field: 'Standard',title: '物料规格',width: 130,align: 'center'}, 
Pda/View/AsnSetting/pingKuEnter.html
@@ -1,589 +1,634 @@
<!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">
            .layout-bill-info {
                height: auto;
                /* background-color: #009E94; */
            }
            .btn-ok-blue {
                border: none;
                color: #FFFFFF;
                background-color: #0a93e3;
                width: 48%;
                height: 36px;
                border-radius: 5px;
            }
            .btn-ok-red {
                border: none;
                color: #FFFFFF;
                background-color: #9f1707;
                width: 48%;
                height: 36px;
                border-radius: 5px;
            }
            .btn-ok-blue:active {
                opacity: 0.8;
            }
            .btn-ok-red:active {
                opacity: 0.8;
            }
            .foot-container {
                text-align: center;
                /* background-color: #007DDB; */
            }
        </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" lang>平库入库</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>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; */
        }
        .btn-ok-blue {
            border: none;
            color: #FFFFFF;
            background-color: #0a93e3;
            width: 48%;
            height: 36px;
            border-radius: 5px;
        }
        .btn-ok-red {
            border: none;
            color: #FFFFFF;
            background-color: #9f1707;
            width: 48%;
            height: 36px;
            border-radius: 5px;
        }
        .btn-ok-blue:active {
            opacity: 0.8;
        }
        .btn-ok-red:active {
            opacity: 0.8;
        }
        .foot-container {
            text-align: center;
            /* background-color: #007DDB; */
        }
    </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" lang>平库入库</td>
                    <td class="title-menu-icon"><img id="menuImg" src="/assets/menu.jpg"></td>
                </tr>
            </table>
        </div>
        <div id="" class="layout-sub-content">
            <div id="menuList" class="menu">
                <ul class="" style="text-align: center;">
                    <li><a href="../index.html" lang>主页</a></li>
                    <!-- <li><a href="productEnterConfirm.html">入库信息确认</a></li> -->
                    <li><a href="../login.html" lang>重新登录</a></li>
                </ul>
            </div>
            <div id="" class="layout-sub-content" >
                <div id="menuList" class="menu">
                    <ul class="" style="text-align: center;">
                        <li><a href="../index.html" lang>主页</a></li>
                        <!-- <li><a href="productEnterConfirm.html">入库信息确认</a></li> -->
                        <li><a href="../login.html" lang>重新登录</a></li>
                    </ul>
                </div>
                <div id="" class="layout-bill-info">
                    <form class="layui-form" action="" style="height: auto;">
                        <div id="" class="layui-form-item layout-dropdownlist" >
                            <label class="layui-form-label" lang>入库单:</label>
                            <div class="layui-input-block" id="selectDiv">
                                <select id="bar" lay-filter="getbar" lay-search>
                                    <option value=""></option>
                                </select>
                                <img src="/assets/down_arraw.png" >
                            </div>
            <div id="" class="layout-bill-info">
                <form class="layui-form" action="" style="height: auto;">
                    <div id="" class="layui-form-item layout-dropdownlist">
                        <label class="layui-form-label" lang>入库单:</label>
                        <div class="layui-input-block" id="selectDiv">
                            <select id="bar" lay-filter="getbar" lay-search>
                                <option value=""></option>
                            </select>
                            <img src="/assets/down_arraw.png">
                        </div>
                        <div id="" class="layui-form-item layout-input">
                            <label class="layui-form-label" lang>托盘条码:</label>
                            <div class="layui-input-block">
                                <input id="PalletNo" type="text" lay-verify="stock" lang langholder placeholder="请扫描托盘条码"
                                    autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div id="" class="layui-form-item layout-input">
                            <label class="layui-form-label" lang>地码:</label>
                            <div class="layui-input-block">
                                <input id="LocatNo" type="text" lay-verify="stock" lang langholder placeholder="请扫描地码"
                                    autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </form>
                    <div id="" style="text-align: center;">
                        <button class="btn-ok-blue" type="button" lay-submit lay-filter="formBind">确认入库</button>
                    </div>
                    <div id="" class="layui-form-item layout-input">
                        <label class="layui-form-label" lang>托盘条码:</label>
                        <div class="layui-input-block">
                            <input id="PalletNo" type="text" lay-verify="stock" lang langholder placeholder="请扫描托盘条码"
                                autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div id="" class="layui-form-item layout-input">
                        <label class="layui-form-label" lang>地码:</label>
                        <div class="layui-input-block">
                            <input id="LocatNo" type="text" lay-verify="stock" lang langholder placeholder="请扫描地码"
                                autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </form>
                <div id="" style="text-align: center;">
                    <button class="btn-ok-blue" type="button" lay-submit lay-filter="formBind">确认入库</button>
                </div>
                <div id="" class="cut-line" >
                    <img src="/assets/fengexian.png" >
                </div>
                <div class="layout-tbl-paging" id="" >
                    <div id="" class="tbl-title">
                        <table class="layout-tbl-input" border="0" cellspacing="" cellpadding="" >
                            <tr>
                                <td>
                                    <!-- <div class="layout-boxinfo">
            </div>
            <div id="" class="cut-line">
                <img src="/assets/fengexian.png">
            </div>
            <div class="layout-tbl-paging" id="">
                <div id="" class="tbl-title">
                    <table class="layout-tbl-input" border="0" cellspacing="" cellpadding="">
                        <tr>
                            <td>
                                <!-- <div class="layout-boxinfo">
                                        <label class="layui-form-label" lang style="width: 35%;">托盘号:</label>
                                        <div class="layui-input-block" style="width: 70%;">
                                            <input id="PalletNo" type="text" disabled lay-verify="required" placeholder=""
                                                autocomplete="off" class="layui-input" style="margin-left: -35px;">
                                        </div>
                                    </div> -->
                                </td>
                                <td>
                                    <div class="layout-boxinfo">
                                        <label class="layui-form-label" style="color: #FF0000" lang>箱子数量:</label>
                                        <div class="layui-input-block">
                                            <input id="boxNum" type="text" disabled lay-verify="required" placeholder=""
                                                autocomplete="off" class="layui-input">
                                        </div>
                            </td>
                            <td>
                                <div class="layout-boxinfo">
                                    <label class="layui-form-label" style="color: #FF0000" lang>箱子数量:</label>
                                    <div class="layui-input-block">
                                        <input id="boxNum" type="text" disabled lay-verify="required" placeholder=""
                                            autocomplete="off" class="layui-input">
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding="">
                        <tr><th lang>箱码</th><th lang>名称</th><th lang>数量</th></tr>
                        <tr id="boxCell" style="display: none">
                            <td id="BoxNo" name="BoxNo">AG000001</td>
                            <td id="SkuName" name="SkuName">疫苗名称名称名称</td>
                            <td id="Qty" name="Qty">30</td>
                            <!-- <td name="del">
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
                <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding="">
                    <tr>
                        <th lang>箱码</th>
                        <th lang>名称</th>
                        <th lang>数量</th>
                    </tr>
                    <tr id="boxCell" style="display: none">
                        <td id="BoxNo" name="BoxNo">AG000001</td>
                        <td id="SkuName" name="SkuName">疫苗名称名称名称</td>
                        <td id="Qty" name="Qty">30</td>
                        <!-- <td name="del">
                                <div id="" class="tbl-btn-del" lang>
                                    删除
                                </div>
                            </td> -->
                        </tr>
                    </table>
                    <!-- 分页 -->
                    <table id="tableBoxPages" class="tbl-box-pages" border="" cellspacing="" cellpadding="">
                        <tr >
                            <td class="page-prev" lang>上一页</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" lang>下一页</td>
                        </tr>
                    </table>
                </div>
            </div>
                    </tr>
                </table>
                <!-- 分页 -->
                <table id="tableBoxPages" class="tbl-box-pages" border="" cellspacing="" cellpadding="">
                    <tr>
                        <td class="page-prev" lang>上一页</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" lang>下一页</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/language.js"></script>
        <script src="/js/jquery.cookie.js"></script>
        <script>
            layui.use(['form', 'jquery'], function() {
                var form = layui.form
                initLanguage()
                setLanguage()
                //当前分页
                var curPageIndex = 1
                var billList = null
                var IsHuiKu=0 //是否回库,0:否 1:是
    </div>
    <script src="/js/jquery-3.5.1.min.js"></script>
    <script src="/layui/layui.js"></script>
    <script src="/js/public.js"></script>
    <script src="/js/language.js"></script>
    <script src="/js/jquery.cookie.js"></script>
    <script>
        layui.use(['form', 'jquery'], function () {
            var form = layui.form
                //获取入库单
                function getBar(selectedvalue) {
                    if (selectedvalue) {
                        let item = getCurBillInfo(selectedvalue)
                        let str = item.ImportWarehouseId + "; " + item.WarehouseName + "; "
                        if(item.LanewayCode == ""){
                            str += ""
                        }else{
                            str += item.LanewayCode
                            str += ";"
                        }
                        if(item.LanewayName == null || $.isPlainObject(item.LanewayName)){
                            str += ""
                        }else{
                            str += item.LanewayName
                        }
                        $('#whName').val(str)
            initLanguage()
            setLanguage()
            //当前分页
            var curPageIndex = 1
            var billList = null
            var IsHuiKu = 0 //是否回库,0:否 1:是
            //
            //获取入库单
            function getBar(selectedvalue) {
                if (selectedvalue) {
                    let item = getCurBillInfo(selectedvalue)
                    let str = item.ImportWarehouseId + "; " + item.WarehouseName + "; "
                    if (item.LanewayCode == "") {
                        str += ""
                    } else {
                        $('#whName').val('')
                        str += item.LanewayCode
                        str += ";"
                    }
                    if (item.LanewayName == null || $.isPlainObject(item.LanewayName)) {
                        str += ""
                    } else {
                        str += item.LanewayName
                    }
                    $('#whName').val(str)
                } else {
                    $('#whName').val('')
                }
                //获取当前所选入库单的信息
                function getCurBillInfo(billcode){
                    for(var i in billList){
                        if(billList[i].ImportBillCode == billcode){
                            return billList[i]
                        }
                    }
                    return null
                }
            }
                $("#selectDiv").click(function(){
                    var input = $('select[id="bar"]').next().find('.layui-select-title input')
                    var val = input.val()
                    //先更新一下入库单
                    updateBillList(function(data){
                        $('select[id="bar"]').next().addClass('layui-form-selected')
                        $('select[id="bar"]').next().find('.layui-select-title input').val(val)
                    })
                })
                //更新入库单
                function updateBillList(callback){
                    var input = $('select[id="bar"]').next().find('.layui-select-title input')
                    var val = input.val()
                    $("#bar").empty()
                    $("#bar").append('<option value =>' + '</option>');
                    form.render('select');
                    var param = {
                        Type: '0,1,2,3',
                    };
                    sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function(res) {
                        if (res.code == 0) { //成功
                            billList = deepCopy(res.data)
                            console.log(billList)
                            for (var i = 0; i < billList.length; i++) {
                                $("#bar").append('<option value =' + billList[i].ASNNo + '>' + billList[i]
                                    .ASNNo +
                                    '</option>');
                            }
                            form.render('select');
                            if(!val){
                                $('#bar').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this')
                            }else{
                                var sel = 'dd[lay-value=' + val + ']';
                                $('#bar').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this')
                            }
                            callback(billList)
                        } else { //不成功
                            // billList = null
                            // layer.msg(res.msg, {
                            //     icon: 2,
                            //     time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            // }, function() {});
                        }
                    });
                }
                //当托盘条码输入框失去焦点时,检查一下托盘状态
                $("#PalletNo").blur(function(){
                    checkPalletStat()
                })
                $("#PalletNo").keydown(function(e) {
                    if (e.keyCode === 13) {
                        //检查托盘状态
                        checkPalletStat();
                    }
                });
                //检查托盘状态
                function checkPalletStat(){
                    if($("#PalletNo").val() == ""){
                        return
                    }
                    IsHuiKu=0
                    var param1 = {
                        "PalletNo": $("#PalletNo").val()
                    }
                    //获取托盘管理的入库单
                    sendData(IP + "/PdaAsn/GetASNNoByPalletNo", param1, 'post', function(res) {
                        if (res.code == 0) { //成功
                            $("#bar").append('<option value =' + res.data + '>' + res.data +'</option>');
                            $("#bar").find("option[value='"+res.data+"']").prop("selected",true);
                            form.render();
                            if(res.data==''){
                                IsHuiKu=1
                            }
                            var param = {
                                "PalletNo": $("#PalletNo").val()
                            }
                            //检查托盘状态
                            sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function(res) {
                                if (res.code == 0) { //成功
                                    $.cookie('PalletNo', $("#PalletNo").val());
                                    refreshTable()
                                } else { //不成功
                                    layer.msg(res.msg, {
                                        icon: 2,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                    }, function() {});
                                }
                            });
                        } 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();
                                }
                            });
                            return
                        }
                    });
                }
                //渲染列表
                function refreshTable() {
                    //先清空一下箱子列表
                    let trs = $("#tableBoxList tr")
                    let len = trs.length
                    for(i=len - 1; i >=2; i--){
                            trs[i].remove();
                    }
                    //设置托盘号
                    $("#PalletNo").val($.cookie('PalletNo'))
                    var param = {
                        // PalletNo: $.cookie('PalletNo')
                        PalletNo: $.cookie('PalletNo'),
                        IsHuiKu : IsHuiKu
                    };
                    sendData(IP + "/PdaAsn/GetBoxInfos", param, 'post', function(res) {
                        console.log(res)
                        if (res.code == 0) { //成功
                            console.log(res)
                            $("#boxNum").val(res.data.length)
                            var list = res.data
                            var arrTrs = new Array()
                            let idx = 0
                            for(var i in list) {
                                // list[i].BoxNo
                                var tr = $("#boxCell").eq(0).clone();
                                tr.appendTo("#tableBoxList");
                                tr.attr('id', list[i].BoxNo)
                                idx++;
                                tr.attr('index', idx)
                                tr.find("td[name='BoxNo']").html(list[i].BoxNo);
                                tr.find("td[name='SkuName']").html(list[i].SkuName);
                                tr.find("td[name='Qty']").html(list[i].Qty);
                                var code = list[i].BoxNo
                                //console.log("code is "+code)
                                // //console.log("BoxNo is "+tr.find("td[name='BoxNo']").html())
                                tr.show();
                                arrTrs[i] = tr
                            }
                            //设置分页
                            setPages(1, list.length)
                        } else { //不成功
                            layer.msg("无数据", {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function() {});
                            $("#boxNum").val(0)
                            setPages(1, 0)
                        }
                    });
                }
                //确认入库
                form.on('submit(formBind)', function(data) {
                    // if (!$.cookie('userId')) {
                    //     layer.msg('登陆失效,请重新登陆', {
                    //         icon: 2,
                    //         time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    //     }, function() {
                    //         location.href = "login.html";
                    //         //回调
                    //     });
                    // }
                    let bval = $('select[id="bar"]').next().find('.layui-select-title input').val()
                    if (!bval && IsHuiKu==0) {
                        layer.msg('请选择入库单', {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                        return;
                    }
                    if (!$("#PalletNo").val()) {
                        layer.msg('请扫描托盘条码', {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                        return;
                    }
                    if (!$("#LocatNo").val()) {
                        layer.msg('请扫描地码', {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                        return;
                    }
                    let item = getCurBillInfo(bval)
                    var param = {
                        PalletNo:$("#PalletNo").val(),
                        LocatNo:$("#LocatNo").val(),
                        ASNNo:$("#bar").val()
                    }
                    param.Qty=Number(param.Qty)
                    sendData(IP + "/PdaAsn/ConfirmInStock", param, 'post', function(res) {
                        if (res.code == 0) { //成功
                            layer.msg(res.msg, {
                                icon: 1,
                                time: 2500 //2秒关闭(如果不配置,默认是3秒)
                            }, function() {
                                clearTable()
                                $("#PalletNo").val('')
                            });
                        } else { //不成功
                            layer.msg(res.msg, {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function() {
                                //回调
                            });
                        }
                    });
                    return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
                });
                function clearTable(){
                    $("#PalletNo").val('')
                    $("#boxNum").val('')
                    let trs = $("#tableBoxList tr")
                    let len = trs.length
                    for(i=len - 1; i >=2; i--){
                            trs[i].remove();
            //获取当前所选入库单的信息
            function getCurBillInfo(billcode) {
                for (var i in billList) {
                    if (billList[i].ImportBillCode == billcode) {
                        return billList[i]
                    }
                }
                form.verify({
                    stock: [/^[\S]{8}$/, '托盘条码必须为六位字符']
                });
                return null
            }
                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
                }
                //设置分页
                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)
                }
                $("#menuImg").click(function(e){
                    e.stopPropagation()
                    if($("#menuList").is(":hidden")){
                        $("#menuList").show()
                    }else{
                        $("#menuList").hide()
                    }
                })
                $('body').click(function(){
                    // //console.log("body")
                    $("#menuList").hide()
            $("#selectDiv").click(function () {
                var input = $('select[id="bar"]').next().find('.layui-select-title input')
                var val = input.val()
                //先更新一下入库单
                updateBillList(function (data) {
                    $('select[id="bar"]').next().addClass('layui-form-selected')
                    $('select[id="bar"]').next().find('.layui-select-title input').val(val)
                })
            })
        </script>
    </body>
</html>
            //更新入库单
            function updateBillList(callback) {
                var input = $('select[id="bar"]').next().find('.layui-select-title input')
                var val = input.val()
                $("#bar").empty()
                $("#bar").append('<option value =>' + '</option>');
                form.render('select');
                var param = {
                    Type: '0,1,2,3',
                };
                sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) {
                    if (res.code == 0) { //成功
                        billList = deepCopy(res.data)
                        console.log(billList)
                        for (var i = 0; i < billList.length; i++) {
                            $("#bar").append('<option value =' + billList[i].ASNNo + '>' + billList[i]
                                .ASNNo +
                                '</option>');
                        }
                        form.render('select');
                        if (!val) {
                            $('#bar').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this')
                        } else {
                            var sel = 'dd[lay-value=' + val + ']';
                            $('#bar').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this')
                        }
                        callback(billList)
                    } else { //不成功
                        // billList = null
                        // layer.msg(res.msg, {
                        //     icon: 2,
                        //     time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        // }, function() {});
                    }
                });
            }
            //当托盘条码输入框失去焦点时,检查一下托盘状态
            $("#PalletNo").blur(function () {
                checkPalletStat()
            })
            $("#PalletNo").keydown(function (e) {
                if (e.keyCode === 13) {
                    //检查托盘状态
                    checkPalletStat();
                }
            });
            //检查托盘状态
            function checkPalletStat() {
                if ($("#PalletNo").val() == "") {
                    return
                }
                IsHuiKu = 0
                var param1 = {
                    "PalletNo": $("#PalletNo").val()
                }
                //获取托盘管理的入库单
                sendData(IP + "/PdaAsn/GetASNNoByPalletNo", param1, 'post', function (res) {
                    if (res.code == 0) { //成功
                        $("#bar").append('<option value =' + res.data + '>' + res.data + '</option>');
                        $("#bar").find("option[value='" + res.data + "']").prop("selected", true);
                        form.render();
                        if (res.data == '') {
                            IsHuiKu = 1
                        }
                        var param = {
                            "PalletNo": $("#PalletNo").val()
                        }
                        //检查托盘状态
                        sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) {
                            if (res.code == 0) { //成功
                                $.cookie('PalletNo', $("#PalletNo").val());
                                refreshTable()
                            } else { //不成功
                                layer.msg(res.msg, {
                                    icon: 2,
                                    time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                }, function () { });
                            }
                        });
                    } 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();
                            }
                        });
                        return
                    }
                });
            }
            // 储位信息(地码)失去焦点后触发验证
            $("#LocatNo").blur(function () {
                CheckLocatNo()
            })
            // 储位信息(地码)点击回车后触发验证
            $("#LocatNo").keydown(function (e) {
                if (e.keyCode === 13) {
                    CheckLocatNo();
                }
            });
            // 验证储位信息(地码)是否可用
            function CheckLocatNo() {
                if ($("#LocatNo").val() == "") {
                    return
                }
                var param1 = {
                    "LocatNo": $("#LocatNo").val()
                }
                //获取托盘管理的入库单
                sendData(IP + "/PdaAsn/CheckLocatNo", param1, 'post', function (res) {
                    if (res.code != 0) { //成功
                        layer.msg(res.msg, {
                            icon: 0,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                        // 清空地码信息。暂定清空输入框信息
                        $("#LocatNo").val('');
                        return
                    }
                });
            }
            //渲染列表
            function refreshTable() {
                //先清空一下箱子列表
                let trs = $("#tableBoxList tr")
                let len = trs.length
                for (i = len - 1; i >= 2; i--) {
                    trs[i].remove();
                }
                //设置托盘号
                $("#PalletNo").val($.cookie('PalletNo'))
                var param = {
                    // PalletNo: $.cookie('PalletNo')
                    PalletNo: $.cookie('PalletNo'),
                    IsHuiKu: IsHuiKu
                };
                sendData(IP + "/PdaAsn/GetBoxInfos", param, 'post', function (res) {
                    console.log(res)
                    if (res.code == 0) { //成功
                        console.log(res)
                        $("#boxNum").val(res.data.length)
                        var list = res.data
                        var arrTrs = new Array()
                        let idx = 0
                        for (var i in list) {
                            // list[i].BoxNo
                            var tr = $("#boxCell").eq(0).clone();
                            tr.appendTo("#tableBoxList");
                            tr.attr('id', list[i].BoxNo)
                            idx++;
                            tr.attr('index', idx)
                            tr.find("td[name='BoxNo']").html(list[i].BoxNo);
                            tr.find("td[name='SkuName']").html(list[i].SkuName);
                            tr.find("td[name='Qty']").html(list[i].Qty);
                            var code = list[i].BoxNo
                            //console.log("code is "+code)
                            // //console.log("BoxNo is "+tr.find("td[name='BoxNo']").html())
                            tr.show();
                            arrTrs[i] = tr
                        }
                        //设置分页
                        setPages(1, list.length)
                    } else { //不成功
                        layer.msg("无数据", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                        $("#boxNum").val(0)
                        setPages(1, 0)
                    }
                });
            }
            //确认入库
            form.on('submit(formBind)', function (data) {
                // if (!$.cookie('userId')) {
                //     layer.msg('登陆失效,请重新登陆', {
                //         icon: 2,
                //         time: 2000 //2秒关闭(如果不配置,默认是3秒)
                //     }, function() {
                //         location.href = "login.html";
                //         //回调
                //     });
                // }
                let bval = $('select[id="bar"]').next().find('.layui-select-title input').val()
                if (!bval && IsHuiKu == 0) {
                    layer.msg('请选择入库单', {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    });
                    return;
                }
                if (!$("#PalletNo").val()) {
                    layer.msg('请扫描托盘条码', {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    });
                    return;
                }
                if (!$("#LocatNo").val()) {
                    layer.msg('请扫描地码', {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    });
                    return;
                }
                let item = getCurBillInfo(bval)
                var param = {
                    PalletNo: $("#PalletNo").val(),
                    LocatNo: $("#LocatNo").val(),
                    ASNNo: $("#bar").val()
                }
                param.Qty = Number(param.Qty)
                sendData(IP + "/PdaAsn/ConfirmInStock", param, 'post', function (res) {
                    if (res.code == 0) { //成功
                        layer.msg(res.msg, {
                            icon: 1,
                            time: 2500 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
                            clearTable()
                            $("#PalletNo").val('')
                        });
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
                            //回调
                        });
                    }
                });
                return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
            });
            function clearTable() {
                $("#PalletNo").val('')
                $("#boxNum").val('')
                let trs = $("#tableBoxList tr")
                let len = trs.length
                for (i = len - 1; i >= 2; i--) {
                    trs[i].remove();
                }
            }
            form.verify({
                stock: [/^[\S]{8}$/, '托盘条码必须为六位字符']
            });
            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
            }
            //设置分页
            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)
            }
            $("#menuImg").click(function (e) {
                e.stopPropagation()
                if ($("#menuList").is(":hidden")) {
                    $("#menuList").show()
                } else {
                    $("#menuList").hide()
                }
            })
            $('body').click(function () {
                // //console.log("body")
                $("#menuList").hide()
            })
        })
    </script>
</body>
</html>
Pda/View/AsnSetting/productEnterQuantity.html
@@ -2,26 +2,26 @@
<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>
    <meta name="viewport" content="user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta charset="UTF-8" />
    <!-- <meta name="viewport" content="width=device-width, initial-scale=0.665, minimum-scale=0.5, maximum-scale=1, user-scalable=no" /> -->
    <!-- <meta name="viewport" content="width=device-width, initial-scale=0.665" /> -->
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Boxline PDA</title>
    <link rel="stylesheet" href="/layui/css/layui.css" />
    <link rel="stylesheet" href="/css/style.css" />
    <script src="/js/adaptive.js"></script>
    <link rel="stylesheet" href="/css/my.css" />
    <style type="text/css">
        td {
            word-break: break-all;
            word-wrap: break-word;
        }
    <link rel="stylesheet" href="/layui/css/layui.css" />
    <link rel="stylesheet" href="/css/style.css" />
    <script src="/js/adaptive.js"></script>
    <link rel="stylesheet" href="/css/my.css" />
    <style type="text/css">
        td {
            word-break: break-all;
            word-wrap: break-word;
        }
        .layui-form-switch {
            margin-top: 0;
        }
        .layui-form-switch {
            margin-top: 0;
        }
        /* 标签样式 */
        .tableyang-this a {
@@ -40,12 +40,13 @@
            border: 1px solid #ccc;
            transition: all 0.3s ease;
        }
        .tableyang-this a.hover {
            color: #5298ff;
            background-color: #eff2ff;
            border: 1px solid #5298ff;
        }
        /* 内容居中 */
        .tableyang-tab {
            display: flex;
@@ -54,9 +55,11 @@
            flex-direction: column;
            height: 90vh;
        }
        /* 必用样式 */
        .tableyang-2,.tableyang-3 {
            display: none;
        .tableyang-2,
        .tableyang-3 {
            display: none;
        }
        ul {
@@ -70,43 +73,40 @@
            padding: 10px;
            margin-bottom: 5px;
        }
    </style>
    <link rel="stylesheet" href="/css/adapter.css" />
    </style>
    <link rel="stylesheet" href="/css/adapter.css" />
    <script src="../../js/jquery.js"></script>
    <script src="../../js/jquery-3.5.1.min.js"></script>
</head>
<body>
    <div id="" class="main-content">
        <div id="" class="layout-title">
            <table border="" cellspacing="" cellpadding="">
                <tr>
                    <td class="img-back"><a href="../index.html"><img src="/assets/back.jpg"></a></td>
                    <td class="title-text" lang>托盘绑定</td>
                    <td class="title-menu-icon"><img id="menuImg" src="/assets/menu.jpg"></td>
                </tr>
            </table>
        </div>
        <div id="" class="layout-sub-content">
            <div id="menuList" class="menu">
                <ul class="" style="text-align: center;">
                    <li><a href="../index.html" lang>主页</a></li>
                    <!-- <li><a href="productEnterConfirm.html">入库信息确认</a></li> -->
                    <li><a href="../login.html" lang>重新登录</a></li>
                </ul>
            </div>
    <div id="" class="main-content">
        <div id="" class="layout-title">
            <table border="" cellspacing="" cellpadding="">
                <tr>
                    <td class="img-back"><a href="../index.html"><img src="/assets/back.jpg"></a></td>
                    <td class="title-text" lang>托盘绑定</td>
                    <td class="title-menu-icon"><img id="menuImg" src="/assets/menu.jpg"></td>
                </tr>
            </table>
        </div>
        <div id="" class="layout-sub-content">
            <div id="menuList" class="menu">
                <ul class="" style="text-align: center;">
                    <li><a href="../index.html" lang>主页</a></li>
                    <!-- <li><a href="productEnterConfirm.html">入库信息确认</a></li> -->
                    <li><a href="../login.html" lang>重新登录</a></li>
                </ul>
            </div>
            <ul>
                <li id="option1">标签</li>
                <li id="option2">数量</li>
            </ul>
            <br />
            <!-- 有码 -->
            <div id="content1">
@@ -130,19 +130,19 @@
                                <img src="/assets/down_arraw.png">
                            </div>
                        </div>
                        <div id="" class="layui-form-item layout-input">
                            <label class="layui-form-label" lang>托盘条码:</label>
                            <div class="layui-input-block">
                                <input id="STOCKCODE" type="text" lay-verify="stock" lang langholder placeholder="请扫描托盘条码"
                                    autocomplete="off" class="layui-input">
                                <input id="STOCKCODE" type="text" lay-verify="stock" lang langholder
                                    placeholder="请扫描托盘条码" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div id="BOX" class="layui-form-item layout-input">
                            <label class="layui-form-label" lang>外箱条码:</label>
                            <div class="layui-input-block">
                                <input id="BOXCODE" type="text" lay-verify="required" lang langholder placeholder="请扫描外箱条码"
                                    autocomplete="off" class="layui-input">
                                <input id="BOXCODE" type="text" lay-verify="required" lang langholder
                                    placeholder="请扫描外箱条码" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div id="" class="layui-form-item layout-input">
@@ -155,11 +155,11 @@
                        <div id="BOX2" class="layui-form-item layout-input" style="display: none;">
                            <label class="layui-form-label" lang>尾箱条码:</label>
                            <div class="layui-input-block">
                                <input id="BOXCODE2" type="text" lang langholder placeholder="请扫描外箱条码" autocomplete="off"
                                    class="layui-input">
                                <input id="BOXCODE2" type="text" lang langholder placeholder="请扫描外箱条码"
                                    autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <table class="layout-tbl-input" border="" cellspacing="" cellpadding="">
                            <tr>
                                <td>
@@ -180,7 +180,7 @@
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
@@ -202,9 +202,9 @@
                                    </div>
                                </td>
                            </tr>
                        </table>
                        <table class="layout-tbl-submit" border="" cellspacing="" cellpadding="">
                            <tr>
                                <td style="width: 23%;"></td>
@@ -213,7 +213,7 @@
                                        lay-filter="formBind">绑定到托盘</button>
                                </td>
                                <td style="width: 33%;"></td>
                            </tr>
                        </table>
                    </form>
@@ -224,7 +224,7 @@
                <div id="" class="cut-line">
                    <img src="/assets/fengexian.png">
                </div>
                <div class="layout-tbl-paging" id="">
                    <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding="">
                        <tr>
@@ -247,17 +247,17 @@
                        </tr>
                    </table>
                    <!-- 分页 -->
                    <table id="tableBoxPages" class="tbl-box-pages" border="" cellspacing="" cellpadding="">
                        <tr style="display: ;">
                            <td class="page-prev">上一页</td>
                            <td class="page-num page-num-select">1</td>
                            <td class="page-num">2</td>
                            <td class="page-num">3</td>
                            <td class="page-num">4</td>
                            <td class="page-num">5</td>
                            <td class="page-next">下一页</td>
                        </tr>
                    </table>
                    <table id="tableBoxPages" class="tbl-box-pages" border="" cellspacing="" cellpadding="">
                        <tr style="display: ;">
                            <td class="page-prev">上一页</td>
                            <td class="page-num page-num-select">1</td>
                            <td class="page-num">2</td>
                            <td class="page-num">3</td>
                            <td class="page-num">4</td>
                            <td class="page-num">5</td>
                            <td class="page-next">下一页</td>
                        </tr>
                    </table>
                </div>
            </div>
@@ -287,8 +287,8 @@
                        <div id="" class="layui-form-item layout-input">
                            <label class="layui-form-label" lang>托盘条码:</label>
                            <div class="layui-input-block">
                                <input id="STOCKCODE1" type="text" lay-verify="stock" lang langholder placeholder="请扫描托盘条码"
                                    autocomplete="off" class="layui-input">
                                <input id="STOCKCODE1" type="text" lay-verify="stock" lang langholder
                                    placeholder="请扫描托盘条码" autocomplete="off" class="layui-input">
                            </div>
                        </div>
@@ -299,7 +299,7 @@
                                    autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <table class="layout-tbl-input" border="" cellspacing="" cellpadding="">
                            <tr>
                                <td>
@@ -311,6 +311,7 @@
                                        </div>
                                    </div>
                                </td>
                                <td></td>
                            </tr>
                            <tr>
                                <td>
@@ -346,7 +347,7 @@
                                        lay-filter="formBind">绑定到托盘</button>
                                </td>
                                <td style="width: 33%;"></td>
                            </tr>
                        </table>
@@ -358,7 +359,7 @@
                <div id="" class="cut-line">
                    <img src="/assets/fengexian.png">
                </div>
                <div class="layout-tbl-paging" id="">
                    <table id="tableBoxList1" class="tbl-box-list" border="" cellspacing="" cellpadding="">
                        <tr>
@@ -381,41 +382,41 @@
                        </tr>
                    </table>
                    <!-- 分页 -->
                    <table id="tableBoxPages1" class="tbl-box-pages" border="" cellspacing="" cellpadding="">
                        <tr style="display: ;">
                            <td class="page-prev">上一页</td>
                            <td class="page-num page-num-select">1</td>
                            <td class="page-num">2</td>
                            <td class="page-num">3</td>
                            <td class="page-num">4</td>
                            <td class="page-num">5</td>
                            <td class="page-next">下一页</td>
                        </tr>
                    </table>
                    <table id="tableBoxPages1" class="tbl-box-pages" border="" cellspacing="" cellpadding="">
                        <tr style="display: ;">
                            <td class="page-prev">上一页</td>
                            <td class="page-num page-num-select">1</td>
                            <td class="page-num">2</td>
                            <td class="page-num">3</td>
                            <td class="page-num">4</td>
                            <td class="page-num">5</td>
                            <td class="page-next">下一页</td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <script src="/js/jquery-3.5.1.min.js"></script>
    <script src="/layui/layui.js"></script>
    <script src="/js/public.js"></script>
    <script src="/js/language.js"></script>
    <script src="/js/jquery.cookie.js"></script>
    <script>
        layui.use(['form', 'jquery'], function () {
            var form = layui.form
        </div>
    </div>
    <script src="/js/jquery-3.5.1.min.js"></script>
    <script src="/layui/layui.js"></script>
    <script src="/js/public.js"></script>
    <script src="/js/language.js"></script>
    <script src="/js/jquery.cookie.js"></script>
    <script>
        layui.use(['form', 'jquery'], function () {
            var form = layui.form
            /* 标签切换代码 */
            var xianshiyemian = 0;
            $('#option1').attr("style", "background-color: aqua;width: 45.77%;float: left;text-align: center;"); //选中后颜色
            $('#option2').attr("style", "background-color: #999;width: 45.77%;float: right;text-align: center;"); //默认颜色
            $('#content2').hide();
            $(document).ready(function() {
                $('#option1').click(function() {
            $(document).ready(function () {
                $('#option1').click(function () {
                    // qingkong();
                    xianshiyemian = 0;
                    $('#content1').show();
@@ -425,7 +426,7 @@
                    $('#option2').attr("style", "background-color: #999;width: 45.77%;float: right;text-align: center;"); //默认颜色
                });
                $('#option2').click(function() {
                $('#option2').click(function () {
                    // qingkong();
                    xianshiyemian = 1;
                    $('#content1').hide();
@@ -433,12 +434,12 @@
                    $('#content2').show();
                    $('#option2').attr("style", "background-color: aqua;width: 45.77%;float: right;text-align: center;"); //选中后颜色
                });
            });
            //清楚文本框中数据
            // function clear() {
            // function clear() {
            //     if (xianshiyemian == "0")
            //     {
            //         $("#BOXCODE").val("");
@@ -459,32 +460,32 @@
            //         $("#ImportFactQuantity").val("");
            //         $("#BoxQty").val("");
            //     }
            // }
            // }
            /*——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————*/
            initLanguage()
            setLanguage()
            initLanguage()
            setLanguage()
            //当前分页
            var curPageIndex = 1;
            //是否连续组托
            isContinue = "0";
            //当前分页
            var curPageIndex = 1;
            //是否连续组托
            isContinue = "0";
            // 托盘码文本改变时触发
            $("#STOCKCODE").on('input', function () {
            // 托盘码文本改变时触发
            $("#STOCKCODE").on('input', function () {
                if ($("#STOCKCODE").val() == "" || $("#STOCKCODE").val().length < 8) {
                    return
                }
                if ($("#STOCKCODE").val().length >= 8) {
                    $("#STOCKCODE").val($("#STOCKCODE").val().substr(-8))
                }
                checkPalletStat()
            })
                if ($("#STOCKCODE").val() == "" || $("#STOCKCODE").val().length < 8) {
                    return
                }
                if ($("#STOCKCODE").val().length >= 8) {
                    $("#STOCKCODE").val($("#STOCKCODE").val().substr(-8))
                }
                checkPalletStat()
            })
            // 托盘码文本改变时触发-数量
            $("#STOCKCODE1").on('input', function () {
            $("#STOCKCODE1").on('input', function () {
                if ($("#STOCKCODE1").val() == "" || $("#STOCKCODE1").val().length < 8) {
                    return
@@ -495,35 +496,34 @@
                checkPalletStat()
            })
            //箱码回车事件
            $("#BOXCODE").keydown(function (e) {
                if (e.keyCode === 13) {
                    if ($("#BOXCODE").val() == "") {
            //箱码回车事件
            $("#BOXCODE").keydown(function (e) {
                if (e.keyCode === 13) {
                    if ($("#BOXCODE").val() == "") {
                        layer.msg('请先扫描箱码', {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                        return
                    }
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                        return
                    }
                    // if ($("#STOCKCODE").val() == "") {
                    //     layer.msg('请先扫描托盘码', {
                    //         icon: 2,
                    //         time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    //     });
                    //     $("#BOXCODE").val("");
                    //     $("#STOCKCODE").focus();
                    //     return;
                    // }
                    checkBoxInfo()
                }
            });
                    // if ($("#STOCKCODE").val() == "") {
                    //     layer.msg('请先扫描托盘码', {
                    //         icon: 2,
                    //         time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    //     });
                    //     $("#BOXCODE").val("");
                    //     $("#STOCKCODE").focus();
                    //     return;
                    // }
                    checkBoxInfo()
                }
            });
            /* 入库单据下拉框 */
            //点击入库单据下拉框事件
            $("#selectDiv").click(function () {
                if (xianshiyemian == 0)
                {
            //点击入库单据下拉框事件
            $("#selectDiv").click(function () {
                if (xianshiyemian == 0) {
                    var input = $('select[id="bar"]').next().find('.layui-select-title input')
                    var val = input.val()
                    //先更新一下入库单
@@ -532,11 +532,10 @@
                        $('select[id="bar"]').next().find('.layui-select-title input').val(val)
                    })
                }
            })
            })
            //点击入库单据下拉框事件
            $("#selectDiv1").click(function () {
                if (xianshiyemian == 1)
                {
            $("#selectDiv1").click(function () {
                if (xianshiyemian == 1) {
                    var input = $('select[id="bar1"]').next().find('.layui-select-title input')
                    var val = input.val()
                    //先更新一下入库单
@@ -545,16 +544,15 @@
                        $('select[id="bar1"]').next().find('.layui-select-title input').val(val)
                    })
                }
            })
            })
            /*————————————————————————————————————————————————————————————————————————————————————————————————*/
            /* 绑定入库单信息 */
            /* 绑定入库单信息 */
            function updateBillList(callback) {
                if (xianshiyemian == 0)
                {
            function updateBillList(callback) {
                if (xianshiyemian == 0) {
                    var input = $('select[id="bar"]').next().find('.layui-select-title input')
                    var val = input.val()
                    $("#bar").empty()
@@ -589,8 +587,7 @@
                        }
                    });
                }
                else if (xianshiyemian == 1)
                {
                else if (xianshiyemian == 1) {
                    var input = $('select[id="bar1"]').next().find('.layui-select-title input')
                    var val = input.val()
                    $("#bar1").empty()
@@ -625,54 +622,53 @@
                        }
                    });
                }
            }
            }
            /*————————————————————————————————————————————————————————————————————————————————————————————————*/
            //点击物料下拉框事件
            $("#goodDiv").click(function () {
                if ($("#bar").val() == null || $("#bar").val() == "" || $("#bar").val() == undefined) {
                    layer.msg("请先选择入库单", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () { });
                }
            })
            //点击物料下拉框事件
            $("#goodDiv").click(function () {
                if ($("#bar").val() == null || $("#bar").val() == "" || $("#bar").val() == undefined) {
                    layer.msg("请先选择入库单", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () { });
                }
            })
            //点击物料下拉框事件-数量
            $("#goodDiv1").click(function () {
                if ($("#bar1").val() == null || $("#bar1").val() == "" || $("#bar1").val() == undefined) {
                    layer.msg("请先选择入库单", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () { });
                }
            })
            //选中入库单事件
            form.on('select(getbar)', function (data) {
                updateGoodList()
                setOrderGoods();
            });
            $("#goodDiv1").click(function () {
                if ($("#bar1").val() == null || $("#bar1").val() == "" || $("#bar1").val() == undefined) {
                    layer.msg("请先选择入库单", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () { });
                }
            })
            //选中入库单事件
            form.on('select(getbar)', function (data) {
                updateGoodList()
                setOrderGoods();
            });
            //选中入库单事件-数量
            form.on('select(getbar1)', function (data) {
                updateGoodList()
                setOrderGoods();
            });
            //选中物料事件
            form.on('select(goodSelect)', function (data) {
                setOrderGoods();
            });
           //选中物料事件-数量
            form.on('select(goodSelect1)', function (data) {
                setOrderGoods();
            });
            form.on('select(getbar1)', function (data) {
                updateGoodList()
                setOrderGoods();
            });
            //绑定到托盘事件
            form.on('submit(formBind)', function (data) {
                if(xianshiyemian == 0)
                {
                    console.log($("#goodSelect").val());
            //选中物料事件
            form.on('select(goodSelect)', function (data) {
                setOrderGoods();
            });
            //选中物料事件-数量
            form.on('select(goodSelect1)', function (data) {
                setOrderGoods();
            });
            //绑定到托盘事件
            form.on('submit(formBind)', function (data) {
                if (xianshiyemian == 0) {
                    console.log($("#goodSelect").val());
                    if ($("#bar").val() == "") {
                        layer.msg('请选择入库单', {
                            icon: 2,
@@ -702,40 +698,39 @@
                        return;
                    }
                    var param = {
                    AsnNo: $("#bar").val(),
                    PalletNo: $("#STOCKCODE").val(),
                    AsnDetailId: parseInt($("#goodSelect").val()),
                    LotNo:$("#goodSelect").find("option:selected").text(),
                    BoxNo: $("#BOXCODE").val(),
                    IsContinue: isContinue,
                    TailBoxNo: $("#BOXCODE2").val(),
                    Origin:"PDA"
                }
                //组盘
                sendData(IP + "/PdaAsn/BindPallet", param, 'post', function (res) {
                    if (res.code == 0) { //成功
                        layer.msg(res.msg, {
                            icon: 1,
                            time: 1000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
                            setOrderGoods();
                            refreshTable();
                            $("#BOXCODE").val("");
                            $("#BOXCODE2").val("");
                            $("#QTY").val("");
                        });
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
                            //回调
                        });
                    }
                });
                        AsnNo: $("#bar").val(),
                        PalletNo: $("#STOCKCODE").val(),
                        AsnDetailId: parseInt($("#goodSelect").val()),
                        LotNo: $("#goodSelect").find("option:selected").text(),
                        BoxNo: $("#BOXCODE").val(),
                        IsContinue: isContinue,
                        TailBoxNo: $("#BOXCODE2").val(),
                        Origin: "PDA"
                    }
                    //组盘
                    sendData(IP + "/PdaAsn/BindPallet", param, 'post', function (res) {
                        if (res.code == 0) { //成功
                            layer.msg(res.msg, {
                                icon: 1,
                                time: 1000 //2秒关闭(如果不配置,默认是3秒)
                            }, function () {
                                setOrderGoods();
                                refreshTable();
                                $("#BOXCODE").val("");
                                $("#BOXCODE2").val("");
                                $("#QTY").val("");
                            });
                        } else { //不成功
                            layer.msg(res.msg, {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function () {
                                //回调
                            });
                        }
                    });
                }
                else if(xianshiyemian == 1)
                {
                else if (xianshiyemian == 1) {
                    if ($("#bar1").val() == "") {
                        layer.msg('请选择入库单', {
                            icon: 2,
@@ -760,11 +755,12 @@
                    var param = {
                        AsnNo: $("#bar1").val(), //出库单据
                        PalletNo: $("#STOCKCODE1").val(), //托盘条码
                        AsnDetailId: parseInt($("#goodSelect1").val()), //物料批次
                        AsnDetailId: parseInt($("#goodSelect1").val()), //入库单明细ID
                        LotNo: $("#goodSelect1").find("option:selected").text(),  //物料批次
                        SkuQty: parseInt($("#SkuQty").val()), //物料数量
                        Origin:"PDA"
                        Origin: "PDA"
                    }
                    console.log(param)
                    //组盘
                    sendData(IP + "/PdaAsn/BindPallet", param, 'post', function (res) {
@@ -788,15 +784,14 @@
                        }
                    });
                }
                return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
            });
                return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
            });
            // 根据入库明细ID 获取详细信息
            function setOrderGoods() {
                if (xianshiyemian == 0)
                {
            // 根据入库明细ID 获取详细信息
            function setOrderGoods() {
                if (xianshiyemian == 0) {
                    $("#ImportQuantity").val("");
                    $("#Standard").val("");
                    $("#ImportFactQuantity").val("");
@@ -814,10 +809,9 @@
                        }
                    });
                }
                else if (xianshiyemian == 1)
                {
                else if (xianshiyemian == 1) {
                    $("#ImportQuantity1").val("");
                    $("#Standard1").val("");
                    $("#Standard1").val("");
                    $("#ImportFactQuantity1").val("");
                    var param = {
@@ -833,15 +827,14 @@
                        }
                    });
                }
            }
            var asnDetails = "";
            /* 绑定入库单物料及批次 */
            function updateGoodList(skuNo) {
                if (xianshiyemian == 0)
                {
            }
            var asnDetails = "";
            /* 绑定入库单物料及批次 */
            function updateGoodList(skuNo) {
                if (xianshiyemian == 0) {
                    console.log("aaaa");
                    var input = $('select[id="goodSelect"]').next().find('.layui-select-title input')
                    var val = input.val()
@@ -857,40 +850,40 @@
                        if (res.code == 0) { //成功
                            asnDetails = res.data;
                            for (var i = 0; i < res.data.length; i++) {
                                if(skuNo!='' && skuNo==res.data[i].SkuNo){
                                    if(res.data[i].LotNo=='' || res.data[i].LotNo == null){
                                if (skuNo != '' && skuNo == res.data[i].SkuNo) {
                                    if (res.data[i].LotNo == '' || res.data[i].LotNo == null) {
                                        $("#goodSelect").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
                                        .SkuName +
                                        '</option>');
                                    }else{
                                        $("#goodSelect").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
                                        .SkuName + "-" + res.data[i].LotNo +
                                        '</option>');
                                    }
                                }else{
                                    if (i == 0) {
                                        if(res.data[i].LotNo=='' || res.data[i].LotNo == null){
                                            $("#goodSelect").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
                                            .SkuName +
                                            '</option>');
                                        }else{
                                            $("#goodSelect").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
                                            .SkuName + "-" + res.data[i].LotNo +
                                            '</option>');
                                        }
                                    } else {
                                        if(res.data[i].LotNo=='' || res.data[i].LotNo == null){
                                            $("#goodSelect").append('<option value =' + res.data[i].Id + '>' + res.data[i]
                                            .SkuName +
                                            '</option>');
                                        }else{
                                            $("#goodSelect").append('<option value =' + res.data[i].Id + '>' + res.data[i]
                                        $("#goodSelect").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
                                            .SkuName + "-" + res.data[i].LotNo +
                                            '</option>');
                                        }
                                     }
                                }
                                    }
                                } else {
                                    if (i == 0) {
                                        if (res.data[i].LotNo == '' || res.data[i].LotNo == null) {
                                            $("#goodSelect").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
                                                .SkuName +
                                                '</option>');
                                        } else {
                                            $("#goodSelect").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
                                                .SkuName + "-" + res.data[i].LotNo +
                                                '</option>');
                                        }
                                    } else {
                                        if (res.data[i].LotNo == '' || res.data[i].LotNo == null) {
                                            $("#goodSelect").append('<option value =' + res.data[i].Id + '>' + res.data[i]
                                                .SkuName +
                                                '</option>');
                                        } else {
                                            $("#goodSelect").append('<option value =' + res.data[i].Id + '>' + res.data[i]
                                                .SkuName + "-" + res.data[i].LotNo +
                                                '</option>');
                                        }
                                    }
                                }
                            }
                            form.render('select');
@@ -904,8 +897,7 @@
                        }
                    });
                }
                else if (xianshiyemian == 1)
                {
                else if (xianshiyemian == 1) {
                    console.log("bbbb");
                    var input = $('select[id="goodSelect1"]').next().find('.layui-select-title input')
                    var val = input.val()
@@ -921,17 +913,28 @@
                        if (res.code == 0) { //成功
                            asnDetails = res.data;
                            for (var i = 0; i < res.data.length; i++) {
                                if (i == 0) {
                                    $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
                                        .SkuName);
                                if (skuNo != '' && skuNo == res.data[i].SkuNo) {
                                    if (i == 0) {
                                        $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
                                            .SkuName);
                                    } else {
                                        $("#goodSelect1").append('<option value =' + res.data[i].Id + '>' + res.data[i]
                                            .SkuName);
                                    }
                                    if (res.data[i].LotNo != null) {
                                        $("#goodSelect1").append("-" + res.data[i].LotNo +
                                            '</option>');
                                    }
                                } else {
                                    $("#goodSelect1").append('<option value =' + res.data[i].Id + '>' + res.data[i]
                                        .SkuName);
                                }
                                if (res.data[i].LotNo != null)
                                {
                                    $("#goodSelect1").append("-" + res.data[i].LotNo +
                                        '</option>');
                                    if (res.data[i].LotNo == '' || res.data[i].LotNo == null) {
                                        $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
                                            .SkuName +
                                            '</option>');
                                    } else {
                                        $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
                                            .SkuName + "-" + res.data[i].LotNo +
                                            '</option>');
                                    }
                                }
                            }
@@ -947,13 +950,12 @@
                        }
                    });
                }
            }
            // 渲染箱码信息
            function refreshTable() {
                if (xianshiyemian == 0)
                {
            }
            // 渲染箱码信息
            function refreshTable() {
                if (xianshiyemian == 0) {
                    //先清空一下箱子列表
                    let trs = $("#tableBoxList tr")
                    let len = trs.length
@@ -1033,8 +1035,7 @@
                        }
                    });
                }
                else if (xianshiyemian == 1)
                {
                else if (xianshiyemian == 1) {
                    //先清空一下箱子列表
                    let trs = $("#tableBoxList1 tr")
                    let len = trs.length
@@ -1107,8 +1108,8 @@
                                arrTrs[i] = tr
                            }
                        //设置分页
                        setPages(1, list.length)
                            //设置分页
                            setPages(1, list.length)
                        } else { //不成功
                            layer.msg("无数据", {
@@ -1120,13 +1121,12 @@
                        }
                    });
                }
            }
            // 判断托盘码是否可用
            function checkPalletStat() {
                if (xianshiyemian == 0)
                {
            }
            // 判断托盘码是否可用
            function checkPalletStat() {
                if (xianshiyemian == 0) {
                    var param = {
                        "PalletNo": $("#STOCKCODE").val()
                    }
@@ -1145,8 +1145,7 @@
                        }
                    });
                }
                else if (xianshiyemian == 1)
                {
                else if (xianshiyemian == 1) {
                    var param = {
                        "PalletNo": $("#STOCKCODE1").val()
                    }
@@ -1165,342 +1164,335 @@
                        }
                    });
                }
            }
            function checkBoxInfo() {
                var param = {
                    "BoxNo": $("#BOXCODE").val(),
                }
                sendData(IP + "/PdaAsn/GetBindBoxInfos", param, 'post', function (res) {
                    if (res.code == 0) { //成功
                        var bl = false;
                        if (res.data.length == 0) {
                            layer.msg("未查询到此箱物料信息,请核实!", {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            });
                            return;
                        }
                        if(res.data[0].ASNNo!='' && res.data[0].ASNNo!=null){
                            $("#bar").empty()
                            $("#bar").append('<option value =>' + '</option>');
                            form.render('select');
            }
                            $("#bar").append('<option value =' + res.data[0].ASNNo + ' selected>' + res.data[0].ASNNo +'</option>');
                            updateGoodList(res.data[0].SkuNo)
                            setOrderGoods();
                        }else{
                            if(asnDetails==''){
                                layer.msg("请先选择入库单据!", {
                                    icon: 2,
                                    time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                });
                                return;
                            }
                        }
                        asnDetails.forEach(element => {
                            console.log(element);
            function checkBoxInfo() {
                var param = {
                    "BoxNo": $("#BOXCODE").val(),
                }
                sendData(IP + "/PdaAsn/GetBindBoxInfos", param, 'post', function (res) {
                    if (res.code == 0) { //成功
                        var bl = false;
                        if (res.data.length == 0) {
                            layer.msg("未查询到此箱物料信息,请核实!", {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            });
                            return;
                        }
                        if (res.data[0].ASNNo != '' && res.data[0].ASNNo != null) {
                            $("#bar").empty()
                            $("#bar").append('<option value =>' + '</option>');
                            form.render('select');
                            if (element.SkuNo == res.data[0].SkuNo && element.LotNo == res.data[0].LotNo) {
                                var sel = 'dd[lay-value=' + element.id + ']';
                                $('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this');
                                bl = true;
                            }
                        });
                        if (!bl) {
                            layer.msg("此箱物料不符合该入库单,请核实!", {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            });
                        } else {
                            $("#BoxQty").val(res.data[0].Qty);
                        }
                            $("#bar").append('<option value =' + res.data[0].ASNNo + ' selected>' + res.data[0].ASNNo + '</option>');
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                    }
                });
                            updateGoodList(res.data[0].SkuNo)
                            setOrderGoods();
                        } else {
                            if (asnDetails == '') {
                                layer.msg("请先选择入库单据!", {
                                    icon: 2,
                                    time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                });
                                return;
                            }
                        }
                        asnDetails.forEach(element => {
                            console.log(element);
            }
                            if (element.SkuNo == res.data[0].SkuNo && element.LotNo == res.data[0].LotNo) {
                                var sel = 'dd[lay-value=' + element.id + ']';
                                $('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this');
                                bl = true;
                            }
                        });
                        if (!bl) {
                            layer.msg("此箱物料不符合该入库单,请核实!", {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            });
                        } else {
                            $("#BoxQty").val(res.data[0].Qty);
                        }
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                    }
                });
            }
            /* 分页 */
            //设置分页
            function setPages(pageIndex, boxNum){
            function setPages(pageIndex, boxNum) {
                if (xianshiyemian == 0)
                {
                    if(boxNum <= 0){
                if (xianshiyemian == 0) {
                    if (boxNum <= 0) {
                        //列表为空,隐藏分页页码
                        $("#tableBoxPages").hide()
                        return
                    }
                    let pageNum = Math.floor(boxNum / 10);
                    if(boxNum % 10 > 0){
                    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(){
                    $("#tableBoxPages tr").eq(0).find("td[id^='prevPage']").click(function () {
                        onClickPrevPage()
                    })
                    for(i=1; i < pageNum + 1; i++){
                    for (i = 1; i < pageNum + 1; i++) {
                        // newTr.append("<td class='page-num'>"+ i +"</td>")
                        $("<td class='page-num'>"+ i +"</td>").appendTo("#tableBoxPages tr")
                        $("<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(){
                    $("#tableBoxPages tr").eq(0).find("td[id^='nextPage']").click(function () {
                        onClickNextPage()
                    })
                    // pages.show()
                    $("#tableBoxPages").show()
                    setCurPage(1)
                }
                else if (xianshiyemian == 1)
                {
                    if(boxNum <= 0){
                else if (xianshiyemian == 1) {
                    if (boxNum <= 0) {
                        //列表为空,隐藏分页页码
                        $("#tableBoxPages1").hide()
                        return
                    }
                    let pageNum = Math.floor(boxNum / 10);
                    if(boxNum % 10 > 0){
                    if (boxNum % 10 > 0) {
                        pageNum += 1;
                    }
                    //console.log("pageNum is " + pageNum)
                    $("#tableBoxPages1").find("tr").remove()
                    let table = $("#tableBoxPages1")
                    $("<tr></tr>").appendTo("#tableBoxPages1")
                    // let newTr = table.append("<tr></tr>")
                    // newTr.append("<td class='page-prev'>上一页</td>")
                    $("<td id='prevPage' class='page-prev'>上一页</td>").appendTo("#tableBoxPages1 tr")
                    $("#tableBoxPages1 tr").eq(0).find("td[id^='prevPage']").click(function(){
                    $("#tableBoxPages1 tr").eq(0).find("td[id^='prevPage']").click(function () {
                        onClickPrevPage()
                    })
                    for(i=1; i < pageNum + 1; i++){
                    for (i = 1; i < pageNum + 1; i++) {
                        // newTr.append("<td class='page-num'>"+ i +"</td>")
                        $("<td class='page-num'>"+ i +"</td>").appendTo("#tableBoxPages1 tr")
                        $("<td class='page-num'>" + i + "</td>").appendTo("#tableBoxPages1 tr")
                    }
                    // newTr.append("<td class='page-next'>下一页</td>")
                    $("<td id='nextPage' class='page-next'>下一页</td>").appendTo("#tableBoxPages1 tr")
                    $("#tableBoxPages1 tr").eq(0).find("td[id^='nextPage']").click(function(){
                    $("#tableBoxPages1 tr").eq(0).find("td[id^='nextPage']").click(function () {
                        onClickNextPage()
                    })
                    // pages.show()
                    $("#tableBoxPages1").show()
                    setCurPage(1)
                }
            }
            //设置当前分页
            function setCurPage(pageIndex){
                if (xianshiyemian == 0)
                {
            function setCurPage(pageIndex) {
                if (xianshiyemian == 0) {
                    let totalTrNum = $("#tableBoxList tr").length
                    if(totalTrNum <= 2 ){
                    if (totalTrNum <= 2) {
                        //console.log("tableBoxList 为空 totalTrNum: " + totalTrNum)
                        //curPageIndex = 1
                        return
                    }
                    let pageNum = getBoxPageNum()
                    if(pageIndex > pageNum){
                    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){
                    if (n > 9) {
                        endIndex = startIndex + 9
                    }else{
                    } else {
                        endIndex = startIndex + n
                    }
                    let trs = $("#tableBoxList tr")
                    //console.log("行数 "+trs.length)
                    let d = 0
                    for(let i = 2; i < trs.length; i++){
                    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){
                        if (d >= startIndex && d <= endIndex) {
                            //console.log("需要显示")
                            //显示行
                            t.show()
                        }else{
                        } else {
                            //隐藏行
                            t.hide()
                        }
                    }
                    curPageIndex = pageIndex
                    let ptr = $("#tableBoxPages tr")
                    for(let i = 1; i < pageNum+1; i++){
                    for (let i = 1; i < pageNum + 1; i++) {
                        ptr.eq(0).find("td").eq(i).removeClass("page-num-select")
                        if(i == curPageIndex){
                        if (i == curPageIndex) {
                            ptr.eq(0).find("td").eq(i).addClass("page-num-select")
                        }
                    }
                }
                else if (xianshiyemian == 1)
                {
                else if (xianshiyemian == 1) {
                    let totalTrNum = $("#tableBoxList1 tr").length
                    if(totalTrNum <= 2 ){
                    if (totalTrNum <= 2) {
                        return
                    }
                    let pageNum = getBoxPageNum()
                    if(pageIndex > pageNum){
                    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){
                    if (n > 9) {
                        endIndex = startIndex + 9
                    }else{
                    } else {
                        endIndex = startIndex + n
                    }
                    let trs = $("#tableBoxList1 tr")
                    //console.log("行数 "+trs.length)
                    let d = 0
                    for(let i = 2; i < trs.length; i++){
                    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){
                        if (d >= startIndex && d <= endIndex) {
                            //console.log("需要显示")
                            //显示行
                            t.show()
                        }else{
                        } else {
                            //隐藏行
                            t.hide()
                        }
                    }
                    curPageIndex = pageIndex
                    let ptr = $("#tableBoxPages1 tr")
                    for(let i = 1; i < pageNum+1; i++){
                    for (let i = 1; i < pageNum + 1; i++) {
                        ptr.eq(0).find("td").eq(i).removeClass("page-num-select")
                        if(i == curPageIndex){
                        if (i == curPageIndex) {
                            ptr.eq(0).find("td").eq(i).addClass("page-num-select")
                        }
                    }
                }
            }
            function getBoxPageNum()
            {
                if (xianshiyemian == 0)
                {
            function getBoxPageNum() {
                if (xianshiyemian == 0) {
                    let num = $("#tableBoxList tr").length
                    if(num <= 2 ){
                    if (num <= 2) {
                        return 0
                    }
                    let pageNum = Math.floor(num / 10);
                    if(num % 10 > 0){
                    if (num % 10 > 0) {
                        pageNum += 1;
                    }
                    return pageNum
                }
                else if (xianshiyemian == 1)
                {
                else if (xianshiyemian == 1) {
                    let num = $("#tableBoxList1 tr").length
                    if(num <= 2 ){
                    if (num <= 2) {
                        return 0
                    }
                    let pageNum = Math.floor(num / 10);
                    if(num % 10 > 0){
                    if (num % 10 > 0) {
                        pageNum += 1;
                    }
                    return pageNum
                }
            }
            function onClickPrevPage(){
            function onClickPrevPage() {
                //console.log("上一页按钮被点击")
                if(curPageIndex == 1){
                if (curPageIndex == 1) {
                    return
                }
                setCurPage(curPageIndex - 1)
            }
            function onClickNextPage(){
            function onClickNextPage() {
                //console.log("下一页按钮被点击")
                let n = getBoxPageNum()
                if(curPageIndex == n){
                if (curPageIndex == n) {
                    return
                }
                setCurPage(curPageIndex + 1)
            }
            /*——————————————————————————————————————————————————————————*/
            form.on('switch(IsLianXu)', function (obj) {
                if (obj.elem.checked) {
                    $('#BOX2').attr("style", "display:block")
                    $('#zongDiv').attr("style", "height: 285px;")
                    isContinue = "1";
                } else {
                    $('#BOX2').attr("style", "display:none")
                    $('#zongDiv').attr("style", "height: 255px;")
                    isContinue = "0";
                }
                $('#BOXCODE2').val("");
            });
            form.on('switch(IsLianXu)', function (obj) {
                if (obj.elem.checked) {
                    $('#BOX2').attr("style", "display:block")
                    $('#zongDiv').attr("style", "height: 285px;")
                    isContinue = "1";
                } else {
                    $('#BOX2').attr("style", "display:none")
                    $('#zongDiv').attr("style", "height: 255px;")
                    isContinue = "0";
                }
                $('#BOXCODE2').val("");
            });
            $("#menuImg").click(function (e) {
                //console.log("menuImg")
                e.stopPropagation()
            $("#menuImg").click(function (e) {
                //console.log("menuImg")
                e.stopPropagation()
                if ($("#menuList").is(":hidden")) {
                    $("#menuList").show()
                } else {
                    $("#menuList").hide()
                }
            })
            $('body').click(function () {
                // //console.log("body")
                $("#menuList").hide()
            })
        })
    </script>
                if ($("#menuList").is(":hidden")) {
                    $("#menuList").show()
                } else {
                    $("#menuList").hide()
                }
            })
            $('body').click(function () {
                // //console.log("body")
                $("#menuList").hide()
            })
        })
    </script>
</body>
</html>
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
@@ -136,8 +136,8 @@
                    throw new Exception("未查询到入库单明细");
                }
                var labelQty = Db.Queryable<BllBoxInfo>().Where(m => m.IsDel == "0" && m.ASNDetailNo == id).Sum(m=>m.Qty);
                var qty = detail.Qty-labelQty;
                var labelQty = Db.Queryable<BllBoxInfo>().Where(m => m.IsDel == "0" && m.ASNDetailNo == id).Sum(m => m.Qty);
                var qty = detail.Qty - labelQty;
                return qty.ToString();
            }
@@ -249,6 +249,15 @@
                        throw new Exception("单据类型不可为空!");
                    }
                }
                //判断是否为采购入库单据或车间余料退回入库
                // 0:成品入库 1:采购入库 2:中间品入库 3:退货入库 4:车间余料退回入库 5:其它入库 6:代储入库 7:寄存入库
                if (model.Type == "1" || model.Type == "4")
                {
                    if (!string.IsNullOrWhiteSpace(model.LotNo))
                    {
                        throw new Exception("采购入库或余料退回不可输入批次,不可编辑!");
                    }
                }
                sqlString += "Insert into BllArrivalNotice (ASNNo,Type,Origin,CustomerNo,";
                sqlString += "CustomerName,LotNo,LotText,SupplierLot,CreateUser) values ( ";
@@ -342,6 +351,18 @@
            string sqlDetailStr = string.Empty;
            try
            {
                //判断是否为采购入库单据或车间余料退回入库
                // 0:成品入库 1:采购入库 2:中间品入库 3:退货入库 4:车间余料退回入库 5:其它入库 6:代储入库 7:寄存入库
                int isType = 0;
                if (model.Type == "1" || model.Type == "4")
                {
                    isType = 1;
                    if (!string.IsNullOrWhiteSpace(model.LotNo))
                    {
                        strMessage = "-1:采购入库或余料退回不可输入批次,不可编辑;";
                        return strMessage;
                    }
                }
                if (model.Origin != "录入")
                {
                    strMessage = "-1:上游系统下发的单据,不可编辑;";
@@ -396,7 +417,7 @@
                        strMessage = "-1:数量必须大于0;";
                        continue;
                    }
                    if (string.IsNullOrEmpty(detailModel.LotNo))
                    if (string.IsNullOrEmpty(detailModel.LotNo) && isType != 1)
                    {
                        strMessage = "-1:批次号不可为空;";
                        continue;
@@ -501,6 +522,7 @@
                }
                // 删除总单
                sqlString = $"UPDATE BllArrivalNotice SET IsDel = '1',";
                sqlString += $"UpdateTime = GETDATE(),UpdateUser = '{model.CreateUser}' ";
@@ -510,10 +532,30 @@
                sqlString += $"UPDATE BllArrivalNoticeDetail SET IsDel = '1',";
                sqlString += $"UpdateTime = GETDATE(),UpdateUser = '{model.CreateUser}' ";
                sqlString += $"WHERE ASNNo = '{model.ASNNo}';";
                //判断是否为采购入库单据或车间余料退回入库
                // 0:成品入库 1:采购入库 2:中间品入库 3:退货入库 4:车间余料退回入库 5:其它入库 6:代储入库 7:寄存入库
                int notdel = 0;
                if (model.Type == "1" || model.Type == "4")
                {
                    //获取单据生成对应标签
                    var list = Db.Queryable<BllBoxInfo>().Where(a => a.IsDel == "0" && a.Status == "0" && a.BindNo == null);
                    //验证对应箱支信息是否存在
                    if (list == null)
                    {
                        return "-1:已有箱码已绑定托盘或已入库,不可删除!";
                    }
                    // 删除对应箱支信息
                    sqlString += $"UPDATE BllBoxInfo SET IsDel = '1',";
                    sqlString += $"UpdateTime = GETDATE(),UpdateUser = '{model.CreateUser}' ";
                    sqlString += $"WHERE ASNNo = '{model.ASNNo}';";
                    notdel = 1;
                }
                Db.Ado.BeginTran();
                int rowCount = Db.Ado.ExecuteCommand(sqlString);
                if (rowCount < 2)
                if (rowCount < 2 + notdel)
                {
                    Db.RollbackTran();
                    return "-1:删除失败!";
@@ -524,6 +566,7 @@
            }
            catch (Exception ex)
            {
                Db.RollbackTran();
                throw ex;
            }
        }
Wms/WMS.BLL/BllAsnServer/AuditLogServer.cs
@@ -15,7 +15,7 @@
namespace WMS.BLL.BllAsnServer
{
    public class AuditLogServer: DbHelper<BllAuditLog>, IAuditLogServer
    public class AuditLogServer : DbHelper<BllAuditLog>, IAuditLogServer
    {
        private static readonly SqlSugarScope Db = DataContext.Db;
@@ -29,22 +29,22 @@
            try
            {
                Expression<Func<BllAuditLog, bool>> item = Expressionable.Create<BllAuditLog>()
                    .AndIF(!string.IsNullOrWhiteSpace(model.AsnNo),it=>it.OrderNo.Contains(model.AsnNo.Trim()))
                    .AndIF(!string.IsNullOrWhiteSpace(model.Status),it=>it.Status == model.Status)
                    .AndIF(!string.IsNullOrWhiteSpace(model.StartTime),it=> it.CreateTime >= Convert.ToDateTime(model.StartTime))
                    .AndIF(!string.IsNullOrWhiteSpace(model.EndTime),it=> it.CreateTime <= Convert.ToDateTime(model.EndTime).AddDays(1))
                    .And(it=>it.IsDel=="0")
                    .AndIF(!string.IsNullOrWhiteSpace(model.AsnNo), it => it.OrderNo.Contains(model.AsnNo.Trim()))
                    .AndIF(!string.IsNullOrWhiteSpace(model.Status), it => it.Status == model.Status)
                    .AndIF(!string.IsNullOrWhiteSpace(model.StartTime), it => it.CreateTime >= Convert.ToDateTime(model.StartTime))
                    .AndIF(!string.IsNullOrWhiteSpace(model.EndTime), it => it.CreateTime <= Convert.ToDateTime(model.EndTime).AddDays(1))
                    .And(it => it.IsDel == "0")
                    .ToExpression();
                var total = 0;
                var data = GetAllWhereAsync(item)
                    .LeftJoin<SysUserInfor>((a, b ) => a.CreateUser == b.Id)
                    .LeftJoin<SysUserInfor>((a, b) => a.CreateUser == b.Id)
                    .LeftJoin<SysUserInfor>((a, b, c) => a.AuditUser == c.Id)
                    .Select((a, b, c) => new AuditLogDto()
                    {
                        Id = a.Id,
                        OrderNo = a.OrderNo,
                        PalletNo = a.PalletNo,
                        Msg = a.Msg,
                        Status = a.Status,
                        Reason = a.Reason,
@@ -68,11 +68,11 @@
        }
        //编辑审核
        public void EditAudit(int id, string status,string opinion,int userId)
        public void EditAudit(int id, string status, string opinion, int userId)
        {
            try
            {
                var log = Db.Queryable<BllAuditLog>().First(m => m.Id == id && m.IsDel =="0");
                var log = Db.Queryable<BllAuditLog>().First(m => m.Id == id && m.IsDel == "0");
                if (log == null)
                {
                    throw new Exception("未查询到审核信息,请核实");
@@ -156,7 +156,7 @@
                                        .First(m => m.IsDel == "0" && m.LocatNo == item.LocatNo);
                                    if (item.Qty != null)
                                    {
                                        if (item.LockQty>0)
                                        if (item.LockQty > 0)
                                        {
                                            throw new Exception("当前物料批次已被分配,无法撤销");
                                        }
@@ -197,9 +197,12 @@
                                    {
                                        if (demo2.Origin != "WMS")
                                        {
                                            demo2.ASNNo = null;
                                            demo2.ASNDetailNo = null;
                                        }
                                            if (notice.Type != "1" && notice.Type != "4")
                                            {
                                                demo2.ASNNo = null;
                                                demo2.ASNDetailNo = null;
                                            }
                                        }
                                        demo2.BindNo = null;
                                        demo2.PalletNo = null;
                                        demo2.Status = "0";
@@ -246,7 +249,7 @@
                                        {
                                            Db.Updateable(stock).ExecuteCommand();
                                        }
                                    }
                                    Db.Deleteable(item).ExecuteCommand();
@@ -404,7 +407,7 @@
                            if (stockDetail.Qty != null)
                            {
                                stock.Qty -= (int)stockDetail.Qty;
                            }
                            if (stock.Qty == 0)
@@ -415,7 +418,7 @@
                            {
                                Db.Updateable(stock).ExecuteCommand();
                            }
                            Db.Deleteable(stockDetail).ExecuteCommand();
                            Db.Deleteable(stockInfo).ExecuteCommand();
                            if (locate != null)
@@ -435,14 +438,14 @@
                            bind.TaskNo = "";
                            bind.CompleteTime = null;
                            Db.Updateable(bind).ExecuteCommand();
                        }
                        else
                        {
                            throw new Exception("记录的功能编号异常");
                        }
                    }
                    log.Status = status;
                    log.Opinion = opinion;
                    log.AuditTime = DateTime.Now;
Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
@@ -576,7 +576,7 @@
                    packStr += "-" + pack.L5Num + "/" + pack.L5Name;
                }
                //标签表
                var label = Db.Queryable<BllBoxInfo>().Where(m => m.IsDel == "0" && m.ASNDetailNo == imId).ToList();
                var label = Db.Queryable<BllBoxInfo>().Where(m => m.IsDel == "0" && m.Origin == "WMS生成").ToList();
                #endregion
@@ -614,30 +614,35 @@
                var modelList = new List<BllBoxInfo>();
                var addLotNo = "";
                if (arriveQty < 0)
                {
                    throw new Exception("到货数量不能小于0!");
                }
                Db.BeginTran();
                if (packLevel == 1)
                {
                    #region 一级包装
                    // 根据用户输入的箱数量计算需要的条码数
                    var labQty = label.Sum(m => m.Qty);
                    var qty = asnList.Qty - labQty;//当前单据剩余需要打印的物料数量(不是标签数量)
                    if (qty <= 0)
                    {
                        throw new Exception("当前单据物料标签已打印完毕,如有需要请补打");
                    }
                    //var labQty = label.Sum(m => m.Qty);
                    //var qty = asnList.Qty - labQty;//当前单据剩余需要打印的物料数量(不是标签数量)
                    //if (qty <= 0)
                    //{
                    //    throw new Exception("当前单据物料标签已打印完毕,如有需要请补打");
                    //}
                    #region 到货数量
                    if (arriveQty - qty > 0)
                    {
                        throw new Exception("到货数量大于未打标签数量,请重新输入到货数量并核实!");
                    }
                    else
                    {
                        qty = arriveQty;
                    }
                    //if (arriveQty - qty > 0)
                    //{
                    //    throw new Exception("到货数量大于未打标签数量,请重新输入到货数量并核实!");
                    //}
                    //else
                    //{
                    //    qty = arriveQty;
                    //}
                    var qty = arriveQty;
                    #endregion
                    int labelNum = 1; //生产条码数量
@@ -656,23 +661,38 @@
                    string maxBoxCode = ""; //箱码号
                    // 生成自编批号
                    string toDayTime = DateTime.Now.ToString("yyyyMMdd");
                    var maxLotNo = label.Max(a => a.LotNo);
                    var maxBoxNo = label.Max(a => a.BoxNo);
                    if (isReset == "0")
                    {
                        maxLotNoStr = maxLotNo;
                        maxBoxCode = maxBoxNo;
                        if (string.IsNullOrWhiteSpace(maxLotNoStr))
                        //判断单据是否是余料退回单
                        if (asn.Type == "4")
                        {
                            maxLotNoStr = toDayTime.Substring(2, 6) + "0001";
                            maxLotNoStr = asnList.LotNo;
                            maxBoxCode = label.Where(m=>m.LotNo == maxLotNoStr).Max(a => a.BoxNo);
                            if (string.IsNullOrWhiteSpace(maxLotNoStr))
                            {
                                throw new Exception("车间余料退回单据批次不能为空");
                            }
                        }
                        else
                        {
                            var labelCount = label.Where(m => m.ASNDetailNo == imId).ToList();
                            if (labelCount.Count <= 0)
                            {
                                throw new Exception("当前单据明细还未生成标签,请选择重置批次选项为‘是’;");
                            }
                            maxLotNoStr = label.Max(a => a.LotNo);
                            maxBoxCode = label.Max(a => a.BoxNo);
                            if (string.IsNullOrWhiteSpace(maxLotNoStr))
                            {
                                maxLotNoStr = toDayTime.Substring(2, 6) + "0001";
                            }
                        }
                    }
                    else
                    {
                        var maxCode = Db.Queryable<BllLabelBoxNo>().Max(a => a.LotNo);                        // 获取今天最大批次号
                        var maxCode = Db.Queryable<BllBoxInfo>().Where(m=>m.Origin == "WMS生成").Max(a => a.LotNo);                        // 获取今天最大批次号
                        if (string.IsNullOrWhiteSpace(maxCode))
                        {
                            maxLotNoStr = toDayTime.Substring(2, 6) + "0001";
@@ -720,7 +740,7 @@
                        }
                        //获取箱码
                        if (maxBoxCode == "")
                        if (string.IsNullOrWhiteSpace(maxBoxCode))
                        {
                            var str = "B"+maxLotNoStr + "000001"; //批号+ 流水  2302010001000001
                            maxBoxCode = str;
@@ -769,25 +789,27 @@
                    #region 二级包装
                    // 根据用户输入的箱数量计算需要的条码数
                    var labQty = label.Sum(m => m.Qty);
                    var qty2 = asnList.Qty - labQty;
                    if (qty2 <= 0)
                    {
                        throw new Exception("当前单据物料标签已打印完毕,如有需要请补打");
                    }
                    //var labQty = label.Sum(m => m.Qty);
                    //var qty2 = asnList.Qty - labQty;
                    //if (qty2 <= 0)
                    //{
                    //    throw new Exception("当前单据物料标签已打印完毕,如有需要请补打");
                    //}
                    #region 增加到货数量
                    if (arriveQty - qty2 > 0)
                    {
                        throw new Exception("到货数量大于未打标签数量,请重新输入到货数量!");
                    }
                    else
                    {
                        qty2 = arriveQty;
                    }
                    //if (arriveQty - qty2 > 0)
                    //{
                    //    throw new Exception("到货数量大于未打标签数量,请重新输入到货数量!");
                    //}
                    //else
                    //{
                    //    qty2 = arriveQty;
                    //}
                    #endregion
                    var qty2 = arriveQty;
                    int labelNum2 = 1; //生产箱条码数量
                    labelNum2 = int.Parse(Math.Ceiling(qty2 / bNum).ToString());
@@ -806,20 +828,37 @@
                    string toDayTime2 = DateTime.Now.ToString("yyyyMMdd");
                    if (isReset == "0")
                    {
                        var maxCode = label.Max(a => a.LotNo);
                        var boxCode1 = label.Max(a => a.BoxNo);//箱号
                        var boxCode2 = label.Max(a => a.BoxNo3);//支号
                        maxCodestr2 = maxCode;
                        maxboxcode2 = boxCode1;
                        maxboxcode3 = boxCode2;
                        if (string.IsNullOrWhiteSpace(maxCodestr2))
                        //判断单据是否是余料退回单
                        if (asn.Type == "4")
                        {
                            maxCodestr2 = toDayTime2.Substring(2, 6) + "0001";
                            maxCodestr2 = asnList.LotNo;
                            maxboxcode2 = label.Where(m => m.LotNo == maxCodestr2).Max(a => a.BoxNo);
                            maxboxcode3 = label.Where(m => m.LotNo == maxCodestr2).Max(a => a.BoxNo3);//支号
                            if (string.IsNullOrWhiteSpace(maxCodestr2))
                            {
                                throw new Exception("车间余料退回单据批次不能为空");
                            }
                        }
                        else
                        {
                            var labelCount = label.Where(m => m.ASNDetailNo == imId).ToList();
                            if (labelCount.Count <= 0)
                            {
                                throw new Exception("当前单据明细还未生成标签,请选择重置批次选项为‘是’;");
                            }
                            maxCodestr2 = label.Max(a => a.LotNo); ;
                            maxboxcode2 = label.Max(a => a.BoxNo);//箱号;
                            maxboxcode3 = label.Max(a => a.BoxNo3);//支号;
                            if (string.IsNullOrWhiteSpace(maxCodestr2))
                            {
                                maxCodestr2 = toDayTime2.Substring(2, 6) + "0001";
                            }
                        }
                    }
                    else
                    {
                        var maxCode = Db.Queryable<BllLabelBoxNo>().Max(a => a.LotNo);                        // 获取今天最大批次号
                        var maxCode = Db.Queryable<BllBoxInfo>().Where(m => m.Origin == "WMS生成").Max(a => a.LotNo);                        // 获取今天最大批次号
                        if (string.IsNullOrWhiteSpace(maxCode))
                        {
                            maxCodestr2 = toDayTime2.Substring(2, 6) + "0001";
@@ -868,7 +907,7 @@
                        }
                        //获取箱码
                        if (maxboxcode2 == "")
                        if (string.IsNullOrWhiteSpace(maxboxcode2))
                        {
                            maxboxcode2 = "B"+maxCodestr2 + "000001"; // 箱号     批号+第几箱
                        }
@@ -912,7 +951,7 @@
                                }
                            }
                            
                            if (maxboxcode3 == "")
                            if (string.IsNullOrWhiteSpace(maxboxcode3))
                            {
                                maxboxcode3 = "Z"+maxCodestr2 + "0001"; // 支号     批号+第几箱 
                            }
@@ -975,7 +1014,7 @@
                        Db.Updateable(asnList).ExecuteCommand();
                    } 
                }
                Db.CommitTran();
                return modelList;
@@ -983,6 +1022,7 @@
            }
            catch (Exception e)
            {
                Db.RollbackTran();
                throw new Exception(e.Message);
            }
        }
@@ -1512,7 +1552,7 @@
                                        model1.Qty = item.Qty;// 数量
                                        model1.BoxNo = item.BoxNo3;                 // 支号     
                                        model.ImgStr = BarcodeHelper.GetCodeBarBase64(model1.BoxNo, 160, 40, false);
                                        model1.ImgStr = BarcodeHelper.GetCodeBarBase64(model1.BoxNo, 160, 40, false);
                                        // 添加到list集合
                                        printModelList.Add(model1);
@@ -1543,9 +1583,6 @@
                #endregion
                //dataContext.WmsLabelPrintLog.InsertAllOnSubmit(printlog);
                //    dataContext.SubmitChanges();
                //    return printModel;
                return printModelList;
            }
            catch (Exception e)
Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs
@@ -48,7 +48,7 @@
                  .AndIF(!string.IsNullOrWhiteSpace(model.PalletNo), it => it.PalletNo.Contains(model.PalletNo.Trim()))
                  .AndIF(!string.IsNullOrWhiteSpace(model.LocatNo), it => it.LocatNo.Contains(model.LocatNo.Trim()))
                  .AndIF(!string.IsNullOrEmpty(model.RoadwayNo), a => a.RoadwayNo == model.RoadwayNo)
                  .AndIF(!string.IsNullOrEmpty(model.WareHouseNo), a => a.RoadwayNo == model.WareHouseNo)
                  .AndIF(!string.IsNullOrEmpty(model.WareHouseNo), a => a.WareHouseNo == model.WareHouseNo)
                  .AndIF(strList.Count>0, it => strList.Contains((int)it.ASNDetailNo))
                  .AndIF(!string.IsNullOrWhiteSpace(model.LotNo), it => it.LotNo.Contains(model.LotNo.Trim()))
                  .AndIF(!string.IsNullOrWhiteSpace(model.LotText), it => it.LotText.Contains(model.LotText.Trim()))
@@ -664,6 +664,314 @@
        }
        #endregion
        // 申请巷道
        public OutCommandDto RequestRoadWay(string palletNo, string houseNo)
        {
            try
            {
                //验证托盘条码是否为空
                if (string.IsNullOrEmpty(palletNo))
                {
                    throw new Exception("请输入要申请的托盘条码");
                }
                //验证所属仓库是否为空
                if (string.IsNullOrEmpty(houseNo))
                {
                    throw new Exception("请选择所属仓库");
                }
                //验证是否为平库入库
                if (houseNo == "W02")
                {
                    throw new Exception("平库请使用PDA手持进行平库入库");
                }
                OutCommandDto comDto;//返回wcs的入库命令
                var isHaveLocateNo = false; //托盘绑定信息中是否已有指定储位
                var stock = Db.Queryable<SysPallets>().First(a => a.PalletNo == palletNo);//托盘信息
                //判断托盘条码是否有效
                if (stock == null)
                {
                    throw new Exception("托盘条码不受WMS管理,不可入库!");
                }
                #region
                //查询托盘绑定信息(状态为等待入库的)
                var palletBindList = Db.Queryable<BllPalletBind>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo && m.Status != "2").ToList();
                var haveLocate = palletBindList.FirstOrDefault(m => !string.IsNullOrWhiteSpace(m.LocatNo));
                var skuList = Db.Queryable<SysMaterials>().Where(m => m.IsDel == "0").ToList();
                //物料类别信息
                var skuCategoryList = Db.Queryable<SysMaterialCategory>().Where(m => m.IsDel == "0").ToList();
                var skuNo = ""; //入库物料
                if (palletBindList.Count >= 1) //正常入库
                {
                    var palletBind = palletBindList.FirstOrDefault(m => m.Status == "1");//查询是否有正在执行的托盘绑定
                    if (palletBind != null)
                    {
                        var beingTask = Db.Queryable<LogTask>().First(m => m.IsDel == "0" && m.TaskNo == palletBind.TaskNo);
                        if (beingTask == null)
                        {
                            throw new Exception("该托盘正在入库,但未查询到任务信息");
                        }
                        comDto = new OutCommandDto()
                        {
                            PalletNo = palletNo,//托盘号
                            StartRoadway = beingTask.StartRoadway, // 起始巷道
                            StartLocate = "", // 起始位置
                            EndLocate = beingTask.EndLocat, // 目标位置
                            EndRoadway = beingTask.EndRoadway, //  目标巷道
                            TaskNo = beingTask.TaskNo, // 任务号
                            TaskType = "0",// 任务类型 (出库)
                            OutMode = "",  //目标地址
                            Order = 1
                        };
                        return comDto;
                    }
                    if (haveLocate != null)
                    {
                        isHaveLocateNo = true; //已有指定储位
                    }
                    if (palletBindList.First().Type == "0") //物料托入库
                    {
                        //判断是否绑定单据及单据状态是否正常
                        foreach (var item in palletBindList)
                        {
                            var notice = Db.Queryable<BllArrivalNotice>().First(m => m.IsDel == "0" && m.ASNNo == item.ASNNo);
                            if (notice == null)
                            {
                                throw new Exception("托盘存在物料未绑定入库单,不可入库!");
                            }
                            if (notice.Status == "3")
                            {
                                throw new Exception($"入库单{item.ASNNo}已关闭,不可入库!");
                            }
                        }
                        //获取物料存放区域
                        var noticeDetail = Db.Queryable<BllArrivalNoticeDetail>().First(m =>
                            m.IsDel == "0" && m.Id == palletBindList.First().ASNDetailNo);
                        if (noticeDetail == null)
                        {
                            throw new Exception("托盘存在物料未绑定入库单明细,不可入库");
                        }
                        skuNo = noticeDetail.SkuNo;
                    }
                    else if (palletBindList.First().Type == "1")//空托盘
                    {
                        skuNo = "100099";
                    }
                }
                else //回流入库
                {
                    var stockDetail = Db.Queryable<DataStockDetail>().Where(m => m.PalletNo == palletNo).ToList();
                    if (stockDetail.Count == 0)
                    {
                        throw new Exception($"{palletNo}托盘条码不具有箱码信息,不可入库!");
                    }
                    skuNo = stockDetail.First().SkuNo;
                    //获取对应回库规则
                    var function = Db.Queryable<SysFunSetting>().First(a => a.IsDel == "0" && a.FunSetName == "托盘回库验证" && a.IsEnable == "NO");
                    #region 托盘回库规则
                    if (function != null)
                    {
                        //拣货完成后允许托盘回库
                        if (function.SetValue == "CompletePick")
                        {
                            var allot = Db.Queryable<BllExportAllot>().First(a => a.IsDel == "0" && a.LotNo == stockDetail[0].LotNo && a.PalletNo == palletNo && a.SkuNo == stockDetail[0].SkuNo);
                            //验证拣货明细是否存在
                            if (allot != null)
                            {
                                //验证当前托盘拣货信息是否已完成
                                if (allot.Status != "5")
                                {
                                    throw new Exception("当前托盘拣货信息未完成,请完成后回库!");
                                }
                            }
                        }
                    }
                    #endregion
                }
                var allotLocate = new AllotLocation();
                SysStorageLocat locate;
                var sku = skuList.FirstOrDefault(m => m.SkuNo == skuNo);
                if (sku == null)
                {
                    throw new Exception("物料信息中未查询到入库单明细包含的物料信息,不可入库");
                }
                //判断物料是否含有类别信息
                if (string.IsNullOrWhiteSpace(sku.CategoryNo))
                {
                    throw new Exception($"物料:{sku.SkuNo}未查询到类别信息");
                }
                var skuCategory = skuCategoryList.FirstOrDefault(m => m.CategoryNo == sku.CategoryNo);
                if (skuCategory == null)
                {
                    throw new Exception($"未在类别信息中查询到物料:{sku.SkuNo}包含的类别");
                }
                var areaStr = skuCategory.AreaNo.Split(",");
                var areaList = new List<string>();
                foreach (var item in areaStr)
                {
                    areaList.Add(item);
                }
                var laneAllot = 0; //储位跳巷分配 0:跳着分配(一个一个分配)1:巷道按照优先级分配,同优先级顺序分配(一个巷道满了再分配下一个的巷道储位)
                var funSet3 = Db.Queryable<SysFunSetting>().First(m => m.IsDel == "0" && m.FunSetName == "储位跳巷分配" && m.IsEnable == "NO");
                if (funSet3 != null)
                {
                    switch (funSet3.SetValue)
                    {
                        case "JumpLaneAllot":
                            laneAllot = 0;//立库储位分配 巷道同优先级巷道跳着分配(一个一个分配)
                            break;
                        case "RankLaneAllot":
                            laneAllot = 1;//立库储位分配 巷道按照优先级分配,同优先级顺序分配(一个巷道满了再分配下一个的巷道储位)
                            break;
                        default:
                            laneAllot = 1;// 默认 跳着分配
                            break;
                    }
                }
                var roadList = Db.Queryable<SysStorageLocat>().Where(m => m.WareHouseNo == houseNo && areaList.Contains(m.AreaNo))
                    .GroupBy(m => m.RoadwayNo).Select(m => m.RoadwayNo).ToList();
                SysRoadwayUseLog useLog = Db.Ado.SqlQuerySingle<SysRoadwayUseLog>("select Top(1) * from SysRoadwayUseLog where IsDel=0 order by CreateTime desc"); //巷道最后一次使用记录
                var bindNum = Db.Queryable<BllPalletBind>()
                    .Where(m => m.IsDel == "0" && m.Status == "0" && !string.IsNullOrWhiteSpace(m.RoadwayNo))
                    .GroupBy(m => m.PalletNo).Select(m => m.PalletNo).Count();
                var roadNo = "";
                if (laneAllot == 0)//跳巷道平均分配
                {
                    //如果同级巷道有多条则查上次位置日志
                    if (roadList.Count > 1)
                    {
                        useLog = Db.Queryable<SysRoadwayUseLog>().OrderByDescending(l => l.Id).First();
                    }
                    //取各巷道所有排第一个合适位
                    foreach (var l in roadList)
                    {
                        //如果上次是当前巷道则跳出
                        if (useLog != null && l == useLog.RoadwayNo)
                        {
                            continue;
                        }
                        var locateCount = Db.Queryable<SysStorageLocat>()
                            .Where(m => m.Status == "0" && m.Flag == "0" && areaList.Contains(m.AreaNo)).Count();
                        if (locateCount- bindNum>0)
                        {
                            roadNo = l;
                        }
                        //当前巷有位置则退出
                        if (roadNo != null)
                        {
                            break;
                        }
                    }
                    //如果跳巷道并且未找到合适空储位,则跳到最后一次使用的巷道查询
                    if (roadNo == null)
                    {
                        if (useLog != null)
                        {
                            roadNo = useLog.RoadwayNo;
                        }
                    }
                }
                else//按照巷道优先级分配
                {
                    foreach (var item in roadList)
                    {
                        roadNo = item;
                        if (roadNo != null)
                        {
                            break;
                        }
                    }
                }
                if (string.IsNullOrWhiteSpace(roadNo))
                {
                    throw new Exception("未查询到空储位巷道");
                }
                Db.BeginTran();
                try
                {
                    if (roadNo != null)
                    {
                        //添加巷道使用记录
                        var log = new SysRoadwayUseLog
                        {
                            RoadwayNo = roadNo ,
                            WareHouseNo = houseNo,
                            Row = 0,
                            Column = 0,
                            Layer = 0,
                        };
                        Db.Insertable(log).ExecuteCommand();
                    }
                    if (palletBindList.Count >= 1)
                    {
                        foreach (var item in palletBindList)
                        {
                            item.WareHouseNo = houseNo;
                            item.RoadwayNo = roadNo;
                            item.TaskNo = "";
                        }
                        Db.Updateable(palletBindList).ExecuteCommand();
                    }
                    Db.CommitTran();
                    comDto = new OutCommandDto()
                    {
                        PalletNo = palletNo,//托盘号
                        StartRoadway = "",
                        StartLocate = "", // 起始位置
                        EndLocate = "", // 目标位置
                        EndRoadway = roadNo,   // 目标巷道
                        TaskNo = "", // 任务号
                        TaskType = "0",// 任务类型 (出库)
                        OutMode = "",  //目标地址
                        Order = 1
                    };
                }
                catch (Exception ex)
                {
                    Db.RollbackTran();
                    throw new Exception(ex.Message);
                }
                #endregion
                return null;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
        //申请储位
        public OutCommandDto RequestLocation(string palletNo, string houseNo, string roadwayNo)
        {
@@ -682,7 +990,7 @@
                //验证是否为平库入库
                if (houseNo == "W02")
                {
                    throw new Exception("零箱库请使用PDA手持进行平库入库");
                    throw new Exception("平库请使用PDA手持进行平库入库");
                }
                OutCommandDto comDto;//返回wcs的入库命令
@@ -864,21 +1172,21 @@
                Db.BeginTran();
                try
                {
                    if (locate != null)
                    {
                        //添加巷道使用记录
                        var log = new SysRoadwayUseLog
                        {
                            RoadwayNo = locate.RoadwayNo,
                            LocateNo = locate.LocatNo,
                            WareHouseNo = locate.WareHouseNo,
                            Row = locate.Row,
                            Column = locate.Column,
                            Layer = locate.Layer,
                            Depth = locate.Depth
                        };
                        Db.Insertable(log).ExecuteCommand();
                    }
                    //if (locate != null)
                    //{
                    //    //添加巷道使用记录
                    //    var log = new SysRoadwayUseLog
                    //    {
                    //        RoadwayNo = locate.RoadwayNo,
                    //        LocateNo = locate.LocatNo,
                    //        WareHouseNo = locate.WareHouseNo,
                    //        Row = locate.Row,
                    //        Column = locate.Column,
                    //        Layer = locate.Layer,
                    //        Depth = locate.Depth
                    //    };
                    //    Db.Insertable(log).ExecuteCommand();
                    //}
                    var taskNo = new Common().GetMaxNo("TK");
                    var exTask = new LogTask    //入库任务
@@ -1150,7 +1458,7 @@
                            #region 库存明细
                            var sd = new DataStockDetail()
                            {
                                LotNo = noticeDetail.LotNo,
                                LotNo = item.LotNo,
                                LotText = noticeDetail.LotText,
                                SupplierLot = noticeDetail.SupplierLot,
                                SkuNo = noticeDetail.SkuNo,
@@ -1250,7 +1558,7 @@
                            #region 库存 
                            var dataStock = Db.Queryable<DataStock>().First(m =>
                                m.IsDel == "0" && m.SkuNo == noticeDetail.SkuNo && m.LotNo == noticeDetail.LotNo);
                                m.IsDel == "0" && m.SkuNo == noticeDetail.SkuNo && m.LotNo == item.LotNo);
                            if (dataStock != null)
                            {
                                dataStock.Qty += item.Qty;
@@ -1263,7 +1571,7 @@
                                    SkuNo = noticeDetail.SkuNo,
                                    SkuName = noticeDetail.SkuName,
                                    Standard = noticeDetail.Standard,
                                    LotNo = noticeDetail.LotNo,
                                    LotNo = item.LotNo,
                                    LotText = noticeDetail.LotText,
                                    Qty = item.Qty,
                                    LockQty = 0,
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -1281,6 +1281,30 @@
            }
        }
        /// <summary>
        /// 验证储位地址(地码)是否可用
        /// </summary>
        /// <param name="locatNo">储位编码</param>
        /// <returns></returns>
        public string CheckLocatNo(string locatNo)
        {
            try
            {
                string strMsg = "";
                var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == locatNo && w.Status == "0" && w.WareHouseNo == "W02");
                if (storageLocat == null)
                {
                    throw new Exception("-1:地码(储位信息)不存在或非空闲状态,请核查!");
                }
                return strMsg;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        //根据箱码获取物料、批次、数量等信息
        public PdaPalletNoCheckDto GetBoxInfoByBoxNo(string boxNo)
        {
@@ -1687,9 +1711,24 @@
                        string[] LotNoList = item.LotNo.Split(';');
                        foreach (var item2 in LotNoList)
                        {
                            ArrivalNoticeDetailDto entry = new ArrivalNoticeDetailDto();
                            entry = item;
                            entry.LotNo = item2;
                            ArrivalNoticeDetailDto entry = new ArrivalNoticeDetailDto()
                            {
                                Id = item.Id,
                                ASNNo = item.ASNNo,
                                CompleteQty = item.CompleteQty,
                                CompleteTime = item.CompleteTime,
                                CreateTime = item.CreateTime,
                                Qty = item.Qty,
                                FactQty = item.FactQty,
                                LotNo = item2,
                                Money = item.Money,
                                PackagNo = item.PackagNo,
                                PackagName = item.PackagName,
                                Status = item.Status,
                                SkuNo = item.SkuNo,
                                SkuName = item.SkuName,
                            };
                            noticeList.Add(entry);
                        }
@@ -1877,6 +1916,7 @@
                        throw new Exception("-1:当前托盘正在执行中,绑定失败,请核实!");
                    }
                    bindId = bind.Id;
                    bind.Qty += model.SkuQty;
                }
                #region 箱码信息
@@ -1911,6 +1951,7 @@
                // 更改箱支关系表
                decimal factQty = 0.00m;//托盘总数量
                //成品组托
                if (model.SkuQty == 0)
                {
                    var boxGroup = boxInfoList.GroupBy(m => m.BoxNo).ToList();
@@ -1970,7 +2011,7 @@
                var sqlString = string.Empty;
                if (factQty == 0)
                {
                    sqlString += $"update BllArrivalNoticeDetail set FactQty = FactQty + '{bind.Qty}' where id = '{model.AsnDetailId}';";
                    sqlString += $"update BllArrivalNoticeDetail set FactQty = FactQty + '{model.SkuQty}' where id = '{model.AsnDetailId}';";
                }
                else
                {
@@ -2062,7 +2103,7 @@
                        throw new Exception("该托盘未在库外,请核查!");
                    }
                }
                #endregion
                #region 地码信息(储位信息)
@@ -2076,22 +2117,6 @@
                Db.BeginTran();//开启事务
                if (iscount == 0)//正常入库
                {
                    #region 箱码信息
                    var boxInfoList = Db.Queryable<BllBoxInfo>().Where(w => w.IsDel == "0" && w.ASNNo == model.ASNNo).ToList();
                    //验证箱码信息是否存在
                    if (boxInfoList.Count <= 0)
                    {
                        throw new Exception("箱码信息不存在,请核查!");
                    }
                    foreach (var item in boxInfoList)
                    {
                        item.Status = "2"; // 改变箱支关系表状态:已入库
                        item.UpdateTime = serverTime;
                        item.UpdateUser = model.CreateUser;
                    }
                    Db.Updateable(boxInfoList).ExecuteCommand();
                    #endregion
                    #region 入库总单信息
                    var notice = Db.Queryable<BllArrivalNotice>().First(a => a.IsDel == "0" && a.Status != "3" && a.ASNNo == model.ASNNo);
                    //验证入库单总单是否关闭
@@ -2103,6 +2128,30 @@
                    if (notice.Status == "3")
                    {
                        throw new Exception("入库单总单已关闭,请核查!");
                    }
                    #endregion
                    #region 箱码信息
                    var boxInfoList = Db.Queryable<BllBoxInfo>().Where(w => w.IsDel == "0" && w.ASNNo == model.ASNNo).ToList();
                    // type 0:成品入库 1:采购入库 2:中间品入库 3:退货入库 4:车间余料退回入库 5:其它入库 6:代储入库 7:寄存入库
                    if (notice.Type == "2" || notice.Type == "6" || notice.Type == "7")
                    {
                        // 不贴码物料 无需验证箱码信息
                    }
                    else
                    {
                        //验证箱码信息是否存在
                        if (boxInfoList.Count <= 0)
                        {
                            throw new Exception("箱码信息不存在,请核查!");
                        }
                        foreach (var item in boxInfoList)
                        {
                            item.Status = "2"; // 改变箱支关系表状态:已入库
                            item.UpdateTime = serverTime;
                            item.UpdateUser = model.CreateUser;
                        }
                        Db.Updateable(boxInfoList).ExecuteCommand();
                    }
                    #endregion
@@ -2194,7 +2243,7 @@
                            ASNDetailNo = (int)bindInfo.ASNDetailNo,
                            WareHouseNo = "W02",
                            RoadwayNo = "",
                            AreaNo = "",
                            AreaNo = storageLocat.AreaNo,
                            LocatNo = model.LocatNo,
                            PalletNo = model.PalletNo,
                            PalletNo2 = bindInfo.PalletNo2,
@@ -2219,6 +2268,7 @@
                    {
                        stId = detailModel.Id;
                        detailModel.LocatNo = model.LocatNo;
                        detailModel.AreaNo = storageLocat.AreaNo;
                        detailModel.UpdateTime = serverTime;
                        detailModel.UpdateUser = (int)model.CreateUser;
                        // 变更储位地址
Wms/WMS.BLL/DataServer/StockDetailServer.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using Model.ModelDto.DataDto;
using SqlSugar;
using WMS.DAL;
using WMS.Entity.Context;
@@ -33,33 +34,33 @@
        /// <param name="bitBoxMark">零箱标记</param>
        /// <param name="inspectStatus">质量状态</param>
        /// <returns></returns>
        public List<DataStockDetail> GetBindList(string skuNo, string skuName, string palletNo, string lotNo, string boxNo, string status, string inspectMark, string bitPalletMark, string bitBoxMark, string inspectStatus)
        public List<StockDetailDto> GetBindList(string skuNo, string skuName, string palletNo, string lotNo, string boxNo, string status, string inspectMark, string bitPalletMark, string bitBoxMark, string inspectStatus)
        {
            string str = "select Id,LotNo,LotText,SupplierLot,SkuNo,SkuName,Qty,LockQty,FrozenQty,WareHouseNo,AreaNo,LocatNo,PalletNo,PalletNo2,PalletNo3,InspectMark,BitPalletMark from DataStockDetail where IsDel = @isdel";
            string str = "select detail.*,house.WareHouseNo + '-' + house.WareHouseName as WareHouseName,roadway.RoadwayNo + '-' + roadway.RoadwayName as RoadwayName,area.AreaNo + '-' + area.AreaName as AreaName from DataStockDetail detail left join SysStorageRoadway roadway on detail.RoadwayNo = roadway.RoadwayNo left join SysWareHouse house on detail.WareHouseNo = house.WareHouseNo left join SysStorageArea area on detail.AreaNo = area.AreaNo where detail.IsDel = @isdel";
            //判断物料号是否为空
            if (!string.IsNullOrEmpty(skuNo))
            {
                str += " and SkuNo like @skuno";
                str += " and detail.SkuNo like @skuno";
            }
            //判断物料名称是否为空
            if (!string.IsNullOrEmpty(skuName))
            {
                str += " and SkuName like @skuname";
                str += " and detail.SkuName like @skuname";
            }
            //判断托盘号是否为空
            if (!string.IsNullOrEmpty(palletNo))
            {
                str += " and PalletNo like @palletno";
                str += " and detail.PalletNo like @palletno";
            }
            //判断批次是否为空
            if (!string.IsNullOrEmpty(lotNo))
            {
                str += " and LotNo like @lotno";
                str += " and detail.LotNo like @lotno";
            }
            //判断零托标记是否为空
            if (!string.IsNullOrEmpty(bitPalletMark))
            {
                str += " and BitPalletMark = @bitpalletmark";
                str += " and detail.BitPalletMark = @bitpalletmark";
            }
            int i = 0;
@@ -81,7 +82,7 @@
            if (!string.IsNullOrEmpty(inspectMark))
            {
                boxstr += " and InspectMark = @inspectmark";
                str += " and InspectMark = @inspectmark";
                str += " and detail.InspectMark = @inspectmark";
                i = 1;
            }
            //判断零箱标记是否为空
@@ -94,7 +95,7 @@
            if (!string.IsNullOrEmpty(inspectStatus))
            {
                boxstr += " and InspectStatus = @inspectstatus";
                str += " and InspectStatus = @inspectstatus";
                str += " and detail.InspectStatus = @inspectstatus";
                i = 1;
            }
            //将箱码数据进行排序
@@ -140,7 +141,7 @@
            //排序
            str += " order by PalletNo,SkuNo,LotNo";
            List<DataStockDetail> boxInforList = Db.Ado.SqlQuery<DataStockDetail>(str, new
            List<StockDetailDto> boxInforList = Db.Ado.SqlQuery<StockDetailDto>(str, new
            {
                isdel = "0", //是否删除
                skuno = "%" + skuNo + "%", //物料号
Wms/WMS.BLL/DataServer/StockServer.cs
@@ -107,7 +107,7 @@
        /// <returns></returns>
        public List<StockDetailDto> GetInventoryList1(string skuNo, string skuName, string lotNo, string locatNo, string palletNo, string status, string inspectStatus)
        {
            string str = "select detail.*,house.WareHouseName as WareHouseName,roadway.RoadwayName as RoadwayName  from DataStockDetail detail left join SysStorageRoadway roadway on detail.RoadwayNo = roadway.RoadwayNo left join SysWareHouse house on detail.WareHouseNo = house.WareHouseNo Where detail.IsDel = @isdel";
            string str = "select detail.*,house.WareHouseNo + '-' + house.WareHouseName as WareHouseName,roadway.RoadwayNo + '-' + roadway.RoadwayName as RoadwayName,area.AreaNo + '-' + area.AreaName as AreaName  from DataStockDetail detail left join SysStorageRoadway roadway on detail.RoadwayNo = roadway.RoadwayNo left join SysWareHouse house on detail.WareHouseNo = house.WareHouseNo left join SysStorageArea area on detail.AreaNo = area.AreaNo Where detail.IsDel = @isdel";
            //判断物料编码是否为空
            if (!string.IsNullOrEmpty(skuNo))
            {
Wms/WMS.BLL/Logic/AllotLocation.cs
@@ -63,7 +63,7 @@
                            //查询该巷道并且标志为正常的的储位
                            roadwayList.Add(roadway);
                            var locate = GetLocateByRoadways(roadwayList,areaList);
                            var locate = GetLocateByRoadways(roadwayList,areaList,true);
                            if (locate == null)
                            {
                                throw new Exception($"{roadwayNo}巷道没有合适的空储位");
@@ -107,8 +107,9 @@
        /// </summary>
        /// <param name="roadways">巷道集合</param>
        /// <param name="areaList">区域集合</param>
        /// <param name="isRoadway">是否指定巷道</param>
        /// <returns></returns>
        private SysStorageLocat GetLocateByRoadways(List<SysStorageRoadway> roadways,List<string> areaList)
        private SysStorageLocat GetLocateByRoadways(List<SysStorageRoadway> roadways,List<string> areaList,bool isRoadway = false)
        {
            try
            {
@@ -185,11 +186,15 @@
                    //取各巷道所有排第一个合适位
                    foreach (var l in roadways)
                    {
                        //如果上次是当前巷道则跳出
                        if (log != null && l.RoadwayNo == log.RoadwayNo)
                        if (!isRoadway)
                        {
                            continue;
                            //如果上次是当前巷道则跳出
                            if (log != null && l.RoadwayNo == log.RoadwayNo)
                            {
                                continue;
                            }
                        }
                        //取当前巷最优位置
                        locate = GetLocateByRoadway(l.RoadwayNo, topOrBom, leftOrRight, areaList);
                        //当前巷有位置则退出
@@ -199,11 +204,14 @@
                        }
                    }
                    //如果跳巷道并且未找到合适空储位,则跳到最后一次使用的巷道查询
                    if (locate == null)
                    if (!isRoadway)
                    {
                        if (log != null)
                        if (locate == null)
                        {
                            locate = GetLocateByRoadway(log.RoadwayNo, topOrBom, leftOrRight, areaList);
                            if (log != null)
                            {
                                locate = GetLocateByRoadway(log.RoadwayNo, topOrBom, leftOrRight, areaList);
                            }
                        }
                    }
                }
@@ -212,6 +220,10 @@
                    foreach (var item in roadways)
                    {
                        locate = GetLocateByRoadway(item.RoadwayNo, topOrBom, leftOrRight, areaList);
                        if (locate != null)
                        {
                            break;
                        }
                    }
                }
@@ -246,7 +258,7 @@
                sql += "order by ";
                sql += topOrBom == 0 ? "Layer desc, " : "Layer, ";
                sql += leftOrRight == 0 ? "[Column], " : "[Column] desc, ";
                sql += " Row desc; ";
                sql += " Row desc Depth desc; ";
                var locateList = db.Ado.SqlQuery<SysStorageLocat>(sql);
Wms/WMS.IBLL/IBllAsnServer/IPalletBindServer.cs
@@ -69,6 +69,13 @@
        #endregion
        /// <summary>
        /// 申请巷道
        /// </summary>
        /// <param name="palletNo">托盘号</param>
        /// <param name="houseNo">仓库号</param>
        /// <returns></returns>
        OutCommandDto RequestRoadWay(string palletNo, string houseNo);
        /// <summary>
        /// 申请空储位
        /// </summary>
        /// <param name="palletNo">托盘号</param>
Wms/WMS.IBLL/IDataServer/IStockDetailServer.cs
@@ -1,4 +1,5 @@
using System;
using Model.ModelDto.DataDto;
using System;
using System.Collections.Generic;
using System.Text;
using WMS.Entity.DataEntity;
@@ -22,7 +23,7 @@
        /// <param name="bitBoxMark">零箱标记</param>
        /// <param name="inspectStatus">质量状态</param>
        /// <returns></returns>
        List<DataStockDetail> GetBindList(string skuNo, string skuName, string palletNo, string lotNo, string boxNo, string status, string inspectMark, string bitPalletMark, string bitBoxMark, string inspectStatus);
        List<StockDetailDto> GetBindList(string skuNo, string skuName, string palletNo, string lotNo, string boxNo, string status, string inspectMark, string bitPalletMark, string bitBoxMark, string inspectStatus);
        /// <summary>
        /// 导出托盘明细
Wms/WMS.IBLL/IPdaServer/IPdaAsnServer.cs
@@ -55,6 +55,13 @@
        //根据托盘号获取入库单号
        string GetASNNoByPalletNo(string palletNo);
        /// <summary>
        /// 验证储位地址(地码)是否可用。
        /// </summary>
        /// <param name="LocatNo"></param>
        /// <returns></returns>
        string CheckLocatNo(string LocatNo);
        //根据箱码获取物料、批次、数量等信息
        PdaPalletNoCheckDto GetBoxInfoByBoxNo(string boxNo);
Wms/Wms/Controllers/PdaAsnController.cs
@@ -383,6 +383,26 @@
                return Ok(new { code = 1, msg = e.Message });
            }
        }
        /// <summary>
        /// 验证储位(地码)是否可用
        /// </summary>
        /// <param name="model">LocatNo储位地址</param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult CheckLocatNo(PalletBindVm model)
        {
            try
            {
                var result = _PdaAsnSvc.CheckLocatNo(model.LocatNo);
                return Ok(new { code = 0, msg = "验证成功!", data = result });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
        }
        #endregion
        #region 零箱入库
Wms/Wms/Controllers/StatisticalController.cs
@@ -98,7 +98,7 @@
        {
            try
            {
                List<DataStockDetail> boxInfoList = _stockDetail.GetBindList(skuNo, skuName, palletNo, lotNo, boxNo, status, inspectMark, bitPalletMark, bitBoxMark, inspectStatus);
                List<StockDetailDto> boxInfoList = _stockDetail.GetBindList(skuNo, skuName, palletNo, lotNo, boxNo, status, inspectMark, bitPalletMark, bitBoxMark, inspectStatus);
                return Ok(new { data = boxInfoList, code = 0, msg = "获取托盘明细成功" });
            }
            catch (Exception e)