
@{
    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 scripts{
<script>
        var tb;
        $(document).ready(function () {
            var height = document.body.clientHeight;
            $("#roletable").attr("data-height", (height - 100));

            list();
        })

        function list() {
            var columns = [
                { field: 'warehouse_name', title: '仓库名称', width: '160', sortable: true },
                { field: 'sku_code', title: 'Sku编码', width: '160', sortable: true},
                { field: 'transfer_quantity', title: '库存数量', width: '120', sortable: true },
                { field: 'inventory_amount', title: '库存金额', width: '120', sortable: false },
                { field: 'day', title: '统计日期', width: '110', sortable: false }
            ];

            var url = '@Url.Content("~/Reports/Finance/SemiTransferStockJson")' + '?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/SemiTransferStockExport?date=")' + '@(ViewBag.date)&paycompanyid=@(ViewBag.paycompanyid)', "_blank");
        }

</script>

}

