yusijie
2024-04-25 3de6a9eb5d6c00a756831fbab13da264c198ece7
WebTM/views/²Ö´æ¹ÜÀí/²Ö¿âµ÷²¦/Cc_LookingForBill.html
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>找货单</title>
<title>下架找货单</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
@@ -45,6 +45,7 @@
                        <ul class="layui-tab-title" lay-filter="tab-all">
                            <li lay-id="1" style="padding:1px;display:none">表头信息</li>
                            <li lay-id="2" style="padding:1px;" class="layui-this">明细信息</li>
                            <li lay-id="3" style="padding:1px;">已扫信息</li>
                        </ul>
                        <div class="layui-tab-content">
                            <!--表头信息-->
@@ -121,6 +122,10 @@
                            <div class="layui-tab-item layui-show">
                                <table class="layui-hide" id="bzd-table" lay-filter="bzd-table"></table>
                            </div>
                            <!--已扫信息-->
                            <div class="layui-tab-item">
                                <table class="layui-hide" id="bzd-table2" lay-filter="bzd-table2"></table>
                            </div>
                        </div>
                    </div>
                    <div class="layer-footer" style="z-index: 10; position: fixed; text-align: center; bottom: 0; width:100%; height:50px">
@@ -174,6 +179,14 @@
            $("#HMakerID").val(sessionStorage["Czybm"]);
            $("#HMaker").val(sessionStorage["HUserName"]);
            //判断用户是否绑定班组和生产资源
            if ($("#HGroupID").val() == 0 || $("#HSourceID").val() == 0) {
                layer.confirm("该用户未绑定班组或生产资源!不允许找货!", {
                    icon: 4, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['确认退出']
                }, function () { window.location.href = "../../index.html"; });
            }
            //获取最大单据号 new
            $("#HInterID").val("");
            $("#HBillNo").val("");
@@ -195,15 +208,16 @@
                , page: true
                //, height: 256
                , cellMinWidth: 90
                , limit: 500
                , cols: [[
                    { type: 'numbers', title: '序号' }
                    , { field: 'HIsStatus', title: '是否扫码' }
                    , { field: 'HMTONo', title: '批号', width: 180 }
                    , { field: 'HSPID', title: '仓位ID', hide: true }
                    , { field: 'HSPName', title: '仓位' }
                    , { field: 'HSPName', title: '仓位', hide: true }
                    , { field: 'HStatus', title: '在库状态', width: 165 }
                    , { field: 'HWhID', title: '仓库ID', hide: true }
                    , { field: 'HWhName', title: '仓库' }
                    , { field: 'HWhName', title: '仓库', width: 130, hide: true }
                    , { field: 'HSourceInterID', title: '源单ID', hide: true }
                    , { field: 'HSourceBillNo', title: '源单号', width: 110 }
                    , { field: 'HGroupID', title: '班组ID', hide: true }
@@ -228,9 +242,53 @@
                }
            };
            //主表列表-已扫信息
            var option2 = {
                elem: '#bzd-table2'
                //, toolbar: '#toolbarDemo'
                , page: true
                //, height: 256
                , cellMinWidth: 90
                , limit: 500
                , cols: [[
                    { type: 'numbers', title: '序号' }
                    , { field: 'HIsStatus', title: '是否扫码' }
                    , { field: 'HMTONo', title: '批号', width: 180 }
                    , { field: 'HSPID', title: '仓位ID', hide: true }
                    , { field: 'HSPName', title: '仓位', hide: true }
                    , { field: 'HStatus', title: '在库状态', width: 165 }
                    , { field: 'HWhID', title: '仓库ID', hide: true }
                    , { field: 'HWhName', title: '仓库', width: 130, hide: true }
                    , { field: 'HSourceInterID', title: '源单ID', hide: true }
                    , { field: 'HSourceBillNo', title: '源单号', width: 110 }
                    , { field: 'HGroupID', title: '班组ID', hide: true }
                    , { field: 'HGroup', title: '班组' }
                    , { field: 'HSourceID', title: '生产资源ID', hide: true }
                    , { field: 'HSource', title: '生产资源', width: 115, templet: '#sexTpl' }
                    , { field: 'HQty', title: '数量' }
                    , { field: 'HMaterID', title: '物料ID', hide: true }
                    , { field: 'HMaterName', title: '物料名称', width: 120 }
                    , { field: 'HMaterNumber', title: '物料编码' }
                    , { field: 'HMaterModel', title: '规格型号' }
                    , { field: '即时库存', title: '即时库存' }
                    , { field: 'HBarCode', title: '条码编号', hide: true }
                    , { field: 'HInterID', title: '单据ID', hide: true }
                    , { field: 'HBillNo', title: '单据号' }
                    , { field: 'HMakerID', title: '制单人ID', hide: true }
                    , { field: 'HMaker', title: '制单人' }
                    , { field: 'HBillType', title: 'HBillType', hide: true }
                ]]
                , text: {
                    none: '暂无相关数据,请先扫描实物条码!' //默认:无数据。注:该属性为 layui 2.2.5 å¼€å§‹æ–°å¢ž
                }
            };
            //初始加载表格
            option.data = [];
            table.render(option);
            option2.data = [];
            table.render(option2);
            //进入页面默认光标在源单号上
            $("#HSourceBillNo").focus();
