智云SRM-LAYUI(夏宝服务器版本)
YL
2021-11-01 cb4067f68b5ec16ff9ea904998eb4156085d5a92
Merge branch 'master' of http://101.37.171.70:10101/r/SRM-LAYUI
1个文件已添加
7个文件已修改
1950 ■■■■■ 已修改文件
WebSRM/Scripts/webConfig.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebSRM/WebSRM.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebSRM/layuiAdmin.std-v1.2.1/src/views/PublicPage/OrderBackInfomation.html 251 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_BarCodeBill.html 1015 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBill.html 373 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBillList.html 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBill_Edit.html 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POOrderBillList.html 268 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebSRM/Scripts/webConfig.js
@@ -1,9 +1,10 @@
function GetWEBURL()
{
    var WEBURL = "http://localhost:8083/WEB-API/";
    //var WEBURL = "http://localhost:8083/WEB-API/";
    //var WEBURL = "http://111.3.111.183:8083/WEB-API/";
    //var WEBURL = "http://10.0.2.11:8083/WEB-API/";
    //var WEBURL = "http://192.168.31.47:8083/WEB-API/";
    var WEBURL = "http://localhost:8082/srmAPI/";    //章紫柔本地配置
    
    return WEBURL
}
WebSRM/WebSRM.csproj
@@ -837,6 +837,7 @@
    <Content Include="layuiAdmin.std-v1.2.1\src\views\iframe\layer\iframe.html" />
    <Content Include="layuiAdmin.std-v1.2.1\src\views\index.html" />
    <Content Include="layuiAdmin.std-v1.2.1\src\layuiadmin\layui\JavaScript1.js" />
    <Content Include="layuiAdmin.std-v1.2.1\src\views\PublicPage\OrderBackInfomation.html" />
    <Content Include="layuiAdmin.std-v1.2.1\src\views\senior\echarts\bar.html" />
    <Content Include="layuiAdmin.std-v1.2.1\src\views\senior\echarts\line.html" />
    <Content Include="layuiAdmin.std-v1.2.1\src\views\senior\echarts\map.html" />
WebSRM/layuiAdmin.std-v1.2.1/src/views/PublicPage/OrderBackInfomation.html
New file
@@ -0,0 +1,251 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; 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, maximum-scale=1">
    <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
    <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/layui/lay/modules/util.js"></script>
    <script src="../../../../Scripts/webConfig.js"></script>
    <style media="screen">
        .custom-tree-item-clicked {
            color: #FC9003
        }
    </style>
