zzr99
2021-11-19 4497aa333e65e55548cbdbca204d843fee79d387
Merge branch 'master' of http://101.37.171.70:10101/r/MESWMS-LayUI
5个文件已修改
1771 ■■■■■ 已修改文件
WebTM/views/销售管理/发货通知单/Xs_SeOutStockBillList.html 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/销售管理/退货通知单/Xs_SeOutStockBackBillList.html 428 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/领料发货/销售出库/Kf_SellOutBillList.html 443 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/验收入库/产品入库/Kf_ProductInBillList.html 438 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/验收入库/其他入库/Kf_OtherInBillList.html 457 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/ÏúÊÛ¹ÜÀí/·¢»õ֪ͨµ¥/Xs_SeOutStockBillList.html
@@ -100,10 +100,7 @@
            </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>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
WebTM/views/ÏúÊÛ¹ÜÀí/ÍË»õ֪ͨµ¥/Xs_SeOutStockBackBillList.html
@@ -1,15 +1,27 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <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/layui/layui.js"></script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <style type="text/css">
        input.layui-input.layui-unselect {
            padding-right: 0;
        }
    </style>
</head>
<body>
    <div class="layui-fluid">
@@ -27,26 +39,25 @@
                                <div class="layui-inline">
                                    <label class="layui-form-label">开始日期</label>
                                    <div class="layui-input-block">
                                        <input type="date" class="layui-input" id="HDate">
                                        <input type="date" class="layui-input" id="HBeginDate" style="width:190px;">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">结束日期</label>
                                    <div class="layui-input-block">
                                        <input type="date" class="layui-input" id="HDate1">
                                        <input type="date" class="layui-input" id="HEndDate" style="width:190px;">
                                    </div>
                                </div>
                                <!--<div class="layui-inline">
                                    <label class="layui-form-label">订单跟踪号</label>
                                <div class="layui-inline">
                                    <label class="layui-form-label">单据号</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HOrderProcNO" id="HOrderProcNO">
                                        <input type="text" class="layui-input" name="HBillNo" id="HBillNo" style="width:190px;">
                                    </div>
                                </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 class="layui-colla-content">
                                    <div class="layui-inline">
                                        <div class="layui-inline">
@@ -54,9 +65,21 @@
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">单据号</label>
                                        <label class="layui-form-label">客户</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="WorkCenter" id="WorkCenter">
                                            <input type="text" class="layui-input" name="HCusID" id="HCusID" style="width:190px;">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">部门</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="HDeptID" id="HDeptID" style="width:190px;">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">主管</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="HMangerID" id="HMangerID" style="width:190px;">
                                        </div>
                                    </div>
                                </div>
@@ -65,14 +88,11 @@
                        <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-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" 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-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-exit"><i class="layui-icon layui-icon-return"></i>退出</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add"><i class="layui-icon layui-icon-file-b"></i>新增</button>
                                <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-delete"></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>
