<%@ Page Language="C#" AutoEventWireup="true" CodeFile="VendorYingFu_List.aspx.cs" Inherits="Ling_VendorYingFu_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 year = $("#year").val();
            var cus_name = $("#cus_name").val();
            var vd_name = $("#vd_name").val();
            var cus_fit = $("#cus_fit").val();
            var vd_fit = $("#vd_fit").val();
            var jie_qing = $("#jie_qing").val();
            var url = "VendorYingFu_Grid.aspx?keyword=" + keyword + "&year=" + year
                    + "&cus_name=" + cus_name
                    + "&vd_name=" + escape(vd_name)
                    + "&cus_fit=" + cus_fit + "&vd_fit=" + vd_fit
                    + "&jie_qing=" + jie_qing;
            fg.src = url;
        }
        //修改
        function modify() {

        }
        //选择打印模板
        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);
        }
        //小计
        function compute() {
            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;
            }
            var qk = cw.aw_GetSelectRows(cw._qian_kuan); //返回一维数组
            var sum_qk = 0;
            for (var i = 0; i < qk.length; i++) {
                if (!isNaN(qk[i])) {
                    sum_qk += parseFloat(qk[i]);
                }
            }
            AlertOK("选中部分的累计欠款金额：" + JSRound(sum_qk, 2));
        }
    </script>
</head>
<body onload="search_grid()">
    <!--工具栏-->
    <div style="height:30px;" class="list_menu_bar">
            <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>
            <select id='jie_qing' onchange="search_grid()">
                <option value="0">未结清</option>
                <option value="1">已结清</option>
                <option value="">全部</option>
            </select>
            <a plain="true" class="easyui-linkbutton" onclick="compute()">小计</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_VendorYingFu_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>
                    <select id='year'>
                        <%=html_year%>
                    </select>
                </td>
                <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>
            </tr>
            <tr>
                <td style="text-align:right">工地:</td>
                <td>
                    <input type="text" class="edit_text_box" id="cus_name" style='width:98px'/></td>
                <td style="text-align:right">
                <select id='cus_fit'>
                        <option value='1'>精确</option>
                        <option value='0'>模糊</option>
                    </select></td>
                <td></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(); //查询供应商
            $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>
