
<!DOCTYPE html>
<html>
<head>
    <title>库存概览</title>
    <link rel="stylesheet" href="../../lib/app/css/app.min.css">
    <link rel="stylesheet" href="../../lib/simple-line-icons/css/simple-line-icons.css">
    <link rel="stylesheet" href="../../lib/bootable/bootstrap-table.css">
    <link rel="stylesheet" href="../../lib/jquery/jquery-ui/jquery-ui.min.css">
    <link rel="stylesheet" href="../../lib/webo/css/ui.css">
    <link rel="stylesheet" href="../../lib/toastr/toastr.css">
    <link rel="stylesheet" href="../../static/css/styles1.css">
</head>
<body>
<div id="base" class="">
    <header id="header" class="app-header navbar" role="menu">
        {{template "com/stocktop.tpl" .}}
    </header>
    <div>
        <table id="item_table"
               data-show-refresh="true"
               data-show-columns="true"
               data-show-export="true"
               data-search="true"
               data-page-size="100"
               data-row-style="rowStyleOvertime"
               data-filter-control="true"
               data-query-params="queryParams"
               data-toolbar=".toolbar">
            <thead>
            <tr>
               {{/* <th data-field="action"
                    data-align="center"
                    data-formatter="actionFormatter"
                    data-events="actionEvents"
                    data-sortable="false"
                    data-width="10px"> [ 操作 ]
                </th>*/}}
                {{/*<th data-field="state" data-checkbox="true" data-sortable="false"></th>*/}}
                <th data-field="number" data-filter-control="input" data-formatter="Formatter">编号</th>
                <th data-field="buyersn" data-filter-control="input">供应商</th>
                <th data-field="product" data-filter-control="input">产品</th>
                <th data-field="unit" data-filter-control="input">单位</th>
                <th data-field="num" data-filter-control="input">数量</th>
                <th data-field="requisitioner" data-filter-control="input" data-extend-label="name">请购人</th>
                <th data-field="purchaser" data-filter-control="input" data-extend-label="name">采购员</th>
                <th data-field="bill" data-filter-control="input">源单据</th>
                <th data-field="status" data-filter-control="input">状态</th>
            </tr>
            </thead>
        </table>
    </div>

</div>
<script src="../../lib/app/js/app.min.js"></script>
<script src="../../lib/jquery/jquery-ui/jquery-ui.min.js"></script>
<script src="../../lib/bootable/bootstrap-table.js"></script>
<script src="../../lib/webo/js/ui.js"></script>
<script src="../../lib/toastr/toastr.js"></script>
<script>
    var $table = $("#item_table");
    $(function () {
        $table.bootstrapTable({
            url: "/item/list/prestore",
            method: "post",
            sidePagination: "server",
            pagination: true,
            height: getTableHeight(),
            fixedColumns: true,
            fixedNumber: 1
        });
        $(window).resize(function () {
            $table.bootstrapTable('resetView', {
                height: getTableHeight()
            });
        });
    });
    function getTableHeight() {
        return 800;
    }
    function refreshContent(options) {
        $table.bootstrapTable("refresh")
    }

    function Formatter(value, row){
        return '<a class="text-primary"  href="/prestore/ui/receive?number='+row.number+'">'+ row.number+'</a>'
    }
    /*function actionFormatter(value, row) {
        str ='<a class ="update text-primary" href="javascript:" title="修改" style="margin-right: 5px;">修改</a>';
        return str
    }
    window.actionEvents = {
        'click .update': function (e, value, row) {
            window.location = "/prestore/ui/update?sn=" + row.sn
        }
    }*/
</script>
</body>
</html>