@@ -80,124 +100,127 @@
            </div>
        </div>
    </div>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <!--<script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>-->
    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['index', 'form', 'table', 'element', 'laypage','laydate'], function () {
        }).use(['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
            //var sWhere = " äº§å“ä»£ç  = 'BX0002'";
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , element = layui.element
                , laypage = layui.laypage
                , laydate = layui.laydate
                , util = layui.util
            //查询条件
            var sWhere = "";
            var option = [];
            var option = {
                elem: '#mainTable'
                //, toolbar: '#toolbarDemo'
                ,height: 'full-50'
                , page: true
                ,cellMinWidth: 90
                , cols: [[
                    { field: 'hmainid', title: 'hmainid', sort: true, hide: true }
                    , { field: '日期', title: '日期' }
                    , { field: '单据号', title: '单据号' }
                    , { field: 'HBillType', title: 'HBillType', hide: true }
                    , { field: 'HCusID', title: 'HCusID', hide: true }
                    , { field: '客户代码', title: '客户代码' }
                    , { field: '客户', title: '客户' }
                    , { field: 'HDeptID', title: 'HDeptID', hide: true }
                    , { field: '部门代码', title: '部门代码' }
                    , { field: '部门', title: '部门' }
                    , { field: '摘要', title: '摘要' }
                    , { field: '表头备注', title: '表头备注' }
                    , { field: 'hsubid', title: 'hsubid', hide: true }
                    , { field: 'HMaterID', title: 'HMaterID', hide: true }
                    , { field: '物料代码', title: '物料代码' }
                    , { field: '物料名称', title: '物料名称' }
                    , { field: '规格型号', title: '规格型号' }
                    , { field: '批号', title: '批号' }
                    , { field: 'HUnitID', title: 'HUnitID', hide: true }
                    , { field: '计量单位代码', title: '计量单位代码' }
                    , { field: '计量单位', title: '计量单位' }
                    , { field: '数量', title: '数量' }
                    , { field: '单价', title: '单价' }
                    , { field: '金额', title: '金额' }
                    , { field: 'HWHID', title: 'HWHID', hide: true }
                    , { field: '仓库代码', title: '仓库代码' }
                    , { field: '发货仓库', title: '发货仓库' }
                    , { field: '源单单号', title: '源单单号' }
                    , { field: '销售订单号', title: '销售订单号' }
                    , { field: '计划跟踪号', title: '计划跟踪号' }
                    , { field: '表体备注', title: '表体备注' }
                    , { field: '制单人', title: '制单人' }
                    , { field: '制单日期', title: '制单日期' }
                    , { field: '审核人', title: '审核人' }
                    , { field: '审核日期', title: '审核日期' }
                    , { field: '修改人', title: '修改人' }
                    , { field: '修改日期', title: '修改日期' }
                    , { field: '关闭人', title: '关闭人' }
                    , { field: '关闭日期', title: '关闭日期' }
                    , { field: '作废人', title: '作废人' }
                    , { field: '作废日期', title: '作废日期' }
                ]]
            };
            //初始化界面
            set_ClearBill();
            //进入页面显示的缓存列表
            var index0 = layer.load(0, { shade: false });
            $.ajax({
                //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                url: GetWEBURL() + '/Xs_SeOutStockBackBill/list',
                type: "GET",
                data: { "sWhere": sWhere },
                success: function (data1) {
                    if (data1.count == 1) {
                        option.data = data1.data;
                        table.render(option);
                        layer.close(index0);
                    } else {
                        layer.close(index0);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(index0);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
            //#endregion
            //重置按钮
            //#region é‡ç½®æŒ‰é’®
            form.on('submit(btnReSearch)', function (data) {
                $("#HDate").val("");//开始日期
                $("#HDate1").val("");//结束日期
                $("#WorkCenter").val("");//单据号
                $("#btnSearch").click();
                //清空过滤条件
                set_ClearQuery();
            });
            //#endregion
            //查询按钮
            form.on('submit(btnSearch)', function (data) {//选择仓位
                var HDate = $("#HDate").val();//开始日期
                var HDate1 = $("#HDate1").val();//结束日期
                var HOrderProcNO = $("#HOrderProcNO").val();//订单跟踪号
                var WorkCenter = $("#WorkCenter").val();//单据号
                if (HDate) {
                    sWhere += " and æ—¥æœŸ >= '" + HDate + "'";
                }
                if (HDate1) {
                    sWhere += " and æ—¥æœŸ <= '" + HDate1 + "'";
                }
                if (WorkCenter) {
                    sWhere += " and å•据号 like '%" + WorkCenter + "%'";
                }
                var index = layer.load(0, { shade: false });
            //#region æŸ¥è¯¢æŒ‰é’®
            form.on('submit(btnSearch)', function (data) {
                get_FastQuery(table, option);
            });
            //#endregion
            //#region åˆå§‹åŒ–界面
            function set_ClearBill() {
                //初始化表格
                set_InitGrid();
                //查询
                get_Display(sWhere);
            }
            //#endregion
            //#region åˆå§‹åŒ–表格方法
            $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
            $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
            function set_InitGrid() {
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , page: true
                    , cellMinWidth: 90
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                       ,{ field: 'hmainid', title: 'hmainid', sort: true, hide: true }
                        , { field: '日期', title: '日期', width: 150 }
                        , { field: '单据号', title: '单据号' }
                        , { field: 'HBillType', title: 'HBillType', hide: true }
                        , { field: 'HCusID', title: 'HCusID', width: 120, hide: true }
                        , { field: '客户代码', title: '客户代码', width: 150 }
                        , { field: '客户', title: '客户', width: 120 }
                        , { field: 'HDeptID', title: 'HDeptID', width: 120, hide: true }
                        , { field: '部门代码', title: '部门代码', width: 150 }
                        , { field: '部门', title: '部门' }
                        , { field: 'HCurID', title: 'HCurID', width: 120, hide: true }
                        , { field: '币别代码', title: '币别代码' }
                        , { field: '币别', title: '币别' }
                        , { field: '摘要', title: '摘要' }
                        , { field: 'HManagerID', title: 'HManagerID', width: 120, hide: true }
                        , { field: '主管代码', title: '主管代码' }
                        , { field: '主管', title: '主管' }
                        , { field: 'HEmpID', title: 'HEmpID', width: 120, hide: true }
                        , { field: '业务员代码', title: '业务员代码', width: 120 }
                        , { field: '业务员', title: '业务员' }
                        , { field: '表头备注', title: '表头备注' }
                        , { field: 'hsubid', title: 'hsubid', hide: true }
                        , { field: 'HMaterID', title: 'HMaterID', hide: true }
                        , { field: '物料代码', title: '物料代码', width: 150 }
                        , { field: '物料名称', title: '物料名称', width: 150 }
                        , { field: '规格型号', title: '规格型号' }
                        , { field: '批号', title: '批号' }
                        , { field: 'HUnitID', title: 'HUnitID', hide: true }
                        , { field: '计量单位代码', title: '计量单位代码', width: 150 }
                        , { field: '计量单位', title: '计量单位', width: 150 }
                        , { field: '数量', title: '数量' }
                        , { field: '单价', title: '单价' }
                        , { field: '金额', title: '金额' }
                        , { field: '单价', title: '单价' }
                        , { field: 'HWHID', title: 'HWHID', hide: true }
                        , { field: '仓库代码', title: '仓库代码', width: 150 }
                        , { field: '发货仓库', title: '发货仓库' }
                        , { field: '源单单号', title: '源单单号', width: 125 }
                        , { field: '销售订单号', title: '销售订单号', width: 125 }
                        , { field: '计划跟踪号', title: '计划跟踪号', width: 125 }
                        , { field: '表体备注', title: '表体备注', width: 125 }
                        , { field: '制单人', title: '制单人', width: 125 }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '审核人', title: '审核人', width: 125 }
                        , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '修改人', title: '修改人', width: 125 }
                        , { field: '修改日期', title: '修改日期', width: 200, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '关闭人', title: '关闭人', width: 125 }
                        , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '作废人', title: '作废人', width: 125 }
                        , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    ]]
                };
            }
            //进入页面显示的缓存列表
            function get_Display(sWhere) {
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/Xs_SeOutStockBackBill/list',
                    type: "GET",
@@ -206,33 +229,170 @@
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(index);
                            layer.alert("查询成功", { icon: 1 });
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(index);
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(index);
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                sWhere = "";//调用接口后清空sWhere缓存
            }
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                    case 'btn-Add':
                        //页面层-自定义
                        layer.open({
                            type: 2,
                            skin: 'layui-layer-rim', //加上边框
                            title: '新增退货通知单',
                            closeBtn: 1,
                            shift: 2,
                            area: ['100%', '100%'],
                            maxmin: true,
                            content: '../../采购管理/收料通知单/Add_Edit_Cg_POInStockBillList.html?OperationType=1&linterid=0&HSouceBillType=0&closeType=1',
                            end: function () {
                                //刷新页面,
                                location.reload();
                            },
                            success: function (layero, index) {
                            }
                        });
                        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: '编辑退货通知单'
                                , closeBtn: 1
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: '../../采购管理/收料通知单/Add_Edit_Cg_POInStockBillList.html?OperationType=3&linterid=' + hID + '&HSouceBillType=0&closeType=1'
                                , resize: false,
                                end: function () {
                                    //刷新页面,
                                    location.reload();
                                }
                                , 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) {
                                $.ajax({
                                    type: "GET",
                                    url: GetWEBURL() + "Xs_SeOutStockBackBill/DeltetSeOutStockBackBill", //方法所在页面和方法名
                                    data: { "HInterID": InterID },
                                    success: function (result) {
                                        if (result.count == 1) {
                                            layer.msg(result.Message, { time: 1 * 1000, 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 });
                                        }
                                    }, error: function () {
                                        layer.alert("接口请求失败!", { icon: 5 });
                                    }
                                });
                            })
                        }
                        else {
                            layer.msg('请选择一行数据删除!');
                        }
                        break;
                    //刷新
                    case 'get_Refresh': get_Refresh();
                        break;
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        break;
                };
            });
            //laydate.render({
            //    elem: '#HDate'
            //    , type: 'datetime'
            //    , trigger: 'click'
            //    , format:'yyyy-MM-dd HH:mm'
            //});
            //#region å¿«é€Ÿè¿‡æ»¤
            function get_FastQuery(table, option) {
                var HDate = $("#HBeginDate").val();//开始日期
                var HDate1 = $("#HEndDate").val();//结束日期
                var HBillNo = $("#HBillNo").val();//单据号
                var HCusID = $("#HCusID").val();
                var HDeptID = $("#HDeptID").val();
                var HMangerID = $("#HMangerID").val();
                if (HDate) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + HDate + "'";
                }
                if (HDate1) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) <= '" + HDate1 + "'";
                }
                if (HBillNo) {
                    sWhere += " and å•据号 like '%" + HBillNo + "%'";
                }
                if (HCusID) {
                    sWhere += " and å®¢æˆ· like '%" + HCusID + "%'";
                }
                if (HDeptID) {
                    sWhere += " and éƒ¨é—¨ like '%" + HDeptID + "%'";
                }
                if (HMangerID) {
                    sWhere += " and ä¸»ç®¡ like '%" + HMangerID + "%'";
                }
                get_Display(sWhere);
                sWhere = "";//调用接口后清空sWhere缓存
            }
            //#endregion
            //#region é‡ç½®è¿‡æ»¤æ¡ä»¶
            function set_ClearQuery() {
                $("#HDate").val("");//开始日期
                $("#HDate1").val("");//结束日期
                $("#HBillNo").val("");//
                $("#HCusID").val("");
                $("#HDeptID").val("");
                $("#HMangerID").val("");
                sWhere = "";
            }
            //#endregion
            //#region åˆ·æ–°
            function get_Refresh() {
                set_ClearQuery();
                get_Display(sWhere);
            }
            //#endregion
            //以上是layui模块
        });
    </script>