</head>
<body>
    <div class="layui-fluid">
        <div class="layui-col-md12">
            <div class="layui-card" style="padding: 1px">
                <div class="layui-card-body" style="padding: 1px;">
                    <form class="layui-form" action="" lay-filter="component-form-group">
                        <div class="layui-collapse">
                            <div class="layui-colla-item">
                                <div class="layui-form-item" style="border-top: solid 1px #F6F6F6;">
                                    <div class="layui-row" style="padding:10px 0">
                                        <div class="layui-col-xs3 layui-inline" style="width: 23%;display:none;">
                                            <div id="treeDepartment" lay-filter="treeDepartment" class="demo-tree demo-tree-box" style="height: 580px; overflow: scroll;"></div>
                                        </div>
                                        <div class="layui-col-xs12 layui-inline">
                                            <div class="layui-row">
                                                <div class="layui-inline">
                                                    <label class="layui-form-label">代码</label>
                                                    <div class="layui-input-block">
                                                        <input type="text" class="layui-input" name="HNumber" id="HNumber">
                                                    </div>
                                                </div>
                                                <div class="layui-inline">
                                                    <label class="layui-form-label">名称</label>
                                                    <div class="layui-input-block">
                                                        <input type="text" class="layui-input" name="HName" id="HName">
                                                    </div>
                                                </div>
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                </button>
                                            </div>
                                            <div>
                                                <table class="" id="mainTable" lay-filter="mainTable"></table>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <script>
        var treeCkData = { id: 0 };
        var TagId = "";
        var TagParentId = "";
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['tree', 'index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , element = layui.element
                , laypage = layui.laypage
                , laydate = layui.laydate
                , util = layui.util
                , tree = layui.tree
            var sWhere = " where HStopFlag=0 and HEndFlag<>'1' "; //树型100046  sessionStorage["OrganizationID"]
            var sWhere1 = " where HStopFlag=0 and HEndFlag=1 ";  //列表
            //tree.render({
            //    elem: '#treeDepartment',
            //    data: getData(sWhere),
            //    showCheckbox: false,     //是否显示复选框
            //    id: 'demoId',
            //    isJump: false, //是否允许点击节点时弹出新窗口跳转
            //    showLine: true,//是否开启连接线
            //    onlyIconControl: true,   //点击后不收缩
            //    click: function (obj) {
            //        //点击高光
            //        if (obj.data.id !== treeCkData.id) {
            //            $('div[data-id="' + obj.data.id + '"] span').eq(1).last().addClass("custom-tree-item-clicked");
            //            $('div[data-id="' + treeCkData.id + '"] span').eq(1).last().removeClass('custom-tree-item-clicked');
            //            treeCkData = obj.data;
            //            TagId = obj.data.id;
            //            TagParentId = obj.data.ParentID;
            //        }
            //        else {
            //            $('div[data-id="' + treeCkData.id + '"] span').eq(1).last().removeClass('custom-tree-item-clicked');
            //            treeCkData = { id: 0 };
            //            TagId = "";
            //            TagParentId = "";
            //        }
            //        $.ajax({
            //            url: GetWEBURL() + '/Gy_MaintenanceMode/OrderBackInfoCX',
            //            type: "GET",
            //            data: { "HInterID": obj.data.id },
            //            success: function (data1) {
            //                if (data1.count == 1) {
            //                    option.data = data1.data;
            //                    table.render(option);
            //                    layer.close(index);
            //                } else {
            //                    layer.close(index);
            //                    layer.alert(data1.code + data1.Message, { icon: 5 });
            //                }
            //            }, error: function () {
            //                layer.close(index);
            //                layer.alert("接口请求失败!", { icon: 5 });
            //            }
            //        });
            //    }
            //});
            var option = {
                elem: '#mainTable'
                //, toolbar: '#toolbarDemo'
                , height: 'full-120'
                , page: true
                , cellMinWidth: 90
                , cols: [[
                    { type: 'radio', fixed: 'left' }
                    , { field: 'HItemID', title: 'HItemID', sort: true, hide: true }
                    , { field: 'ParentID', title: 'ParentID', sort: true, hide: true }
                    , { field: 'HNumber', title: '订单反馈状态代码' }
                    , { field: 'HName', title: '订单反馈状态' }
                ]]
            };
            var index = layer.load(0, { shade: false });
            //进入页面显示的缓存列表
            $.ajax({
                url: GetWEBURL() + '/PublicPageMethod/OrderBackInfoList',
                type: "GET",
                data: { "sWhere": SeachFilter(sWhere1) },
                success: function (data1) {
                    if (data1.count == 1) {
                        option.data = data1.data;
                        table.render(option);
                        layer.close(index);
                    } else {
                        layer.close(index);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(index);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
            //查询按钮
            form.on('submit(btnSearch)', function (data) {
                $.ajax({
                    url: GetWEBURL() + '/PublicPageMethod/OrderBackInfoList',
                    type: "GET",
                    data: { "sWhere": SeachFilter(sWhere1) },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.alert("查询成功", { icon: 1 });
                        } else {
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                sWhere1 = "";//调用接口后清空sWhere缓存
            });
            //以上是layui模块
        });
        //查询树状数据
        function getData(sWhere) {
            var treeData;
            $.ajax({
                url: GetWEBURL() + '/Gy_MaintenanceMode/OrderBackInfoLoadTree',
                type: "GET",
                data: { "sWhere": sWhere },
                async: false,
                success: function (result) {
                    var data = result.data;
                    //生成数据对象集合
                    treeData = LoadTree(data);
                }
            });
            return treeData;
        }
        /**处理树形展示数据,要求有ID和ParentID、title字段**/
        function LoadTree(data) {
            let map = {};
            let treeData = [];
            data.forEach(it => {
                map[it.id] = it;    //ID为每个节点的id
            })
            //生成结果集
            data.forEach(it => {
                const parent = map[it.ParentID];   //ParentID为父节点的id
                if (parent) {
                    if (!Array.isArray(parent.children)) parent.children = [];
                    parent.children.push(it);
                } else {
                    treeData.push(it)
                }
            })
            return treeData;
        }
        function SeachFilter(sWhere1) {
            var HNumber = $("#HNumber").val();
            var HName = $("#HName").val();
            if (HNumber) {
                sWhere1 += " and HNumber like '%" + HNumber + "%'";
            }
            if (HName) {
                sWhere1 += " and HName like '%" + HName + "%'";
            }
            return sWhere1;
        }
    </script>
</body>
</html>
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_BarCodeBill.html
@@ -102,7 +102,7 @@
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                                    <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                                    <script type="text/html" id="toolbarDemo">
                                        <div class="layui-btn-container">
                                            <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-normal">普通条码</button>-->
@@ -112,11 +112,11 @@
                                    </script>
                                </div>
                            </div>
                        </div>
                        </div>
                        <!--<blockquote class="layui-elem-quote">条码</blockquote>-->
                    </form>
            </div>
                </div>
            </div>
        </div>
    </div>
@@ -140,7 +140,7 @@
            //  }
            //});
        }
        function isPositiveIntegerTimes(x,y){
        function isPositiveIntegerTimes(x, y) {
            if (x > y) {
                var flag = x;
                x = y;
@@ -150,14 +150,11 @@
            if (x == 0) {
                return true;
            }
            else
           {
                if (z == 0)
                {
            else {
                if (z == 0) {
                    return true;
                }
                else
                {
                else {
                    return false;
                }
            }
@@ -172,7 +169,7 @@
            var day = date.getDate();
            var mm = "'" + month + "'";
            var dd = "'" + day + "'";
            //单位数前面加0
            if (mm.length == 3) {
                month = "0" + month;
@@ -197,44 +194,50 @@
        var params = getUrlVars();
        var linterid = params[params[0]];
        var lentryid = params[params[1]];
      // debugger;
        $.ajax({
            url: GetWEBURL()+"GetHBarCodeShowBillMain",
            type: "GET",
            data: { "sMsg": linterid },
            success: function (d) {
                console.log(d.data);
                //$("#HDate").val(d.)
                $("#HInterID").val(d.data[0].HInterID);
                $("#HBillNo").val(d.data[0].HBillNo);
                $("#HRemark").val(d.data[0].HRemark);
                $("#HDate").val(d.data[0].HDateForWeb);
                //$("#HMaker").val(d.data[0].HMaker);
                $("#HMakerDate").val(d.data[0].HMakerDate)
                $("#HChecker").val(d.data[0].HChecker);
                $("#HCheckDate").val(d.data[0].HCheckDate);
                $("#HSupID").val(d.data[0].HSupID);
                $("#HSupName").val(d.data[0].HSupName);
                $("#HEmpID").val(d.data[0].HEmpID);
                $("#HEmpName").val(d.data[0].HEmpName);
                $("#HManagerID").val(d.data[0].HManagerID);
                $("#HManagerName").val(d.data[0].HManagerName);
                $("#HMaker").val(sessionStorage["HUserName"]);
            }
        });
        var type = params[params[2]];
        var mainUrl = "GetHBarCodeShowBillMain";
        var subUrl = "GetHBarCodeShowBillSub";
        if (type == 'SRM_POOrderBillList') {
            mainUrl = 'GetHBarCodeShowBillMainBycg';
            subUrl = "GetHBarCodeShowBillSubBycg";
        }
        // debugger;
            $.ajax({
                url: GetWEBURL() + mainUrl,
                type: "GET",
                data: { "sMsg": linterid },
                success: function (d) {
                    console.log(d.data);
                    //$("#HDate").val(d.)
                    $("#HInterID").val(d.data[0].HInterID);
                    $("#HBillNo").val(d.data[0].HBillNo);
                    $("#HRemark").val(d.data[0].HRemark);
                    $("#HDate").val(d.data[0].HDateForWeb);
                    //$("#HMaker").val(d.data[0].HMaker);
                    $("#HMakerDate").val(d.data[0].HMakerDate)
                    $("#HChecker").val(d.data[0].HChecker);
                    $("#HCheckDate").val(d.data[0].HCheckDate);
                    $("#HSupID").val(d.data[0].HSupID);
                    $("#HSupName").val(d.data[0].HSupName);
                    $("#HEmpID").val(d.data[0].HEmpID);
                    $("#HEmpName").val(d.data[0].HEmpName);
                    $("#HManagerID").val(d.data[0].HManagerID);
                    $("#HManagerName").val(d.data[0].HManagerName);
                    $("#HMaker").val(sessionStorage["HUserName"]);
                }
            });
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'table', 'form', 'element', 'layer', 'laydate'], function () {
            var table = layui.table
            ,$ = layui.$
            , form = layui.form
            , layer = layui.layer
            , laydate = layui.laydate
            , element = layui.element; //Tab的切换功能,切换事件监听等,需要依赖element模块
                , $ = layui.$
                , form = layui.form
                , layer = layui.layer
                , laydate = layui.laydate
                , element = layui.element; //Tab的切换功能,切换事件监听等,需要依赖element模块
            //生成品种码
            form.on('submit(HBarcodeSaverPZ)', function (data) {//保存
@@ -246,64 +249,64 @@
                var sMainSub = sMainStr + ';' + sSubStr;
                layer.load(3)
                $.ajax(
                {
                    type: "POST",
                    url: GetWEBURL()+"GetBarcodeSaveBillVarieties", //方法所在页面和方法名
                    async: true,
                    data: { "msg": sMainSub },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) { // 说明验证成功了,
                            layer.msg(data.Message, { icon: 1 });
                            element.tabDelete('tabDemo', '2'); //删除
                            element.tabAdd('tabDemo', {
                                title: '条码信息'
                              , content: '<table class="layui-hide" id="subTable" lay-filter="subTable"></table>' //支持传入(html代码)不持支直接传入html页面
                              , id: '2' //选项卡标题的lay-id属性值
                            });
                             table.render({
                                 elem: '#subTable'
                              , url:  GetWEBURL()+'GetHBarCodeShowBillSub2'
                              //, toolbar: '#toolbarDemo1'
                              , defaultToolbar: ['filter', 'exports']
                              , where: { sMsg: linterid }
                              , cols: [[
                                 // , { field: 'HMTONO', title: '计划跟踪单号', width: 100, sort: true, fixed: true edit: 'text', hide: true }
                               , { field: 'HItemID', title: 'HItemID', width: 100, hide: true }
                               , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                               , { field: 'HMaterNumber', title: '物料代码', width: 200 }
                               , { field: 'HMaterName', title: '物料名称', width: 200 }
                               , { field: 'HMaterModel', title: '规格型号', width: 200 }
                               , { field: 'HBarCode', title: '条码编号', width: 200 }
                               , { field: 'HUnitName', title: '计量单位', width: 100 }
                               , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                               , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                               , { field: 'HQty', title: '数量', width: 100 }
                               , { field: 'HBatchNo', title: '批次', width: 100 }
                               , { field: 'HEndQty', title: '是否尾箱', width: 100 }
                               , { field: 'HKFDate', title: '生产日期', width: 100 }
                               , { field: 'HKFPeriod', title: '保质期', width: 100 }
                               , { field: 'HKFDQDate', title: '到期日期', width: 100 }
                              ]]
                                // , data: [linterid]
                            //  , page: true
                              , done: function () {
                                  layer.closeAll("loading");
                              }
                             });
                             element.tabChange('tabDemo', '2');
                    {
                        type: "POST",
                        url: GetWEBURL() + "GetBarcodeSaveBillVarieties", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainSub },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // 说明验证成功了,
                                layer.msg(data.Message, { icon: 1 });
                                element.tabDelete('tabDemo', '2'); //删除
                                element.tabAdd('tabDemo', {
                                    title: '条码信息'
                                    , content: '<table class="layui-hide" id="subTable" lay-filter="subTable"></table>' //支持传入(html代码)不持支直接传入html页面
                                    , id: '2' //选项卡标题的lay-id属性值
                                });
                                table.render({
                                    elem: '#subTable'
                                    , url: GetWEBURL() + 'GetHBarCodeShowBillSub2'
                                    //, toolbar: '#toolbarDemo1'
                                    , defaultToolbar: ['filter', 'exports']
                                    , where: { sMsg: linterid }
                                    , cols: [[
                                        // , { field: 'HMTONO', title: '计划跟踪单号', width: 100, sort: true, fixed: true edit: 'text', hide: true }
                                        , { field: 'HItemID', title: 'HItemID', width: 100, hide: true }
                                        , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                                        , { field: 'HMaterNumber', title: '物料代码', width: 200 }
                                        , { field: 'HMaterName', title: '物料名称', width: 200 }
                                        , { field: 'HMaterModel', title: '规格型号', width: 200 }
                                        , { field: 'HBarCode', title: '条码编号', width: 200 }
                                        , { field: 'HUnitName', title: '计量单位', width: 100 }
                                        , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                                        , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                                        , { field: 'HQty', title: '数量', width: 100 }
                                        , { field: 'HBatchNo', title: '批次', width: 100 }
                                        , { field: 'HEndQty', title: '是否尾箱', width: 100 }
                                        , { field: 'HKFDate', title: '生产日期', width: 100 }
                                        , { field: 'HKFPeriod', title: '保质期', width: 100 }
                                        , { field: 'HKFDQDate', title: '到期日期', width: 100 }
                                    ]]
                                    // , data: [linterid]
                                    //  , page: true
                                    , done: function () {
                                        layer.closeAll("loading");
                                    }
                                });
                                element.tabChange('tabDemo', '2');
                            }
                            else {
                                // $("#verifycode").click();
                                layer.msg(data.Message, { icon: 5 });
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            f_alert("错误:" + err);
                        }
                        else {
                            // $("#verifycode").click();
                            layer.msg(data.Message, { icon: 5 });
                        }
                        layer.closeAll("loading");
                    },
                    error: function (err) {
                        f_alert("错误:" + err);
                    }
                });
                    });
                return false;
            });
            //生成唯一码
@@ -316,64 +319,64 @@
                var sMainSub = sMainStr + ';' + sSubStr;
                layer.load(3)
                $.ajax(
                {
                    type: "POST",
                    url: GetWEBURL()+"GetBarcodeSaveBillOnly", //方法所在页面和方法名
                    async: true,
                    data: { "msg": sMainSub },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) { // 说明验证成功了,
                            layer.msg(data.Message, { icon: 1 });
                            element.tabDelete('tabDemo', '2'); //删除
                            element.tabAdd('tabDemo', {
                                title: '条码信息'
                              , content: '<table class="layui-hide" id="subTable" lay-filter="subTable"></table>' //支持传入(html代码)不持支直接传入html页面
                              , id: '2' //选项卡标题的lay-id属性值
                            });
                            table.render({
                                elem: '#subTable'
                             , url:  GetWEBURL()+'GetHBarCodeShowBillSub2'
                             , toolbar: '#toolbarDemo1'
                             , defaultToolbar: ['filter', 'exports']
                             , where: { sMsg: linterid }
                             , cols: [[
                                 // , { field: 'HMTONO', title: '计划跟踪单号', width: 100, sort: true, fixed: true edit: 'text', hide: true }
                               , { field: 'HItemID', title: 'HItemID', width: 100, hide: true }
                               , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                               , { field: 'HMaterNumber', title: '物料代码', width: 200 }
                               , { field: 'HMaterName', title: '物料名称', width: 200 }
                               , { field: 'HMaterModel', title: '规格型号', width: 200 }
                               , { field: 'HBarCode', title: '条码编号', width: 200}
                               , { field: 'HUnitName', title: '计量单位', width: 100 }
                               , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                               , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                               , { field: 'HQty', title: '数量', width: 100 }
                               , { field: 'HBatchNo', title: '批次', width: 100 }
                               , { field: 'HEndQty', title: '是否尾箱', width: 100 }
                               , { field: 'HKFDate', title: '生产日期', width: 100 }
                               , { field: 'HKFPeriod', title: '保质期', width: 100 }
                               , { field: 'HKFDQDate', title: '到期日期', width: 100 }
                    {
                        type: "POST",
                        url: GetWEBURL() + "GetBarcodeSaveBillOnly", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainSub },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // 说明验证成功了,
                                layer.msg(data.Message, { icon: 1 });
                                element.tabDelete('tabDemo', '2'); //删除
                                element.tabAdd('tabDemo', {
                                    title: '条码信息'
                                    , content: '<table class="layui-hide" id="subTable" lay-filter="subTable"></table>' //支持传入(html代码)不持支直接传入html页面
                                    , id: '2' //选项卡标题的lay-id属性值
                                });
                                table.render({
                                    elem: '#subTable'
                                    , url: GetWEBURL() + 'GetHBarCodeShowBillSub2'
                                    , toolbar: '#toolbarDemo1'
                                    , defaultToolbar: ['filter', 'exports']
                                    , where: { sMsg: linterid }
                                    , cols: [[
                                        // , { field: 'HMTONO', title: '计划跟踪单号', width: 100, sort: true, fixed: true edit: 'text', hide: true }
                                        , { field: 'HItemID', title: 'HItemID', width: 100, hide: true }
                                        , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                                        , { field: 'HMaterNumber', title: '物料代码', width: 200 }
                                        , { field: 'HMaterName', title: '物料名称', width: 200 }
                                        , { field: 'HMaterModel', title: '规格型号', width: 200 }
                                        , { field: 'HBarCode', title: '条码编号', width: 200 }
                                        , { field: 'HUnitName', title: '计量单位', width: 100 }
                                        , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                                        , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                                        , { field: 'HQty', title: '数量', width: 100 }
                                        , { field: 'HBatchNo', title: '批次', width: 100 }
                                        , { field: 'HEndQty', title: '是否尾箱', width: 100 }
                                        , { field: 'HKFDate', title: '生产日期', width: 100 }
                                        , { field: 'HKFPeriod', title: '保质期', width: 100 }
                                        , { field: 'HKFDQDate', title: '到期日期', width: 100 }
                             ]]
                                // , data: [linterid]
                                //  , page: true
                             , done: function () {
                                 layer.closeAll("loading");
                             }
                            });
                            element.tabChange('tabDemo', '2');
                                    ]]
                                    // , data: [linterid]
                                    //  , page: true
                                    , done: function () {
                                        layer.closeAll("loading");
                                    }
                                });
                                element.tabChange('tabDemo', '2');
                            }
                            else {
                                // $("#verifycode").click();
                                layer.msg(data.Message, { icon: 5 });
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            f_alert("错误:" + err);
                        }
                        else {
                            // $("#verifycode").click();
                            layer.msg(data.Message, { icon: 5 });
                        }
                        layer.closeAll("loading");
                    },
                    error: function (err) {
                        f_alert("错误:" + err);
                    }
                });
                    });
                return false;
            });
            //生成内外箱码
@@ -386,138 +389,138 @@
                var sMainSub = sMainStr + ';' + sSubStr;
                layer.load(3)
                $.ajax(
                {
                    type: "POST",
                    url: GetWEBURL()+"GetBarcodeSaveBillBox", //方法所在页面和方法名
                    async: true,
                    data: { "msg": sMainSub },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) { // 说明验证成功了,
                            layer.msg(data.Message, { icon: 1 });
                            element.tabDelete('tabDemo', '2'); //删除
                            element.tabDelete('tabDemo', '3'); //删除
                            element.tabAdd('tabDemo', {
                                title: '外箱条码'
                              , content: '<table class="layui-hide" id="subTable" lay-filter="subTable"></table>' //支持传入(html代码)不持支直接传入html页面
                              , id: '2' //选项卡标题的lay-id属性值
                            });
                            table.render({
                                elem: '#subTable'
                             , url:  GetWEBURL()+'GetHBarCodeShowBillSub3'
                             , toolbar: '#toolbarDemo1'
                             , defaultToolbar: ['filter', 'exports']
                             , where: { sMsg: linterid }
                             , cols: [[
                                 // , { field: 'HMTONO', title: '计划跟踪单号', width: 100, sort: true, fixed: true edit: 'text', hide: true }
                               , { field: 'HItemID', title: 'HItemID', width: 100, hide: true }
                               , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                               , { field: 'HMaterNumber', title: '物料代码', width: 200 }
                               , { field: 'HMaterName', title: '物料名称', width: 200 }
                               , { field: 'HMaterModel', title: '规格型号', width: 200 }
                               , { field: 'HBarCode', title: '条码编号', width: 200 }
                               , { field: 'HUnitName', title: '计量单位', width: 100 }
                               , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                               , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                               , { field: 'HQty', title: '数量', width: 100 }
                               , { field: 'HBatchNo', title: '批次', width: 100 }
                               , { field: 'HEndQty', title: '是否尾箱', width: 100 }
                               , { field: 'HKFDate', title: '生产日期', width: 100 }
                               , { field: 'HKFPeriod', title: '保质期', width: 100 }
                               , { field: 'HKFDQDate', title: '到期日期', width: 100 }
                    {
                        type: "POST",
                        url: GetWEBURL() + "GetBarcodeSaveBillBox", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainSub },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // 说明验证成功了,
                                layer.msg(data.Message, { icon: 1 });
                                element.tabDelete('tabDemo', '2'); //删除
                                element.tabDelete('tabDemo', '3'); //删除
                                element.tabAdd('tabDemo', {
                                    title: '外箱条码'
                                    , content: '<table class="layui-hide" id="subTable" lay-filter="subTable"></table>' //支持传入(html代码)不持支直接传入html页面
                                    , id: '2' //选项卡标题的lay-id属性值
                                });
                                table.render({
                                    elem: '#subTable'
                                    , url: GetWEBURL() + 'GetHBarCodeShowBillSub3'
                                    , toolbar: '#toolbarDemo1'
                                    , defaultToolbar: ['filter', 'exports']
                                    , where: { sMsg: linterid }
                                    , cols: [[
                                        // , { field: 'HMTONO', title: '计划跟踪单号', width: 100, sort: true, fixed: true edit: 'text', hide: true }
                                        , { field: 'HItemID', title: 'HItemID', width: 100, hide: true }
                                        , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                                        , { field: 'HMaterNumber', title: '物料代码', width: 200 }
                                        , { field: 'HMaterName', title: '物料名称', width: 200 }
                                        , { field: 'HMaterModel', title: '规格型号', width: 200 }
                                        , { field: 'HBarCode', title: '条码编号', width: 200 }
                                        , { field: 'HUnitName', title: '计量单位', width: 100 }
                                        , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                                        , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                                        , { field: 'HQty', title: '数量', width: 100 }
                                        , { field: 'HBatchNo', title: '批次', width: 100 }
                                        , { field: 'HEndQty', title: '是否尾箱', width: 100 }
                                        , { field: 'HKFDate', title: '生产日期', width: 100 }
                                        , { field: 'HKFPeriod', title: '保质期', width: 100 }
                                        , { field: 'HKFDQDate', title: '到期日期', width: 100 }
                             ]]
                                // , data: [linterid]
                                //  , page: true
                             , done: function () {
                                 layer.closeAll("loading");
                             }
                            });
                            element.tabAdd('tabDemo', {
                                title: '内箱条码'
                                , content: '<table class="layui-hide" id="subTable2" lay-filter="subTable2"></table>' //支持传入(html代码)不持支直接传入html页面
                                , id: '3' //选项卡标题的lay-id属性值
                            });
                            table.render({
                                elem: '#subTable2'
                             , url:  GetWEBURL()+'GetHBarCodeShowBillSub4'
                             , toolbar: '#toolbarDemo2'
                             , defaultToolbar: ['filter', 'exports']
                             , where: { sMsg: linterid }
                             , cols: [[
                                 // , { field: 'HMTONO', title: '计划跟踪单号', width: 100, sort: true, fixed: true edit: 'text', hide: true }
                               , { field: 'HItemID', title: 'HItemID', width: 100, hide: true }
                               , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                               , { field: 'HMaterNumber', title: '物料代码', width: 200 }
                               , { field: 'HMaterName', title: '物料名称', width: 200 }
                               , { field: 'HMaterModel', title: '规格型号', width: 200 }
                               , { field: 'HBarCode', title: '条码编号', width: 200 }
                               , { field: 'HUnitName', title: '计量单位', width: 100 }
                               , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                               , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                               , { field: 'HQty', title: '数量', width: 100 }
                               , { field: 'HBatchNo', title: '批次', width: 100 }
                               , { field: 'HEndQty', title: '是否尾箱', width: 100 }
                               , { field: 'HKFDate', title: '生产日期', width: 100 }
                               , { field: 'HKFPeriod', title: '保质期', width: 100}
                               , { field: 'HKFDQDate', title: '到期日期', width: 100 }
                                    ]]
                                    // , data: [linterid]
                                    //  , page: true
                                    , done: function () {
                                        layer.closeAll("loading");
                                    }
                                });
                                element.tabAdd('tabDemo', {
                                    title: '内箱条码'
                                    , content: '<table class="layui-hide" id="subTable2" lay-filter="subTable2"></table>' //支持传入(html代码)不持支直接传入html页面
                                    , id: '3' //选项卡标题的lay-id属性值
                                });
                                table.render({
                                    elem: '#subTable2'
                                    , url: GetWEBURL() + 'GetHBarCodeShowBillSub4'
                                    , toolbar: '#toolbarDemo2'
                                    , defaultToolbar: ['filter', 'exports']
                                    , where: { sMsg: linterid }
                                    , cols: [[
                                        // , { field: 'HMTONO', title: '计划跟踪单号', width: 100, sort: true, fixed: true edit: 'text', hide: true }
                                        , { field: 'HItemID', title: 'HItemID', width: 100, hide: true }
                                        , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                                        , { field: 'HMaterNumber', title: '物料代码', width: 200 }
                                        , { field: 'HMaterName', title: '物料名称', width: 200 }
                                        , { field: 'HMaterModel', title: '规格型号', width: 200 }
                                        , { field: 'HBarCode', title: '条码编号', width: 200 }
                                        , { field: 'HUnitName', title: '计量单位', width: 100 }
                                        , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                                        , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                                        , { field: 'HQty', title: '数量', width: 100 }
                                        , { field: 'HBatchNo', title: '批次', width: 100 }
                                        , { field: 'HEndQty', title: '是否尾箱', width: 100 }
                                        , { field: 'HKFDate', title: '生产日期', width: 100 }
                                        , { field: 'HKFPeriod', title: '保质期', width: 100 }
                                        , { field: 'HKFDQDate', title: '到期日期', width: 100 }
                             ]]
                                // , data: [linterid]
                                //  , page: true
                             , done: function () {
                                 layer.closeAll("loading");
                             }
                            });
                            element.tabChange('tabDemo', '2');
                                    ]]
                                    // , data: [linterid]
                                    //  , page: true
                                    , done: function () {
                                        layer.closeAll("loading");
                                    }
                                });
                                element.tabChange('tabDemo', '2');
                            }
                            else {
                                // $("#verifycode").click();
                                layer.msg(data.Message, { icon: 5 });
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            f_alert("错误:" + err);
                        }
                        else {
                            // $("#verifycode").click();
                            layer.msg(data.Message, { icon: 5 });
                        }
                        layer.closeAll("loading");
                    },
                    error: function (err) {
                        f_alert("错误:" + err);
                    }
                });
                    });
                return false;
            });
      form.on('submit(Print)', function (data) {//打印
        var data1 = layui.table.cache["subTable"]
        , data2 = layui.table.cache["subTable2"];
        var rows = '';
        var rows2 = '';
        for (var i = 0; i < data1.length; i++) {
            rows += data1[i].HItemID.toString() + ',';
            rows2 += data1[i].HBarCode.toString() + ',';
        }
        for (var j = 0; j < data2.length; j++) {
            rows += data2[j].HItemID.toString() + ',';
            rows2 += data2[j].HBarCode.toString() + ',';
        }
        rows = rows.substring(rows.length - 1, 0);
        rows2 = rows2.substring(rows2.length - 1, 0);
        if (rows == "") {
            layer.msg("至少选择一行记录!")
        }
        else {
            layer.open({
                type: 2
                , area: ['50%', '50%']
                , title: '打印模版选择'
                , shade: 0.6 //遮罩透明度
                , maxmin: false //允许全屏最小化
                , anim: 0 //0-6的动画形式,-1不开启
                , content: ['../../views/BaseSet/SRM_OpenTmpList.html?linterid=' + rows.toString() + '&HBarcode=' + rows2.toString() + '&Type=HBarCodePrint', 'yes']
                , resize: false
                //, cancel: function () {
                //    $(".layui-btn").removeClass("layui-btn-disabled");
                //}
            })
        }
        });
            form.on('submit(Print)', function (data) {//打印
                var data1 = layui.table.cache["subTable"]
                    , data2 = layui.table.cache["subTable2"];
                var rows = '';
                var rows2 = '';
                for (var i = 0; i < data1.length; i++) {
                    rows += data1[i].HItemID.toString() + ',';
                    rows2 += data1[i].HBarCode.toString() + ',';
                }
                for (var j = 0; j < data2.length; j++) {
                    rows += data2[j].HItemID.toString() + ',';
                    rows2 += data2[j].HBarCode.toString() + ',';
                }
                rows = rows.substring(rows.length - 1, 0);
                rows2 = rows2.substring(rows2.length - 1, 0);
                if (rows == "") {
                    layer.msg("至少选择一行记录!")
                }
                else {
                    layer.open({
                        type: 2
                        , area: ['50%', '50%']
                        , title: '打印模版选择'
                        , shade: 0.6 //遮罩透明度
                        , maxmin: false //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: ['../../views/BaseSet/SRM_OpenTmpList.html?linterid=' + rows.toString() + '&HBarcode=' + rows2.toString() + '&Type=HBarCodePrint', 'yes']
                        , resize: false
                        //, cancel: function () {
                        //    $(".layui-btn").removeClass("layui-btn-disabled");
                        //}
                    })
                }
            });
            form.on('submit(Exit)', function (data) {//退出
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index); //再执行关闭
@@ -534,51 +537,52 @@
                }
            });
            layer.load(3)
            table.render({
                elem: '#mainTable'
              , url:  GetWEBURL()+'GetHBarCodeShowBillSub'
              , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
              , defaultToolbar: ['filter', 'exports']
              , where: { sMsg: linterid, sMsg2: lentryid }
              , cols: [[
              , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
              , { field: 'HMaterNumber', title: '物料代码', width: 100 }
              , { field: 'HMaterName', title: '物料名称', width: 200 }
              , { field: 'HMaterModel', title: '规格型号', width: 200 }
              , { field: 'HUnitName', title: '计量单位', width: 100 }
              , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
              , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
              , { field: 'HQty', title: '数量', width: 100 }
              , { field: 'HMinQty', title: '内箱包装数', width: 100, edit: 'text' }
              , { field: 'HBQty', title: '内箱数', width: 100 }
              , { field: 'HWXQty', title: '外箱包装数', width: 100, edit: 'text' }
              , { field: 'HWBQty', title: '外箱数', width: 100 }
              , { field: 'HPrice', title: '单价', width: 100, hide: true }
              , { field: 'HMoney', title: '金额', width: 100, hide: true }
              , { field: 'HMTONO', title: '计划跟踪单号', width: 100 }
              , { field: 'HBatchNo', title: '批次', width: 100, edit: 'text' }
              , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150 }//, data_field: 'HKFDate', event: "chooseHKFDate"
              , { field: 'HKFPeriod', title: '保质期', width: 100 }//, edit: 'text', event: "inputHKFPeriod"
              , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150 }//, data_field: 'HKFDQDate', event: "chooseHKFDQDate"
              //, { field: 'HDate', title: '要求交货日期', width: 150 }
              , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
              , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
              , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 }
              , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true }
              , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true }
              , { field: 'HWWOrderDetaiLID    ', title: '委外订单明细内码', width: 150, hide: true }
              , { field: 'HWWOrderBillNo', title: '委外订单单号', width: 200 }
              , { field: 'HSourceBillType', title: '源单类型', width: 100 }
              , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
              , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true }
              , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true }
              , { field: 'HSupID', title: '供应商ID', width: 150, hide: true }
                , url: GetWEBURL() + subUrl
                , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
                , defaultToolbar: ['filter', 'exports']
                , where: { sMsg: linterid, sMsg2: lentryid }
                , cols: [[
                    , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                    , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                    , { field: 'HMaterName', title: '物料名称', width: 200 }
                    , { field: 'HMaterModel', title: '规格型号', width: 200 }
                    , { field: 'HUnitName', title: '计量单位', width: 100 }
                    , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                    , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                    , { field: 'HQty', title: '数量', width: 100 }
                    , { field: 'HMinQty', title: '内箱包装数', width: 100, edit: 'text' }
                    , { field: 'HBQty', title: '内箱数', width: 100 }
                    , { field: 'HWXQty', title: '外箱包装数', width: 100, edit: 'text' }
                    , { field: 'HWBQty', title: '外箱数', width: 100 }
                    , { field: 'HPrice', title: '单价', width: 100, hide: true }
                    , { field: 'HMoney', title: '金额', width: 100, hide: true }
                    , { field: 'HMTONO', title: '计划跟踪单号', width: 100 }
                    , { field: 'HBatchNo', title: '批次', width: 100, edit: 'text' }
                    , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150 }//, data_field: 'HKFDate', event: "chooseHKFDate"
                    , { field: 'HKFPeriod', title: '保质期', width: 100 }//, edit: 'text', event: "inputHKFPeriod"
                    , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150 }//, data_field: 'HKFDQDate', event: "chooseHKFDQDate"
                    //, { field: 'HDate', title: '要求交货日期', width: 150 }
                    , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
                    , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
                    , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 }
                    , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true }
                    , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true }
                    , { field: 'HWWOrderDetaiLID    ', title: '委外订单明细内码', width: 150, hide: true }
                    , { field: 'HWWOrderBillNo', title: '委外订单单号', width: 200 }
                    , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
                    , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true }
                    , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true }
                    , { field: 'HSupID', title: '供应商ID', width: 150, hide: true }
              ]]
              // , data: [linterid]
             // , page: true
                ]]
                // , data: [linterid]
                // , page: true
                //, height: 500
                , done: function (res, curr, count) {
                    //日期控件
                    //$(".layui-input-date").each(function (i) {
@@ -605,95 +609,95 @@
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                        //自定义头工具栏
                    //自定义头工具栏
                    case 'btn-normal':
                        table.render({
                            elem: '#mainTable'
                          , url:  GetWEBURL()+'GetHBarCodeShowBillSub'
                          , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
                          , defaultToolbar: ['filter', 'exports']
                          , where: { sMsg: linterid, sMsg2: lentryid }
                          , cols: [[
                            , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                            , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                            , { field: 'HMaterName', title: '物料名称', width: 200 }
                            , { field: 'HMaterModel', title: '规格型号', width: 200 }
                            , { field: 'HUnitName', title: '计量单位', width: 100 }
                            , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                            , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                            , { field: 'HQty', title: '数量', width: 100 }
                            , { field: 'HMinQty', title: '最小包装数', width: 100, edit: 'text' }
                            , { field: 'HBQty', title: '条码张数', width: 100 }
                            , { field: 'HPrice', title: '单价', width: 100, hide: true }
                            , { field: 'HMoney', title: '金额', width: 100, hide: true }
                            , { field: 'HMTONO', title: '计划跟踪单号', width: 100 }
                            , { field: 'HBatchNo', title: '批次', width: 100, edit: 'text' }
                            , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" }
                            , { field: 'HKFPeriod', title: '保质期', width: 100, edit: 'text', event: "inputHKFPeriod" }
                            , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate', event: "chooseHKFDQDate" }
                            //, { field: 'HDate', title: '要求交货日期', width: 150 }
                            , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
                            , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
                            , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 }
                            , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true }
                            , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true }
                            , { field: 'HWWOrderDetaiLID    ', title: '委外订单明细内码', width: 150, hide: true }
                            , { field: 'HWWOrderBillNo', title: '委外订单单号', width: 200 }
                            , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                            , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
                            , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true }
                            , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true }
                            , { field: 'HSupID', title: '供应商ID', width: 150, hide: true }
                          ]]
                          , done: function () {
                              layer.closeAll("loading");
                          }
                            , url: GetWEBURL() + 'GetHBarCodeShowBillSub'
                            , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
                            , defaultToolbar: ['filter', 'exports']
                            , where: { sMsg: linterid, sMsg2: lentryid }
                            , cols: [[
                                , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                                , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                                , { field: 'HMaterName', title: '物料名称', width: 200 }
                                , { field: 'HMaterModel', title: '规格型号', width: 200 }
                                , { field: 'HUnitName', title: '计量单位', width: 100 }
                                , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                                , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                                , { field: 'HQty', title: '数量', width: 100 }
                                , { field: 'HMinQty', title: '最小包装数', width: 100, edit: 'text' }
                                , { field: 'HBQty', title: '条码张数', width: 100 }
                                , { field: 'HPrice', title: '单价', width: 100, hide: true }
                                , { field: 'HMoney', title: '金额', width: 100, hide: true }
                                , { field: 'HMTONO', title: '计划跟踪单号', width: 100 }
                                , { field: 'HBatchNo', title: '批次', width: 100, edit: 'text' }
                                , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" }
                                , { field: 'HKFPeriod', title: '保质期', width: 100, edit: 'text', event: "inputHKFPeriod" }
                                , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate', event: "chooseHKFDQDate" }
                                //, { field: 'HDate', title: '要求交货日期', width: 150 }
                                , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
                                , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
                                , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 }
                                , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true }
                                , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true }
                                , { field: 'HWWOrderDetaiLID    ', title: '委外订单明细内码', width: 150, hide: true }
                                , { field: 'HWWOrderBillNo', title: '委外订单单号', width: 200 }
                                , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                                , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
                                , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true }
                                , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true }
                                , { field: 'HSupID', title: '供应商ID', width: 150, hide: true }
                            ]]
                            , done: function () {
                                layer.closeAll("loading");
                            }
                        });
                        break;
                    case "btn-box":
                        table.render({
                            elem: '#mainTable'
                          , url:  GetWEBURL()+'GetHBarCodeShowBillSub'
                          , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
                          , defaultToolbar: ['filter', 'exports']
                          , where: { sMsg: linterid, sMsg2: lentryid }
                          , cols: [[
                            , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                            , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                            , { field: 'HMaterName', title: '物料名称', width: 200 }
                            , { field: 'HMaterModel', title: '规格型号', width: 200 }
                            , { field: 'HUnitName', title: '计量单位', width: 100 }
                            , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                            , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                            , { field: 'HQty', title: '数量', width: 100 }
                            , { field: 'HMinQty', title: '内箱包装数', width: 100, edit: 'text' }
                            , { field: 'HBQty', title: '内箱数', width: 100 }
                            , { field: 'HWXQty', title: '外箱包装数', width: 100, edit: 'text' }
                            , { field: 'HWBQty', title: '外箱数', width: 100 }
                            , { field: 'HPrice', title: '单价', width: 100, hide: true }
                            , { field: 'HMoney', title: '金额', width: 100, hide: true }
                            , { field: 'HMTONO', title: '计划跟踪单号', width: 100 }
                            , { field: 'HBatchNo', title: '批次', width: 100, edit: 'text' }
                            , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" }
                            , { field: 'HKFPeriod', title: '保质期', width: 100, edit: 'text', event: "inputHKFPeriod" }
                            , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate', event: "chooseHKFDQDate" }
                            //, { field: 'HDate', title: '要求交货日期', width: 150 }
                            , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
                            , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
                            , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 }
                            , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true }
                            , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true }
                            , { field: 'HWWOrderDetaiLID    ', title: '委外订单明细内码', width: 150, hide: true }
                            , { field: 'HWWOrderBillNo', title: '委外订单单号', width: 200 }
                            , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                            , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
                            , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true }
                            , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true }
                            , { field: 'HSupID', title: '供应商ID', width: 150, hide: true }
                          ]]
                          , done: function () {
                              layer.closeAll("loading");
                          }
                            , url: GetWEBURL() + 'GetHBarCodeShowBillSub'
                            , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
                            , defaultToolbar: ['filter', 'exports']
                            , where: { sMsg: linterid, sMsg2: lentryid }
                            , cols: [[
                                , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                                , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                                , { field: 'HMaterName', title: '物料名称', width: 200 }
                                , { field: 'HMaterModel', title: '规格型号', width: 200 }
                                , { field: 'HUnitName', title: '计量单位', width: 100 }
                                , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                                , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                                , { field: 'HQty', title: '数量', width: 100 }
                                , { field: 'HMinQty', title: '内箱包装数', width: 100, edit: 'text' }
                                , { field: 'HBQty', title: '内箱数', width: 100 }
                                , { field: 'HWXQty', title: '外箱包装数', width: 100, edit: 'text' }
                                , { field: 'HWBQty', title: '外箱数', width: 100 }
                                , { field: 'HPrice', title: '单价', width: 100, hide: true }
                                , { field: 'HMoney', title: '金额', width: 100, hide: true }
                                , { field: 'HMTONO', title: '计划跟踪单号', width: 100 }
                                , { field: 'HBatchNo', title: '批次', width: 100, edit: 'text' }
                                , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" }
                                , { field: 'HKFPeriod', title: '保质期', width: 100, edit: 'text', event: "inputHKFPeriod" }
                                , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate', event: "chooseHKFDQDate" }
                                //, { field: 'HDate', title: '要求交货日期', width: 150 }
                                , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
                                , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
                                , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 }
                                , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true }
                                , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true }
                                , { field: 'HWWOrderDetaiLID    ', title: '委外订单明细内码', width: 150, hide: true }
                                , { field: 'HWWOrderBillNo', title: '委外订单单号', width: 200 }
                                , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                                , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
                                , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true }
                                , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true }
                                , { field: 'HSupID', title: '供应商ID', width: 150, hide: true }
                            ]]
                            , done: function () {
                                layer.closeAll("loading");
                            }
                        });
                        break;
