<%@ Register TagPrefix="webdiyer" Namespace="Wuqi.Webdiyer" Assembly="AspNetPager" %>

<%@ Page Language="c#" CodeBehind="RefundFeesSecAudit.aspx.cs" AutoEventWireup="false" Inherits="M_Main.ChargesNew.RefundFeesSecAudit" %>

<!DOCTYPE HTML>
<html>
<head>
    <title></title>
    <script type="text/javascript" src="../jscript/DateControl.js"></script>
    <script type="text/javascript" src="../jscript/JSClient.js"></script>
    <script type="text/javascript" src="../jscript/ajax.js"></script>
    <script type="text/javascript" src="../jscript/Keydown.js" event="onkeydown" for="document"></script>

    <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 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>

    <link href="../css/framesearch_old.css" type="text/css" rel="stylesheet" />
    <link href="../css/button.css" rel="stylesheet" />
    <script src="../jscript/DateFormat.js" type="text/javascript"></script>
    <script src="../jscript/format.js" type="text/javascript"></script>
    <script type="text/javascript" src="../Jscript-Ui/JQForm/JQForm.js"></script>
    <script type="text/javascript" src="../jscript/DatePicker/WdatePicker.js"></script>
    <script src="../jscript/DateControl.js"></script>
    <script src="../jscript/JSClient.js"></script>
    <script src="../jscript/ajax.js"></script>
    <script src="../jscript/Keydown.js" event="onkeydown" for="document"></script>
    <script language="javascript">
		<!--

    var strpageNumber = 1;
    var strpageSize = top.ListPageSize;
    function CheckData() {
       
        if (RefundFeesManage.RefundAmount.value == "" || RefundFeesManage.RefundAmount.value == "0") {

            if (RefundFeesManage.RefundLateFeeAmount.value == "0" || RefundFeesManage.RefundLateFeeAmount.value == "") {
                HDialog.Info("请输入退款金额,此项不能为空或0!");
                RefundFeesManage.RefundAmount.focus();
                return false;
            }
           
           
        }
        if (RefundFeesManage.RefundLateFeeAmount.value != "" || RefundFeesManage.RefundAmount.value != "") {
            if (Number(RefundFeesManage.RefundLateFeeAmount.value) < 0 || Number(RefundFeesManage.RefundAmount.value) < 0) {
                HDialog.Info("退款金额不能小于0!");
                RefundFeesManage.RefundAmount.focus();
                return false;
            }
        }
        if (RefundFeesManage.RefundLateFeeAmount.value == "0" || RefundFeesManage.RefundLateFeeAmount.value == "") {
            if (RefundFeesManage.RefundAmount.value == "" || RefundFeesManage.RefundAmount.value == "0") {
                HDialog.Info("请输入合同违约金退款金额,退款金额为0!");
                RefundFeesManage.RefundLateFeeAmount.focus();
                return false;
            }            

        }

        //提交本金////////////////////////////////////////////////////

        var varLimitAmount = RefundFeesManage.hiChargeAmount.value;
        var varRefundAmount = RefundFeesManage.RefundAmount.value;
        var varCanAmount = RefundFeesManage.CanRefundAmount.value;

        var tmpLimitAmount = 0.0;
        var tmpRefundAmount = 0.0;
        var tmpCanAmount = 0.0;

        if (varLimitAmount != "") {
            tmpLimitAmount = parseFloat(varLimitAmount);
        }
        if (varRefundAmount != "") {
            tmpRefundAmount = parseFloat(varRefundAmount);
        }
        if (varCanAmount != "") {
            tmpCanAmount = parseFloat(varCanAmount);
        }


        if (tmpLimitAmount < parseFloat(tmpRefundAmount).toFixed(2)) {

            HDialog.Info('提交本金超过最大限额(' + varLimitAmount + ')！');
            RefundFeesManage.RefundAmount.focus();
            return false;
        }


        ///合同违约金///////////////////////////////////////////////////

        varLimitAmount = RefundFeesManage.hiLateFeeAmount.value;
        varRefundAmount = RefundFeesManage.RefundLateFeeAmount.value;
        varCanAmount = RefundFeesManage.CanRefundLateFeeAmount.value;

        tmpLimitAmount = 0.0;
        tmpRefundAmount = 0.0;
        tmpCanAmount = 0.0;

        if (varLimitAmount != "") {
            tmpLimitAmount = parseFloat(varLimitAmount);
        }
        if (varRefundAmount != "") {
            tmpRefundAmount = parseFloat(varRefundAmount);
        }
        if (varCanAmount != "") {
            tmpCanAmount = parseFloat(varCanAmount);
        }

        if (tmpLimitAmount < (tmpRefundAmount + tmpCanAmount)) {
            HDialog.Info('合同违约金超过最大限额(' + varLimitAmount + ')！');
            RefundFeesManage.RefundLateFeeAmount.focus();
            return false;
        }

        return true;
    }

    //-->
    </script>
