zgq
2021-08-05 e4fc4be3a162854c2acbd521c72bd1c8c7d39d01
扫码详情
1个文件已添加
3个文件已修改
1434 ■■■■■ 已修改文件
WebTM/WebTM.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/layuiadmin/Scripts/webConfig.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/Baseset/基础资料/WMSBarCodeDetailsList.html 166 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/领料发货/领料出库/Kf_MateOutBill_Fast.html 1264 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/WebTM.csproj
@@ -300,6 +300,7 @@
    <Content Include="views\Baseset\基础资料\Gy_StockPlaceList.html" />
    <Content Include="views\Baseset\基础资料\Gy_SupplierList.html" />
    <Content Include="views\Baseset\基础资料\Gy_WarehouseList.html" />
    <Content Include="views\Baseset\基础资料\WMSBarCodeDetailsList.html" />
    <Content Include="views\component\anim\index.html" />
    <Content Include="views\component\auxiliar\index.html" />
    <Content Include="views\component\badge\index.html" />
WebTM/layuiadmin/Scripts/webConfig.js
@@ -1,9 +1,10 @@
function GetWEBURL() {
    var WEBURL = "http://61.130.49.162:9090/WMSAPI//";  //开山外网
    //var WEBURL = "http://61.130.49.162:9090/WMSAPI//";  //开山外网
    //var WEBURL = "http://192.168.16.80:8011/";          //办公室服务器
    //var WEBURL = "http://192.168.235.1:8011/";          //陈航
    //var WEBURL = "http://192.168.3.7:8011/";            //家里无线
    //var WEBURL = "http://localhost:8086/API";
    var WEBURL = "http://localhost:8085/API/";   //zgq本地
    //61.130.49.162:9090
    //WEBURL = "";
    return WEBURL
WebTM/views/Baseset/»ù´¡×ÊÁÏ/WMSBarCodeDetailsList.html
New file
@@ -0,0 +1,166 @@
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>扫码详情列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <style type="text/css">
        .layui-form-label {
            width: 85px;
        }
    </style>
</head>
<body>
    <div id="layout1" class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body" style="padding: 15px;">
                        <form class="layui-form" action="" lay-filter="component-form-group">
                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <!--<button type="button" lay-submit="" class="layui-btn" lay-filter="FH">返回</button>-->
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="Exit">退出</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
    <script type="text/html" id="barDemo">
        <!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , laydate = layui.laydate
                , element = layui.element;
            //获取参数
            function getUrlVars() {
                var vars = [], hash;
                var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
                for (var i = 0; i < hashes.length; i++) {
                    hash = hashes[i].split('=');
                    vars.push(hash[0]);
                    vars[hash[0]] = hash[1];
                }
                return vars;
            }
            var params = getUrlVars();
            var HInterID = params[params[0]];
            var HBillType = params[params[1]];
            form.on('submit(FH)', function () {
                var checkStatus = table.checkStatus('ck-table')
                    , data = checkStatus.data;
                parent.GetHKeeperValue(data);
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            });
            form.on('submit(Exit)', function () {
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            });
            RoadQuery(HInterID, HBillType);
            table.render({
                elem: '#mainTable'
                // , url: '/demo/table/user/'
                //, toolbar: '#toolbarDemo'
                , data: []
                //, cellMinWidth: 80 //全局定义常规单元格的最小宽度,layui 2.2.1 æ–°å¢ž
                , height: 'full-1000'
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HInterID', width: 150, title: 'HInterID', hide: true }//, hide: true
                    , { field: 'HBillType', width: 150, title: '单据类型' }
                    , { field: 'HMaterID', width: 150, title: 'HMaterID', hide: true }
                    , { field: 'HMaterNumber', width: 150, title: '产品编码' }
                    , { field: 'HMaterName', width: 150, title: '产品名称' }
                    , { field: 'HMaterModel', width: 150, title: '规格型号' }
                    , { field: 'HQty', width: 150, title: '数量' }
                    , { field: 'HQtyMust', width: 150, title: '应收数量' }
                    , { field: 'HBatchNo', width: 150, title: '批次' }
                    , { field: 'HPieceQty', width: 150, title: '件数' }
                    , { fixed: 'right', width: 70, title: '操作', toolbar: '#barDemo' }
                ]]
                //, page: true
            });
            ///加载显示数据
            function RoadQuery(HInterID, HBillType) {
                $.ajax({
                    type: "get",
                    url: GetWEBURL() + "/Web/GetWMSBarCodeDetailsList",
                    async: true,
                    data: { "HInterID": HInterID, "HBillType": HBillType },
                    success: function (result) {
                        ajaxReturnData = JSON.parse(JSON.stringify(result)).data;
                        table.reload('mainTable', {
                            data: ajaxReturnData
                            , height: 'full-1000'
                            , loading: false
                            , done: function (index, res) {
                            }
                        });
                    },
                    error: function (result) {
                        console.log(result);
                        //layer.msg('获取采购订单出现异常', { icon: 2, time: 2000 });
                    }
                });
            };
            //行内事件
            table.on('tool(mainTable)', function (obj) {
                var data = obj.data;
                if (obj.event === 'del') {
                    layer.confirm('真的删除行么', function (index) {
                        $.ajax({
                            url: GetWEBURL() + '/Web/DelCacheList',
                            type: "GET",
                            data: { "sHitemID": data.HitemID },
                            success: function (data) {
                                if (data.count == 1) {
                                    layer.close(index);
                                    obj.del(); //删除对应行(tr)的DOM结构
                                    layer.msg('删除成功');
                                } else {
                                    layer.alert(data.code + data.msg, { icon: 5 });
                                }
                            }, error: function () {
                                layer.msg("接口请求失败!", {
                                    icon: 5, btn: ['确认'], time: 100000, offset: 't',
                                    skin: 'layui-layer-lan', title: "温馨提示"
                                });
                            }
                        });
                    });
                }
            });
            //以上为layui模块
        });
    </script>
</body>
</html>
WebTM/views/ÁìÁÏ·¢»õ/ÁìÁϳö¿â/Kf_MateOutBill_Fast.html
@@ -8,6 +8,18 @@
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <style>
        /*.layui-table-body{
            height:auto;
        }*/
        .layui-table-fixed .layui-table-body {
            height: auto !important;
        }
        .layui-table-fixed.layui-hide {
            display: block !important;
        }
    </style>
</head>
<!--<style>
    @media screen and (max-width: 450px) {
@@ -32,6 +44,7 @@
        }
    }
</style>-->
<body>
    <div class="layui-fluid">
        <div class="layui-card" style="padding: 1px">
@@ -79,7 +92,7 @@
                                                <option value="-1">手工录入</option>
                                            </select>
                                        </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-row">
@@ -89,10 +102,10 @@
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" autocomplete="off" class="layui-input">
                                        </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-tab-item" >
                            <div class="layui-tab-item">
                                <div class="layui-form-item" style="padding:0px;margin:0px">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