@@ -703,35 +707,36 @@
            //监听行工具事件
            table.on('tool(mainTable)', function (obj) {
                var data = obj.data;
                if(obj.event === 'chooseHKFDate'){
                if (obj.event === 'chooseHKFDate') {
                    var field = $(this).data('field');
                    laydate.render({
                        elem: this.firstChild
                      , show: true //直接显示
                      , closeStop: this
                      , done: function (value, date) {
                          data[field] = value;
                          obj.update(data);
                          if (parseInt(obj.data.HKFPeriod) >= 0) {
                              var sKFDQDate = addDate(value, parseInt(obj.data.HKFPeriod));
                              obj.update({
                                  HKFDQDate: sKFDQDate,
                              });
                          }
                      }
                        , show: true //直接显示
                        , closeStop: this
                        , done: function (value, date) {
                            data[field] = value;
                            obj.update(data);
                            if (parseInt(obj.data.HKFPeriod) >= 0) {
                                var sKFDQDate = addDate(value, parseInt(obj.data.HKFPeriod));
                                obj.update({
                                    HKFDQDate: sKFDQDate,
                                });
                            }
                        }
                    });
                }
                else if (obj.event == 'chooseHKFDQDate') {
                    var field = $(this).data('field');
                    laydate.render({
                        elem: this.firstChild
                      , show: true //直接显示
                      , closeStop: this
                      , done: function (value, date) {
                          data[field] = value;
                          obj.update(data);
                        , show: true //直接显示
                        , closeStop: this
                        , done: function (value, date) {
                            data[field] = value;
                            obj.update(data);
                      }});
                        }
                    });
                }
                else if (obj.event == 'inputHKFPeriod') {
                    $(obj.tr).find(".layui-table-edit").keyup(function () {
@@ -753,81 +758,79 @@
            //    }
            //});
            table.on('edit(mainTable)', function (obj) { //注:edit是固定事件名,test是table原始容器的属性 lay-filter="对应的值"
               var value = obj.value //得到修改后的值
                  ,data = obj.data //得到所在行所有键值
                  , field = obj.field; //得到字段
               var HMinQty = 0;
               var HWXQty = 0;
               var HKFPeriod = 0;
               if (obj.data.HMinQty != undefined)
               {
                   HMinQty = parseFloat(obj.data.HMinQty);
               }
               if (obj.data.HWXQty != undefined) {
                   HWXQty = parseFloat(obj.data.HWXQty);
               }
               if (obj.data.HKFPeriod != undefined) {
                   HKFPeriod = parseFloat(obj.data.HKFPeriod);
               }
               HKFPeriod
               switch(field){
                   case "HMinQty":
                       if (HMinQty>0){
                           if (HWXQty >= 0) {
                               if (isPositiveIntegerTimes(parseFloat(obj.value), HWXQty)) //外箱包装数能被内箱包装数整除
                               {
                                   obj.update({
                                       HBQty: Math.ceil(parseFloat(obj.data.HQty) / parseFloat(obj.value)),
                                   });
                               }
                               else {
                                   //obj.update({
                                   //    HMinQty: 0,
                                   //});
                                   f_alert("外箱包装数必须是内箱包装数的整数倍!");
                               }
                           }
                       }
                       else
                       {
                           //obj.update({
                           //    HMinQty: 0,
                           //});
                           f_alert("内箱包装数不能为负数!");
                       }
                       break;
                   case "HWXQty":
                       if (HWXQty > 0) {
                           if (HMinQty >= 0) {
                               if (isPositiveIntegerTimes(HMinQty, parseFloat(obj.value))) //外箱包装数能被内箱包装数整除
                               {
                                   obj.update({
                                       HWBQty: Math.ceil(parseFloat(obj.data.HQty) / parseFloat(obj.value)),
                                   });
                               }
                               else {
                                   //obj.update({
                                   //    HWXQty: 0,
                                   //});
                                   f_alert("外箱包装数必须是内箱包装数的整数倍!");
                               }
                           }
                       }
                       else {
                           //obj.update({
                           //    HWXQty: 0,
                           //});
                           f_alert("外箱包装数不能为负数!");
                       }
                       break;
                   case "HKFPeriod":
                       if (HKFPeriod >= 0) {
                           var sKFDQDate = addDate(obj.data.HKFDate, HKFPeriod);
                           obj.update({
                               HKFDQDate: sKFDQDate,
                           });
                       }
         }
                var value = obj.value //得到修改后的值
                    , data = obj.data //得到所在行所有键值
                    , field = obj.field; //得到字段
                var HMinQty = 0;
                var HWXQty = 0;
                var HKFPeriod = 0;
                if (obj.data.HMinQty != undefined) {
                    HMinQty = parseFloat(obj.data.HMinQty);
                }
                if (obj.data.HWXQty != undefined) {
                    HWXQty = parseFloat(obj.data.HWXQty);
                }
                if (obj.data.HKFPeriod != undefined) {
                    HKFPeriod = parseFloat(obj.data.HKFPeriod);
                }
                HKFPeriod
                switch (field) {
                    case "HMinQty":
                        if (HMinQty > 0) {
                            if (HWXQty >= 0) {
                                if (isPositiveIntegerTimes(parseFloat(obj.value), HWXQty)) //外箱包装数能被内箱包装数整除
                                {
                                    obj.update({
                                        HBQty: Math.ceil(parseFloat(obj.data.HQty) / parseFloat(obj.value)),
                                    });
                                }
                                else {
                                    //obj.update({
                                    //    HMinQty: 0,
                                    //});
                                    f_alert("外箱包装数必须是内箱包装数的整数倍!");
                                }
                            }
                        }
                        else {
                            //obj.update({
                            //    HMinQty: 0,
                            //});
                            f_alert("内箱包装数不能为负数!");
                        }
                        break;
                    case "HWXQty":
                        if (HWXQty > 0) {
                            if (HMinQty >= 0) {
                                if (isPositiveIntegerTimes(HMinQty, parseFloat(obj.value))) //外箱包装数能被内箱包装数整除
                                {
                                    obj.update({
                                        HWBQty: Math.ceil(parseFloat(obj.data.HQty) / parseFloat(obj.value)),
                                    });
                                }
                                else {
                                    //obj.update({
                                    //    HWXQty: 0,
                                    //});
                                    f_alert("外箱包装数必须是内箱包装数的整数倍!");
                                }
                            }
                        }
                        else {
                            //obj.update({
                            //    HWXQty: 0,
                            //});
                            f_alert("外箱包装数不能为负数!");
                        }
                        break;
                    case "HKFPeriod":
                        if (HKFPeriod >= 0) {
                            var sKFDQDate = addDate(obj.data.HKFDate, HKFPeriod);
                            obj.update({
                                HKFDQDate: sKFDQDate,
                            });
                        }
                }
            });
@@ -839,20 +842,20 @@
                        page: {
                            curr: 1 //重新从第 1 页开始
                        }
                      , where: {
                          key: {
                              id: demoReload.val()
                          }
                      }
                        , where: {
                            key: {
                                id: demoReload.val()
                            }
                        }
                    });
                }
            };
            $('.test-table-reload-btn .layui-btn').on('click', function () {
                var type = $(this).data('type');
                active[type] ? active[type].call(this) : '';
            });
           });
        });
    </script>
