<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CustomerBalance.aspx.cs" Inherits="ARAP_Report_CustomerBalance" %>
<%@ Register Src="~/Scripts/AWGridRuntime/UserControl/ListHeader.ascx" TagPrefix="uc1" TagName="ListHeader" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <uc1:ListHeader runat="server" ID="ListHeader" />
    <script type="text/javascript">
        //搜索
        function search_grid() {
            var fg = document.getElementById("frame_grid");
            var keyword = $("#keyword").val();
            var begin_date = $("#begin_date").val();
            var end_date = $("#end_date").val();
            var cus_name = $("#cus_name").val();

            var url = "CustomerBalance_Grid.aspx?keyword=" + keyword
                    + "&begin_date=" + begin_date + "&end_date=" + end_date
                    + "&cus_name=" + cus_name;
            fg.src = url;
        }
        //联查
        function modify() {
            return;
        }
        //选择打印模板
        function grf_print() {
            var fg = document.getElementById("frame_grid"); //得到grid控件所在iframe
            var cw = fg.contentWindow;
            choice_print_template('<%=xview["auth_code"]%>', "", cw.sql_print_detail_session_id);
        }
    </script>
</head>
<body>
    <!--工具栏-->
    <div style="height:30px;" class="list_menu_bar">
        <input type="text" class="keyword_box" id="keyword"/>
        <a plain="true" class="easyui-linkbutton" onclick="search_grid()">搜索</a>
        <a plain="true" class="easyui-linkbutton" onclick="$('#search_win').window('open')" iconcls="icon-search">高级搜索</a>
        <a plain="true" class="easyui-linkbutton" onclick="modify()">联查</a>
        <a plain="true" class="easyui-linkbutton" id="btn_print" onclick='grf_print()'>打印</a>
        <a plain="true" class="easyui-linkbutton" onclick="DesignModuleFormat('ARAP_Report_CustomerBalance')">格式</a>
    </div>

    <!--Grid控件所在的iframe-->
    <%=xview["grid_frame"]%>
    <!--搜索窗口-->  
	<div id="search_win" class="easyui-dialog" title="搜索"
        data-options="modal:true,closed:false,closable: false,iconCls:'icon-search'"
        style="width:500px;height:450px;padding:10px;">
		<table style="margin:auto;">
            <tr>
                <td style="text-align:right">起始日期:</td>
                <td>
                    <input type="text" class="edit_text_box" id="begin_date" style='width:120px' onclick='ShowDateControl()' value='<%=xview["begin_date"]%>'/></td>
            </tr>
            <tr>
                <td style="text-align:right">截止日期:</td>
                <td>
                    <input type="text" class="edit_text_box" id="end_date" style='width:120px' onclick='ShowDateControl()' value='<%=xview["end_date"]%>'/></td>
            </tr>
            <tr>
                <td style="text-align:right">客户:</td>
                <td>
                    <input type="hidden" class="edit_text_box" id="cus_id"/>
                    <input type="text" class="edit_text_box" id="cus_name" style='width:98px'/></td>
            </tr>
		</table>
        <div style="margin-top:20px;text-align:center">
            <a href="javascript:search_grid()" class="easyui-linkbutton" onclick="javascript:$('#search_win').dialog('close')">搜索</a>
        </div>
	</div>
    <!--end of 搜索窗口--> 
    <script type="text/javascript">
        $(document).ready(function(){
            FastSearch_Customer(); //查询客户
            //FastSearch_Vendor(); //查询供应商

            $F("keyword").focus();
            $F("keyword").onkeypress = function (evt) {
                evt = evt ? evt : (window.event ? window.event : null);
                if (evt.keyCode == "13") {
                    search_grid();
                }
            }

        });
    </script>
</body>
</html>