WebTM/views/ÁìÁÏ·¢»õ/ÏúÊÛ³ö¿â/Kf_SellOutBillList.html
@@ -1,14 +1,22 @@
<!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/layui/layui.js"></script>-->
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <style type="text/css">
        input.layui-input.layui-unselect {
            padding-right: 0;
@@ -28,64 +36,63 @@
                                        <span>更多</span>
                                    </div>
                                </div>
                                <!--<div class="layui-inline">
                                    <label class="layui-form-label">单据类型</label>
                                <div class="layui-inline">
                                    <label class="layui-form-label">开始日期</label>
                                    <div class="layui-input-block">
                                        <select name="HBillType" id="HBillType">
                                            <option value="">所有</option>
                                            <option value="ZHXJ">下架找货单</option>
                                            <option value="ZHSJ">上架归还单</option>
                                        </select>
                                        <input type="date" class="layui-input" id="HBeginDate" style="width:190px;">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">结束日期</label>
                                    <div class="layui-input-block">
                                        <input type="date" class="layui-input" id="HEndDate" style="width:190px;">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">单据号</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                        <input type="text" class="layui-input" name="HBillNo" id="HBillNo" style="width:190px;">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">制单人</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HCreateBy" id="HCreateBy">
                                    </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 class="layui-colla-content">
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
                                <div class="layui-colla-content">
                                    <div class="layui-inline">
                                        <div class="layui-inline">
                                            <span>其他条件></span>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">开始时间</label>
                                        <label class="layui-form-label">客户</label>
                                        <div class="layui-input-block">
                                            <input type="date" class="layui-input" name="BenginHCreateDate" id="BenginHCreateDate">
                                            <input type="text" class="layui-input" name="HCusID" id="HCusID" style="width:190px;">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">结束时间</label>
                                        <label class="layui-form-label">部门</label>
                                        <div class="layui-input-block">
                                            <input type="date" class="layui-input" name="EndHCreateDate" id="EndHCreateDate">
                                            <input type="text" class="layui-input" name="HDeptID" id="HDeptID" style="width:190px;">
                                        </div>
                                    </div>
                                </div>-->
                                    <div class="layui-inline">
                                        <label class="layui-form-label">主管</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="HMangerID" id="HMangerID" style="width:190px;">
                                        </div>
                                    </div>
                                </div>
                            </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-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" 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-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-exit"><i class="layui-icon layui-icon-return"></i>退出</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add"><i class="layui-icon layui-icon-file-b"></i>新增</button>
                                <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-delete"></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>
@@ -93,10 +100,10 @@
            </div>
        </div>
    </div>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <!--<script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>-->
    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
@@ -114,162 +121,258 @@
                , util = layui.util
            //查询条件
            var sWhere = "";
            var option = [];
            var option = {
                elem: '#mainTable'
                //, toolbar: '#toolbarDemo'
                , height: 'full-50'
                , page: true
                , cellMinWidth: 90
                , cols: [[
                    { field: 'hmainid', title: '单据ID', hide: true }
                    , { field: '日期', title: '日期', width: 160 }
                    , { field: '单据号', title: '单据号', width: 160 }
                    , { field: '红蓝单标记', title: '红蓝单标记', width: 160 }
                    , { field: 'hsupid', title: 'hsupid', width: 200, hide: true }
                    , { field: '客户', title: '客户', width: 200 }
                    , { field: 'HEmpID', title: 'HEmpID', width: 200, hide: true }
                    , { field: '业务员', title: '业务员', width: 200 }
                    , { field: 'hmanagerid', title: 'hmanagerid', width: 200, hide: true }
                    , { field: '主管', title: '主管', width: 200 }
                    , { field: 'hsecmanagerid', title: 'hsecmanagerid', width: 160, hide: true }
                    , { field: '发货人', title: '发货人', width: 160}
                    , { field: 'hkeeperid', title: 'hkeeperid', width: 160, hide: true }
                    , { field: '保管员', title: '保管员', width: 200 }
                    , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true }
                    , { field: '部门', title: '部门', width: 200 }
                    , { field: '销售方式', title: '销售方式', width: 200 }
                    , { field: 'hsubid', title: 'hsubid', width: 200, hide: true }
                    , { field: 'hmaterid', title: 'hmaterid', width: 200, hide: true }
                    , { field: '物料代码', title: '物料代码', width: 200 }
                    , { field: '物料名称', title: '物料名称', width: 115 }
                    , { field: '规格型号', title: '规格型号', width: 115 }
                    , { field: 'hunitid', title: 'hunitid', width: 200, hide: true }
                    , { field: '计量单位代码', title: '计量单位代码', width: 200 }
                    , { field: '计量单位', title: '计量单位', width: 115 }
                    , { field: '数量', title: '数量', width: 200 }
                    , { field: '单价', title: '单价', width: 200 }
                    , { field: '金额', title: '金额', width: 200 }
                    , { field: 'hwhid', title: 'hwhid', width: 200, hide: true }
                    , { field: '发货仓库代码', title: '发货仓库代码', width: 115 }
                    , { field: '发货仓库', title: '发货仓库', width: 200 }
                    , { field: '核销金额', title: '核销金额', width: 200 }
                    , { field: '核销本位币金额', title: '核销本位币金额', width: 200 }
                    , { field: '核销剩余金额', title: '核销剩余金额', width: 115 }
                    , { 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: '审核人', title: '审核人', width: 200 }
                    , { field: '审核日期', title: '审核日期', width: 200 }
                    , { field: '修改人', title: '修改人', width: 200 }
                    , { field: '修改日期', title: '修改日期', width: 115 }
                    , { field: '关闭人', title: '关闭人', width: 115 }
                    , { field: '关闭日期', title: '关闭日期', width: 200 }
                    , { field: '作废人', title: '作废人', width: 200 }
                    , { field: '作废日期', title: '作废日期', width: 200 }
                    , { field: '计划跟踪号', title: '计划跟踪号', width: 115 }
                ]]
            };
            //初始化界面
            set_ClearBill();
            var index = layer.load(0);
            //进入页面显示的缓存列表
            $.ajax({
                //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                url: GetWEBURL() + '/Kf_SellOutBill/GetSellOutBillList',
                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 });
                }
            //#endregion
            //#region é‡ç½®æŒ‰é’®
            form.on('submit(btnReSearch)', function (data) {
                //清空过滤条件
                set_ClearQuery();
            });
            //#endregion
            //重置按钮
            //form.on('submit(btnReSearch)', function (data) {
            //    $("#HBillType").val("");//单据类型
            //    $("#HBillNo").val("");//单据号
            //    $("#HSourceBillNo").val("");//源单号
            //    $("#HCreateBy").val("");//制单人
            //    $("#BenginHCreateDate").val("");//开始制单时间
            //    $("#EndHCreateDate").val("");//结束制单时间
            //    $("#btnSearch").click();
            //});
            //#region æŸ¥è¯¢æŒ‰é’®
            form.on('submit(btnSearch)', function (data) {
                get_FastQuery(table, option);
            });
            //#endregion
            //查询按钮
            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);
            //#region åˆå§‹åŒ–界面
            function set_ClearBill() {
                //初始化表格
                set_InitGrid();
                //查询
                get_Display(sWhere);
            }
            //#endregion
            //#region åˆå§‹åŒ–表格方法
            $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
            $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
            function set_InitGrid() {
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , page: true
                    , cellMinWidth: 90
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                       ,{ field: 'hmainid', title: 'hmainid', sort: true, hide: true }
                       ,{ field: '单据号', title: '单据号', hide: true }
                        , { field: '日期', title: '日期', width: 160 }
                        , { field: '单据号', title: '单据号', width: 160 }
                        , { field: '红蓝单标记', title: '红蓝单标记', width: 160 }
                        , { field: 'hsupid', title: 'hsupid', width: 200, hide: true }
                        , { field: '客户', title: '客户', width: 200 }
                        , { field: 'HEmpID', title: 'HEmpID', width: 200, hide: true }
                        , { field: '业务员', title: '业务员', width: 200 }
                        , { field: 'hmanagerid', title: 'hmanagerid', width: 200, hide: true }
                        , { field: '主管', title: '主管', width: 200 }
                        , { field: 'hsecmanagerid', title: 'hsecmanagerid', width: 160, hide: true }
                        , { field: '发货人', title: '发货人', width: 160 }
                        , { field: 'hkeeperid', title: 'hkeeperid', width: 160, hide: true }
                        , { field: '保管员', title: '保管员', width: 200 }
                        , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true }
                        , { field: '部门', title: '部门', width: 200 }
                        , { field: '销售方式', title: '销售方式', width: 200 }
                        , { field: 'hsubid', title: 'hsubid', width: 200, hide: true }
                        , { field: 'hmaterid', title: 'hmaterid', width: 200, hide: true }
                        , { field: '物料代码', title: '物料代码', width: 200 }
                        , { field: '物料名称', title: '物料名称', width: 115 }
                        , { field: '规格型号', title: '规格型号', width: 115 }
                        , { field: 'hunitid', title: 'hunitid', width: 200, hide: true }
                        , { field: '计量单位代码', title: '计量单位代码', width: 200 }
                        , { field: '计量单位', title: '计量单位', width: 115 }
                        , { field: '数量', title: '数量', width: 200 }
                        , { field: '单价', title: '单价', width: 200 }
                        , { field: '金额', title: '金额', width: 200 }
                        , { field: '制单人', title: '制单人', width: 125 }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '审核人', title: '审核人', width: 125 }
                        , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '修改人', title: '修改人', width: 125 }
                        , { field: '修改日期', title: '修改日期', width: 200, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '关闭人', title: '关闭人', width: 125 }
                        , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '作废人', title: '作废人', width: 125 }
                        , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    ]]
                };
            }
            //进入页面显示的缓存列表
            function get_Display(sWhere) {
                var ajaxLoad = layer.load();
                $.ajax({
                    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                    url: GetWEBURL1() + '/Kf_SellOutBill/GetSellOutBillList',
                    url: GetWEBURL() + '/Kf_SellOutBill/GetSellOutBillList',
                    type: "GET",
                    data: { "sWhere": sWhere},
                    data: { "sWhere": sWhere },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(index);
                            layer.alert("查询成功", { icon: 1 });
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(index);
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(index);
                        layer.alert("接口失效!", { icon: 5 });
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                //调用接口后清空sWhere缓存
            }
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                    case 'btn-Add':
                        //页面层-自定义
                        layer.open({
                            type: 2,
                            skin: 'layui-layer-rim', //加上边框
                            title: '新增退货通知单',
                            closeBtn: 1,
                            shift: 2,
                            area: ['100%', '100%'],
                            maxmin: true,
                            content: '../../采购管理/收料通知单/Add_Edit_Cg_POInStockBillList.html?OperationType=1&linterid=0&HSouceBillType=0&closeType=1',
                            end: function () {
                                //刷新页面,
                                location.reload();
                            },
                            success: function (layero, index) {
                            }
                        });
                        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: '编辑退货通知单'
                                , closeBtn: 1
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: '../../采购管理/收料通知单/Add_Edit_Cg_POInStockBillList.html?OperationType=3&linterid=' + hID + '&HSouceBillType=0&closeType=1'
                                , resize: false,
                                end: function () {
                                    //刷新页面,
                                    location.reload();
                                }
                                , 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) {
                                $.ajax({
                                    type: "GET",
                                    url: GetWEBURL() + "Kf_SellOutBill/DeltetSellOutBill", //方法所在页面和方法名
                                    data: { "HInterID": InterID },
                                    success: function (result) {
                                        if (result.count == 1) {
                                            layer.msg(result.Message, { time: 1 * 1000, 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 });
                                        }
                                    }, error: function () {
                                        layer.alert("接口请求失败!", { icon: 5 });
                                    }
                                });
                            })
                        }
                        else {
                            layer.msg('请选择一行数据删除!');
                        }
                        break;
                    //刷新
                    case 'get_Refresh': get_Refresh();
                        break;
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        break;
                };
            });
            //#region å¿«é€Ÿè¿‡æ»¤
            function get_FastQuery(table, option) {
                var HDate = $("#HBeginDate").val();//开始日期
                var HDate1 = $("#HEndDate").val();//结束日期
                var HBillNo = $("#HBillNo").val();//单据号
                var HCusID = $("#HCusID").val();
                var HDeptID = $("#HDeptID").val();
                var HMangerID = $("#HMangerID").val();
                if (HDate) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + HDate + "'";
                }
                if (HDate1) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) <= '" + HDate1 + "'";
                }
                if (HBillNo) {
                    sWhere += " and å•据号 like '%" + HBillNo + "%'";
                }
                if (HCusID) {
                    sWhere += " and å®¢æˆ· like '%" + HCusID + "%'";
                }
                if (HDeptID) {
                    sWhere += " and éƒ¨é—¨ like '%" + HDeptID + "%'";
                }
                if (HMangerID) {
                    sWhere += " and ä¸»ç®¡ like '%" + HMangerID + "%'";
                }
                get_Display(sWhere);
                sWhere = "";//调用接口后清空sWhere缓存
            }
            //#endregion
            //#region é‡ç½®è¿‡æ»¤æ¡ä»¶
            function set_ClearQuery() {
                $("#HDate").val("");//开始日期
                $("#HDate1").val("");//结束日期
                $("#HBillNo").val("");//
                $("#HCusID").val("");
                $("#HDeptID").val("");
                $("#HMangerID").val("");
                sWhere = "";
                //$("#HBillType").val("");//单据类型
                //$("#HBillNo").val("");//单据号
                //$("#HSourceBillNo").val("");//源单号
                //$("#HCreateBy").val("");//制单人
                //$("#BenginHCreateDate").val("");//开始制单时间
                //$("#EndHCreateDate").val("");//结束制单时间
            });
            }
            //#endregion
            //监听行双击事件
            table.on('rowDouble(mainTable)', function (obj) {
                layer.alert("双击事件", { icon: 1 });
            });
            //laydate.render({
            //    elem: '#HDate'
            //    , type: 'datetime'
            //    , trigger: 'click'
            //    , format:'yyyy-MM-dd HH:mm'
            //});
            //#region åˆ·æ–°
            function get_Refresh() {
                set_ClearQuery();
                get_Display(sWhere);
            }
            //#endregion
            //以上是layui模块