</body>
</html>
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBill.html
@@ -90,7 +90,12 @@
                                                        <input id="HDeptID" name="HDeptID" type="hidden" />
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label"> 物流单号:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HDeliveryNo" id="HDeliveryNo" autocomplete="off">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
@@ -169,6 +174,7 @@
                    <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                    <script type="text/html" id="toolbarDemo">
                        <div class="layui-btn-container">
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Save"><i class="layui-icon layui-icon-tips"></i>保存</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-view"><i class="layui-icon layui-icon-tips"></i>预览</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>打印</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-reload"><i class="layui-icon layui-icon-refresh"></i>刷新</button>
@@ -178,7 +184,7 @@
                    </script>
                    <blockquote class="layui-elem-quote">送货单</blockquote>
                </div>
                        </div>
            </div>
        </div>
    </div>
    <!--<script src="../../layuiadmin/layui/lay/modules/mobile/jquery-3.3.1.min.js"></script>-->
@@ -194,80 +200,82 @@
            index: 'lib/index' //主入口模块
        }).use(['index', 'table', 'form', 'element'], function () {
            var table = layui.table
            , $ = layui.$
            , form = layui.form
            , element = layui.element; //Tab的切换功能,切换事件监听等,需要依赖element模块
                , $ = layui.$
                , form = layui.form
                , element = layui.element; //Tab的切换功能,切换事件监听等,需要依赖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 linterid = params[params[0]];
        var lentryid = params[params[1]];
        RoadBillMain(linterid);
        RoadBillSub(linterid);
        // debugger;
        function RoadBillMain(linterid) {
            $.ajax({
                url: GetWEBURL()+"GetPOInStockShowBillMain",
                type: "GET",
                data: { "sMsg": linterid },
                success: function (d) {
                    console.log(d.data);
                    //$("#HDate").val(d.)
                    $("#HInterID").val(d.data[0].HInterID);
                    $("#HBillNo").val(d.data[0].HBillNo);
                    $("#HStatus").val(d.data[0].HStatus);
                    $("#HInnerBillNo").val(d.data[0].HInnerBillNo);
                    $("#HRemark").val(d.data[0].HRemark);
                    $("#HDate").val(d.data[0].HDateForWeb);
                    $("#HMaker").val(d.data[0].HMaker);
                    $("#HMakerDate").val(d.data[0].HMakerDate)
                    $("#HChecker").val(d.data[0].HChecker);
                    $("#HCheckDate").val(d.data[0].HCheckDate);
                    $("#HDeptID").val(d.data[0].HDeptID);
                    $("#HDeptName").val(d.data[0].HDeptName);
                    $("#HSupID").val(d.data[0].HSupID);
                    $("#HSupName").val(d.data[0].HSupName);
                    $("#HEmpID").val(d.data[0].HEmpID);
                    $("#HEmpName").val(d.data[0].HEmpName);
                    $("#HManagerID").val(d.data[0].HManagerID);
                    $("#HManagerName").val(d.data[0].HManagerName);
            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 linterid = params[params[0]];
            var lentryid = params[params[1]];
            var btntype = params[params[1]];
            RoadBillMain(linterid);
            RoadBillSub(linterid);
            // debugger;
            function RoadBillMain(linterid) {
                $.ajax({
                    url: GetWEBURL() + "GetPOInStockShowBillMain",
                    type: "GET",
                    data: { "sMsg": linterid },
                    success: function (d) {
                        console.log(d.data);
                        //$("#HDate").val(d.)
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HStatus").val(d.data[0].HStatus);
                        $("#HInnerBillNo").val(d.data[0].HInnerBillNo);
                        $("#HRemark").val(d.data[0].HRemark);
                        $("#HDate").val(d.data[0].HDateForWeb);
                        $("#HMaker").val(d.data[0].HMaker);
                        $("#HMakerDate").val(d.data[0].HMakerDate)
                        $("#HChecker").val(d.data[0].HChecker);
                        $("#HCheckDate").val(d.data[0].HCheckDate);
                        $("#HDeptID").val(d.data[0].HDeptID);
                        $("#HDeptName").val(d.data[0].HDeptName);
                        $("#HSupID").val(d.data[0].HSupID);
                        $("#HSupName").val(d.data[0].HSupName);
                        $("#HEmpID").val(d.data[0].HEmpID);
                        $("#HEmpName").val(d.data[0].HEmpName);
                        $("#HManagerID").val(d.data[0].HManagerID);
                        $("#HManagerName").val(d.data[0].HManagerName);
                        $("#HDeliveryNo").val(d.data[0].HDeliveryNo);
                    }
                });
            }
            ///加载显示数据
        function RoadBillSub(linterid) {
            $.ajax({
                type: "get",
                url: GetWEBURL()+"GetPOInStockShowBillSub",
                async: true,
                data: { sMsg: linterid},
                success: function (result) {
                    ajaxReturnData = JSON.parse(JSON.stringify(result)).data;
                    table.reload('mainTable', {
                        data: ajaxReturnData
                        , height: 'full-10'
                        , loading: false
                        , done: function (index, res) {
            function RoadBillSub(linterid) {
                $.ajax({
                    type: "get",
                    url: GetWEBURL() + "GetPOInStockShowBillSub",
                    async: true,
                    data: { sMsg: linterid },
                    success: function (result) {
                        ajaxReturnData = JSON.parse(JSON.stringify(result)).data;
                        table.reload('mainTable', {
                            data: ajaxReturnData
                            , height: 'full-10'
                            , loading: false
                            , done: function (index, res) {
                        }
                    });
                },
                error: function (result) {
                    console.log(result);
                    //layer.msg('获取采购订单出现异常', { icon: 2, time: 2000 });
                }
            });
        }
                            }
                        });
                    },
                    error: function (result) {
                        console.log(result);
                        //layer.msg('获取采购订单出现异常', { icon: 2, time: 2000 });
                    }
                });
            }
            //监听提交
            //form.verify({
            //    numberOrEmpty: function (value, item) {
@@ -278,48 +286,48 @@
            //        //}
            //    }
            //});
        layer.load(3)
        table.render({
            elem: '#mainTable'
          , url:  GetWEBURL()+'GetPOInStockShowBillSub'
            , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
            , defaultToolbar: ['filter', 'exports']
            //, where: { sMsg: linterid }
          , where: { sMsg: linterid }
          , cols: [[
           // , { field: 'HMTONO', title: '计划跟踪单号', width: 100,, sort: true, fixed: true edit: 'text', hide: true }
            , { field: 'HMaterID', title: '物料ID', width: 100, edit: 'text', hide: true }
            , { field: 'HMaterNumber', title: '物料代码', width: 100}
            , { field: 'HMaterName', title: '物料名称', width: 200}
            , { field: 'HMaterModel', title: '规格型号', width: 200}
            , { field: 'HUnitName', title: '计量单位', width: 100}
            , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
            , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
            , { field: 'HQty', title: '数量', width: 100}
            , { field: 'HPrice', title: '单价', width: 100}
            , { field: 'HMoney', title: '金额', width: 100}
            , { field: 'HWHName', title: '收料仓库', width: 100 }
            , { field: 'HWHNumber', title: '收料仓库代码', width: 100, hide: true }
            , { field: 'HWHID', title: '收料仓库ID', width: 100, hide: true }
            , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
            , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
            , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 }
            , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true }
            , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true }
            , { field: 'HWWOrderDetaiLID', title: '委外订单明细内码', width: 150, hide: true }
            , { field: 'HWWOrderBillNo', title: '委外订单号', width: 200 }
            , { field: 'HSourceBillType', title: '源单类型', width: 100, hide: true }
            , { field: 'HSourceBillNo', title: '源单单号', width: 200}
            , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true }
            , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true }
          ]]
            // , data: [linterid]
            // , page: true
            //, height: 500
          , done: function () {
              layer.closeAll("loading");
          }
        });
            layer.load(3)
            table.render({
                elem: '#mainTable'
                , url: GetWEBURL() + 'GetPOInStockShowBillSub'
                , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
                , defaultToolbar: ['filter', 'exports']
                //, where: { sMsg: linterid }
                , where: { sMsg: linterid }
                , cols: [[
                    // , { field: 'HMTONO', title: '计划跟踪单号', width: 100,, sort: true, fixed: true edit: 'text', hide: true }
                    , { field: 'HMaterID', title: '物料ID', width: 100, edit: 'text', hide: true }
                    , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                    , { field: 'HMaterName', title: '物料名称', width: 200 }
                    , { field: 'HMaterModel', title: '规格型号', width: 200 }
                    , { field: 'HUnitName', title: '计量单位', width: 100 }
                    , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                    , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                    , { field: 'HQty', title: '数量', width: 100 }
                    , { field: 'HPrice', title: '单价', width: 100 }
                    , { field: 'HMoney', title: '金额', width: 100 }
                    , { field: 'HWHName', title: '收料仓库', width: 100 }
                    , { field: 'HWHNumber', title: '收料仓库代码', width: 100, hide: true }
                    , { field: 'HWHID', title: '收料仓库ID', width: 100, hide: true }
                    , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
                    , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
                    , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 }
                    , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true }
                    , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true }
                    , { field: 'HWWOrderDetaiLID', title: '委外订单明细内码', width: 150, hide: true }
                    , { field: 'HWWOrderBillNo', title: '委外订单号', width: 200 }
                    , { field: 'HSourceBillType', title: '源单类型', width: 100, hide: true }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
                    , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true }
                    , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true }
                ]]
                // , data: [linterid]
                // , page: true
                //, height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            });
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
@@ -331,19 +339,45 @@
                        window.open("../../views/SRM/HBarPlanPrint.html?linterid=" + linterid + "&Type=HPOInStockBill");
                        break;
                        //自定义头工具栏右侧图标 - 提示
                    //自定义头工具栏右侧图标 - 提示
                    case 'btn-reload':
                        RoadBillMain(linterid);
                        RoadBillSub(linterid);
                        break;
                    case 'btn-exit':
                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        parent.layer.close(index); //再执行关闭
                        //layer.close(layer.index);
                        break;
                    case 'btn-Save':
                        var HDeliveryNo = $("#HDeliveryNo").val();
                        if (btntype == "changebg") {
                            $.ajax(
                                {
                                    type: "GET",
                                    url: GetWEBURL() + "SavePOInStock", //方法所在页面和方法名
                                    async: true,
                                    data: { "HmainId": linterid, "HDeliveryNo": HDeliveryNo },
                                    dataType: "json",
                                    success: function (data) {
                                        if (data.Message.indexOf("成功") > 0) { // 说明验证成功了,
                                            layer.msg(data.Message, { icon: 1 });
                                        }
                                        else {
                                            layer.msg(data.Message, { icon: 5 });
                                        }
                                        layer.closeAll("loading");
                                    },
                                    error: function (err) {
                                        f_alert("错误:" + err);
                                    }
                                });
                        }
                        break;
                };
        });
            });
            form.on('submit(Saver)', function (data) {//保存
                //debugger;
                var sMainStr = JSON.stringify(data.field);
@@ -351,29 +385,56 @@
                var sMainSub = sMainStr + ';' + sSubStr;
                layer.load(3)
                $.ajax(
                {
                    type: "POST",
                    url: GetWEBURL()+"SaverPOInStock", //方法所在页面和方法名
                    async: true,
                    {
                        type: "POST",
                        url: GetWEBURL() + "SaverPOInStock", //方法所在页面和方法名
                        async: true,
                    data: { "msg": sMainSub },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) { // 说明验证成功了,
                            layer.msg(data.Message, { icon: 1 });
                        data: { "msg": sMainSub },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // 说明验证成功了,
                                layer.msg(data.Message, { icon: 1 });
                            }
                            else {
                                layer.msg(data.Message, { icon: 5 });
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            f_alert("错误:" + err);
                        }
                        else {
                            layer.msg(data.Message, { icon: 5 });
                        }
                        layer.closeAll("loading");
                    },
                    error: function (err) {
                        f_alert("错误:" + err);
                    }
                });
                    });
                return false;
            });
            form.on('submit(Save)', function (data) {//更新物流单号
                //debugger;
                //获取上个页面传过来的按钮事件
                if (btntype == "changebg") {
                    var HDeliveryNo = $("#HDeliveryNo").val();
                    $.ajax(
                        {
                            type: "POST",
                            url: GetWEBURL() + "SavePOInStock", //方法所在页面和方法名
                            async: true,
                            data: { "HmainId": linterid, "HDeliveryNo": HDeliveryNo },
                            dataType: "json",
                            success: function (data) {
                                if (data.Message.indexOf("成功") > 0) { // 说明验证成功了,
                                    layer.msg(data.Message, { icon: 1 });
                                }
                                else {
                                    layer.msg(data.Message, { icon: 5 });
                                }
                                layer.closeAll("loading");
                            },
                            error: function (err) {
                                f_alert("错误:" + err);
                            }
                        });
                    return false;
                }
            });
