<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ViewReport.aspx.cs" Inherits="System_XReport_ViewReport" %>
<%@ 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">
        var module_code = '<%=Request["module_code"]%>';
        //搜索
        function search_grid() {
            var fg = document.getElementById("frame_grid");
            var keyword = $("#keyword").val();
            var date1 = $("#date1").val();
            var date2 = $("#date2").val();
            var textbox1 = $("#textbox1").val();
            var textbox2 = $("#textbox2").val();
            <%=xview["get_pars"]%>
            var url = "ViewReport_Grid.aspx?keyword=" + keyword+"&to_debug=<%=Request["to_debug"]%>"
                    + "&module_code=" + module_code
                    + "&date1=" + date1 + "&date2=" + date2
                    + "&textbox1=" + textbox1 + "&textbox2=" + textbox2
                    + "<%=xview["search_pars"]%>";
            fg.src = url;
        }
        //联查
        function modify() {
            /*
            var fg = document.getElementById("frame_grid"); //得到grid控件所在iframe
            var cw = fg.contentWindow;
            var id = cw.aw_GetSelectRows(cw._id); //返回一维数组
            if (id == "")
                return;
            if (id.length == 0) {
                AlertNO('请选择要查看的记录!');
                return;
            }
            if (id.length > 1) {
                AlertNO('一次只可以查看一条记录!');
                return;
            }
            var url = '../../Stock/OtherIn/OtherIn_Document.aspx?action=Update&id=' + id;
            top.OpenWindow('Activate', 'Stock_OtherIn_' + id, '其它入库单', url);*/
        }
        //选择打印模板
        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>
    <style type="text/css">
        #form1 {
            margin:0px;
            height:100%;
        }
    </style>
</head>
<body>
        <form id="form1" runat="server">
    <asp:Label runat="server" ID="msg" ForeColor="Red"></asp:Label>
    <!--工具栏-->
    <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>
        <%=xview["html"]%>
        <a plain="true" class="easyui-linkbutton" onclick="modify()" style="display:none">联查</a>
        <a plain="true" class="easyui-linkbutton" id="btn_print" onclick='grf_print()'>打印</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:500px;padding:10px;">
		<table style="margin:auto;">
            <tr<%=xview["show_date1"]%>>
                <td style="text-align:right"><asp:Label runat="server" ID="date1_title"></asp:Label></td>
                <td>
                    <asp:TextBox runat="server" class="edit_text_box" ID="date1" style='width:120px' onclick="ShowDateControl()" Text=""></asp:TextBox></td>
            </tr>
            <tr<%=xview["show_date2"]%>>
                <td style="text-align:right"><asp:Label runat="server" ID="date2_title"></asp:Label></td>
                <td>
                    <asp:TextBox runat="server" class="edit_text_box" ID="date2" style='width:120px' onclick="ShowDateControl()" Text=""></asp:TextBox></td>
            </tr>
            <tr<%=xview["show_textbox1"]%>>
                <td style="text-align:right"><asp:Label runat="server" ID="textbox1_title"></asp:Label></td>
                <td>
                    <asp:TextBox runat="server" class="edit_text_box" ID="textbox1" style='width:120px'></asp:TextBox></td>
            </tr>
            <tr<%=xview["show_textbox2"]%>>
                <td style="text-align:right"><asp:Label runat="server" ID="textbox2_title"></asp:Label></td>
                <td>
                    <asp:TextBox runat="server" class="edit_text_box" ID="textbox2" style='width:120px'></asp:TextBox></td>
            </tr>
            <%=xview["filters"]%>
		</table>
        <div style="margin-top:20px;text-align:center">
            <a href="javascript:search_grid()" id="btn_ad_search" class="easyui-linkbutton" onclick="javascript:$('#search_win').dialog('close')">搜索</a>
        </div>
	</div>
    <!--end of 搜索窗口--> 
    <script type="text/javascript">
        $(document).ready(function () {
            $F("keyword").focus();
            $F("keyword").onkeypress = function (evt) {
                evt = evt ? evt : (window.event ? window.event : null);
                if (evt.keyCode == "13") {
                    return false;//禁止回车提交表单
                }
            }
            <%=xview["fast_searchs"]%>
                var search_on_load = "<%=xview["search_on_load"]%>";
                if (search_on_load == "1") {
                    $('#search_win').dialog('close');
                    search_grid();
                }
            });

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