WebTM/views/ÑéÊÕÈë¿â/²úÆ·Èë¿â/Kf_ProductInBillList.html
@@ -1,14 +1,22 @@
<!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/layui/layui.js"></script>-->
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <style type="text/css">
        input.layui-input.layui-unselect {
            padding-right: 0;
@@ -28,64 +36,63 @@
                                        <span>更多</span>
                                    </div>
                                </div>
                                <!--<div class="layui-inline">
                                    <label class="layui-form-label">单据类型</label>
                                <div class="layui-inline">
                                    <label class="layui-form-label">开始日期</label>
                                    <div class="layui-input-block">
                                        <select name="HBillType" id="HBillType">
                                            <option value="">所有</option>
                                            <option value="ZHXJ">下架找货单</option>
                                            <option value="ZHSJ">上架归还单</option>
                                        </select>
                                        <input type="date" class="layui-input" id="HBeginDate" style="width:190px;">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">结束日期</label>
                                    <div class="layui-input-block">
                                        <input type="date" class="layui-input" id="HEndDate" style="width:190px;">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">单据号</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                        <input type="text" class="layui-input" name="HBillNo" id="HBillNo" style="width:190px;">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">制单人</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HCreateBy" id="HCreateBy">
                                    </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 class="layui-colla-content">
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
                                <div class="layui-colla-content">
                                    <div class="layui-inline">
                                        <div class="layui-inline">
                                            <span>其他条件></span>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">开始时间</label>
                                        <label class="layui-form-label">客户</label>
                                        <div class="layui-input-block">
                                            <input type="date" class="layui-input" name="BenginHCreateDate" id="BenginHCreateDate">
                                            <input type="text" class="layui-input" name="HCusID" id="HCusID" style="width:190px;">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">结束时间</label>
                                        <label class="layui-form-label">部门</label>
                                        <div class="layui-input-block">
                                            <input type="date" class="layui-input" name="EndHCreateDate" id="EndHCreateDate">
                                            <input type="text" class="layui-input" name="HDeptID" id="HDeptID" style="width:190px;">
                                        </div>
                                    </div>
                                </div>-->
                                    <div class="layui-inline">
                                        <label class="layui-form-label">主管</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="HMangerID" id="HMangerID" style="width:190px;">
                                        </div>
                                    </div>
                                </div>
                            </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-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" 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-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-exit"><i class="layui-icon layui-icon-return"></i>退出</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add"><i class="layui-icon layui-icon-file-b"></i>新增</button>
                                <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-delete"></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>
@@ -93,10 +100,10 @@
            </div>
        </div>
    </div>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <!--<script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>-->
    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
@@ -114,155 +121,260 @@
                , util = layui.util
            //查询条件
            var sWhere = "";
            var option = [];
            var option = {
                elem: '#mainTable'
                //, toolbar: '#toolbarDemo'
                , height: 'full-50'
                , page: true
                , cellMinWidth: 90
                , cols: [[
                    { field: 'hmainid', title: '单据ID', hide: true }
                    , { field: '日期', title: '日期', width: 160 }
                    , { field: '单据号', title: '单据号', width: 160 }
                    , { field: '红蓝单标记', title: '红蓝单标记', width: 160 }
                    , { field: 'HCusID', title: 'HCusID', width: 160, hide: true }
                    , { field: '客户', title: '客户', width: 200 }
                    , { field: 'hsecmanagerid', title: 'hsecmanagerid', width: 200, hide: true }
                    , { field: '验收员', title: '验收员', width: 200 }
                    , { field: 'hkeeperid', title: 'hkeeperid', width: 200, hide: true }
                    , { field: '保管员', title: '保管员', width: 200 }
                    , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true  }
                    , { field: '部门', title: '部门', width: 160 }
                    , { field: '仓库', title: '仓库', width: 160}
                    , { field: 'hsubid', title: 'hsubid', width: 160, hide: true }
                    , { field: 'hmaterid', title: 'hmaterid', width: 200, hide: true }
                    , { field: '物料代码', title: '物料代码', width: 200 }
                    , { field: '物料名称', title: '物料名称', width: 200 }
                    , { field: '规格型号', title: '规格型号', width: 200 }
                    , { field: '批次', title: '批次', width: 200 }
                    , { field: 'hunitid', title: 'hunitid', width: 200, hide: true }
                    , { field: '计量单位', title: '计量单位', width: 200 }
                    , { field: '应收数量', title: '应收数量', width: 115 }
                    , { field: '实收数量', title: '实收数量', width: 115 }
                    , { field: '出库数量', title: '出库数量', width: 200 }
                    , { field: '单价', title: '单价', width: 200 }
                    , { field: '金额', title: '金额', width: 115 }
                    , { field: 'hwhid', title: 'hwhid', width: 200, hide: true }
                    , { field: '收料仓库代码', title: '收料仓库代码', width: 200 }
                    , { field: '收料仓库', title: '收料仓库', width: 200 }
                    , { field: '表体备注', title: '表体备注', width: 200 }
                    , { field: '源单单号', title: '源单单号', width: 115 }
                    , { 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: '修改人', title: '修改人', width: 200 }
                    , { field: '修改日期', title: '修改日期', width: 200 }
                    , { field: '关闭人', title: '关闭人', width: 200 }
                    , { field: '关闭日期', title: '关闭日期', width: 200 }
                    , { field: '作废人', title: '作废人', width: 200 }
                    , { field: '作废日期', title: '作废日期', width: 200 }
                ]]
            };
            //初始化界面
            set_ClearBill();
            var index = layer.load(0);
            //进入页面显示的缓存列表
            $.ajax({
                //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                url: GetWEBURL() + '/Kf_ProductInBill/GetProductInBill',
                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 });
                }
            //#endregion
            //#region é‡ç½®æŒ‰é’®
            form.on('submit(btnReSearch)', function (data) {
                //清空过滤条件
                set_ClearQuery();
            });
            //#endregion
            //重置按钮
            //form.on('submit(btnReSearch)', function (data) {
            //    $("#HBillType").val("");//单据类型
            //    $("#HBillNo").val("");//单据号
            //    $("#HSourceBillNo").val("");//源单号
            //    $("#HCreateBy").val("");//制单人
            //    $("#BenginHCreateDate").val("");//开始制单时间
            //    $("#EndHCreateDate").val("");//结束制单时间
            //    $("#btnSearch").click();
            //});
            //#region æŸ¥è¯¢æŒ‰é’®
            form.on('submit(btnSearch)', function (data) {
                get_FastQuery(table, option);
            });
            //#endregion
            //查询按钮
            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);
            //#region åˆå§‹åŒ–界面
            function set_ClearBill() {
                //初始化表格
                set_InitGrid();
                //查询
                get_Display(sWhere);
            }
            //#endregion
            //#region åˆå§‹åŒ–表格方法
            $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
            $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
            function set_InitGrid() {
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , page: true
                    , cellMinWidth: 90
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                       ,{ field: 'hmainid', title: 'hmainid', sort: true, hide: true }
                       ,{ field: '单据号', title: '单据号', hide: true }
                        , { field: '日期', title: '日期', width: 160 }
                        , { field: '单据号', title: '单据号', width: 160 }
                        , { field: '红蓝单标记', title: '红蓝单标记', width: 160 }
                        , { field: 'HCusID', title: 'HCusID', width: 160, hide: true }
                        , { field: '客户', title: '客户', width: 200 }
                        , { field: 'hsecmanagerid', title: 'hsecmanagerid', width: 200, hide: true }
                        , { field: '验收员', title: '验收员', width: 200 }
                        , { field: 'hkeeperid', title: 'hkeeperid', width: 200, hide: true }
                        , { field: '保管员', title: '保管员', width: 200 }
                        , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true }
                        , { field: '部门', title: '部门', width: 160 }
                        , { field: '仓库', title: '仓库', width: 160 }
                        , { field: 'hsubid', title: 'hsubid', width: 160, hide: true }
                        , { field: 'hmaterid', title: 'hmaterid', width: 200, hide: true }
                        , { field: '物料代码', title: '物料代码', width: 200 }
                        , { field: '物料名称', title: '物料名称', width: 200 }
                        , { field: '规格型号', title: '规格型号', width: 200 }
                        , { field: '批次', title: '批次', width: 200 }
                        , { field: 'hunitid', title: 'hunitid', width: 200, hide: true }
                        , { field: '计量单位', title: '计量单位', width: 200 }
                        , { field: '应收数量', title: '应收数量', width: 115 }
                        , { field: '实收数量', title: '实收数量', width: 115 }
                        , { field: '出库数量', title: '出库数量', width: 200 }
                        , { field: '单价', title: '单价', width: 200 }
                        , { field: '金额', title: '金额', width: 115 }
                        , { field: 'hwhid', title: 'hwhid', width: 200, hide: true }
                        , { field: '收料仓库代码', title: '收料仓库代码', width: 200 }
                        , { field: '收料仓库', title: '收料仓库', width: 200 }
                        , { field: '表体备注', title: '表体备注', width: 200 }
                        , { field: '制单人', title: '制单人', width: 125 }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '审核人', title: '审核人', width: 125 }
                        , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '修改人', title: '修改人', width: 125 }
                        , { field: '修改日期', title: '修改日期', width: 200, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '关闭人', title: '关闭人', width: 125 }
                        , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '作废人', title: '作废人', width: 125 }
                        , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    ]]
                };
            }
            //进入页面显示的缓存列表
            function get_Display(sWhere) {
                var ajaxLoad = layer.load();
                $.ajax({
                    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                    url: GetWEBURL1() + '/Kf_ProductInBill/GetProductInBill',
                    url: GetWEBURL() + '/Kf_ProductInBill/GetProductInBill',
                    type: "GET",
                    data: { "sWhere": sWhere},
                    data: { "sWhere": sWhere },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(index);
                            layer.alert("查询成功", { icon: 1 });
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(index);
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(index);
                        layer.alert("接口失效!", { icon: 5 });
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                //调用接口后清空sWhere缓存
            }
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                    case 'btn-Add':
                        //页面层-自定义
                        layer.open({
                            type: 2,
                            skin: 'layui-layer-rim', //加上边框
                            title: '新增退货通知单',
                            closeBtn: 1,
                            shift: 2,
                            area: ['100%', '100%'],
                            maxmin: true,
                            content: '../../采购管理/收料通知单/Add_Edit_Cg_POInStockBillList.html?OperationType=1&linterid=0&HSouceBillType=0&closeType=1',
                            end: function () {
                                //刷新页面,
                                location.reload();
                            },
                            success: function (layero, index) {
                            }
                        });
                        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: '编辑退货通知单'
                                , closeBtn: 1
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: '../../采购管理/收料通知单/Add_Edit_Cg_POInStockBillList.html?OperationType=3&linterid=' + hID + '&HSouceBillType=0&closeType=1'
                                , resize: false,
                                end: function () {
                                    //刷新页面,
                                    location.reload();
                                }
                                , 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) {
                                $.ajax({
                                    type: "GET",
                                    url: GetWEBURL() + "Kf_SellOutBill/DeltetSellOutBill", //方法所在页面和方法名
                                    data: { "HInterID": InterID },
                                    success: function (result) {
                                        if (result.count == 1) {
                                            layer.msg(result.Message, { time: 1 * 1000, 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 });
                                        }
                                    }, error: function () {
                                        layer.alert("接口请求失败!", { icon: 5 });
                                    }
                                });
                            })
                        }
                        else {
                            layer.msg('请选择一行数据删除!');
                        }
                        break;
                    //刷新
                    case 'get_Refresh': get_Refresh();
                        break;
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        break;
                };
            });
            //#region å¿«é€Ÿè¿‡æ»¤
            function get_FastQuery(table, option) {
                var HDate = $("#HBeginDate").val();//开始日期
                var HDate1 = $("#HEndDate").val();//结束日期
                var HBillNo = $("#HBillNo").val();//单据号
                var HCusID = $("#HCusID").val();
                var HDeptID = $("#HDeptID").val();
                var HMangerID = $("#HMangerID").val();
                if (HDate) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + HDate + "'";
                }
                if (HDate1) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) <= '" + HDate1 + "'";
                }
                if (HBillNo) {
                    sWhere += " and å•据号 like '%" + HBillNo + "%'";
                }
                if (HCusID) {
                    sWhere += " and å®¢æˆ· like '%" + HCusID + "%'";
                }
                if (HDeptID) {
                    sWhere += " and éƒ¨é—¨ like '%" + HDeptID + "%'";
                }
                if (HMangerID) {
                    sWhere += " and ä¸»ç®¡ like '%" + HMangerID + "%'";
                }
                get_Display(sWhere);
                sWhere = "";//调用接口后清空sWhere缓存
            }
            //#endregion
            //#region é‡ç½®è¿‡æ»¤æ¡ä»¶
            function set_ClearQuery() {
                $("#HDate").val("");//开始日期
                $("#HDate1").val("");//结束日期
                $("#HBillNo").val("");//
                $("#HCusID").val("");
                $("#HDeptID").val("");
                $("#HMangerID").val("");
                sWhere = "";
                //$("#HBillType").val("");//单据类型
                //$("#HBillNo").val("");//单据号
                //$("#HSourceBillNo").val("");//源单号
                //$("#HCreateBy").val("");//制单人
                //$("#BenginHCreateDate").val("");//开始制单时间
                //$("#EndHCreateDate").val("");//结束制单时间
            });
            }
            //#endregion
            //监听行双击事件
            table.on('rowDouble(mainTable)', function (obj) {
                layer.alert("双击事件", { icon: 1 });
            });
            //laydate.render({
            //    elem: '#HDate'
            //    , type: 'datetime'
            //    , trigger: 'click'
            //    , format:'yyyy-MM-dd HH:mm'
            //});
            //#region åˆ·æ–°
            function get_Refresh() {
                set_ClearQuery();
                get_Display(sWhere);
            }
            //#endregion
            //以上是layui模块