@@ -210,13 +223,13 @@
                                        </div>
                                    </div>
                                </div>
                                <table class="layui-hide" id="wl-table" lay-filter="wl-table" ></table>
                                <table class="layui-hide" id="wl-table" lay-filter="wl-table"></table>
                            </div>
                            <div class="layui-tab-item">
                                <table class="layui-hide" id="mx-table" lay-filter="mx-table"></table>
                            </div>
                            <div class="layui-tab-item">
                                <table class="layui-hide" id="fj-table-qd" lay-filter="fj-table-qd" ></table>
                                <table class="layui-hide" id="fj-table-qd" lay-filter="fj-table-qd"></table>
                            </div>
                        </div>
                        <div class="layui-form-item" style="margin-bottom: 20px;">
@@ -244,236 +257,240 @@
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    </script>
    <script>
    layui.config({
        base: '../../../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
        var $ = layui.$
        , admin = layui.admin
        , layer = layui.layer
        , table = layui.table
        , form = layui.form
        , element = layui.element;
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , element = layui.element;
        $("#HWHID").val(sessionStorage["HWHID"]);
        $("#HWHNAME").val(sessionStorage["HWHName"]);
        $("#HStockPlaceID").val(sessionStorage["HSPID"]);
        $("#HStockPlaceName").val(sessionStorage["HSPName"]);
        //$("#HSupID").val(sessionStorage["HSupID"]);
        //$("#HSupName").val(sessionStorage["HSupName"]);
        $("#HDeptID").val(sessionStorage["HDeptID"]);
        $("#HDeptName").val(sessionStorage["HDept"]);
        $("#HSecManagerID").val(sessionStorage["HSecManagerID"]);
        $("#HSecManager").val(sessionStorage["HSecManager"]);
        $("#HKeeperID").val(sessionStorage["HKeeperID"]);
        $("#HKeeper").val(sessionStorage["HKeeper"]);
        $("#HMaker").val(sessionStorage["HUserName"]);
        $("#HMaker").hide();
        $("#HMakerID").hide();
        $("#HBillerID").val(sessionStorage["HBillerID"]);
        $("#HBillerID").hide();
            $("#HWHID").val(sessionStorage["HWHID"]);
            $("#HWHNAME").val(sessionStorage["HWHName"]);
            $("#HStockPlaceID").val(sessionStorage["HSPID"]);
            $("#HStockPlaceName").val(sessionStorage["HSPName"]);
            //$("#HSupID").val(sessionStorage["HSupID"]);
            //$("#HSupName").val(sessionStorage["HSupName"]);
            $("#HDeptID").val(sessionStorage["HDeptID"]);
            $("#HDeptName").val(sessionStorage["HDept"]);
            $("#HSecManagerID").val(sessionStorage["HSecManagerID"]);
            $("#HSecManager").val(sessionStorage["HSecManager"]);
            $("#HKeeperID").val(sessionStorage["HKeeperID"]);
            $("#HKeeper").val(sessionStorage["HKeeper"]);
            $("#HMaker").val(sessionStorage["HUserName"]);
            $("#HMaker").hide();
            $("#HMakerID").hide();
            $("#HBillerID").val(sessionStorage["HBillerID"]);
            $("#HBillerID").hide();
        //获取参数
        function getUrlVars() {
            var vars = [], hash;
            var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < hashes.length; i++) {
                hash = hashes[i].split('=');
                vars.push(hash[0]);
                vars[hash[0]] = hash[1];
            //获取参数
            function getUrlVars() {
                var vars = [], hash;
                var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
                for (var i = 0; i < hashes.length; i++) {
                    hash = hashes[i].split('=');
                    vars.push(hash[0]);
                    vars[hash[0]] = hash[1];
                }
                return vars;
            }
            return vars;
        }
        var params = getUrlVars();
        var linterid = params[params[0]]; //从参数中获取 å•据内码
        var lSourceBillType = params[params[2]];  //从单据获取 æºå•类型
            var params = getUrlVars();
            var linterid = params[params[0]]; //从参数中获取 å•据内码
            var lSourceBillType = params[params[2]];  //从单据获取 æºå•类型
        function RoadBillMain(linterid)//加载表头
        {
            $.ajax({
                url: GetWEBURL() + "/Web/GetPonderationBill",
                type: "GET",
                data: { "HInterID": linterid },
                success: function (d) {
                    // console.log(d.data);
                    $("#HInterID").val(d.data[0].HInterID);
                    $("#HBillNo").val(d.data[0].HBillNo);
                    $("#HBillType").val(d.data[0].HSourceBillType);
                    $("#HSourceBillNo").val(d.data[0].HSourceBillNo);
                    //$("#HWHID").val(d.data[0].HWhID);
                    //$("#HKeeperID").val(d.data[0].HKeeperID);
                    //$("#HSecManagerID").val(d.data[0].HSecManagerID);
                    //$("#HDeptID").val(d.data[0].HDeptID);
                    //$("#HBarCode").val(d.data[0].HBarCode);
                    //$("#HQty").val(d.data[0].HQty);
                }
            })
        }
            function RoadBillMain(linterid)//加载表头
            {
                $.ajax({
                    url: GetWEBURL() + "/Web/GetPonderationBill",
                    type: "GET",
                    data: { "HInterID": linterid },
                    success: function (d) {
                        // console.log(d.data);
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HBillType").val(d.data[0].HSourceBillType);
                        $("#HSourceBillNo").val(d.data[0].HSourceBillNo);
                        //$("#HWHID").val(d.data[0].HWhID);
                        //$("#HKeeperID").val(d.data[0].HKeeperID);
                        //$("#HSecManagerID").val(d.data[0].HSecManagerID);
                        //$("#HDeptID").val(d.data[0].HDeptID);
                        //$("#HBarCode").val(d.data[0].HBarCode);
                        //$("#HQty").val(d.data[0].HQty);
                    }
                })
            }
        function RoadBillSub(linterid)//加载表体
        {
            table.render({
                elem: '#wl-table'
                , url: GetWEBURL1() + '/MateOutBill/DisBillEntryList_Webs_New_Json'
                //, cellMinWidth: 80
                , toolbar: '#toolbarDemo'
                , where: { HBillID: linterid, HBillType: '1204', sWhere: '' }
                , cols: [[
                  { type: 'radio' }
                , { field: 'HSNO', title: '序号', width: 60 }
                , { field: 'HQty', title: '数量', width: 80 }
                , { field: 'HQtyMust', title: '应收数量', width: 80 }
                , { field: 'HMaterName', title: '物料名称', width: 90 }
                , { field: 'HMaterNumber', title: '物料代码', width: 110 }
                , { field: 'HMaterModel', title: '规格型号', width: 90 }
                , { field: 'HSourceInterID', title: '源单主内码', width: 90 }
                , { field: 'HSourceEntryID', title: '源单子内码', width: 90 }
                , { field: 'HSourceBillNo', title: '源单单号', width: 90 }
                , { field: 'HBatchNo', title: '批次', width: 90 }
                ]]
                // , data: [linterid]
                // , page: true
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            function RoadBillSub(linterid)//加载表体
            {
                table.render({
                    elem: '#wl-table'
                    , url: GetWEBURL1() + '/MateOutBill/DisBillEntryList_Webs_New_Json'
                    //, cellMinWidth: 80
                    , toolbar: '#toolbarDemo'
                    , where: { HBillID: linterid, HBillType: '1204', sWhere: '' }
                    , cols: [[
                        { type: 'radio' }
                        , { field: 'HSNO', title: '序号', width: 60 }
                        , { field: 'HQty', title: '数量', width: 80 }
                        , { field: 'HQtyMust', title: '应收数量', width: 80 }
                        , { field: 'HMaterName', title: '物料名称', width: 90 }
                        , { field: 'HMaterNumber', title: '物料代码', width: 110 }
                        , { field: 'HMaterModel', title: '规格型号', width: 90 }
                        , { field: 'HSourceInterID', title: '源单主内码', width: 90 }
                        , { field: 'HSourceEntryID', title: '源单子内码', width: 90 }
                        , { field: 'HSourceBillNo', title: '源单单号', width: 90 }
                        , { field: 'HBatchNo', title: '批次', width: 90 }
                        , { fixed: 'right', title: '操作', toolbar: '#barDemo', width: 70 }
                    ]]
                    // , data: [linterid]
                    // , page: true
                    , height: 500
                    , done: function () {
                        layer.closeAll("loading");
                    }
                });
            }
            //动态加载源单类型列表 new
            //表头初始化赋值(根据登录用户获取 é»˜è®¤ä»“库、部门、验收、保管、金蝶用户) new
            //获取最大单据号 new
            //默认带入的仓库,如果启用仓位则仓位有效,如果没有启用则仓位灰度 new
            //判断是否新增
            if (linterid == null || linterid == 0) {
                $("#HInterID").val("");
                $("#HBillNo").val("");
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '1204' },
                    success: function (d) {
                        //console.log(d.data);
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HBillNo").val(d.data[0].HBillNo);
                    }
                });
            }
            else {//如果修改则走下面 new
                RoadBillMain(linterid);
                RoadBillSub(linterid);
            }
            form.on('submit(HWHID-BT)', function () {//选择仓库
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '仓库列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_WarehouseList.html?Type=HWHID', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
        }
        //动态加载源单类型列表 new
        //表头初始化赋值(根据登录用户获取 é»˜è®¤ä»“库、部门、验收、保管、金蝶用户) new
        //获取最大单据号 new
        //默认带入的仓库,如果启用仓位则仓位有效,如果没有启用则仓位灰度 new
        //判断是否新增
        if (linterid == null || linterid == 0) {
            $("#HInterID").val("");
            $("#HBillNo").val("");
            $.ajax({
                url: GetWEBURL() + "/Web/GetMAXNum",
                type: "GET",
                data: { "HBillType": '1204' },
                success: function (d) {
                    //console.log(d.data);
                    $("#HInterID").val(d.data[0].HInterID);
                    $("#HBillNo").val(d.data[0].HBillNo);
                }
            form.on('submit(HSpID-BT)', function () {//选择仓位
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '仓位列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_StockPlaceList.html?HWhID=' + sessionStorage["HWHID"] + '&Type=HSpID', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
        }
        else {//如果修改则走下面 new
            RoadBillMain(linterid);
            RoadBillSub(linterid);
        }
            form.on('submit(HSupID-BT)', function () {//选择供应商
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '供应商列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_SupplierList.html', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            form.on('submit(HKeeperID-BT)', function () {//选择保管
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '领料人列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            form.on('submit(HSecManagerID-BT)', function (data) {//选择验收
                var sMainStr = JSON.stringify(data.field);
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '发料人列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HSecManager', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            form.on('submit(HDeptID-BT)', function () {//选择部门
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '部门列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_DepartmentList.html', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
        form.on('submit(HWHID-BT)', function () {//选择仓库
            layer.open({
                type: 2
                , area: ['100%', '100%']
                , title: '仓库列表'
                , shade: 0.6 //遮罩透明度
                , maxmin: true //允许全屏最小化
                , anim: 0 //0-6的动画形式,-1不开启
                , content: ['../../../views/Baseset/基础资料/Gy_WarehouseList.html?Type=HWHID', 'yes']
                , resize: false
                , cancel: function () {
                    //$(".layui-btn").removeClass("layui-btn-disabled");
                }
            form.on('submit(Cancel)', function () {
                parent.location.href = "../../../views/index.html"
                //window.close();//关闭当前页
            })
        });
        form.on('submit(HSpID-BT)', function () {//选择仓位
            layer.open({
                type: 2
                , area: ['100%', '100%']
                , title: '仓位列表'
                , shade: 0.6 //遮罩透明度
                , maxmin: true //允许全屏最小化
                , anim: 0 //0-6的动画形式,-1不开启
                , content: ['../../../views/Baseset/基础资料/Gy_StockPlaceList.html?HWhID=' + sessionStorage["HWHID"] + '&Type=HSpID', 'yes']
                , resize: false
                , cancel: function () {
                    //$(".layui-btn").removeClass("layui-btn-disabled");
                }
            })
        });
        form.on('submit(HSupID-BT)', function () {//选择供应商
            layer.open({
                type: 2
                , area: ['100%', '100%']
                , title: '供应商列表'
                , shade: 0.6 //遮罩透明度
                , maxmin: true //允许全屏最小化
                , anim: 0 //0-6的动画形式,-1不开启
                , content: ['../../../views/Baseset/基础资料/Gy_SupplierList.html', 'yes']
                , resize: false
                , cancel: function () {
                    //$(".layui-btn").removeClass("layui-btn-disabled");
                }
            })
        });
        form.on('submit(HKeeperID-BT)', function () {//选择保管
            layer.open({
                type: 2
                , area: ['100%', '100%']
                , title: '领料人列表'
                , shade: 0.6 //遮罩透明度
                , maxmin: true //允许全屏最小化
                , anim: 0 //0-6的动画形式,-1不开启
                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                , resize: false
                , cancel: function () {
                    //$(".layui-btn").removeClass("layui-btn-disabled");
                }
            })
        });
        form.on('submit(HSecManagerID-BT)', function (data) {//选择验收
            var sMainStr = JSON.stringify(data.field);
            layer.open({
                type: 2
                , area: ['100%', '100%']
                , title: '发料人列表'
                , shade: 0.6 //遮罩透明度
                , maxmin: true //允许全屏最小化
                , anim: 0 //0-6的动画形式,-1不开启
                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HSecManager', 'yes']
                , resize: false
                , cancel: function () {
                    //$(".layui-btn").removeClass("layui-btn-disabled");
                }
            })
        });
        form.on('submit(HDeptID-BT)', function () {//选择部门
            layer.open({
                type: 2
                , area: ['100%', '100%']
                , title: '部门列表'
                , shade: 0.6 //遮罩透明度
                , maxmin: true //允许全屏最小化
                , anim: 0 //0-6的动画形式,-1不开启
                , content: ['../../../views/Baseset/基础资料/Gy_DepartmentList.html', 'yes']
                , resize: false
                , cancel: function () {
                    //$(".layui-btn").removeClass("layui-btn-disabled");
                }
            })
        });
        form.on('submit(Cancel)', function () {
            parent.location.href = "../../../views/index.html"
            //window.close();//关闭当前页
        })
        form.on('submit(cmdModify)', function () {//编辑
            var sSubStr = table.cache['wl-table'];
            //if (AllowLoadData(sSubStr) != false) {//非空验证
            form.on('submit(cmdModify)', function () {//编辑
                var sSubStr = table.cache['wl-table'];
                //if (AllowLoadData(sSubStr) != false) {//非空验证
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
@@ -487,199 +504,176 @@
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
           // }
        });
                // }
            });
        form.on('submit(cmdDelete)', function () {//删除
            var checkStatus = table.checkStatus('wl-table')
            , data = checkStatus.data;
            // console.log(data);
            var sInterID = $('#HInterID').val()
            var sMaterID = data[0].HMaterID
            var sBillType = '1204'
            var sAuxPropID = data[0].HAuxPropID
            //var sMTONo = data[0].HMTONo
            var sMTONo = ''
            var sSourceInterID = data[0].HSourceInterID
            var sSourceEntryID = data[0].HSourceEntryID
            $.ajax(
               {
                   type: "Get",
                   url: GetWEBURL() + "/MateOutBill/Delete_Json",
                   async: true,
                   data: { "HInterID": sInterID, "HMaterID": sMaterID, "HAuxPropID": sAuxPropID, "HMTONo": sMTONo, "HSourceInterID": sSourceInterID, "HSourceEntryID": sSourceEntryID, "sHBillType": sBillType, },
                   dataType: "json",
                   success: function (data) {
                       if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                           //layer.msg(data.Message, { icon: 1 });
                           table.render({
                               elem: '#wl-table'
                               , url: GetWEBURL1() + '/MateOutBill/DisBillEntryList_Webs_New_Json'
                               //, cellMinWidth: 80
                               , toolbar: '#toolbarDemo'
                               , where: { HBillID: sInterID, HBillType: '1204', sWhere: '' }
                               , cols: [[
                                  { type: 'radio' }
                                , { field: 'HSNO', title: '序号', width: 60 }
                                , { field: 'HQty', title: '数量', width: 80 }
                                , { field: 'HQtyMust', title: '应收数量', width: 80 }
                                , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                                , { field: 'HMaterName', title: '物料名称', width: 150 }
                                , { field: 'HMaterModel', title: '规格型号', width: 150 }
                                , { field: 'HSourceInterID', title: '源单主内码', width: 100 }
                                , { field: 'HSourceEntryID', title: '源单子内码', width: 100 }
                                , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                                , { field: 'HBatchNo', title: '批次', width: 100 }
                                , { field: 'HAuxPropID', title: '辅助属性', width: 100 }
                                , { field: 'HMTONo', title: '计划跟踪号', width: 100 }
                               ]]
                         , height: 500
                           })
                       }
                       else {
                           layer.msg(data.Message, { icon: 2 });
                       }
                   },
                   error: function (err) {
                       layer.msg('错误' + err, {
                           icon: 5,
                           time: 20000
                       }, function () {
                           //do something
                       });
                   }
               });
        });
        form.on('submit(Saver)', function (data) {//提交
            //debugger;
            var sMainStr = JSON.stringify(data.field);
            var sSubStr = table.cache['wl-table'];
            var sSourceType = $("#HBillType").val();
            if (AllowLoadData(sSubStr) != false)//非空验证
            {
                layer.load(3);
            form.on('submit(cmdDelete)', function () {//删除
                var checkStatus = table.checkStatus('wl-table')
                    , data = checkStatus.data;
                // console.log(data);
                var sInterID = $('#HInterID').val()
                var sMaterID = data[0].HMaterID
                var sBillType = '1204'
                var sAuxPropID = data[0].HAuxPropID
                //var sMTONo = data[0].HMTONo
                var sMTONo = ''
                var sSourceInterID = data[0].HSourceInterID
                var sSourceEntryID = data[0].HSourceEntryID
                $.ajax(
                {
                    type: "POST",
                    url: GetWEBURL() + "/MateOut/set_SaveMateOutBill_Json",
                    async: true,
                    data: { "oMain": sMainStr  },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            layer.msg(data.Message + $("#HBillNo").val(), { icon: 1 });
                    {
                        type: "Get",
                        url: GetWEBURL() + "/MateOutBill/Delete_Json",
                        async: true,
                        data: { "HInterID": sInterID, "HMaterID": sMaterID, "HAuxPropID": sAuxPropID, "HMTONo": sMTONo, "HSourceInterID": sSourceInterID, "HSourceEntryID": sSourceEntryID, "sHBillType": sBillType, },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                //layer.msg(data.Message, { icon: 1 });
                                table.render({
                                    elem: '#wl-table'
                                    , url: GetWEBURL1() + '/MateOutBill/DisBillEntryList_Webs_New_Json'
                                    //, cellMinWidth: 80
                                    //, toolbar: '#toolbarDemo'
                                    , where: { HBillID: sInterID, HBillType: '1204', sWhere: '' }
                                    , cols: [[
                                        { type: 'radio' }
                                        , { field: 'HSNO', title: '序号', width: 60 }
                                        , { field: 'HQty', title: '数量', width: 80 }
                                        , { field: 'HQtyMust', title: '应收数量', width: 80 }
                                        , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                                        , { field: 'HMaterName', title: '物料名称', width: 150 }
                                        , { field: 'HMaterModel', title: '规格型号', width: 150 }
                                        , { field: 'HSourceInterID', title: '源单主内码', width: 100 }
                                        , { field: 'HSourceEntryID', title: '源单子内码', width: 100 }
                                        , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                                        , { field: 'HBatchNo', title: '批次', width: 100 }
                                        , { field: 'HAuxPropID', title: '辅助属性', width: 100 }
                                        , { field: 'HMTONo', title: '计划跟踪号', width: 100 }
                                    ]]
                                    , height: 500
                                })
                            }
                            else {
                                layer.msg(data.Message, { icon: 2 });
                            }
                        },
                        error: function (err) {
                            layer.msg('错误' + err, {
                                icon: 5,
                                time: 20000
                            }, function () {
                                //do something
                            });
                        }
                        else {
                            layer.msg(data.Message, { icon: 1 });
                        }
                        layer.closeAll("loading");
                    },
                    error: function (err) {
                    });
            });
                        layer.msg('错误' + err, {
                            icon: 5,
                            time: 20000
                        }, function () {
                            //do something
            form.on('submit(Saver)', function (data) {//提交
                //debugger;
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = table.cache['wl-table'];
                var sSourceType = $("#HBillType").val();
                if (AllowLoadData(sSubStr) != false)//非空验证
                {
                    layer.load(3);
                    $.ajax(
                        {
                            type: "POST",
                            url: GetWEBURL() + "/MateOut/set_SaveMateOutBill_Json",
                            async: true,
                            data: { "oMain": sMainStr },
                            dataType: "json",
                            success: function (data) {
                                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                    layer.msg(data.Message + $("#HBillNo").val(), { icon: 1 });
                                }
                                else {
                                    layer.msg(data.Message, { icon: 1 });
                                }
                                layer.closeAll("loading");
                            },
                            error: function (err) {
                                layer.msg('错误' + err, {
                                    icon: 5,
                                    time: 20000
                                }, function () {
                                    //do something
                                });
                            }
                        });
                    }
                });
                return false;
            }
        });
        //监听提交
        form.verify({
            numberOrEmpty: function (value, item) {
                // if (value != '') {
                if (!/^\d+$/.test(value)) {
                    return '不能为空或数字或者0';
                }
                //}
            }
        });
        $('#HBarCode').on('keydown', function (event) {
            var sBarCode = $('#HBarCode').val()
            var sInterID = $("#HInterID").val()
            var sBillNo = $("#HBillNo").val()
            var sQty = $("#HQty").val()
            var sHBillType = $("#HBillType").val()  //源单类型
            var sBillType = '1204'
            var sHWHID = $("#HWHID").val()
            var sHSPID = $("#HStockPlaceID").val()
            var sSourceBillNo = $("#HSourceBillNo").val()
            if (sQty == "") {
                sQty = 0;
            }
            if (sHBillType == '-1')
            {
                sSourceBillNo=''
            }
            if (event.keyCode == 13) {
                if (sBarCode == '') {
                    layer.msg("条码为空,不能扫描!", { icon: 5, btn: ['确定'], time: 100000, offset: 't' });
                    return false;
                }
                if (sBarCode != "") {
                    $('#HBarCode').val("");
            });
            //监听提交
            form.verify({
                numberOrEmpty: function (value, item) {
                    // if (value != '') {
                    if (!/^\d+$/.test(value)) {
                        return '不能为空或数字或者0';
                    }
                    //}
                }
            });
            $('#HBarCode').on('keydown', function (event) {
                var sBarCode = $('#HBarCode').val()
                var sInterID = $("#HInterID").val()
                var sBillNo = $("#HBillNo").val()
                var sQty = $("#HQty").val()
                var sHBillType = $("#HBillType").val()  //源单类型
                var sBillType = '1204'
                var sHWHID = $("#HWHID").val()
                var sHSPID = $("#HStockPlaceID").val()
                var sSourceBillNo = $("#HSourceBillNo").val()
                if (sQty == "") {
                    sQty = 0;
                }
                $.ajax({
                    url: GetWEBURL() + "/MateOutBill/get_CheckTypeByBarCode_Json",
                    type: "GET",
                    data: { "sCode": sBarCode, "sInterID": sInterID,"HBillType": sBillType,"sBillNo": sBillNo, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": sessionStorage["SourceFlag"], "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": 0 },
                    success: function (result) {
                        if (result.count == 1) {
                            if (result.data.HBarType == '仓库条码') {
                                $("#HWHNAME").val(result.data.HWhName);
                                $("#HWHID").val(result.data.HWhID);
                                $("#HStockPlaceName").val("");
                                $("#HNote").val(";一键扫码仓库条码");
                                element.tabChange('tab-Kf_MateOutBill', '3');  //跳转页签
                            }
                            else if (result.data.HBarType == '仓位条码') {
                                $("#HStockPlaceName").val(result.data.HSPName);
                                $("#HStockPlaceID").val(result.data.HSPID);
                                $("#HWHNAME").val(result.data.HWhName);
                                $("#HWHID").val(result.data.HWhID);
                                $("#HNote").val(";一键扫码仓位条码");
                                element.tabChange('tab-Kf_MateOutBill', '3');//跳转页签
                            }
                            else if (result.data.HBarType == '部门条码') {
                                $("#HDeptName").val(result.data.HDeptName);
                                $("#HDeptID").val(result.data.HDeptID);
                                $("#HNote").val(";一键扫码部门条码");
                                element.tabChange('tab-Kf_MateOutBill', '3');//跳转页签
                            }
                            else if (result.data.HBarType == '源单条码') {
                                $("#HSupName").val(result.data.HSupName);
                                $("#HSupID").val(result.data.HSupID);
                                $("#HDeptName").val(result.data.HDeptName);
                                $("#HDeptID").val(result.data.HDeptID);
                                $("#HSourceBillNo").val(result.data.HSourceBillNo);
                                sessionStorage["SourceFlag"] = true;
                                //获取源单类型、源单单号
                                if (result.data.HSourceBillType == "3720") {
                                    $("#HBillType").val("3720");
                if (sHBillType == '-1') {
                    sSourceBillNo = ''
                }
                if (event.keyCode == 13) {
                    if (sBarCode == '') {
                        layer.msg("条码为空,不能扫描!", { icon: 5, btn: ['确定'], time: 100000, offset: 't' });
                        return false;
                    }
                    if (sBarCode != "") {
                        $('#HBarCode').val("");
                    }
                    if (sQty == "") {
                        sQty = 0;
                    }
                    $.ajax({
                        url: GetWEBURL() + "/MateOutBill/get_CheckTypeByBarCode_Json",
                        type: "GET",
                        data: { "sCode": sBarCode, "sInterID": sInterID, "HBillType": sBillType, "sBillNo": sBillNo, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": sessionStorage["SourceFlag"], "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": 0 },
                        success: function (result) {
                            if (result.count == 1) {
                                if (result.data.HBarType == '仓库条码') {
                                    $("#HWHNAME").val(result.data.HWhName);
                                    $("#HWHID").val(result.data.HWhID);
                                    $("#HStockPlaceName").val("");
                                    $("#HNote").val(";一键扫码仓库条码");
                                    element.tabChange('tab-Kf_MateOutBill', '3');  //跳转页签
                                }
                                else {
                                    $("#HBillType").val("手工录入");
                                else if (result.data.HBarType == '仓位条码') {
                                    $("#HStockPlaceName").val(result.data.HSPName);
                                    $("#HStockPlaceID").val(result.data.HSPID);
                                    $("#HWHNAME").val(result.data.HWhName);
                                    $("#HWHID").val(result.data.HWhID);
                                    $("#HNote").val(";一键扫码仓位条码");
                                    element.tabChange('tab-Kf_MateOutBill', '3');//跳转页签
                                }
                                $("#HNote").val(";一键扫码源单条码");
                                element.tabChange('tab-Kf_MateOutBill', '3');
                            }
                            else {
                                if (sessionStorage["SourceFlag"] == "true") {
                                    element.tabChange('tab-Kf_MateOutBill', '3');
                                else if (result.data.HBarType == '部门条码') {
                                    $("#HDeptName").val(result.data.HDeptName);
                                    $("#HDeptID").val(result.data.HDeptID);
                                    $("#HNote").val(";一键扫码部门条码");
                                    element.tabChange('tab-Kf_MateOutBill', '3');//跳转页签
                                }
                                else {
                                    //$("#HSupName").val(result.data.HSupName);
                                    //$("#HSupID").val(result.data.HSupID);
                                    //$("#HDeptName").val(result.data.HDeptName);
                                    //$("#HDeptID").val(result.data.HDeptID);
                                else if (result.data.HBarType == '源单条码') {
                                    $("#HSupName").val(result.data.HSupName);
                                    $("#HSupID").val(result.data.HSupID);
                                    $("#HDeptName").val(result.data.HDeptName);
                                    $("#HDeptID").val(result.data.HDeptID);
                                    $("#HSourceBillNo").val(result.data.HSourceBillNo);
                                    sessionStorage["SourceFlag"] = true;
                                    //获取源单类型、源单单号
@@ -687,214 +681,284 @@
                                        $("#HBillType").val("3720");
                                    }
                                    //else if (result.data.HSourceBillType == "1601") {
                                    //    $("#HBillType").val("1601");
                                    //}
                                    $("#HNote").val(";物料条码");
                                    else {
                                        $("#HBillType").val("手工录入");
                                    }
                                    $("#HNote").val(";一键扫码源单条码");
                                    element.tabChange('tab-Kf_MateOutBill', '3');
                                }
                            }
                            //$("#HSupID").val(result.data.HSupID);
                            //$("#HSupName").val(result.data.HSupName);
                            //$("#HDeptID").val(result.data.HDeptID);
                            //$("#HDeptName").val(result.data.HDeptName);
                            layer.load(3)
                            table.render({
                                elem: '#wl-table'
                          , url: GetWEBURL1() + '/MateOutBill/DisBillEntryList_Webs_New_Json'
                          , toolbar: '#toolbarDemo'
                          , where: { HBillID: sInterID, HBillType: '1204', sWhere: '' }
                          , cols: [[
                              { type: 'radio' }
                            , { field: 'HSNO', title: '序号', width: 60 }
                            , { field: 'HQty', title: '数量', width: 80 }
                            , { field: 'HQtyMust', title: '应收数量', width: 80 }
                            , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                            , { field: 'HMaterName', title: '物料名称', width: 150 }
                            , { field: 'HMaterModel', title: '规格型号', width: 150 }
                            , { field: 'HSourceInterID', title: '源单主内码', width: 150 }
                            , { field: 'HSourceEntryID', title: '源单子内码', width: 150 }
                            , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                            , { field: 'HBatchNo', title: '批次', width: 150 }
                          ]]
                                // , data: [linterid]
                                // , page: true
                          , height: 500
                          , done: function () {
                              layer.closeAll("loading");
                          }
                            });
                        }
                        else {
                            // $("#verifycode").click();
                            //layer.msg(result.Message, { icon: 5 });
                            layer.msg(result.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                        }
                        layer.closeAll("loading");
                    }
                });
            }
        });
        $('#HSourceBillNo').on('keydown', function (event) {
            var HSourceBillNo = $('#HSourceBillNo').val()
            var sInterID = $("#HInterID").val()
            var sBillNo = $("#HBillNo").val()
            var HSourceBillType = $("#HBillType").val()
            if (event.keyCode == 13) {
                $.ajax({
                    url: GetWEBURL() + "/MateOut/set_SavePonderationBillMain_Temp_Mate_Source_Fast_Json",
                    type: "GET",
                    data: { "HSourceBillType": HSourceBillType, "HSourceBillNo": HSourceBillNo, "sInterID": sInterID, "sBillNo": sBillNo },
                    success: function (result) {
                        sessionStorage["SourceFlag"] = true;
                        element.tabChange('tab-MateOutBill', '2');
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            layer.load(3)
                            table.render({
                                elem: '#wl-table'
                                , url: GetWEBURL1() + '/MateOutBill/DisBillEntryList_Webs_New_Json'
                                //, cellMinWidth: 80
                              , toolbar: '#toolbarDemo'
                              , where: { HBillID: sInterID, HBillType: '1204', sWhere: '' }
                              , cols: [[
                                  { type: 'radio' }
                                , { field: 'HSNO', title: '序号', width: 60 }
                                , { field: 'HQty', title: '数量', width: 80 }
                                , { field: 'HQtyMust', title: '应收数量', width: 80 }
                                , { field: 'HMaterName', title: '物料名称', width: 90 }
                                , { field: 'HMaterNumber', title: '物料代码', width: 90 }
                                , { field: 'HMaterModel', title: '规格型号', width: 90 }
                                , { field: 'HSourceInterID', title: '源单主内码', width: 90 }
                                , { field: 'HSourceEntryID', title: '源单子内码', width: 90 }
                                , { field: 'HSourceBillNo', title: '源单单号', width: 90 }
                                , { field: 'HBatchNo', title: '批次', width: 90 }
                              ]]
                                // , data: [linterid]
                                // , page: true
                              , height: 500
                              , done: function () {
                                  layer.closeAll("loading");
                              }
                            });
                        }
                        else {
                            // $("#verifycode").click();
                            //layer.msg(result.Message, { icon: 5 });
                            layer.msg(result.Message, { icon: 5, btn: ['确定'], time: 100000, offset: 't' });
                        }
                        layer.closeAll("loading");
                    }
                });
               // layer.msg($('#HSourceBillNo').val(), { icon: 1 });
            }
        });
                                else {
                                    if (sessionStorage["SourceFlag"] == "true") {
                                        element.tabChange('tab-Kf_MateOutBill', '3');
                                    }
                                    else {
                                        //$("#HSupName").val(result.data.HSupName);
                                        //$("#HSupID").val(result.data.HSupID);
                                        //$("#HDeptName").val(result.data.HDeptName);
                                        //$("#HDeptID").val(result.data.HDeptID);
                                        $("#HSourceBillNo").val(result.data.HSourceBillNo);
                                        sessionStorage["SourceFlag"] = true;
                                        //获取源单类型、源单单号
                                        if (result.data.HSourceBillType == "3720") {
                                            $("#HBillType").val("3720");
        table.render({
            elem: '#mx-table'
            // , url: 'http://61.130.49.162:9090/WMSAPI///MateOut/GetHBarCodeShowBillSub'
            //, toolbar: '#toolbarDemo'
            // , where: { sMsg: linterid, sMsg2: lentryid }
         , cols: [[
           , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
         ]]
         , page: true
         , height: 500
         , done: function () {
         }
                                        }
                                        //else if (result.data.HSourceBillType == "1601") {
                                        //    $("#HBillType").val("1601");
                                        //}
                                        $("#HNote").val(";物料条码");
                                        element.tabChange('tab-Kf_MateOutBill', '3');
                                    }
                                }
                                //$("#HSupID").val(result.data.HSupID);
                                //$("#HSupName").val(result.data.HSupName);
                                //$("#HDeptID").val(result.data.HDeptID);
                                //$("#HDeptName").val(result.data.HDeptName);
                                layer.load(3)
                                table.render({
                                    elem: '#wl-table'
                                    , url: GetWEBURL1() + '/MateOutBill/DisBillEntryList_Webs_New_Json'
                                    //, toolbar: '#toolbarDemo'
                                    , where: { HBillID: sInterID, HBillType: '1204', sWhere: '' }
                                    , cols: [[
                                        { type: 'radio' }
                                        , { field: 'HSNO', title: '序号', width: 60 }
                                        , { field: 'HQty', title: '数量', width: 80 }
                                        , { field: 'HQtyMust', title: '应收数量', width: 80 }
                                        , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                                        , { field: 'HMaterName', title: '物料名称', width: 150 }
                                        , { field: 'HMaterModel', title: '规格型号', width: 150 }
                                        , { field: 'HSourceInterID', title: '源单主内码', width: 150 }
                                        , { field: 'HSourceEntryID', title: '源单子内码', width: 150 }
                                        , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                                        , { field: 'HBatchNo', title: '批次', width: 150 }
                                        , { fixed: 'right', title: '操作', toolbar: '#barDemo', width: 70 }
                                    ]]
                                    // , data: [linterid]
                                    // , page: true
                                    , height: 500
                                    , done: function () {
                                        layer.closeAll("loading");
                                    }
                                });
                            }
                            else {
                                // $("#verifycode").click();
                                //layer.msg(result.Message, { icon: 5 });
                                layer.msg(result.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                            }
                            layer.closeAll("loading");
                        }
                    });
                }
            });
            $('#HSourceBillNo').on('keydown', function (event) {
                var HSourceBillNo = $('#HSourceBillNo').val()
                var sInterID = $("#HInterID").val()
                var sBillNo = $("#HBillNo").val()
                var HSourceBillType = $("#HBillType").val()
                if (event.keyCode == 13) {
                    $.ajax({
                        url: GetWEBURL() + "/MateOut/set_SavePonderationBillMain_Temp_Mate_Source_Fast_Json",
                        type: "GET",
                        data: { "HSourceBillType": HSourceBillType, "HSourceBillNo": HSourceBillNo, "sInterID": sInterID, "sBillNo": sBillNo },
                        success: function (result) {
                            sessionStorage["SourceFlag"] = true;
                            element.tabChange('tab-MateOutBill', '2');
                            if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                layer.load(3)
                                table.render({
                                    elem: '#wl-table'
                                    , url: GetWEBURL1() + '/MateOutBill/DisBillEntryList_Webs_New_Json'
                                    //, cellMinWidth: 80
                                    //, toolbar: '#toolbarDemo'
                                    , where: { HBillID: sInterID, HBillType: '1204', sWhere: '' }
                                    , cols: [[
                                        { type: 'radio' }
                                        , { field: 'HSNO', title: '序号', width: 60 }
                                        , { field: 'HQty', title: '数量', width: 80 }
                                        , { field: 'HQtyMust', title: '应收数量', width: 80 }
                                        , { field: 'HMaterName', title: '物料名称', width: 90 }
                                        , { field: 'HMaterNumber', title: '物料代码', width: 90 }
                                        , { field: 'HMaterModel', title: '规格型号', width: 90 }
                                        , { field: 'HSourceInterID', title: '源单主内码', width: 90 }
                                        , { field: 'HSourceEntryID', title: '源单子内码', width: 90 }
                                        , { field: 'HSourceBillNo', title: '源单单号', width: 90 }
                                        , { field: 'HBatchNo', title: '批次', width: 90 }
                                        , { fixed: 'right', title: '操作', toolbar: '#barDemo', width: 70 }
                                    ]]
                                    // , data: [linterid]
                                    // , page: true
                                    , height: 500
                                    , done: function () {
                                        layer.closeAll("loading");
                                    }
                                });
                            }
                            else {
                                // $("#verifycode").click();
                                //layer.msg(result.Message, { icon: 5 });
                                layer.msg(result.Message, { icon: 5, btn: ['确定'], time: 100000, offset: 't' });
                            }
                            layer.closeAll("loading");
                        }
                    });
                    // layer.msg($('#HSourceBillNo').val(), { icon: 1 });
                }
            });
            table.render({
                elem: '#mx-table'
                // , url: 'http://61.130.49.162:9090/WMSAPI///MateOut/GetHBarCodeShowBillSub'
                //, toolbar: '#toolbarDemo'
                // , where: { sMsg: linterid, sMsg2: lentryid }
                , cols: [[
                    , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                ]]
                , page: true
                , height: 500
                , done: function () {
                }
            });
            //测试数据begin
            var rowdata = [{
                "HSNO": "1", "HQty": "2", "HQtyMust": "3", "HMaterName": "4", "HMaterNumber": "5"
                , "HMaterModel": "6"
                , "HSourceInterID": "367", "HSourceEntryID": "7", "HSourceBillNo": "8", "HBatchNo": "9"
            }];
            var option = {
                elem: '#wl-table'
                , height: 'full-1000'
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HSNO', title: '序号', width: 60 }
                    , { field: 'HQty', title: '数量', width: 80 }
                    , { field: 'HQtyMust', title: '应收数量', width: 80 }
                    , { field: 'HMaterName', title: '物料名称', width: 90 }
                    , { field: 'HMaterNumber', title: '物料代码', width: 90 }
                    , { field: 'HMaterModel', title: '规格型号', width: 90 }
                    , { field: 'HSourceInterID', title: '源单主内码', width: 90 }
                    , { field: 'HSourceEntryID', title: '源单子内码', width: 90 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 90 }
                    , { field: 'HBatchNo', title: '批次', width: 90 }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo', width: 70 }
                ]]
                //, page: true
            };
            option.data = rowdata;
            table.render(option);
            //测试数据end
            //行内事件
            table.on('tool(wl-table)', function (obj) {
                var data = obj.data;
                console.log(data.源单主内码);
                var rowIndex = $(obj.tr).attr("data-index");
                if (obj.event === 'edit') {
                    var _obj = obj;
                    layer.open({
                        type: 2
                        , area: ['90%', '90%']
                        , title: '扫码详情列表'
                        , content: ['../../../views/Baseset/基础资料/WMSBarCodeDetailsList.html?HInterID=' + data.HSourceInterID + '&HBillType=3789', 'yes']
                        , end: function () {
                        }
                    })
                }
            });
        });
    });
    function GetHWHValue(obj)  //返回仓库
    {
        $("#HWHNAME").val(obj[0].HName);
        sessionStorage["HWHID"] = obj[0].HItemID;
        $("#HWHID").val(obj[0].HItemID);
    }
    function GetHSpValue(obj) {  //返回调入仓位
        $("#HStockPlaceName").val(obj[0].HName);
        $("#HStockPlaceID").val(obj[0].HItemID);
    }
    function GetHSupValue(obj) {  //返回供应商
        $("#HSupName").val(obj[0].HName);
        $("#HSupID").val(obj[0].HItemID);
    }
    function GetHKeeperValue(obj) {  //返回保管
        $("#HKeeper").val(obj[0].HName);
        $("#HKeeperID").val(obj[0].HItemID);
    }
    function GetHSecManagerValue(obj) {  //返回验收
        $("#HSecManager").val(obj[0].HName);
        $("#HSecManagerID").val(obj[0].HItemID);
    }
    function GetHDeptNameValue(obj) {   //返回部门
        $("#HDeptName").val(obj[0].HName);
        $("#HDeptID").val(obj[0].HItemID);
    }
    function AllowLoadData(sSubStr) {  //非空验证
        //if ($("#HSourceBillNo").val() == '') {
        //    layer.msg("请先扫源单!", { icon: 5 });
        //    return false;
        //}
        //if($("#HDeptName").val()=='')
        //{
        //    layer.msg("部门没有选择!", { icon: 5 });
        //    return false;
        //}
        //if ($("#HSecManager").val() == '') {
        //    layer.msg("发料人没有选择!", { icon: 5 });
        //    return false;
        //}
        //if ($("#HKeeper").val() == '') {
        //    layer.msg("领料人没有选择!", { icon: 5 });
        //    return false;
        //}
        //if ($("#HSupName").val() == '') {
        //    layer.msg("供应商没有选择!", { icon: 5 });
        //    return false;
        //}
        //if ($("#HWHNAME").val() == '') {
        //    layer.msg("仓库没有选择!", { icon: 5 });
        //    return false;
        //}
        if ($("#HBillNo").val() == '') {
            layer.msg("错误的单据号!", { icon: 5 });
            return false;
        }
        if ($("#HInterID").val() == '') {
            layer.msg("错误的内码!", { icon: 5 });
            return false;
        }
        if(sSubStr=='')
        function GetHWHValue(obj)  //返回仓库
        {
            layer.msg("没有物料明细记录!", { icon: 5 });
            return false;
            $("#HWHNAME").val(obj[0].HName);
            sessionStorage["HWHID"] = obj[0].HItemID;
            $("#HWHID").val(obj[0].HItemID);
        }
        var s = 0;
        if (sSubStr != '') {
            for (var i = 0; i <= sSubStr.length - 1; i++) {  //判断扫码数量不能大于应收数量
                if (parseFloat(sSubStr[i].HQtyMust) > 0) {
                    if (parseFloat(sSubStr[i].HQty) > parseFloat(sSubStr[i].HQtyMust))
                    {
                        layer.msg("数量不能大于应发数量!", { icon: 5 });
                        return false;
                    }
                }
            }
            for (var i = 0; i <= sSubStr.length - 1; i++) {   //判断扫码数量不能为0
                if (parseFloat(sSubStr[i].HQty) > 0) {
                    s = 1;
                }
            }
            if (s == 0)
            {
                layer.msg("生产领料出库记录未扫码!", { icon: 5 });
        function GetHSpValue(obj) {  //返回调入仓位
            $("#HStockPlaceName").val(obj[0].HName);
            $("#HStockPlaceID").val(obj[0].HItemID);
        }
        function GetHSupValue(obj) {  //返回供应商
            $("#HSupName").val(obj[0].HName);
            $("#HSupID").val(obj[0].HItemID);
        }
        function GetHKeeperValue(obj) {  //返回保管
            $("#HKeeper").val(obj[0].HName);
            $("#HKeeperID").val(obj[0].HItemID);
        }
        function GetHSecManagerValue(obj) {  //返回验收
            $("#HSecManager").val(obj[0].HName);
            $("#HSecManagerID").val(obj[0].HItemID);
        }
        function GetHDeptNameValue(obj) {   //返回部门
            $("#HDeptName").val(obj[0].HName);
            $("#HDeptID").val(obj[0].HItemID);
        }
        function AllowLoadData(sSubStr) {  //非空验证
            //if ($("#HSourceBillNo").val() == '') {
            //    layer.msg("请先扫源单!", { icon: 5 });
            //    return false;
            //}
            //if($("#HDeptName").val()=='')
            //{
            //    layer.msg("部门没有选择!", { icon: 5 });
            //    return false;
            //}
            //if ($("#HSecManager").val() == '') {
            //    layer.msg("发料人没有选择!", { icon: 5 });
            //    return false;
            //}
            //if ($("#HKeeper").val() == '') {
            //    layer.msg("领料人没有选择!", { icon: 5 });
            //    return false;
            //}
            //if ($("#HSupName").val() == '') {
            //    layer.msg("供应商没有选择!", { icon: 5 });
            //    return false;
            //}
            //if ($("#HWHNAME").val() == '') {
            //    layer.msg("仓库没有选择!", { icon: 5 });
            //    return false;
            //}
            if ($("#HBillNo").val() == '') {
                layer.msg("错误的单据号!", { icon: 5 });
                return false;
            }
            if ($("#HInterID").val() == '') {
                layer.msg("错误的内码!", { icon: 5 });
                return false;
            }
            if (sSubStr == '') {
                layer.msg("没有物料明细记录!", { icon: 5 });
                return false;
            }
            var s = 0;
            if (sSubStr != '') {
                for (var i = 0; i <= sSubStr.length - 1; i++) {  //判断扫码数量不能大于应收数量
                    if (parseFloat(sSubStr[i].HQtyMust) > 0) {
                        if (parseFloat(sSubStr[i].HQty) > parseFloat(sSubStr[i].HQtyMust)) {
                            layer.msg("数量不能大于应发数量!", { icon: 5 });
                            return false;
                        }
                    }
                }
                for (var i = 0; i <= sSubStr.length - 1; i++) {   //判断扫码数量不能为0
                    if (parseFloat(sSubStr[i].HQty) > 0) {
                        s = 1;
                    }
                }
                if (s == 0) {
                    layer.msg("生产领料出库记录未扫码!", { icon: 5 });
                    return false;
                }
            }
            else {
                return true;
            }
        }
        else
        {
            return true;
        }
    }
    </script>
</body>