@@ -382,26 +443,26 @@
                //jiuajax从服务器获取
                layer.load(3)
                $.ajax(
                {
                    type: "POST",
                    url: GetWEBURL()+"SaverPOInStock", //方法所在页面和方法名
                    async:true,
                    data: { msg: sMainSub },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) { // 说明验证成功了,
                            layer.msg(data.Message, { icon: 1 });
                    {
                        type: "POST",
                        url: GetWEBURL() + "SaverPOInStock", //方法所在页面和方法名
                        async: true,
                        data: { msg: sMainSub },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // 说明验证成功了,
                                layer.msg(data.Message, { icon: 1 });
                            }
                            else {
                                // $("#verifycode").click();
                                layer.msg(data.Message, { icon: 5 });
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            f_alert("错误:" + err);
                        }
                        else {
                            // $("#verifycode").click();
                            layer.msg(data.Message, { icon: 5 });
                        }
                        layer.closeAll("loading");
                    },
                    error: function (err) {
                        f_alert("错误:" + err);
                    }
                });
                    });
            }
            function f_alert(sMsg) {
                layer.alert(sMsg, { icon: 5 });
@@ -442,7 +503,7 @@
            //    return JSON.stringify(ajaxData).replace(/(")/g, "\\\"");
            //   // return false;
            //});
            //function f_SaveBefore() {
            //    //保存前处理(字段格式:int类型不能为空,日期类型符合格式,bool类型)
            //    if ($("#HInterID").val() == '') {
@@ -456,7 +517,7 @@
                var type = $(this).data('type');
                active[type] ? active[type].call(this) : '';
            });
           });
        });
    </script>
