
@{
    ViewData["Title"] = "其他应付款明细";
    Layout = "~/Pages/Shared/_MainLayout.cshtml";
}

<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 css{
    <style>
        .mules {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
    </style>
}
@section scripts{
    <script>
        var tb;
        $(document).ready(function () {
            var height = document.body.clientHeight;
            $("#roletable").attr("data-height", (height - 100));

            list();
        })

        function list() {
            var columns = [
                //{
                //    field: 'company_name', title: '公司主体', width: '180', sortable: false, formatter: function (idx, data) {
                //        return '<div class="mules" title="' + data.company_name + '">' + data.company_name + '</div>';
                //    }
                //},
                { field: 'borrower_or_payer', title: '还款方', width: '100', sortable: true },
                { field: 'start_amount', title: '期初金额', width: '100', sortable: true },
                { field: 'debit_amount', title: '借方发生额', width: '110', sortable: true },
                { field: 'credit_amount', title: '贷方发生额', width: '110', sortable: true },
                { field: 'end_amount', title: '期末金额', width: '100', sortable: true },
                { field: 'day', title: '日期', width: '90', sortable: true }
            ];

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

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

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

    </script>

}