@@ -285,9 +343,9 @@
                                        rowFlage += i + 1 + ",";
                                    }
                                }
                                if (rowFlage) {
                                    layer.msg("第" + rowFlage + "行数据无条码,请先生成条码!", { icon: 5, btn: ['我已知晓'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                }
                                //if (rowFlage) {
                                //    layer.msg("第" + rowFlage + "行数据无条码,请先生成条码!", { icon: 5, btn: ['我已知晓'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                //}
                                $("#HSourceBillNo").attr("readonly", "readonly");//源单号只读
                                $("#HSourceBillNo").css("background-color", "#efefef4d");
                                element.tabChange('tab-LookingForBill', '2');  //跳转页签
@@ -305,6 +363,7 @@
                }
            });
            var data = new Object();
            //扫实物条码
            $('#HBarCode').on('keydown', function (event) {
                var HBarCode = $('#HBarCode').val()
@@ -338,15 +397,20 @@
                                sSubStr[i].HMaker = $("#HMaker").val();
                                option.data = table.cache["bzd-table"];
                                table.render(option);
                                layer.close(index);
                                $('#HBarCode').val("");
                                //动态获取已扫码记录并添加到已扫信息中
                                table.cache["bzd-table2"].push(sSubStr[i]);
                                option2.data = table.cache["bzd-table2"];
                                table.render(option2);
                                element.tabChange('tab-LookingForBill', '3');//跳转页签
                                layer.close(index);
                                layer.msg("扫码成功!", { icon: 1, time: 1000 });
                            }
                        }
                    }
                    if (rowCount == 0) {
                        layer.close(index);
                        layer.msg("无效条码!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        layer.msg("您扫的条码不在找货清单中!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
@@ -429,18 +493,18 @@
            form.on('submit(Saver)', function (data) {//提交
                //debugger;
                //var sMainStr = JSON.stringify(data.field);
                var tableData = table.cache['bzd-table'];
                for (var i = 0; i < tableData.length; i++) {
                    if (tableData[i].HIsStatus == "是" ) {
                var tableData = table.cache['bzd-table2'];
                //for (var i = 0; i < tableData.length; i++) {
                //    if (tableData[i].HIsStatus == "是" ) {
                    } else {
                        //移除当前行
                        tableData.splice(i, 1);
                        i--;
                        option.data = tableData;
                        table.render(option);
                    }
                }
                //    } else {
                //        //移除当前行
                //        tableData.splice(i, 1);
                //        i--;
                //        option.data = tableData;
                //        table.render(option);
                //    }
                //}
                var sSubStr = JSON.stringify(tableData);
                sSubStr = "{\"oSub\": " + sSubStr + "}";
                //sSubStr = JSON.stringify(sSubStr);