<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('分配选择销售')" />
</head>

<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="role-form">
                <div class="select-list">
                    <ul>
                        <li>
                            经销商编号：<input type="text" name="chainsCode"/>
                        </li>
                        <li>
                            经销商名称：<input type="text" name="chainsName"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var datas = [[${@dict.getType('sys_normal_disable')}]];
    var prefix = ctx + "order/customers/customersList";
    var prefix1 = ctx + "order/customersStart";
    $(function() {
        var options = {
            url: prefix,
            modalName: "经销商启用",
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            clickToSelect: true,
            rememberSelected: true,
            columns: [{
                field: 'state',
                checkbox: true
            },
                {
                    field: 'id',
                    title: '经销商ID',
                    visible: false
                },
                {
                    field: 'chainsCode',
                    title: '经销商编码'
                },
                {
                    field: 'chainsName',
                    title: '经销商姓名'
                }]
        };
        $.table.init(options);
    });

    /* 添加用户-选择用户-提交 */
    function submitHandler() {
        var rows = $.table.selectFirstColumns();
        if (rows.length == 0) {
            $.modal.alertWarning("请至少选择一条记录");
            return;
        }
        var data = {"ids": rows.join() };
        $.operate.save(prefix1 + "/addCustomersStart", data);
    }
</script>
</body>
</html>