仲国强
2021-09-08 3f6147a3d113f03dd973c4437d43f14e9537012b
产品入库检验单列表优化sz
1个文件已修改
623 ■■■■ 已修改文件
WebTM/views/质量管理/产品入库检验单/QC_LastPieceCheckBillList.html 623 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/ÖÊÁ¿¹ÜÀí/²úÆ·Èë¿â¼ìÑéµ¥/QC_LastPieceCheckBillList.html
@@ -1,21 +1,29 @@
<!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 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/zgqCustom/zgqCustom.js"></script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <style type="text/css">
        input.layui-input.layui-unselect {
            padding-right: 0;
        }
    </style>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
</head>
<body>
    <div class="layui-card layadmin-header">
        <div class="layui-breadcrumb" lay-filter="breadcrumb">
            <a lay-href="">主页</a>
            <!--<a><cite>采购订单</cite></a>
            <a><cite>采购订单表格</cite></a>
            <a><cite>采购订单表格的重载</cite></a>-->
        </div>
    </div>
    <div class="layui-fluid">
        <div class="layui-col-md12">
            <div class="layui-card" style="padding: 1px">
@@ -23,59 +31,112 @@
                    <form class="layui-form" action="" lay-filter="component-form-group">
                        <div class="layui-collapse">
                            <div class="layui-colla-item">
                                <div class="layui-colla-title layui-inline">
                                    <div class="layui-inline">
                                        <span>更多</span>
                                <div class="layui-inline">
                                    <label class="layui-form-label" style="width: 85px;">单据号</label>
                                    <div class="layui-input-block" style="margin-left: 120px;">
                                        <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                    </div>
                                </div>
                                <div style="padding: 10px;">
                                    <button type="button" lay-submit="" class="layui-btn layui-btn-radius" lay-filter="btnReSearch" style="padding:0 5px">重置</button>
                                    <button type="button" lay-submit="" class="layui-btn layui-btn-radius" lay-filter="btndelete" style="padding:0 5px">删除</button>
                                    <!--<button type="button" lay-submit="" class="layui-btn layui-btn-radius" lay-filter="btnAdd" style="padding:0 5px">新增</button>-->
                                    <button type="button" lay-submit="" class="layui-btn layui-btn-radius" lay-filter="btnModify" style="padding:0 5px">修改</button>
                                    <button type="button" lay-submit="" class="layui-btn layui-btn-radius" lay-filter="btnJY" style="padding:0 5px">禁用</button>
                                    <button type="button" lay-submit="" class="layui-btn layui-btn-radius" lay-filter="btnFJY" style="padding:0 5px">反禁用</button>
                                <div class="layui-inline">
                                    <label class="layui-form-label" style="width: 85px;">开始日期</label>
                                    <div class="layui-input-block" style="margin-left: 120px;">
                                        <input type="text" class="layui-input" name="HDate1" id="HDate1">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label" style="width: 85px;">结束日期</label>
                                    <div class="layui-input-block" style="margin-left: 120px;">
                                        <input type="text" class="layui-input" name="HDate2" id="HDate2">
                                    </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>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
                            </div>
                        </div>
                        <table class="" 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-Edit"><i class="layui-icon layui-icon-form"></i>编辑</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-form"></i>删除</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
                            </div>
                        </script>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script>
        var _cur_page = 1;
        var sWhere = " ";
        //var options = document.getElementById('HStatus').children;
        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;
        }
        function f_alert(sMsg) {
            layer.alert(sMsg, { icon: 5 });
            //layer.open({
            //    type: 1
            //  , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset
            //  , id: 'layerDemo' //防止重复弹出
            //  , content: '<div style="padding: 20px 100px;">' + sMsg + '</div>'
            //  , shade: 0 //不显示遮罩
            //  , yes: function () {
            //      layer.closeAll();
            //  }
            //});
        }
        var params = getUrlVars();
        var type = params[params[0]];
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
            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
                , laypage = layui.laypage
                , laydate = layui.laydate
                , util = layui.util
            //查询条件
            var sWhere = "";
            var option = {
                , element = layui.element;
            //常规用法
            laydate.render({
                elem: '#HDate1'
            });
            laydate.render({
                elem: '#HDate2'
            });
            //layui.code();
            RoadHBillNo(sWhere);
            layer.load(3)
            $("#HDate1").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
            $("#HDate2").val(Format(new Date(), "yyyy-MM-dd"));
            //方法级渲染
            table.render({
                elem: '#mainTable'
                //, toolbar: '#toolbarDemo'
                , height: 'full-50'
                , page: true
                , cellMinWidth: 90
                , dateType: 'json'
                , colFilterRecord: true//是否开启字段筛选的记忆功能
                , data: []
                //  , url:  GetWEBURL()+'GetPOOrderBill'
                , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
                , defaultToolbar: ['filter', 'exports', 'print']
                // , where: { msg: "", NowPage: 1, OnePage: 10 }
                , cellMinWidth: 100
                , cols: [[
                    { type: 'radio', fixed: 'left' }
                    { type: 'checkbox', fixed: 'left' }
                    , { field: 'hmainid', title: '单据ID', hide: true }
                    , { field: '日期', title: '日期', width: 160 }
                    , { field: '单据号', title: '单据号', width: 160 }
@@ -107,102 +168,422 @@
                    , { field: '单据类型', title: '单据类型', width: 115 }
                    , { field: 'hsubid', title: 'hsubid', width: 115, hide: true }
                ]]
            };
            var index = layer.load(0);
            //进入页面显示的缓存列表
            $.ajax({
                //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                url: GetWEBURL() + '/QC_LastPieceCheckBill/GetLastPieceCheckBillList',
                type: "GET",
                data: { "sWhere": sWhere},
                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 });
                //, skin: 'row' //表格风格
                // , even: true
                , page: true //是否显示分页
                , limits: [10, 20, 50, 100]
                , limit: 50 //每页默认显示的数量
                //, height: 500
                , done: function (res, curr, count) {
                    _cur_page = curr;
                    layer.closeAll("loading");
                }
            });
            //#region é‡ç½®æŒ‰é’®
            form.on('submit(btnReSearch)', function (data) {
                set_ClearQuery();
            });
            //#endregion
            //修改按钮
            form.on('submit(btnModify)', function (data) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '产品入库检验单'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: false //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['QC_LastPieceCheckBill.html?HInterID=' + data[0].HItemID + '&HType=Modify', 'yes']
                    , resize: false
                })
            //#region æŸ¥è¯¢æŒ‰é’®
            form.on('submit(btnSearch)', function (data) {
                get_FastQuery();
            });
            //#endregion
            //#region é‡ç½®è¿‡æ»¤æ¡ä»¶æ–¹æ³•
            function set_ClearQuery() {
                $("#HBillNo").val("");
                $("#HNumber").val("");
                $("#HName").val("");
                $("#HDate1").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#HDate2").val(Format(new Date(), "yyyy-MM-dd"));
                sWhere = "";
            }
            //#endregion
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                    case 'btn-getCheckData':
                        var data = checkStatus.data;
                        layer.alert(JSON.stringify(data));
                        break;
                    case 'btn-Edit':
                        var checkStatus = table.checkStatus('mainTable')
                            , data = checkStatus.data;
                        if (checkStatus.data.length === 1) {
                            var hID = 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: ['QC_LastPieceCheckBill.html?HInterID=' + data[0].hmainid + '&HType=Modify', 'yes']
                                , resize: false
                                , cancel: function () {
                                    //$(".layui-btn").removeClass("layui-btn-disabled");
                                }
                            })
                        } else {
                            layer.msg('请选择一行数据编辑!');
                        }
                        break;
                    case 'btn-Delete':
                        var checkStatus = table.checkStatus('mainTable')
                            , data = checkStatus.data;
                        if (checkStatus.data.length === 1) {
                            var InterID = data[0].hmainid.toString();
                            layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                                var index = layer.load();
                                //逻辑删除方法
                                $.ajax({
                                    url: GetWEBURL() + 'DeltetQC_FirstPieceCheck',
                                    type: "GET",
                                    data: { "HInterID": InterID },
                                    success: function (result) {
                                        console.log('gouba' + result);
                                        if (result.count == 1) {
                                            layer.msg(result.Message, { icon: 1 }, function () {
                                                // å¾—到frame索引
                                                var index = layer.getFrameIndex(window.name);
                                                //关闭当前frame
                                                layer.close(index);
                                                //修改为功后刷新界面
                                                window.location.reload();
                                            });
                                        } else {
                                            layer.alert(result.code + result.Message, { icon: 5 });
                                            layer.close(index);
                                        }
                                    }, error: function () {
                                        layer.alert("接口请求失败!", { icon: 5 });
                                        layer.close(index);
                                    }
                                });
                            })
                        }
                        else {
                            layer.msg('请选择一行数据删除!');
                        }
                        break;
                    case 'get_Refresh':
                        set_ClearQuery();
                        RoadHBillNo(sWhere);
                        break;
                    case 'get_Exit':
                        Pub_Close(2);
                        break;
                };
            });
            //查询按钮
            form.on('submit(btnSearch)', function (data) {//选择仓位
                //var HBillType = $("#HBillType").val();//单据类型
                //var HBillNo = $("#HBillNo").val();//单据号
                //var HCreateBy = $("#HCreateBy").val();//制单人
                //var BenginHCreateDate = $("#BenginHCreateDate").val();//开始制单时间
                //var EndHCreateDate = $("#EndHCreateDate").val();//结束制单时间
                //if (HBillNo) {
                //    sWhere += " and HBillNo like '%" + HBillNo + "%'";
                //}
                //if (HCreateBy) {
                //    sWhere += " and HCreateBy like '%" + HCreateBy + "%'";
                //}
                //if (BenginHCreateDate) {
                //    sWhere += " and CONVERT(varchar(100),HCreateDate, 23) >= '" + BenginHCreateDate + "'";
                //}
                //if (EndHCreateDate) {
                //    sWhere += " and CONVERT(varchar(100),HCreateDate, 23) <= '" + EndHCreateDate + "'";
                //}
                var index = layer.load(0);
            //function set_InitGrid() {
            //    option = {
            //        elem: '#mainTable'
            //        , toolbar: '#toolbarDemo'
            //        , height: 'full-50'
            //        , page: true
            //        , cellMinWidth: 90
            //        , limits: [50, 500, 1000, 5000]
            //        , cols: [[
            //            { type: 'checkbox', fixed: 'left' }
            //            , { field: 'hmainid', title: '单据ID', hide: true }
            //            , { field: '日期', title: '日期', width: 160 }
            //            , { field: '单据号', title: '单据号', width: 160 }
            //            , { field: '表头备注', title: '表头备注', width: 160, hide: true }
            //            , { field: '生产资源名称', title: '生产资源名称', width: 200 }
            //            , { field: '生产资源代码', title: '生产资源代码', width: 200 }
            //            , { field: '产品内码', title: '产品内码', width: 200, hide: true }
            //            , { field: '产品名称', title: '产品名称', width: 200 }
            //            , { field: '产品型号', title: '产品型号', width: 200 }
            //            , { field: '客户代码', title: '客户代码', width: 200 }
            //            , { field: '客户', title: '客户', width: 200 }
            //            , { field: '产地代码', title: '产地代码', width: 200 }
            //            , { field: '产地', title: '产地', width: 200, hide: true }
            //            , { field: '加工类型代码', title: '加工类型代码', width: 200 }
            //            , { field: '加工类型', title: '加工类型', width: 200 }
            //            , { field: '拉丝方向', title: '拉丝方向', width: 200 }
            //            , { field: '包装方式代码', title: '包装方式代码', width: 200 }
            //            , { field: '包装方式', title: '包装方式', width: 200 }
            //            , { field: '制单人', title: '制单人', width: 160 }
            //            , { field: '制单日期', title: '制单日期', width: 160 }
            //            , { field: '审核人', title: '审核人', width: 160 }
            //            , { field: '审核日期', title: '审核日期', width: 200 }
            //            , { field: '修改人', title: '修改人', width: 200 }
            //            , { field: '修改日期', title: '修改日期', width: 200 }
            //            , { field: '关闭人', title: '关闭人', width: 200 }
            //            , { field: '关闭日期', title: '关闭日期', width: 200 }
            //            , { field: '作废人', title: '作废人', width: 200 }
            //            , { field: '作废日期', title: '作废日期', width: 200 }
            //            , { field: '单据类型', title: '单据类型', width: 115 }
            //            , { field: 'hsubid', title: 'hsubid', width: 115, hide: true }
            //        ]]
            //    };
            //}
            //#region æŸ¥è¯¢
            function RoadHBillNo(sqlWhere) {
                var ajaxLoad = layer.load();
                $.ajax({
                    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                    url: GetWEBURL1() + '/QC_LastPieceCheckBill/GetLastPieceCheckBillList',
                    type: "GET",
                    data: { "sWhere": sWhere},
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(index);
                            layer.alert("查询成功", { icon: 1 });
                    type: "get",
                    url: GetWEBURL() + "/QC_LastPieceCheckBill/GetLastPieceCheckBillList",
                    async: true,
                    data: { "sWhere": sWhere },//"HSupNo": sessionStorage["HUserName"],
                    success: function (result) {
                        if (result.count == 1) {
                            ajaxReturnData = JSON.parse(JSON.stringify(result)).data;
                            table.reload('mainTable', {
                                data: ajaxReturnData
                                , height: 'full-10'
                                , page: {
                                    curr: _cur_page // å¿…须从第 1 é¡µå¼€å§‹
                                }
                                , loading: false
                                , done: function (index, res) {
                                }
                            });
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(index);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                            layer.close(ajaxLoad);
                            layer.alert(result.code + result.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(index);
                        layer.alert("接口失效!", { icon: 5 });
                    },
                    error: function (result) {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                //调用接口后清空sWhere缓存
            }
            //#endregion
            ////#region åŠ è½½ç½‘ç»œ
            //function get_Display(sWhere) {
            //    var wait = layer.load();//遮罩
            //    //加载数据到网格
            //    $.ajax({
            //        //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
            //        url: GetWEBURL() + '/QC_LastPieceCheckBill/GetLastPieceCheckBillList',
            //        type: "GET",
            //        data: { "sWhere": sWhere },
            //        success: function (data1) {
            //            if (data1.count == 1) {
            //                option.data = data1.data;
            //                table.render(option);
            //                layer.close(wait);
            //            } else {
            //                layer.close(wait);
            //                layer.alert(data1.code + data1.Message, { icon: 5 });
            //            }
            //        }, error: function () {
            //            layer.close(wait);
            //            layer.alert("接口请求失败!", { icon: 5 });
            //        }
            //    });
            //}
            ////#endregion
            //#region å¿«é€Ÿè¿‡æ»¤
            function get_FastQuery() {
                var sqlWhere = " and 1=1 ";
                //if ($("#HStatus").val() != "")
                //    sqlWhere += " and çŠ¶æ€ like ^^%" + $("#HStatus").val() + "%^^";
                var HBillNo = $("#HBillNo").val();//单据号
                var HNumber = $("#HNumber").val();//物料代码
                var HName = $("#HName").val();//物料名称
                var HModel = $("#HModel").val();//规格型号
                var HDate1 = $("#HDate1").val();//开始日期
                var HDate2 = $("#HDate2").val();//结束日期
                if (HBillNo)
                    sWhere += " and å•据号 like '%" + HBillNo + "%'";
                if (HNumber)
                    sWhere += " and ç‰©æ–™ä»£ç  like '%" + HNumber + "%'";
                if (HName)
                    sWhere += " and ç‰©æ–™åç§° like '%" + HName + "%'";
                if (HModel)
                    sWhere += " and è§„格型号 like '%" + HModel + "%'";
                if (HDate1) {
                    sWhere += " and æ—¥æœŸ >= '" + HDate1 + "'";
                }
                if (HDate2) {
                    sWhere += " and æ—¥æœŸ <= '" + HDate2 + "'";
                }
                var Time = $("#Time").val();
                var dd = new Date();
                var dt;
                switch (Time) {
                    case 1: dd = new Date(dd.setDate(dd.getDate() + 7));
                    case 2: dd = new Date(dd.setDate(dd.getDate() + 14));
                    case 3: dd = new Date(dd.setMonth(dd.getMonth() + 1));
                    case 4: dd = new Date(dd.setMonth(dd.getMonth() + 2));
                    case 5: dd = new Date(dd.setMonth(dd.getMonth() + 3));
                    case 6: dd = new Date(dd.setMonth(dd.getMonth() + 6));
                    case 7: dd = new Date(dd.setMonth(dd.getMonth() + 12));
                    default: dd = new Date(dd.setDate(dd.getDate()));
                }
                dt = dd.getFullYear().toString();
                if (dd.getMonth() + 1 < 10) {
                    dt = dt + "-0" + (dd.getMonth() + 1).toString();
                }
                else {
                    dt = dt + "-0" + (dd.getMonth() + 1).toString();
                }
                if (dd.getDate() < 10) {
                    dt = dt + "-0" + dd.getDate().toString();
                }
                else {
                    dt = dt + "-" + dd.getDate().toString();
                }
                //if (Time != 8) {
                //    sqlWhere += " and äº¤è´§æ—¥æœŸ <= ^^" + dt + "^^";
                //}
                sql = sqlWhere;
                //从第一页开始
                _cur_page = 1;
                RoadHBillNo(sWhere);
                sWhere = "";
                //$("#HBillType").val("");//单据类型
                //$("#HBillNo").val("");//单据号
                //$("#HSourceBillNo").val("");//源单号
                //$("#HCreateBy").val("");//制单人
                //$("#BenginHCreateDate").val("");//开始制单时间
                //$("#EndHCreateDate").val("");//结束制单时间
            }
            //#endregion
            var $ = layui.$, active = {
                f_Query: function () { //查询
                },
                f_Qrjq: function () { //接受
                },
                f_Bhjq: function () { //拒绝
                },
                //JSreload: function () {
                //    var demoReload = $('#test-table-demoReload');
                //    //执行重载
                //    table.JSreload('test-table-reload', {
                //        page: {
                //            curr: 1 //重新从第 1 é¡µå¼€å§‹
                //        }
                //      , where: {
                //          key: {
                //              id: demoReload.val()
                //          }
                //      }
                //    });
                //}
            };
            //退出按钮
            form.on('submit(get_Exit)', function () {
                if (OperationType == 1) {
                    Pub_Close(2);
                }
                else if (OperationType == 2) {
                    Pub_Close(1);
                }
            })
            $('.test-table-reload-btn .layui-btn').on('click', function () {
                var type = $(this).data('type');
                active[type] ? active[type].call(this) : '';
            });
            //监听行双击事件
            table.on('rowDouble(mainTable)', function (obj) {
                layer.alert("双击事件", { icon: 1 });
            });
            ////进入页面显示的缓存列表
            //$.ajax({
            //    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
            //    url: GetWEBURL() + '/QC_LastPieceCheckBill/GetLastPieceCheckBillList',
            //    type: "GET",
            //    data: { "sWhere": sWhere },
            //    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(btnModify)', function (data) {
            //    var checkStatus = table.checkStatus('mainTable')
            //        , data = checkStatus.data;
            //    layer.open({
            //        type: 2
            //        , area: ['100%', '100%']
            //        , title: '产品入库检验单'
            //        , shade: 0.6 //遮罩透明度
            //        , maxmin: false //允许全屏最小化
            //        , anim: 0 //0-6的动画形式,-1不开启
            //        , content: ['QC_LastPieceCheckBill.html?HInterID=' + data[0].HItemID + '&HType=Modify', 'yes']
            //        , resize: false
            //    })
            //});
            ////查询按钮
            //form.on('submit(btnSearch)', function (data) {//选择仓位
            //    //var HBillType = $("#HBillType").val();//单据类型
            //    //var HBillNo = $("#HBillNo").val();//单据号
            //    //var HCreateBy = $("#HCreateBy").val();//制单人
            //    //var BenginHCreateDate = $("#BenginHCreateDate").val();//开始制单时间
            //    //var EndHCreateDate = $("#EndHCreateDate").val();//结束制单时间
            //    //if (HBillNo) {
            //    //    sWhere += " and HBillNo like '%" + HBillNo + "%'";
            //    //}
            //    //if (HCreateBy) {
            //    //    sWhere += " and HCreateBy like '%" + HCreateBy + "%'";
            //    //}
            //    //if (BenginHCreateDate) {
            //    //    sWhere += " and CONVERT(varchar(100),HCreateDate, 23) >= '" + BenginHCreateDate + "'";
            //    //}
            //    //if (EndHCreateDate) {
            //    //    sWhere += " and CONVERT(varchar(100),HCreateDate, 23) <= '" + EndHCreateDate + "'";
            //    //}
            //    var index = layer.load(0);
            //    $.ajax({
            //        //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
            //        url: GetWEBURL1() + '/QC_LastPieceCheckBill/GetLastPieceCheckBillList',
            //        type: "GET",
            //        data: { "sWhere": sWhere },
            //        success: function (data1) {
            //            if (data1.count == 1) {
            //                option.data = data1.data;
            //                table.render(option);
            //                layer.close(index);
            //                layer.alert("查询成功", { icon: 1 });
            //            } else {
            //                layer.close(index);
            //                layer.alert(data1.code + data1.Message, { icon: 5 });
            //            }
            //        }, error: function () {
            //            layer.close(index);
            //            layer.alert("接口失效!", { icon: 5 });
            //        }
            //    });
            //    //调用接口后清空sWhere缓存
            //    sWhere = "";
            //    //$("#HBillType").val("");//单据类型
            //    //$("#HBillNo").val("");//单据号
            //    //$("#HSourceBillNo").val("");//源单号
            //    //$("#HCreateBy").val("");//制单人
            //    //$("#BenginHCreateDate").val("");//开始制单时间
            //    //$("#EndHCreateDate").val("");//结束制单时间
            //});
            ////监听行双击事件
            //table.on('rowDouble(mainTable)', function (obj) {
            //    layer.alert("双击事件", { icon: 1 });
            //});
            //laydate.render({