</body>
</html>
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBillList.html
@@ -139,9 +139,10 @@
                            <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-getCheckData"><i class="layui-icon layui-icon-tips"></i>预览</button>-->
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-reload"><i class="layui-icon layui-icon-refresh"></i>刷新</button>
                            <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-confirm"><i class="layui-icon layui-icon-ok-circle"></i>确认</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-back"><i class="layui-icon layui-icon-close-fill"></i>驳回</button>-->
    <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-back"><i class="layui-icon layui-icon-close-fill"></i>驳回</button>-->
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-details"><i class="layui-icon layui-icon-form"></i>详情</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>打印送货单</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-changebg"><i class="layui-icon layui-icon-form"></i>变更</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>打印送货单</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-generate"><i class="layui-icon layui-icon-file"></i>生成条码</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>退出</button>
@@ -249,6 +250,7 @@
                , { field: '状态', title: '状态', width: 100, sort: true, fixed: true }
                , { field: '单据号', title: '单据号', width: 180, sort: true, fixed: true }
                , { field: '送货单号', title: '送货单号', width: 180, sort: true, fixed: true }
                , { field: '物流单号', title: '物流单号', width: 180, sort: true, fixed: true }
                , { field: '物料代码', title: '物料代码', width: 180, sort: true  }
                , { field: '物料名称', title: '物料名称', width: 180, sort: true  }
                , { field: '规格型号', title: '规格型号', width: 180, sort: true  }
