<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('选择账户别名')"/>
</head>
<body class="gray-bg">
<input type="hidden" id="rowIds">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var prefix = ctx + "business/pickingwavegoods";

    $(function () {
        var options = {
            url: prefix + "/getEbsAccountName",
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            fixedColumns: true,
            fixedNumber: 3,
            columns: [{
                radio: true
            },
                {
                    field: 'dispositionId',
                    title: 'dispositionId',
                    sortable: true
                },
                {
                    field: 'segment1',
                    title: 'segment1'
                },
                {
                    field: 'description',
                    title: 'description'
                }
            ]
        };
        $.table.init(options);
    });

    /* 添加物料-选择物料-提交 */
    function submitHandler() {
        var rows = $.table.selectFirstColumns();
        if (rows.length == 0) {
            $.modal.alertWarning("请至少选择一条记录");
            return;
        }
        alert(rows.join());
    }

    /* 添加用户-选择用户-提交(回调形式-父页面调用子页面) */
    function getSelections() {
        var selectInfo = [];
        selectInfo.push($.table.selectColumns('dispositionId'));
        selectInfo.push($.table.selectColumns('segment1'));
        selectInfo.push($.table.selectColumns('description'));
        return selectInfo;
    }

    $("#bootstrap-table").on("check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table", function (e, rowsAfter, rowsBefore) {
        var rows = $.common.equals("uncheck-all", e.type) ? rowsBefore : rowsAfter;
        var rowIds = $.table.affectedRowIds(rows);
        $("#rowIds").val(rowIds);
    });
</script>
</body>
</html>