<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CustomerDetails_List.aspx.cs" Inherits="Ling_CustomerDetails_List" %>
<%@ 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 sort = $("#sort").val();
            var digest = $("#digest").val();
            var remark = $("#remark").val();
            var begin_date = $("#begin_date").val();
            var end_date = $("#end_date").val();
            var cus_name = $("#cus_name").val();
            var vd_name = $("#vd_name").val();
            var ele_name = $("#ele_name").val();
            var cus_fit = $("#cus_fit").val();
            var vd_fit = $("#vd_fit").val();

            var url = "CustomerDetails_Grid.aspx?keyword=" + keyword + "&sort=" + sort
                    + "&digest=" + digest
                    + "&begin_date=" + begin_date + "&end_date=" + end_date
                    + "&cus_name=" + cus_name + "&vd_name=" + vd_name
                    + "&ele_name=" + escape(ele_name)
                    + "&cus_fit=" + cus_fit + "&vd_fit=" + vd_fit;
            fg.src = url;
        }
        //修改
        function modify() {
            return;
            var fg = document.getElementById("frame_grid"); //得到grid控件所在iframe
            var cw = fg.contentWindow;
            var data = fg.aw_myData;
            var id = cw.aw_GetSelectRows(cw._da_id); //返回一维数组

            if (id.length == 0) {
                AlertNO('请选择要查看的记录!');
                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 onload="search_grid()">
    <!--工具栏-->
    <div style="height:30px;" class="list_menu_bar">
            <select id="sort" style='margin-top:3px;float:left' onchange='search_grid()'>
                <option value="asc">升序</option>
                <option value="desc">降序</option>
            </select>
            <input type="text" class="edit_text_box" id="keyword" style='width:100px;margin-top:3px;float:left'/>
            <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" id="btn_print" onclick='grf_print()'>打印</a>
        <a plain="true" class="easyui-linkbutton" onclick="DesignModuleFormat('Ling_CustomerDetails_List  ')">格式</a>
    </div>
    <!--Grid控件所在的iframe-->
    <%=xview["grid_frame"]%>
    <!--搜索窗口-->  
	<div id="search_win" class="easyui-dialog" title="搜索"
        data-options="modal:true,closed:true,closable: true,iconCls:'icon-search'"
        style="width:600px;height:300px;padding:10px;">
		<table style="margin:auto;">
            <tr>
                <td style="text-align:right">摘要:</td>
                <td>
                    <input type="text" class="edit_text_box" id="digest" style='width:120px;'/></td>
                <td style="text-align:right">工地:</td>
                <td>
                    <input type="text" class="edit_text_box" id="cus_name" style='width:98px'/>
                    <select id='cus_fit'>
                        <option value='1'>精确</option>
                        <option value='0'>模糊</option>
                    </select></td>
            </tr>
            <tr>
                <td style="text-align:right">起始日期:</td>
                <td>
                    <input type="text" class="edit_text_box" id="begin_date" style='width:120px' onclick='ShowDateControl()'/></td>
                <td style="text-align:right">截止日期:</td>
                <td>
                    <input type="text" class="edit_text_box" id="end_date" style='width:120px' onclick='ShowDateControl()'/></td>
            </tr>
            <tr>
                <td style="text-align:right">供应商:</td>
                <td>
                    <input type="text" class="edit_text_box" id="vd_name" style='width:98px'/>
                    <select id='vd_fit'>
                        <option value='1'>精确</option>
                        <option value='0'>模糊</option>
                    </select></td>
                <td style="text-align:right">员工:</td>
                <td><input type="text" class="edit_text_box" id="ele_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>
            <a 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(); //查询供应商
            FastSearch_Employee(); //查询员工
            FastSearch_Cost(); //查询费用
            $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>
