<%@ Page Title="" Language="C#" MasterPageFile="../BaseMaster.Master" CodeBehind="RechargeList.aspx.cs" Inherits="WAP2P.Web.PC.Admin.Account.RechargeList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="header" runat="server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <dl class="ui-tabs">
        <dt><a href="javascript:" class="on"><%=rechargeType.GetDescription() + "充值列表" %></a></dt>        
        <dd>
             <form action="?action=search&rechargeType=<% =Request.QueryString["rechargeType"] %>" method="get" class="m-search">
                <table class="m-criteria" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <th>充值记录筛选：</th>
                        <td>
                            <ruson:EnumSelect runat="server" ID="status" TypeName="WAP2P.Account.Recharge+AuditingStatusType,WAP2P.Account" TipsText="全部状态"></ruson:EnumSelect>
                            <input type="hidden" name="from" value="<% =Request.QueryString["from"].HtmlEncode() %>" />
                            <ruson:Select runat="server" ID="type" FillRequestValue="true">
                                <option value="会员账号">会员账号</option>
                                <option value="流水号">流水号</option>
                                <option value="<% =rechargeType == WAP2P.Account.Recharge.RechargeType.Online ? "支付机构" : "入帐银行" %>"><% =rechargeType == WAP2P.Account.Recharge.RechargeType.Online ? "支付机构" : "入帐银行" %></option>
                            </ruson:Select>
                            <input type="text" size="35" placeholder="输入搜索条件" name="key" value="<% =Request.QueryString["key"].HtmlEncode() %>" />                            
                            <span class="ml20 js-inlinesubmit"><input type="submit" class="btn-base c-priority iconfont" value="&#xe60f; 搜索" /><input type="reset" class="btn-base c-normal iconfont" value="&#xe670; 清空条件" /></span>
                        </td>
                    </tr>
                    <tr class="g-hide">
                        <th>操作时间筛选：</th>
                        <td><input type="text" name="startAt" id="startAt" value="<% =Request.QueryString["startAt"].UrlEncode() %>" class="ui-date w150" data-maxdate="#endAt" /> 至 <input type="text" name="endAt" id="endAt" value="<% =Request.QueryString["endAt"].UrlEncode() %>" class="ui-date w150" data-mindate="#startAt" /></td>
                    </tr>
                    <tr class="g-hide">
                        <th>充值金额筛选：</th>
                        <td><input type="text" name="startMoney" id="startMoney" value="<% =Request.QueryString["startMoney"].UrlEncode() %>" class="w150" /> 至 <input type="text" name="endMoney" id="endMoney" value="<% =Request.QueryString["endMoney"].UrlEncode() %>" class="w150" /></td>
                    </tr>
                    <tr class="g-hide">
                        <th></th>
                        <td><input type="submit" class="btn-base c-priority iconfont" value="&#xe60f; 搜索" /><input type="reset" class="btn-base c-normal iconfont" value="&#xe670; 清空条件"  /></td>
                    </tr>
                </table>  
                <a href="javascript:void(0);" id="btnSwithMoreFilter" class="iconfont"><span>&#xe661; 显示更多筛选条件</span></a>              
            </form>
            <div class="m-content">
                <div class="m-oper">
                    <ruson:PermissionSpace runat="server" Module="资金管理" Function="会员线下充值管理" Operate="审核">
                        <% if(rechargeType == WAP2P.Account.Recharge.RechargeType.Offline) { %>
                        <span class="js-autoload">
	                        <span class="ui-checkbox"><label><input type="checkbox" class="js-refresh" data-function="会员线下充值管理" data-operate="自动刷新" data-freemes="<% =FreeLimit.ActionLimitMes %>" /> 自动刷新</label></span>
                            <span class="ui-checkbox g-hide mr10"><label><input type="checkbox" data-autoload-char="xe60e; 审核" data-autoload-alert="有待审核项" /> 有待审核项时弹通知</label></span>                        
                        </span>
                        <% } %>
                    </ruson:PermissionSpace>
                </div>
                <table class="m-list" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <th width="15%">会员账号</th>
                        <th width="10%"><%= rechargeType == WAP2P.Account.Recharge.RechargeType.Online ? "支付机构" : "入帐银行" %></th>
                        <th width="20%">交易流水号</th>
                        <th width="12%">充值金额</th>
                        <th width="10%">手续费</th>                        
                        <th width="10%">状态</th>
                        <th width="10%">时间</th>
                        <th width="12%">操作</th>
                    </tr>
                </table>
            </div>
        </dd>
    </dl>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="server">
    <script>
        $('.m-list').on('click', '.js-mending', function () {
            var me = $(this);
            $.ajax({
                url: '/OnlinePayment/Default<% =PageExt %>?action=userPayQuery' + me.attr('data-parameter'),
                dataType: "json",
                data: { payName: me.attr('data-payName'), orderMoney: me.attr('data-amount') },
                success: function (res) {
                    if (res.Success)
                        $.jSuccess("补单成功", function () {
                            //刷新列表
                            var pages = $('table.m-list .pages');
                            if (pages.length) {
                                var a = pages.next();
                                pages.append(a);    //将a放入pages内，以响应点击事件
                                a.trigger('click');
                            } else {
                                $('form.m-search').trigger('submit');
                            }
                        });
                    else
                        $.jError("没有找到对应的订单", '', '');
                }
            });
        })
    </script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="list" runat="server">
    <ruson:Repater runat="server" ID="rptList" ItemType="WAP2P.Account.Recharge">
        <ItemTemplate>
            <tr id="tr<%# Item.Id %>">
                <td class="g-fbold"><%# GetUserDisplay(Item.UserId, Item.UserName) %></td>
                <td><%# rechargeType == WAP2P.Account.Recharge.RechargeType.Online ? Item.PayPlatformName : Item.RecordedInfo %></td>
                <td><%# Item.OrderNo %></td>
                <td><%# Item.Amount.ToMoneyString() %> 元</td>
                <td><%# Item.Fee.ToMoneyString() %> 元</td>
                <td><%# Item.Status.GetDescription() %></td>
                <td><%# Item.CreateAt.ToDateTimeString() %></td>
                <td>
                    <ruson:PermissionSpace runat="server" Module="资金管理" Function="会员线下充值管理" Operate="审核"><%# Item.Type == WAP2P.Account.Recharge.RechargeType.Offline && Item.Status == WAP2P.Account.Recharge.AuditingStatusType.Waiting ? string.Format("<a class=\"iconfont oper fcjade-2\" href=\"javascript:void(0);\" onclick=\"$.jPopupEdit('会员线下充值审核', 'RechargeDetail.aspx?ID={0}&op=valid');\">&#xe60e; 审核</a>",Item.Id) : string.Empty %></ruson:PermissionSpace>
                    <ruson:PermissionSpace runat="server" Module="资金管理" Function="会员线下充值管理" Operate="查看详情"><%# Item.Type == WAP2P.Account.Recharge.RechargeType.Offline && Item.Status != WAP2P.Account.Recharge.AuditingStatusType.Waiting ? string.Format("<a class=\"iconfont oper\" href=\"javascript:void(0);\" onclick=\"$.jPopupEdit('{0}', 'RechargeDetail.aspx?ID={1}');\">&#xe655; 查看详情</a>","线下充值详情",Item.Id) : string.Empty %></ruson:PermissionSpace>                    
                    <ruson:PermissionSpace runat="server" Module="资金管理" Function="会员线上充值管理" Operate="查看详情"><%# Item.Type == WAP2P.Account.Recharge.RechargeType.Online && Item.Status != WAP2P.Account.Recharge.AuditingStatusType.Waiting ? string.Format("<a class=\"iconfont oper\" href=\"javascript:void(0);\" onclick=\"$.jPopupEdit('{0}', 'RechargeDetail.aspx?ID={1}');\">&#xe655; 查看详情</a>","线上充值详情",Item.Id) : string.Empty %></ruson:PermissionSpace>
                    <ruson:PermissionSpace runat="server" Module="资金管理" Function="会员线上充值管理" Operate="补单"><%# Item.Type == WAP2P.Account.Recharge.RechargeType.Online && Item.Status == WAP2P.Account.Recharge.AuditingStatusType.Waiting ? string.Format("<a class=\"iconfont js-mending oper\" href=\"javascript:void(0);\" data-parameter=\"{0}\" data-payName=\"{1}\" data-id=\"{2}\" >&#xe60e; 补单</a>",string.Format("&orderNo={0}&orderDateTime={1}", Item.OrderNo , Item.CreateAt.ToString("yyyyMMddhhmmss")), WAP2P.Sys.OnlinePayment.FindByName(Item.PayPlatformName).CallCode, Item.UserId) : string.Empty %></ruson:PermissionSpace>
                </td>
            </tr>
        </ItemTemplate>
        <EmptyTemplate>
            <tr>
                <td colspan="8" class="g-fleft">暂无数据。</td>
            </tr>
        </EmptyTemplate>
        <FooterTemplate>
            <tr class="js-sum">
                <td colspan="3" class="g-fright">总计</td>
                <td class="g-fleft"><% =amountSum.ToMoneyString() %> 元</td>
                <td class="g-fleft"><% =feeSum.ToMoneyString() %> 元</td>
                <td colspan="3"></td>                
            </tr>
        </FooterTemplate>
    </ruson:Repater>
    <tr class="pager">
        <td colspan="8"><ruson:Pager runat="server" ID="pages" CssClass="pages" /><a href="<% =Request.RawUrl %>" class="g-hide"></a></td>
    </tr>
</asp:Content>