@@ -311,7 +313,7 @@
                   
                    case 'btn-details':
                        var checkStatus = table.checkStatus('mainTable')
                       , data = checkStatus.data;
                            , data = checkStatus.data;
                        var linterid = data[0].hmainid.toString();
                        //if (AllowLoadData(sSubStr) != false) {//非空验证
@@ -329,6 +331,27 @@
                            }
                        })
                        break;
                    case 'btn-changebg':
                        var checkStatus = table.checkStatus('mainTable')
                            , data = checkStatus.data;
                        var linterid = data[0].hmainid.toString();
                        //if (AllowLoadData(sSubStr) != false) {//非空验证
                        layer.open({
                            type: 2
                            , area: ['100%', '100%']
                            , title: '送货单'
                            , shade: 0.6 //遮罩透明度
                            , maxmin: true //允许全屏最小化
                            , anim: 0 //0-6的动画形式,-1不开启
                            , content: '../../../src/views/SRM/SRM_POInStockBill.html?linterid=' + linterid +'&type =changebg'
                            , resize: false
                            , cancel: function () {
                                //$(".layui-btn").removeClass("layui-btn-disabled");
                            }
                        })
                        break;
                    case 'btn-print':
                        var checkStatus = table.checkStatus('mainTable')
                        , data = checkStatus.data;
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBill_Edit.html
@@ -109,10 +109,16 @@
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-row">
                                                <div class="layui-col-xs6">
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label"> 送货单号:</label>
                                                    <div class="layui-input-block">
                                                        <input class="layui-input" name="HInnerBillNo" id="HInnerBillNo" autocomplete="off">
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label"> 物流单号:</label>
                                                    <div class="layui-input-block">
                                                        <input class="layui-input" name="HDeliveryNo" id="HDeliveryNo" autocomplete="off">
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs6">
@@ -277,7 +283,7 @@
                elem: '#mainTable'
              //, url: GetWEBURL()+'GetNewPOInStockShowBillSub'
              , toolbar: '#toolbarDemo'
              //, where: { sMsg: linterid, sMsg2: lentryid, sMsg3: lSourceBillType }
             //, where: { sMsg: linterid, sMsg2: lentryid, sMsg3: lSourceBillType }
             // , where: { sMsg: '28', sMsg2: '28,5;' }
              , cols: [[
                  { type: 'checkbox', fixed: 'left' }
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POOrderBillList.html
@@ -104,12 +104,12 @@
                                <div class="layui-inline">
                                    <label class="layui-form-label">采购组织</label>
                                    <div class="layui-input-block">
                                            <select id="HPURCHASEORGID" name="HPURCHASEORGID" lay-filter="">
                                                <option value="">组织1</option>
                                                <option value="">组织2</option>
                                            </select>
                                        </div>
                                        <select id="HPURCHASEORGID" name="HPURCHASEORGID" lay-filter="">
                                            <option value="">组织1</option>
                                            <option value="">组织2</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">是否已下推送货单</label>
                                    <div class="layui-input-block">
@@ -125,7 +125,7 @@
                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                    </button>
                                </div>
                                </div>
                            </div>
                        </form>
                        <!--</div>-->
@@ -139,8 +139,10 @@
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-reload"><i class="layui-icon layui-icon-refresh"></i>刷新</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-confirm" id="btn_confirm"><i class="layui-icon layui-icon-ok-circle"></i>确认</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-back" id="btn_back"><i class="layui-icon layui-icon-close-fill"></i>驳回</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-report" id="btn_report"><i class="layui-icon layui-icon-close-fill"></i>汇报</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-details"><i class="layui-icon layui-icon-form"></i>详情</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-generate"><i class="layui-icon layui-icon-file"></i>生成送货单</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-barcode"><i class="layui-icon layui-icon-file"></i>生成条码</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>退出</button>
                        </div>
                    </script>
@@ -204,12 +206,12 @@
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'code', 'table', 'element', 'layer'], function () {
            var $ = layui.$
            , admin = layui.admin
            , layer = layui.layer
            , laydate = layui.laydate
            , table = layui.table
            , form = layui.form
            , element = layui.element;
                , admin = layui.admin
                , layer = layui.layer
                , laydate = layui.laydate
                , table = layui.table
                , form = layui.form
                , element = layui.element;
            //常规用法
            laydate.render({
                elem: '#HDate1'
@@ -230,49 +232,50 @@
                , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
                , defaultToolbar: ['filter', 'exports', 'print']
                // , where: { msg: "", NowPage: 1, OnePage: 10 }
              , cellMinWidth: 100
              , cols: [[
                //{ checkbox: true, fixed: true }
                 { type: 'checkbox', fixed: 'left' }
                //{ type: 'radio', fixed: true }
                , { field: 'sorderid', title: '序号', width: 80, fixed: true }
                , { field: 'hmainid', title: 'hmainid', sort: true, fixed: true, hide: true }
                , { field: 'hsubid', title: 'hsubid', sort: true, fixed: true, hide: true }
                , { field: '状态', title: '状态', sort: true, fixed: true }
                , { field: '单据号', title: '单据号', width: 180, sort: true, fixed: 'left' }
                , { field: '日期', title: '日期', width: 180, sort: true, fixed: 'left' }
                , { field: '供应商', title: '供应商', width: 180, sort: true, fixed: 'left' }
                , { field: '计划跟踪单号', title: '计划跟踪单号', sort: true, hide: true }
                , { field: '物料代码', title: '物料代码', width: 180, sort: true }
                , { field: '物料名称', title: '物料名称', width: 180, sort: true }
                , { field: '规格型号', title: '规格型号', width: 180, sort: true }
                , { field: '计量单位', title: '计量单位', width: 80, sort: true }
                , { field: '数量', title: '订货数量', sort: true }
                , { field: '交货地点', title: '交货地点', sort: true }
                , { field: '交货日期', title: '交货日期', width: 180, sort: true }
                , { field: '关联数量', title: '关联数量', sort: true }
                , { field: '未关联数量', title: '未关联数量', sort: true }
                , { field: '剩余入库数量', title: '剩余入库数量', sort: true }
                , { field: '剩余收料数量', title: '剩余收料数量', sort: true }
                , { field: '关闭状态', title: '关闭状态', sort: true }
                , { field: '变更状态', title: '变更状态', sort: true }
                , { field: '采购组织', title: '采购组织', sort: true }
                , { field: '确认人', title: '确认人', sort: true, hide: true }
                , { field: '确认日期', title: '确认日期', sort: true, hide: true }
                , { field: '驳回人', title: '驳回人', sort: true, hide: true }
                , { field: '驳回日期', title: '驳回日期', sort: true, hide: true }
                , { field: '驳回理由', title: '驳回理由', sort: true, hide: true }
              ]]
                , cellMinWidth: 100
                , cols: [[
                    //{ checkbox: true, fixed: true }
                    { type: 'checkbox', fixed: 'left' }
                    //{ type: 'radio', fixed: true }
                    , { field: 'sorderid', title: '序号', width: 80, fixed: true }
                    , { field: 'hmainid', title: 'hmainid', sort: true, fixed: true, hide: true }
                    , { field: 'hsubid', title: 'hsubid', sort: true, fixed: true, hide: true }
                    , { field: '状态', title: '状态', sort: true, fixed: true }
                    , { field: '反馈状态', title: '反馈状态', width: 100, fixed: true }
                    , { field: '单据号', title: '单据号', width: 180, sort: true, fixed: 'left' }
                    , { field: '日期', title: '日期', width: 180, sort: true, fixed: 'left' }
                    , { field: '供应商', title: '供应商', width: 180, sort: true, fixed: 'left' }
                    , { field: '计划跟踪单号', title: '计划跟踪单号', sort: true, hide: true }
                    , { field: '物料代码', title: '物料代码', width: 180, sort: true }
                    , { field: '物料名称', title: '物料名称', width: 180, sort: true }
                    , { field: '规格型号', title: '规格型号', width: 180, sort: true }
                    , { field: '计量单位', title: '计量单位', width: 80, sort: true }
                    , { field: '数量', title: '订货数量', sort: true }
                    , { field: '交货地点', title: '交货地点', sort: true }
                    , { field: '交货日期', title: '交货日期', width: 180, sort: true }
                    , { field: '关联数量', title: '关联数量', sort: true }
                    , { field: '未关联数量', title: '未关联数量', sort: true }
                    , { field: '剩余入库数量', title: '剩余入库数量', sort: true }
                    , { field: '剩余收料数量', title: '剩余收料数量', sort: true }
                    , { field: '关闭状态', title: '关闭状态', sort: true }
                    , { field: '变更状态', title: '变更状态', sort: true }
                    , { field: '采购组织', title: '采购组织', sort: true }
                    , { field: '确认人', title: '确认人', sort: true, hide: true }
                    , { field: '确认日期', title: '确认日期', sort: true, hide: true }
                    , { field: '驳回人', title: '驳回人', sort: true, hide: true }
                    , { field: '驳回日期', title: '驳回日期', sort: true, hide: true }
                    , { field: '驳回理由', title: '驳回理由', sort: true, hide: true }
                ]]
                //, skin: 'row' //表格风格
                // , even: true
            , page: true //是否显示分页
            , limits: [10, 20, 50, 100]
            , limit: 50 //每页默认显示的数量
                , page: true //是否显示分页
                , limits: [10, 20, 50, 100]
                , limit: 50 //每页默认显示的数量
                //, height: 500
            , done: function (res, curr, count) {
                _cur_page = curr;
                layer.closeAll("loading");
            }
                , done: function (res, curr, count) {
                    _cur_page = curr;
                    layer.closeAll("loading");
                }
            });
            //头工具栏事件
@@ -283,28 +286,28 @@
                        var data = checkStatus.data;
                        layer.alert(JSON.stringify(data));
                        break;
                        //case 'getCheckLength':
                        //    var data = checkStatus.data;
                        //    layer.msg('选中了:' + data.length + ' 个');
                        //    break;
                        //case 'isAll':
                        //    layer.msg(checkStatus.isAll ? '全选' : '未全选');
                        //    break;
                    //case 'getCheckLength':
                    //    var data = checkStatus.data;
                    //    layer.msg('选中了:' + data.length + ' 个');
                    //    break;
                    //case 'isAll':
                    //    layer.msg(checkStatus.isAll ? '全选' : '未全选');
                    //    break;
                        //自定义头工具栏右侧图标 - 提示
                    //自定义头工具栏右侧图标 - 提示
                    case 'btn-reload':
                        _cur_page = $(".layui-laypage-em").next().html();
                        RoadHBillNo(sql);
                        break;
                    case 'btn-confirm':
                        var checkStatus = table.checkStatus('mainTable')
                         , data = checkStatus.data;
                            , data = checkStatus.data;
                        _cur_page = $(".layui-laypage-em").next().html();
                        if (data[0]["状态"] == "未确认") {
                            layer.confirm('是否确认单据?', { icon: 3, title: '提示' }, function (index) {
                                $.ajax({
                                    type: "get",
                                    url: GetWEBURL()+"POOrderAccept",
                                    url: GetWEBURL() + "POOrderAccept",
                                    data: { "HInterID": data[0]["hmainid"].toString(), "HBillNo": data[0]["单据号"].toString(), "HUser": sessionStorage["HUserName"] },
                                    success: function (result) {
                                        if (result.count == 1) { // 说明验证成功了,
@@ -329,7 +332,7 @@
                        break;
                    case 'btn-back':
                        var checkStatus = table.checkStatus('mainTable')
                       , data = checkStatus.data;
                            , data = checkStatus.data;
                        _cur_page = $(".layui-laypage-em").next().html();
                        var HBackRemark;
                        if (data[0]["状态"] == "未确认") {
@@ -343,7 +346,7 @@
                                HBackRemark = value.toString();
                                $.ajax({
                                    type: "get",
                                    url: GetWEBURL()+"POOrderRefuse",
                                    url: GetWEBURL() + "POOrderRefuse",
                                    data: { "HInterID": data[0]["hmainid"].toString(), "HBillNo": data[0]["单据号"].toString(), "HUser": sessionStorage["HUserName"], "HBackRemark": HBackRemark },
                                    success: function (result) {
                                        if (result.count == 1) { // 说明验证成功了,
@@ -368,7 +371,7 @@
                        break;
                    case 'btn-details':
                        var checkStatus = table.checkStatus('mainTable')
                       , data = checkStatus.data;
                            , data = checkStatus.data;
                        var linterid = data[0].hmainid.toString();
                        //if (AllowLoadData(sSubStr) != false) {//非空验证
@@ -388,7 +391,7 @@
                        break;
                    case 'btn-generate':
                        var checkStatus = table.checkStatus('mainTable')
                        , data = checkStatus.data;
                            , data = checkStatus.data;
                        ajaxLabelData = data;
                        var rows = '';
                        var HEntry = '';
@@ -404,27 +407,139 @@
                            HEntry = HEntry.substring(0, HEntry.length - 1);
                            layer.msg("第" + HEntry + "行未确认!", { icon: 5 });
                        }
                        else{
                        else {
                            layer.open({
                                type: 2
                                , area: ['100%', '100%']
                                , title: '送货单'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: false //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../views/SRM/SRM_POInStockBill_Edit.html?linterid=' + data[0].hmainid.toString() + '&lentryid=' + rows.toString() + '&lSourceBillType=1102', 'yes']
                                , resize: false
                                //, cancel: function () {
                                //    $(".layui-btn").removeClass("layui-btn-disabled");
                                //}
                            })
                        }
                        break;
                        btn - barcode
                    case 'btn-barcode':
                        var checkStatus = table.checkStatus('mainTable')
                            , data = checkStatus.data;
                        //if (data[0].未生成条码数量 <= 0) {
                        //    layer.msg("选中行已生成条码!", { icon: 5 });
                        //}
                        layer.open({
                            type: 2
                            , area: ['100%', '100%']
                            , title: '送货单'
                            , title: '条码生成'
                            , shade: 0.6 //遮罩透明度
                            , maxmin: false //允许全屏最小化
                            , anim: 0 //0-6的动画形式,-1不开启
                            , content: ['../../views/SRM/SRM_POInStockBill_Edit.html?linterid=' + data[0].hmainid.toString() + '&lentryid=' + rows.toString() + '&lSourceBillType=1102', 'yes']
                            , content: ['../../views/SRM/SRM_BarCodeBill.html?linterid=' + data[0].hmainid + '&lentryid=' + data[0].hsubid + '&type =SRM_POOrderBillList', 'yes']
                            , resize: false
                            //, cancel: function () {
                            //    $(".layui-btn").removeClass("layui-btn-disabled");
                            //}
                            , cancel: function () {
                                $(".layui-btn").removeClass("layui-btn-disabled");
                            }
                        })
                        }
                        break;
                    case 'btn-exit':
                        //var index = parent.layer.getFrameIndex(window.name);
                        //element.tabDelete('layadmin-layout-tabs', this);
                        parent.layui.admin.events.closeThisTabs();
                        //parent.layer.close(index);
                        break;
                    case 'btn-report':
                        var checkStatus = table.checkStatus('mainTable')
                            , data = checkStatus.data;
                        _cur_page = $(".layui-laypage-em").next().html();
                        var arr = new Array();
                        var checkStatus = table.checkStatus('mainTable'),
                            data = checkStatus.data;
                        if (checkStatus.data.length == 0) {
                            return layer.msg('请选择数据');
                        }
                        for (var i = 0; i < data.length; i++) {
                            arr.push(data[i].hmainid + '-' + data[i].hsubid);
                        }
                        var OrderBackId = "";
                        layer.open({
                            type: 2,
                            skin: 'layui-layer-rim', //加上边框
                            title: '订单反馈状态',
                            closeBtn: 1,
                            shift: 2,
                            area: ['80%', '80%'],
                            maxmin: true,
                            content: ['../PublicPage/OrderBackInfomation.html', 'yes'],
                            btn: ['确定', '取消']
                            , btn1: function (index, layero) {
                                //按钮【按钮一】的回调
                                var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                                var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                                if (checkStatus.data.length === 0) {
                                    return layer.msg('请选择数据');
                                }
                                OrderBackId = checkStatus.data[0].HItemID.toString();
                                $.ajax({
                                    url: GetWEBURL() + 'POOrderBack',
                                    //url: 'http://localhost:8082/LuBaoAPI/' + 'POOrderBack',
                                    async: false,
                                    type: "GET",
                                    dataType: "json",
                                    data: { "HmainidList": arr.toString(), "OrderBackId": OrderBackId },
                                    success: function (data1) {
                                        if (data1.Message.indexOf("成功") > 0) {
                                            layer.msg("操作成功", { time: 3 * 1000, icon: 1 }, function () {
                                                var index = layer.getFrameIndex(window.name);
                                                //关闭当前frame
                                                layer.close(index);
                                                //修改为功后刷新界面
                                                window.location.reload();
                                            });
                                        } else {
                                            layer.alert(data1.Message, { icon: 5 });
                                        }
                                    }, error: function (e) {
                                        layer.alert(data1.Message, { icon: 5 });
                                    }
                                });
                            }
                            , btn2: function (index, layero) {
                                //按钮【按钮二】的回调
                                //return false 开启该代码可禁止点击该按钮关闭
                            },
                            end: function () {
                            },
                            success: function (layero, index) {
                            }
                        });
                        //layer.confirm('是否确认单据?', { icon: 3, title: '提示' }, function (index) {
                        //    $.ajax({
                        //        type: "get",
                        //        url: GetWEBURL() + "POOrderAccept",
                        //        data: { "HInterID": data[0]["hmainid"].toString(), "HBillNo": data[0]["单据号"].toString(), "HUser": sessionStorage["HUserName"] },
                        //        success: function (result) {
                        //            if (result.count == 1) { // 说明验证成功了,
                        //                layer.msg(result.Message, { icon: 1 });
                        //                RoadHBillNo(sql);
                        //            }
                        //            else {
                        //                // $("#verifycode").click();
                        //                layer.msg(result.Message, { icon: 5 });
                        //            }
                        //            layer.closeAll("loading");
                        //        }
                        //    })
                        //    layer.close(index);
                        //});
                        break;
                };
            });
@@ -436,7 +551,7 @@
                where = sqlWhere;
                $.ajax({
                    type: "get",
                    url: GetWEBURL()+"GetPOOrderBill",
                    url: GetWEBURL() + "GetPOOrderBill",
                    async: true,
                    data: { "HSupNo": sessionStorage["HUserName"], "sqlWhere": sqlWhere },
                    success: function (result) {
@@ -482,15 +597,14 @@
                    sqlWhere += " and 日期 <= ^^" + $("#HDate2").val() + "^^";
                }
                if ($("#HISGenerate").val() != "") {
                    if ($("#HISGenerate").val() == "是")
                    {
                    if ($("#HISGenerate").val() == "是") {
                        sqlWhere += " and 未关联数量 <= 0";
                    }
                    else if ($("#HISGenerate").val() == "否") {
                        sqlWhere += " and 未关联数量 > 0";
                    }
                }
                var Time = $("#Time").val();
                var dd = new Date();