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

<!DOCTYPE HTML>
<html>
<head>
    <title>GenerateWaivFeesExcel</title>
    <script type="text/javascript" src="../../Jscript-Ui/jquery-easyui-1.4.4/jquery.min.js"></script>
    <script type="text/javascript" src="../../jscript/JSClient.js"></script>
    <script type="text/javascript" src="../../jscript/jquery.tool.new.js"></script>
    <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>
    <script type="text/javascript" src="../../Jscript-Ui/JQForm/JQForm.js"></script>
    <script type="text/javascript" src="../../jscript/Dialog.js"></script>
    <script type="text/javascript" src="../../jscript/DateFormat.js"></script>
    <script type="text/javascript" src="../../jscript/format.js"></script>
    <script type="text/javascript" src="../../jscript/DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../../Jscript-Ui/JQForm/JQForm.js"></script>

    <link type="text/css" rel="stylesheet" href="../../css/framesearch.css" />
    <link type="text/css" rel="stylesheet" href="../../css/button.css" />
    <link type="text/css" rel="stylesheet" href="../../css/framesearch.css" />
    <link type="text/css" rel="stylesheet" href="../../css/framesearch_old.css" />
    <link type="text/css" rel="stylesheet" href="../../Jscript-Ui/jquery-easyui-1.4.4/themes/default/easyui.css" />
    <link type="text/css" rel="stylesheet" href="../../Jscript-Ui/jquery-easyui-1.4.4/themes/icon.css" />
</head>
<body>
    <form id="GenerateWaivFeesExcel" method="post" runat="server">
        <table class="DialogTable" id="Table1">
            <tr>
                <td class="TdTitle" colspan="2"></td>
            </tr>
            <tr style="display:none">
                <td class="TdTitle">楼宇</td>
                <td class="TdContentSearch">
                    <select name="BuildSNum" id="BuildSNum" class="easyui-combobox" paneimaxheight="100px"
                        data-options="editable:false,required:true,panelHeight:'157px'" style="width: 145px" runat="server">
                    </select>
                </td>
            </tr>
            <tr style="display:none">
                <td class="TdTitle">费用对象</td>
                <td class="TdContentSearch">
                    <input id="CkLiveType0" type="radio" checked value="0" name="CkLiveType" runat="server">当前住户
                    <input id="CkLiveType1" type="radio" value="1" name="CkLiveType" runat="server">业主
                    <input id="CkLiveType2" type="radio" value="2" name="CkLiveType" runat="server">租户
                    <input id="CkLiveType3" type="radio" value="3" name="CkLiveType" runat="server">车位业主
                    <input id="CkLiveType4" type="radio" value="4" name="CkLiveType" runat="server">车位租户
                </td>
            </tr>
            <tr>
                <td class="TdTitle">费用项目</td>
                <td class="TdContentSearch">
                    <input class="easyui-searchbox" searcher="SelCost" data-options="editable:false,required:true" id="CostName" name="CostName" runat="server">
                    <input class="Control_ItemInput" id="CostID" style="width: 8px; height: 22px" type="hidden" size="1" name="CostID" runat="server">
                    <input class="Control_ItemInput" id="hiCostName" style="width: 8px; height: 22px" type="hidden" size="1" name="hiCostName" runat="server">
                    <input class="Control_ItemInput" id="CostSNum" style="width: 8px; height: 22px" type="hidden" size="1" name="CostSNum" runat="server">
                </td>
            </tr>
            <tr>
                <td class="TdTitle">减免方式</td>
                <td class="TdContentSearch">
                    <select name="WaivType" id="WaivType" class="easyui-combobox" paneimaxheight="100px"
                        data-options="editable:false,required:true,panelHeight:'auto'" style="width: 145px" runat="server">
                        <option value="按每月减免">按每月减免</option>
                        <option value="按总额减免">按总额减免</option>
                        <option value="按比例减免">按比例减免</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="TdTitle">开始日期</td>
                <td class="TdContentSearch">
                    <select id="CreYear1" name="CreYear1" class="easyui-combobox" paneimaxheight="100px"
                        data-options="editable:false,required:true,panelHeight:'120px'" style="width: 145px" runat="server">
                    </select>&nbsp;&nbsp;年&nbsp;&nbsp;
                    <select id="CreMonth1" name="CreMonth1" class="easyui-combobox" paneimaxheight="100px"
                        data-options="editable:false,required:true,panelHeight:'120px'" style="width: 145px" runat="server">
                    </select>&nbsp;&nbsp;月
                </td>
            </tr>
            <tr>
                <td class="TdTitle">结束日期</td>
                <td class="TdContentSearch">
                    <select id="CreYear2" name="CreYear2" class="easyui-combobox" paneimaxheight="100px"
                        data-options="editable:false,required:true,panelHeight:'127px'" style="width: 145px" runat="server">
                    </select>&nbsp;&nbsp;年&nbsp;&nbsp;
                    <select id="CreMonth2" name="CreMonth2" class="easyui-combobox" paneimaxheight="100px"
                        data-options="editable:false,required:true,panelHeight:'127px'" style="width: 145px" runat="server">
                    </select>&nbsp;&nbsp;月
                </td>
            </tr>
            <tr>
                <td class="TdTitle" colspan="2"></td>
            </tr>
        </table>

        <div style="text-align: center; bottom: 0; position: fixed; width: 100%; height: 60px; line-height: 20px; background-color: #f5f5f5; margin-right: 45px;">
            <table class="DialogTable" id="Table6">
                <tr>
                    <td style="text-align: center;" class="DialogTdSubmit">
                        <input class="button" id="btnGenerateExcel" type="button" value="生成模板文件" name="btnCreExcel" runat="server">
                        &nbsp;
                        <input class="button" id="btnReturn" type="button" value="返回" name="btnReturn" runat="server">
                    </td>
                </tr>
            </table>
        </div>

    </form>
</body>
</html>
<script type="text/javascript">

    $("#btnGenerateExcel").click(function () {
        if ($("#GenerateWaivFeesExcel").form('validate')) {
            var StartDate = $("#CreYear1").val() + '-' + $("#CreMonth1").val();
            var strEndDate = $("#CreYear2").val() + '-' + $("#CreMonth2").val();
            window.location.href = '../ExcelDownload/DownloadWaivFeesExcel.aspx?BuildSNum=' + $("#BuildSNum").combobox('getValue') + '&LiveType=' + $("input[name='CkLiveType']:checked").val() +
                '&CreYear1=' + $("#CreYear1").combobox('getValue') + '&CreMonth1=' + $("#CreMonth1").combobox('getValue') +
                '&CreYear2=' + $("#CreYear2").combobox('getValue') + '&CreMonth2=' + $("#CreMonth2").combobox('getValue') +
                '&CostSNum=' + $('#CostSNum').val() + '&CostName=' + $('#CostName').val() + '&WaivType=' + $("#WaivType").combobox('getValue');
        }
    });

    function SelCost() {
        var conent = "../dialogNew/CorpCommCostDlg.aspx" + "?Ram=" + Math.random();
        HDialog.Open('700', '400', conent, '收费项目选择', false, function callback(_Data) {
            if (_Data != "") {
                //**获得返回 刷新
                var data = JSON.parse(_Data);
                $('#CostName').searchbox("setValue", data.CostName);
                $('#CostID').val(data.CostID);
                $('#hiCostName').val(data.CostName);
                $('#CostSNum').val(data.CostSNum);
            }
        });
    }

    $('#btnReturn').click(function () {
        HDialog.Close();
    });

</script>