WebTM/views/ÑéÊÕÈë¿â/ÆäËûÈë¿â/Kf_OtherInBillList.html
@@ -1,14 +1,22 @@
<!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/layui/layui.js"></script>-->
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <style type="text/css">
        input.layui-input.layui-unselect {
            padding-right: 0;
@@ -28,64 +36,63 @@
                                        <span>更多</span>
                                    </div>
                                </div>
                                <!--<div class="layui-inline">
                                    <label class="layui-form-label">单据类型</label>
                                <div class="layui-inline">
                                    <label class="layui-form-label">开始日期</label>
                                    <div class="layui-input-block">
                                        <select name="HBillType" id="HBillType">
                                            <option value="">所有</option>
                                            <option value="ZHXJ">下架找货单</option>
                                            <option value="ZHSJ">上架归还单</option>
                                        </select>
                                        <input type="date" class="layui-input" id="HBeginDate" style="width:190px;">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">结束日期</label>
                                    <div class="layui-input-block">
                                        <input type="date" class="layui-input" id="HEndDate" style="width:190px;">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">单据号</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                        <input type="text" class="layui-input" name="HBillNo" id="HBillNo" style="width:190px;">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">制单人</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HCreateBy" id="HCreateBy">
                                    </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 class="layui-colla-content">
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
                                <div class="layui-colla-content">
                                    <div class="layui-inline">
                                        <div class="layui-inline">
                                            <span>其他条件></span>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">开始时间</label>
                                        <label class="layui-form-label">客户</label>
                                        <div class="layui-input-block">
                                            <input type="date" class="layui-input" name="BenginHCreateDate" id="BenginHCreateDate">
                                            <input type="text" class="layui-input" name="HCusID" id="HCusID" style="width:190px;">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">结束时间</label>
                                        <label class="layui-form-label">部门</label>
                                        <div class="layui-input-block">
                                            <input type="date" class="layui-input" name="EndHCreateDate" id="EndHCreateDate">
                                            <input type="text" class="layui-input" name="HDeptID" id="HDeptID" style="width:190px;">
                                        </div>
                                    </div>
                                </div>-->
                                    <div class="layui-inline">
                                        <label class="layui-form-label">主管</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="HMangerID" id="HMangerID" style="width:190px;">
                                        </div>
                                    </div>
                                </div>
                            </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-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" 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-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-exit"><i class="layui-icon layui-icon-return"></i>退出</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add"><i class="layui-icon layui-icon-file-b"></i>新增</button>
                                <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-delete"></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>
@@ -93,10 +100,10 @@
            </div>
        </div>
    </div>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <!--<script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>-->
    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
@@ -114,174 +121,260 @@
                , util = layui.util
            //查询条件
            var sWhere = "";
            var option = [];
            var option = {
                elem: '#mainTable'
                //, toolbar: '#toolbarDemo'
                , height: 'full-50'
                , page: true
                , cellMinWidth: 90
                , cols: [[
                    { field: 'hmainid', title: '单据ID', hide: true }
                    , { field: '日期', title: '日期', width: 160 }
                    , { field: '单据号', title: '单据号', width: 160 }
                    , { field: 'hmanagerid', title: 'hmanagerid', width: 160, hide: true }
                    , { field: '主管代码', title: '主管代码', width: 200 }
                    , { field: '主管', title: '主管', width: 200 }
                    , { field: 'hsecmanagerid', title: 'hsecmanagerid', width: 200, hide: true }
                    , { field: '验收员代码', title: '验收员代码', width: 200 }
                    , { field: '验收员', title: '验收员', width: 200 }
                    , { field: 'hkeeperid', title: 'hkeeperid', width: 200, hide: true  }
                    , { field: '保管员代码', title: '保管员代码', width: 160 }
                    , { field: '保管员', title: '保管员', width: 160}
                    , { field: 'HDeptID', title: 'HDeptID', width: 160, 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 }
                    , { field: '红蓝单标记', title: '红蓝单标记', width: 200 }
                    , { field: '制单人', title: '制单人', width: 115 }
                    , { field: '制单日期', title: '制单日期', width: 115 }
                    , { field: '审核人', title: '审核人', width: 200 }
                    , { field: '审核日期', title: '审核日期', width: 200 }
                    , { field: '修改人', title: '修改人', width: 115 }
                    , { 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: 200, hide: true  }
                    , { field: 'hmaterid', title: 'hmaterid', width: 200, hide: true }
                    , { field: '物料代码', title: '物料代码', width: 200 }
                    , { field: '物料名称', title: '物料名称', width: 115 }
                    , { field: '规格型号', title: '规格型号', width: 200 }
                    , { field: '附加属性', title: '附加属性', width: 200 }
                    , { field: '颜色', title: '颜色', width: 200 }
                    , { field: 'hunitid', title: 'hunitid', 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 }
                    , { field: 'hwhid', title: 'hwhid', 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: '采购订单主ID', title: '采购订单主ID', width: 200, hide: true }
                    , { field: '采购订单子ID', title: '采购订单子ID', width: 200, hide: true }
                    , { field: '采购订单号', title: '采购订单号', width: 200 }
                    , { field: '销售订单主ID', title: '销售订单主ID', width: 200, hide: true }
                    , { field: '销售订单子ID', title: '销售订单子ID', width: 200, hide: true }
                    , { field: '销售订单号', title: '销售订单号', width: 200 }
                    , { field: '关联数量', title: '关联数量', width: 200 }
                    , { field: 'HBillType', title: 'HBillType', width: 200, hide: true }
                ]]
            };
            //初始化界面
            set_ClearBill();
            var index = layer.load(0);
            //进入页面显示的缓存列表
            $.ajax({
                //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                url: GetWEBURL() + '/Kf_OtherInBill/GetOtherInBill',
                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 });
                }
            //#endregion
            //#region é‡ç½®æŒ‰é’®
            form.on('submit(btnReSearch)', function (data) {
                //清空过滤条件
                set_ClearQuery();
            });
            //#endregion
            //重置按钮
            //form.on('submit(btnReSearch)', function (data) {
            //    $("#HBillType").val("");//单据类型
            //    $("#HBillNo").val("");//单据号
            //    $("#HSourceBillNo").val("");//源单号
            //    $("#HCreateBy").val("");//制单人
            //    $("#BenginHCreateDate").val("");//开始制单时间
            //    $("#EndHCreateDate").val("");//结束制单时间
            //    $("#btnSearch").click();
            //});
            //#region æŸ¥è¯¢æŒ‰é’®
            form.on('submit(btnSearch)', function (data) {
                get_FastQuery(table, option);
            });
            //#endregion
            //查询按钮
            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);
            //#region åˆå§‹åŒ–界面
            function set_ClearBill() {
                //初始化表格
                set_InitGrid();
                //查询
                get_Display(sWhere);
            }
            //#endregion
            //#region åˆå§‹åŒ–表格方法
            $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
            $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
            function set_InitGrid() {
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , page: true
                    , cellMinWidth: 90
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                       ,{ field: 'hmainid', title: 'hmainid', sort: true, hide: true }
                       ,{ field: '单据号', title: '单据号', hide: true }
                        , { field: '日期', title: '日期', width: 160 }
                        , { field: '单据号', title: '单据号', width: 160 }
                        , { field: '红蓝单标记', title: '红蓝单标记', width: 160 }
                        , { field: 'HCusID', title: 'HCusID', width: 160, hide: true }
                        , { field: '客户', title: '客户', width: 200 }
                        , { field: 'hsecmanagerid', title: 'hsecmanagerid', width: 200, hide: true }
                        , { field: '验收员', title: '验收员', width: 200 }
                        , { field: 'hkeeperid', title: 'hkeeperid', width: 200, hide: true }
                        , { field: '保管员', title: '保管员', width: 200 }
                        , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true }
                        , { field: '部门', title: '部门', width: 160 }
                        , { field: '仓库', title: '仓库', width: 160 }
                        , { field: 'hsubid', title: 'hsubid', width: 160, hide: true }
                        , { field: 'hmaterid', title: 'hmaterid', width: 200, hide: true }
                        , { field: '物料代码', title: '物料代码', width: 200 }
                        , { field: '物料名称', title: '物料名称', width: 200 }
                        , { field: '规格型号', title: '规格型号', width: 200 }
                        , { field: '批次', title: '批次', width: 200 }
                        , { field: 'hunitid', title: 'hunitid', width: 200, hide: true }
                        , { field: '计量单位', title: '计量单位', width: 200 }
                        , { field: '应收数量', title: '应收数量', width: 115 }
                        , { field: '实收数量', title: '实收数量', width: 115 }
                        , { field: '出库数量', title: '出库数量', width: 200 }
                        , { field: '单价', title: '单价', width: 200 }
                        , { field: '金额', title: '金额', width: 115 }
                        , { field: 'hwhid', title: 'hwhid', width: 200, hide: true }
                        , { field: '收料仓库代码', title: '收料仓库代码', width: 200 }
                        , { field: '收料仓库', title: '收料仓库', width: 200 }
                        , { field: '表体备注', title: '表体备注', width: 200 }
                        , { field: '制单人', title: '制单人', width: 125 }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '审核人', title: '审核人', width: 125 }
                        , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '修改人', title: '修改人', width: 125 }
                        , { field: '修改日期', title: '修改日期', width: 200, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '关闭人', title: '关闭人', width: 125 }
                        , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '作废人', title: '作废人', width: 125 }
                        , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    ]]
                };
            }
            //进入页面显示的缓存列表
            function get_Display(sWhere) {
                var ajaxLoad = layer.load();
                $.ajax({
                    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                    url: GetWEBURL1() + '/Kf_OtherInBill/GetOtherInBill',
                    url: GetWEBURL() + '/Kf_OtherInBill/GetOtherInBill',
                    type: "GET",
                    data: { "sWhere": sWhere},
                    data: { "sWhere": sWhere },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(index);
                            layer.alert("查询成功", { icon: 1 });
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(index);
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(index);
                        layer.alert("接口失效!", { icon: 5 });
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                //调用接口后清空sWhere缓存
            }
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                    case 'btn-Add':
                        //页面层-自定义
                        layer.open({
                            type: 2,
                            skin: 'layui-layer-rim', //加上边框
                            title: '新增退货通知单',
                            closeBtn: 1,
                            shift: 2,
                            area: ['100%', '100%'],
                            maxmin: true,
                            content: '../../采购管理/收料通知单/Add_Edit_Cg_POInStockBillList.html?OperationType=1&linterid=0&HSouceBillType=0&closeType=1',
                            end: function () {
                                //刷新页面,
                                location.reload();
                            },
                            success: function (layero, index) {
                            }
                        });
                        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: '编辑退货通知单'
                                , closeBtn: 1
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: '../../采购管理/收料通知单/Add_Edit_Cg_POInStockBillList.html?OperationType=3&linterid=' + hID + '&HSouceBillType=0&closeType=1'
                                , resize: false,
                                end: function () {
                                    //刷新页面,
                                    location.reload();
                                }
                                , 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) {
                                $.ajax({
                                    type: "GET",
                                    url: GetWEBURL() + "Kf_SellOutBill/DeltetSellOutBill", //方法所在页面和方法名
                                    data: { "HInterID": InterID },
                                    success: function (result) {
                                        if (result.count == 1) {
                                            layer.msg(result.Message, { time: 1 * 1000, 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 });
                                        }
                                    }, error: function () {
                                        layer.alert("接口请求失败!", { icon: 5 });
                                    }
                                });
                            })
                        }
                        else {
                            layer.msg('请选择一行数据删除!');
                        }
                        break;
                    //刷新
                    case 'get_Refresh': get_Refresh();
                        break;
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        break;
                };
            });
            //#region å¿«é€Ÿè¿‡æ»¤
            function get_FastQuery(table, option) {
                var HDate = $("#HBeginDate").val();//开始日期
                var HDate1 = $("#HEndDate").val();//结束日期
                var HBillNo = $("#HBillNo").val();//单据号
                var HCusID = $("#HCusID").val();
                var HDeptID = $("#HDeptID").val();
                var HMangerID = $("#HMangerID").val();
                if (HDate) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + HDate + "'";
                }
                if (HDate1) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) <= '" + HDate1 + "'";
                }
                if (HBillNo) {
                    sWhere += " and å•据号 like '%" + HBillNo + "%'";
                }
                if (HCusID) {
                    sWhere += " and å®¢æˆ· like '%" + HCusID + "%'";
                }
                if (HDeptID) {
                    sWhere += " and éƒ¨é—¨ like '%" + HDeptID + "%'";
                }
                if (HMangerID) {
                    sWhere += " and ä¸»ç®¡ like '%" + HMangerID + "%'";
                }
                get_Display(sWhere);
                sWhere = "";//调用接口后清空sWhere缓存
            }
            //#endregion
            //#region é‡ç½®è¿‡æ»¤æ¡ä»¶
            function set_ClearQuery() {
                $("#HDate").val("");//开始日期
                $("#HDate1").val("");//结束日期
                $("#HBillNo").val("");//
                $("#HCusID").val("");
                $("#HDeptID").val("");
                $("#HMangerID").val("");
                sWhere = "";
                //$("#HBillType").val("");//单据类型
                //$("#HBillNo").val("");//单据号
                //$("#HSourceBillNo").val("");//源单号
                //$("#HCreateBy").val("");//制单人
                //$("#BenginHCreateDate").val("");//开始制单时间
                //$("#EndHCreateDate").val("");//结束制单时间
            });
            }
            //#endregion
            //监听行双击事件
            table.on('rowDouble(mainTable)', function (obj) {
                layer.alert("双击事件", { icon: 1 });
            });
            //laydate.render({
            //    elem: '#HDate'
            //    , type: 'datetime'
            //    , trigger: 'click'
            //    , format:'yyyy-MM-dd HH:mm'
            //});
            //#region åˆ·æ–°
            function get_Refresh() {
                set_ClearQuery();
                get_Display(sWhere);
            }
            //#endregion
            //以上是layui模块