<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AutoEInvoiceSetBrowse.aspx.cs" Inherits="M_Main.ChargesNew.AutoEInvoiceSetBrowse" %>

<!DOCTYPE html>
<html>
<head>
    <title>自动开票设置</title>
    <script type="text/javascript" src="../Jscript-Ui/jquery-easyui-1.4.4/jquery.min.js"></script>
    <script src="../jscript/JSClient.js" type="text/javascript"></script>
    <script src="../jscript/jquery.tool.new.js" type="text/javascript"></script>
    <link href="../css/framesearch_old.css" type="text/css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="../Jscript-Ui/jquery-easyui-1.4.4/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../Jscript-Ui/jquery-easyui-1.4.4/themes/icon.css" />
    <script type="text/javascript" src="../Jscript-Ui/jquery-easyui-1.4.4/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../Jscript-Ui/jquery-easyui-1.4.4/locale/easyui-lang-zh_CN.js"></script>
    <link href="../css/framesearch.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="../Jscript-Ui/JQForm/JQForm.js"></script>
    <script src="../jscript/Dialog.js" type="text/javascript"></script>
    <script src="../jscript/ajax.js"></script>
    <link href="../css/framesearch.css" type="text/css" rel="stylesheet" />
</head>
<body>
    <form id="frmForm" runat="server">
        <div id="TableContainer"></div>

        <script type="text/javascript">
            function InitFunction() {
                var h = $(window).height();
                $("#TableContainer").css("height", h + "px");
            }
            InitFunction();

            var toolbar = [
                {
                    text: '新增',
                    iconCls: 'icon-add',
                    handler: function () {
                        HDialog.Open(700, 300, '../ChargesNew/AutoEInvoiceSetManage.aspx', "新增开票设置", false, function callback(_Data) {
                            if (_Data == 1) {
                                LoadList();
                            }
                        });
                    }
                }, '-',
                {
                    text: '修改',
                    iconCls: 'icon-edit',
                    handler: function () {
                        var row = $("#TableContainer").datagrid("getSelected");
                        if (row != undefined) {
                            HDialog.Open(700, 300, '../ChargesNew/AutoEInvoiceSetManage.aspx?ID=' + row.ID + "&OPType=update", "修改开票设置", false, function callback(_Data) {
                                if (_Data == 1) {
                                    LoadList();
                                }
                            });
                        }
                    }
                }
            ];

            var column = [[
                { field: 'OrganName', title: '区域名称', width: 150, align: 'left', sortable: true },
                { field: 'CommName', title: '项目名称', width: 150, align: 'left', sortable: true },
                { field: 'EndOfMonthNotEInvoiceDays', title: '本月末不能开票天数', width: 150, align: 'left', sortable: true },
                { field: 'IsAutoEInvoiceName', title: '是否允许自动开票', width: 100, align: 'left', sortable: true }
            ]];

            function LoadList() {
                $("#TableContainer").datagrid({
                    url: '/HM/M_Main/HC/DataPostControl.aspx',
                    method: "post",
                    nowrap: false,
                    pageSize: top.ListPageSize,
                    pageList: top.ListPageList,
                    columns: column,
                    fitColumns: true,
                    rownumbers: true,
                    singleSelect: true,
                    selectOnCheck: false,
                    checkOnSelect: false,
                    pagination: true,
                    border: false,
                    width: "100%",
                    toolbar: toolbar,
                    sortOrder: "asc",
                    onBeforeLoad: function (param) {
                        param = $.JQForm.GetParam("EInvoiceManage", "AutoEInvoiceList", "TableContainer", param);
                    },
                    onLoadSuccess: function (data) {
                    }
                });

            }
            LoadList();

        </script>
    </form>
</body>
</html>