</head>
<body style="overflow-y: auto">
    <form id="RefundFeesManage" method="post" runat="server">

        <input id="hiOPType" style="width: 32px; height: 22px" type="hidden" size="1" name="hiOPType" runat="server" />
        <input id="RecdID" style="width: 24px; height: 22px" type="hidden" size="1" name="RecdID" runat="server" />
        <input id="CustID" style="width: 24px; height: 22px" type="hidden" size="1" name="CustID" runat="server" />
        <input id="RoomID" style="width: 24px; height: 22px" type="hidden" size="1" name="RoomID" runat="server" />
        <input id="CostID" style="width: 24px; height: 22px" type="hidden" size="1" name="CostID" runat="server" />
        <input id="FeesID" style="width: 24px; height: 22px" type="hidden" size="1" name="BillsSign" runat="server" />
        <input id="PageIndex" style="width: 32px; height: 22px" type="hidden" size="1" name="PageIndex" runat="server" />
        <input id="CostType" style="width: 24px; height: 22px" type="hidden" size="1" name="CostType" runat="server" />
        <input id="BusinessType" style="width: 24px; height: 22px" type="hidden" size="1" name="BillsSign" runat="server" />
        <input id="OffsetIID" style="width: 24px; height: 22px" type="hidden" size="1" name="BillsSign" runat="server" />
        <input id="ReceID" style="width: 24px; height: 22px" type="hidden" size="1" runat="server" />
        <input id="PrecID" style="width: 24px; height: 22px" type="hidden" size="1" name="PrecID" runat="server" />
        <input id="btnGetLoadDataDGrid" type="button" name="btnGetLoadDataDGrid" runat="server" />
        <input id="btnDGridcancel" name="btnDGridcancel" type="button" runat="server" />
        <input id="DGridRefundID" name="DGridRefundID" type="hidden" runat="server" />
        <input id="btnDGridPrecAdd" name="btnDGridPrecAdd" type="button" runat="server" />

        <input id="DGridPrecAdd" name="DGridPrecAdd" type="hidden" runat="server" />

        <input id="btnDGridRefund" name="btnDGridRefund" type="button" runat="server" />
        <input id="DGridRefundIID" name="DGridRefundIID" type="hidden" runat="server" />

        <table class="DialogTable" id="table1">
            <tr>
                <td colspan="4" style="text-align: center; height: 24px; background: #e6e6e6"><span style="font-size: 16px">退费信息</span> </td>
            </tr>
            <tr>
                <td class="TdTitle">客户名称</td>
                <td class="TdContent">
                    <asp:Label ID="CustName" runat="server"></asp:Label></td>
                <td class="TdTitle">房屋编号</td>
                <td class="TdContent">
                    <asp:Label ID="RoomSign" runat="server"></asp:Label></td>
            </tr>
            <tr>
                <td class="TdTitle">费用名称</td>
                <td class="TdContent">
                    <asp:Label ID="CostName" runat="server"></asp:Label></td>
                <td class="TdTitle">收款/冲抵日期</td>
                <td class="TdContent">
                    <asp:Label ID="ChargeDate" runat="server"></asp:Label></td>
            </tr>
            <tr>
                <td class="TdTitle">开始时间</td>
                <td class="TdContent">
                    <asp:Label ID="FeesStateDate" runat="server"></asp:Label></td>
                <td class="TdTitle">结束时间</td>
                <td class="TdContent">
                    <asp:Label ID="FeesEndDate" runat="server"></asp:Label></td>
            </tr>
            <tr>
                <td class="TdTitle">收费/冲抵金额</td>
                <td class="TdContent">
                    <asp:Label ID="ChargeAmount" runat="server"></asp:Label><input id="hiChargeAmount" style="width: 8px; height: 22px" type="hidden" size="1" name="hiChargeAmount"
                        runat="server"></td>
                <td class="TdTitle">合同违约金</td>
                <td class="TdContent">
                    <asp:Label ID="LateFeeAmount" runat="server"></asp:Label><input id="hiLateFeeAmount" style="width: 8px; height: 22px" type="hidden" size="1" name="hiLateFeeAmount"
                        runat="server"></td>
            </tr>
            <tr>
                <td class="TdTitle">收款方式</td>
                <td class="TdContent">
                    <asp:Label ID="ChargeMode" runat="server"></asp:Label></td>
                <td class="TdTitle">可申请金额</td>
                <td class="TdContent">
                    <asp:Label ID="IsCanRefundAmount" runat="server"></asp:Label></td>
            </tr>
            <tr>
                <td class="TdTitle">费用备注</td>
                <td class="TdContent">
                    <asp:Label ID="FeesMemo" runat="server"></asp:Label></td>
                <td class="TdTitle">收据备注</td>
                <td class="TdContent">
                    <asp:Label ID="ReceMemo" runat="server"></asp:Label></td>
            </tr>
            <tr>
                <td class="TdTitle">提交收费/冲抵退款金额</td>
                <td class="TdContent">
                    <input class="Control_ItemInput" id="RefundAmount"
                        name="RefundAmount" runat="server"></td>
                <td class="TdTitle">
                    <input id="CanRefundAmount" type="hidden" size="1" name="CanRefundAmount"
                        runat="server"><input id="CanRefundLateFeeAmount" type="hidden" size="1"
                            name="CanRefundLateFeeAmount" runat="server">提交合同违约金退款金额</td>
                <td class="TdContent">
                    <input class="Control_ItemInput" id="RefundLateFeeAmount" name="RefundLateFeeAmount" runat="server"></td>
            </tr>
            <tr>
                <td class="TdTitle">退款备注</td>
                <td class="TdContent" colspan="3">
                    <input class="Control_ItemInput" id="RefundMemo" style="width: 90%"
                        name="RefundMemo" runat="server"></td>
            </tr>
            <tr>
                <td align="center" colspan="4" style="height: 32px">
                    <input id="MayRefundAmount" style="width: 24px; height: 22px" type="hidden" size="1" name="MayRefundAmount"
                        runat="server"><input class="button" id="btnSave" onclick="javascript: if (CheckData() == false) return false;"
                            type="button" value="确定" name="btnSave" runat="server">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
												&nbsp;&nbsp;&nbsp;
                    <input class="button" id="btnReturn" type="button" value="关闭" name="btnReturn"
                        runat="server"></td>
            </tr>
            <tr>
                <td style="height: 32px" class="SchTable" colspan="4" align="left">备注：1、实收、冲抵费用退款申请，请在本页上面填写退款金额，填写的退款金额不得大于“实收、冲抵金额-已经提交申请的金额”；2、预收退款申请，请在下面“已预收的费用”中直接点击“提交退款”，每笔预收费用只能全退。3、退款申请审核前，可在下面已提交退款申请的列表中撤销；退款申请审核后，不能撤销。</td>
            </tr>
        </table>
        <table class="DialogTable" id="table2">

            <asp:Panel ID="PrecPanel" runat="server">

                <tr>
                    <td id='td1' colspan="4" style="text-align: center; background: #e6e6e6"><span style="font-size: 16px">已预收的费用</span> </td>
                </tr>
                <tr>
                    <td valign="top" width="100%" colspan="4">
                        <input type="hidden" id="hiDGridPrec" name="hiDGridPrec" runat="server" />
                        <div class="SearchContainer" id="DGridPrec"></div>
                    </td>
                </tr>

                <tr>
                    <td id='td2' colspan="4" style="text-align: center; height: 24px; background: #e6e6e6"><span style="font-size: 16px">已提交退款申请的预收费用</span> </td>
                </tr>
                <tr>
                    <td valign="top" width="100%" colspan="4">
                        <input type="hidden" id="hiDGridRefund" name="hiDGridRefund" runat="server" />
                        <div class="SearchContainer" id="DGridRefund"></div>

                    </td>
                </tr>
            </asp:Panel>
            <asp:Panel ID="FeesPanel" runat="server">

                <tr>
                    <td colspan="4" id='td3' style="text-align: center; height: 24px; background: #e6e6e6"><span style="font-size: 16px">已提交退款申请的实收/冲抵费用</span> </td>
                </tr>
                <tr>
                    <td valign="top" width="100%" colspan="4">
                        <input type="hidden" id="hiDGrid" name="hiDGrid" runat="server" />

                        <input type="hidden" id="DGridpageNumber" name="DGridpageNumber" runat="server" />
                        <input type="hidden" id="DGridpageSize" name="DGridpageSize" runat="server" />



                        <div class="SearchContainer" id="DGrid"></div>
                    </td>
                </tr>

            </asp:Panel>
        </table>

        <script type="text/javascript">

            function InitTableHeight() {
                var AllHeight = $(window).height();
                var Table1Height = $("#table1").height();
                var td1h = $("#td1").height();
                var td2h = $("#td2").height();
                var td3h = $("#td3").height();

                var h = AllHeight - Table1Height;
                $("#table2").css("height", h + "px");
                h = h - td3h - 10;
                $("#DGrid").css("height", "140px");
                var h1 = (AllHeight - Table1Height - td1h - td2h - 20) / 2;
                $("#DGridRefund").css("height", "140px");
                $("#DGridPrec").css("height", "140px");
                $('#DGridpageNumber').val(1);
                $('#DGridpageSize').val(top.ListPageSize);

                $('#btnGetLoadDataDGrid').hide();
                $('#btnDGridcancel').hide();

                $('#btnDGridPrecAdd').hide();
                $('#btnDGridRefund').hide();
            }

            InitTableHeight();

            var DGridColumn = [[
                { field: 'CanRefundAmount', title: '提交金额', width: 100, align: 'left', sortable: true },
                { field: 'CanRefundLateFeeAmount', title: '提交合同违约金', width: 100, align: 'left', sortable: true },
                { field: 'SubUserName', title: '提交人', width: 100, align: 'left', sortable: true },
                { field: 'SubDatatime', title: '提交时间', width: 100, align: 'left', sortable: true },
                { field: 'RefundMemo', title: '退款备注', width: 100, align: 'left', sortable: true },
                {
                    field: 'IsAudit', title: '审核状态', width: 100, align: 'left', sortable: true, formatter: function (value, row, index) {
                        var str = "";
                        switch (row.IsAudit) {
                            case "1":
                                str = "<span style=\"color:red\">已审核</span>";
                                break;
                            case "2":
                                str = "<span style=\"color:blue\">审核未通过</span>";
                                break;
                            default:
                                str = "<span style=\"color:green\">未审核</span>";
                                break;

                        }
                        return str;
                    }
                }

            ]];

            var DGridColumn1 = [[
                { field: 'CanRefundPrecAmount', title: '提交冲抵金额', width: 100, align: 'left', sortable: true },
                { field: 'CanRefundLateFeeAmount', title: '提交合同违约金', width: 100, align: 'left', sortable: true },
                { field: 'SubUserName', title: '提交人', width: 100, align: 'left', sortable: true },
                { field: 'SubDatatime', title: '提交时间', width: 100, align: 'left', sortable: true },
                { field: 'RefundMemo', title: '退款备注', width: 100, align: 'left', sortable: true },
                {
                    field: 'IsAudit', title: '审核状态', width: 100, align: 'left', sortable: true, formatter: function (value, row, index) {
                        var str = "";
                        switch (row.IsAudit) {
                            case "1":
                                str = "<span style=\"color:red\">已审核</span>";
                                break;
                            case "2":
                                str = "<span style=\"color:blue\">审核未通过</span>";
                                break;
                            default:
                                str = "<span style=\"color:green\">未审核</span>";
                                break;

                        }
                        return str;
                    }
                }

            ]];

            var DGridtoolbar = [
                 {
                     text: '撤销',
                     iconCls: 'icon-cancel',
                     handler: function () {
                         var rowData = $('#DGrid').datagrid('getSelected');
                         if (rowData == "") {
                             HDialog.Info('请选择要撤销的费用!');
                         }
                         else {

                             if (rowData.IsAudit == "1") {
                                 HDialog.Info('已审核、禁止删除!');
                             }
                             else {
                                 $('#DGridRefundID').val(rowData.RefundID);
                                 $('#btnDGridcancel').click();
                             }

                         }
                     }
                 }

            ];

            var DGridPrectoolbar = [
                {
                    text: '提交退款',
                    iconCls: 'icon-add',
                    handler: function () {
                        var rowData = $('#DGridPrec').datagrid('getSelected');
                        if (rowData == "") {
                            HDialog.Info('请选择要退款的费用!');
                        }
                        else {

                            if (rowData.AuditIID == "1") {
                                HDialog.Info('已审核、禁止删除!');
                            }
                            else {
                                if (rowData.AuditIID > 1) {
                                    HDialog.Info('已提交、禁止重复提交!');
                                }
                                else {
                                    //   $('#DGridRefundID').val(rowData.RefundID);
                                    $('#DGridPrecAdd').val(JSON.stringify(rowData));
                                    $('#btnDGridPrecAdd').click();
                                }
                            }

                        }
                    }
                }

            ];

            var DGridRefundtoolbar = [
                 {
                     text: '撤销',
                     iconCls: 'icon-cancel',
                     handler: function () {
                         var rowData = $('#DGridRefund').datagrid('getSelected');
                         if (rowData == "") {
                             HDialog.Info('请选择要撤销的费用!');
                         }
                         else {

                             if (rowData.IsAudit == "1") {
                                 HDialog.Info('已审核、禁止删除!');
                             }
                             else {

                                 $('#DGridRefundIID').val(rowData.IID);
                                 $('#btnDGridRefund').click();
                             }

                         }
                     }
                 }

            ];

            var DGridPrecColumn = [[
                { field: 'BillsSign', title: '票据号码', width: 100, align: 'left', sortable: true },
                { field: 'RoomSign', title: '房屋编号', width: 100, align: 'left', sortable: true },
                { field: 'CostName', title: '费用名称', width: 100, align: 'left', sortable: true },
                { field: 'FeeDueYearMonth', title: '费用日期', width: 100, align: 'left', sortable: true },
                {
                    field: 'AccountsDueDate', title: '应收日期', width: 100, align: 'left', sortable: true, formatter: function (value, row, index) {

                        var str = formatDate(row.AccountsDueDate, "yyyy-MM-dd");
                        return str;
                    }
                },
                {
                    field: 'FeesStateDate', title: '开始日期', width: 100, align: 'left', sortable: true, formatter: function (value, row, index) {

                        var str = formatDate(row.FeesStateDate, "yyyy-MM-dd");
                        return str;
                    }
                },
                {
                    field: 'FeesEndDate', title: '结束日期', width: 100, align: 'left', sortable: true, formatter: function (value, row, index) {

                        var str = formatDate(row.FeesEndDate, "yyyy-MM-dd");
                        return str;
                    }
                },
                { field: 'DueAmount', title: '应收金额', width: 100, align: 'left', sortable: true },
                { field: 'PaidAmount', title: '实收金额', width: 100, align: 'left', sortable: true },
                { field: 'PrecAmount', title: '预交冲抵', width: 100, align: 'left', sortable: true },
                { field: 'DebtsAmount', title: '欠收金额', width: 100, align: 'left', sortable: true },
                {
                    field: 'AuditIID', title: '提交状态', width: 100, align: 'left', sortable: true, formatter: function (value, row, index) {
                        var str = "";
                        if (row.AuditIID > 1) {
                            str = "<span style=\"color:red\">已提交退款</span>";
                        }
                        else {
                            str = "<span style=\"color:green\">未提交</span>";
                        }
                        return str;
                    }
                }
            ]];

            var DGridRefundColumn = [[
                { field: 'CostName', title: '费用项目', width: 100, align: 'left', sortable: true },
                { field: 'SubAmount', title: '提交金额', width: 100, align: 'left', sortable: true },

                { field: 'SubUserName', title: '提交人', width: 100, align: 'left', sortable: true },
                {
                    field: 'SubDate', title: '提交时间', width: 100, align: 'left', sortable: true, formatter: function (value, row, index) {

                        var str = formatDate(row.SubDate, "yyyy-MM-dd HH:mm:ss");
                        return str;
                    }
                },
                { field: 'ReFundmemo', title: '退款备注', width: 100, align: 'left', sortable: true },
                {
                    field: 'IsAudit', title: '审核状态', width: 100, align: 'left', sortable: true, formatter: function (value, row, index) {
                        var str = "";
                        switch (row.IsAudit) {
                            case "1":
                                str = "<span style=\"color:red\">已审核</span>";
                                break;
                            case "2":
                                str = "<span style=\"color:blue\">审核未通过</span>";
                                break;
                            default:
                                if (row.IID != "") {
                                    str = "<span style=\"color:green\">未审核</span>";
                                }
                                break;

                        }
                        return str;
                    }
                }
            ]];

            function LoadDataDGrid1() {
                var Data = $('#hiDGrid').val();
                var obj = JSON.parse(Data);
                $("#DGrid").datagrid({
                    data: obj,
                    loadMsg: '数据加载中,请稍候...',
                    nowrap: false,
                    pageSize: top.ListPageSize,
                    pageList: top.ListPageList,
                    columns: DGridColumn,
                    fitColumns: true,
                    remoteSort: false,
                    singleSelect: true,
                    pagination: true,
                    width: '100%',
                    sortOrder: "asc",
                    singleSelect: true,
                    selectOnCheck: false,
                    checkOnSelect: false,
                    rownumbers: true,
                    border: false,
                    toolbar: DGridtoolbar,
                    onBeforeLoad: function (param) {
                        var pg = $("#DGrid").datagrid("getPager");
                        if (pg) {
                            $(pg).pagination({
                                onBeforeRefresh: function () {
                                },
                                onRefresh: function (pageNumber, pageSize) {
                                },
                                onChangePageSize: function () {
                                },
                                onSelectPage: function (Pn, Ps) {
                                    //调用服务器事件
                                    $('#DGrid').datagrid('options').pageNumber = Pn;
                                    $('#DGrid').datagrid('options').pageSize = Ps;
                                    $('#DGridpageNumber').val(Pn);
                                    $('#DGridpageSize').val(Ps);
                                    $('#btnGetLoadDataDGrid').click();
                                }
                            });
                        }
                    }
                });

            }

            function LoadDataDGrid2() {
                var Data = $('#hiDGrid').val();
                var obj = JSON.parse(Data);
                $("#DGrid").datagrid({
                    data: obj,
                    loadMsg: '数据加载中,请稍候...',
                    nowrap: false,
                    pageSize: strpageSize,
                    pageList: top.ListPageList,
                    columns: DGridColumn1,
                    fitColumns: true,
                    remoteSort: false,
                    singleSelect: true,
                    pagination: true,
                    width: '100%',
                    sortOrder: "asc",
                    singleSelect: true,
                    selectOnCheck: false,
                    checkOnSelect: false,
                    rownumbers: true,
                    border: false,
                    toolbar: DGridtoolbar,
                    onLoadSuccess: function () {
                        var p = $('#DGrid').datagrid('getPager');
                        if (p) {
                            $(p).pagination({
                                onSelectPage: function (pageNumber, pageSize) {
                                    strpageNumber = pageNumber;
                                    strpageSize = pageSize;
                                    LoadListPage(strpageNumber, strpageSize);
                                    $('#DGrid').datagrid('options').pageNumber = strpageNumber;
                                    $('#DGrid').datagrid('options').pageSize = strpageSize;
                                }
                            });
                        }

                        $('#DGrid').datagrid('options').pageNumber = strpageNumber;
                        $('#DGrid').datagrid('options').pageSize = strpageSize;
                    },
                    //onBeforeLoad: function (param) {
                    //    var pg = $("#DGrid").datagrid("getPager");
                    //    if (pg) {
                    //        $(pg).pagination({
                    //            onBeforeRefresh: function () {
                    //            },
                    //            onRefresh: function (pageNumber, pageSize) {
                    //            },
                    //            onChangePageSize: function () {
                    //            },
                    //            onSelectPage: function (Pn, Ps) {
                    //                //调用服务器事件
                    //                //LoadList(Pn, Ps);
                    //                $('#DGrid').datagrid('options').pageNumber = Pn;
                    //                $('#DGrid').datagrid('options').pageSize = Ps;
                    //                $('#DGridpageNumber').val(Pn);
                    //                $('#DGridpageSize').val(Ps);
                    //                $('#btnGetLoadDataDGrid').click();
                    //            }
                    //        });
                    //    }
                    //}
                });
            }

            function LoadListPage(page, rows) {
                $.tool.DataPostNoLoading('RefundFees', 'RefundFeesLoadData', "Pages=" + page + "&PageSize=" + rows + "&RecdID=" + $('#RecdID').val() + "&OffsetIID=" + $('#OffsetIID').val(),
                 function Init() {
                 },
                 function callback(_Data) {
                     //var Data = eval("(" + _Data + ")");
                     $('#hiDGrid').val(_Data);
                     LoadDataDGrid2();
                 },
                 function completeCallback() {
                 },
                 function errorCallback() {
                 });
            }

            function LoadDataPreDetail() {
                var Data = $('#hiDGridPrec').val();
                var obj = JSON.parse(Data);
                $("#DGridPrec").datagrid({
                    data: obj.rows,
                    loadMsg: '数据加载中,请稍候...',
                    nowrap: false,
                    pageSize: top.ListPageSize,
                    pageList: top.ListPageList,
                    columns: DGridPrecColumn,
                    fitColumns: true,
                    remoteSort: false,
                    singleSelect: true,
                    pagination: true,
                    width: '100%',
                    sortOrder: "asc",
                    singleSelect: true,
                    selectOnCheck: false,
                    checkOnSelect: false,
                    rownumbers: true,
                    border: false,
                    toolbar: DGridPrectoolbar,
                    onBeforeLoad: function (param) {

                    }
                });
            }

            function LoadDataRefundAudit() {
                var Data = $('#hiDGridRefund').val();
                var obj = JSON.parse(Data);
                $("#DGridRefund").datagrid({
                    data: obj.rows,
                    loadMsg: '数据加载中,请稍候...',
                    nowrap: false,
                    pageSize: top.ListPageSize,
                    pageList: top.ListPageList,
                    columns: DGridRefundColumn,
                    fitColumns: true,
                    remoteSort: false,
                    singleSelect: true,
                    pagination: true,
                    width: '100%',
                    sortOrder: "asc",
                    singleSelect: true,
                    selectOnCheck: false,
                    checkOnSelect: false,
                    rownumbers: true,
                    border: false,
                    toolbar: DGridRefundtoolbar,
                    onBeforeLoad: function (param) {

                    }
                });
            }

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