
@{
    ViewData["Title"] = "提现在途";
    Layout = "~/Pages/Shared/_MainLayout.cshtml";
}

@*<div class="ibox-content m-b-sm border-bottom">
    <table id="tb" class="table table-hover table-bordered" style="width:100%;">
        <thead>
            <tr>
                <th>付款主体</th>
                <th>销售平台名称</th>
                <th>支付平台名称</th>
                <th>银行帐号</th>
                <th>银行名称</th>
                <th>持卡人</th>
                <th>帐号余额</th>
                <th>日期</th>
            </tr>
        </thead>
        @if (ViewBag.list.Count > 0)
        {
            foreach (var item in ViewBag.list)
            {
                <tr>
                    <td>@ViewBag.PayCompanyName</td>
                    <td>@item.sale_platform</td>
                    <td>@item.platform</td>
                    <td>@item.pay_account</td>
                    <td>@item.bank_name</td>
                    <td>@item.bank_card_user</td>
                    <td>@item.amount_rmb.ToString("###,###.##")</td>
                    <td>@item.statistical_time.ToString("yyyy-MM-dd")</td>
                </tr>
            }
        }
    </table>
</div>*@

<div class="row">
    <div class="col-sm-12">
        <div class="ibox-content m-b-sm border-bottom">
            <form id="toolbar">
                <div class="form-inline" style="line-height:40px;">
                    <div class="form-group">
                        <button type="button" class="btn btn-primary" onclick="exportFile();">导出</button>
                    </div>
                </div>
            </form>
        </div>
        <div class="ibox-content m-b-sm border-bottom">
            <table id="roletable" style="table-layout:fixed;"></table>
        </div>
    </div>
</div>

@section scripts{ 
    <script>
        var tb;
        $(document).ready(function () {
            var height = document.body.clientHeight;
            $("#roletable").attr("data-height", (height - 170));

            list();
        })

        function list() {
            var columns = [
                { field: 'sale_platform', title: '销售平台名称', width: '120', sortable: true },
                { field: 'platform', title: '支付平台名称', width: '130', sortable: true, iscount: true },
                {
                    field: 'pay_account', title: '银行帐号', width: '130', sortable: true, formatter: function (idx, data) {
                        return '<div class="mules" title="' + data.pay_account + '">' + data.pay_account+'</div>';
                    }
                },
                { field: 'bank_name', title: '银行名称', width: '130', sortable: true },
                { field: 'bank_card_user', title: '持卡人', width: '160', sortable: true },
                { field: 'amount_rmb', title: '帐号余额', width: '120', sortable: true },
                { field: 'statistical_time', title: '日期', width: '160', sortable: true }
            ];

            var url = '@Url.Content("~/Reports/Finance/WithDrawOnWayJson")' + '?date=@(ViewBag.date)&paycompanyid=@(ViewBag.companyid)';

            if (tb == undefined) {
                tb = OnlyTable("roletable", columns, url, "");
            }
            else {
                tb.bootstrapTable('refresh', { url: url });
            }
        }

        function exportFile() {
            window.open('@Url.Content("~/Reports/Finance/WithDrawOnWayExport?date=")' + '@(ViewBag.date)&paycompanyid=@(ViewBag.companyid)',"_blank");
        }

    </script>

}


