<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <meta name="format-detection" content="telephone=no">
    <th:block th:include="include :: header('账号管理')" />
    <th:block th:include="include :: layout-latest-css" />
    <th:block th:include="include :: ztree-css" />
</head>

<body class="gray-bg">
<div class="ui-layout-center">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse" >
                <div class="query-condition-container">
                    <h4 class="query-condition-title">查询条件</h4>
                    <div class="query-buttons">
                        <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="resetPre()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                    </div>
                </div>
                <form id="SXtszMdzhglAccountmanagement-form" class="customize-search-form">
                    <div class="customize-form-group-container">
                        <div class="customize-form-group">
                            <label>姓名:</label>
                            <input type="text" class="styled-input" placeholder="请输入姓名" name="realName" autocomplete="off"/>
                        </div>
                        <div class="customize-form-group">
                            <label>手机号码:</label>
                            <input type="text" class="styled-input" placeholder="请输入手机号码" name="mobileNumber" autocomplete="off"/>
                        </div>
                    </div>
                </form>
            </div>

            <div class="col-sm-12 select-table table-striped" style="width: 100%; overflow-x: hidden;">
                <table id="bootstrap-table" class="fixed-layout-table"></table>
            </div>
        </div>
    </div>
</div>

<th:block th:include="include :: footer" />
<th:block th:include="include :: layout-latest-js" />
<th:block th:include="include :: bootstrap-table-fixed-columns-js" />
<th:block th:include="include :: ztree-js" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('dtp:pmService:edit')}]];
    var removeFlag = [[${@permission.hasPermi('dtp:pmService:remove')}]];
    var prefix = ctx + "xtsz/sxtszmdzhglaccountmanagement";
    $(function() {
        var panehHidden = false;
        if ($(this).width() < 1590) {
            panehHidden = true;
        }
        $('body').layout({ initClosed: panehHidden, west__size: 185, resizeWithWindow: false });
        // 回到顶部绑定
        if ($.fn.toTop !== undefined) {
            var opt = {
                win:$('.ui-layout-center'),
                doc:$('.ui-layout-center')
            };
            $('#scroll-up').toTop(opt);
        }
        queryArchivesList();
    });

    function queryArchivesList() {
        var options = {
            url: prefix + "/sXtszMdzhglAccountmanagementList",
            viewUrl: prefix + "/sXtszMdzhglAccountmanagementView/{id}",
            createUrl: prefix + "/sXtszMdzhglAccountmanagementAdd",
            updateUrl: prefix + "/sXtszMdzhglAccountmanagementEdit/{id}",
            removeUrl: prefix + "/sXtszMdzhglAccountmanagementRemove",
            sortName: "id",
            sortOrder: "asc",
            modalName: "账号管理",
            fitColumns: true,
            striped: true,
            autoRowHeight: true,
            rowNumbers: true,
            showFooter:true,  //是否显示表格底部区域。
            clickToSelect: true, //是否启用点击行时选中整行的功能。
            singleSelect: false, //是否仅允许选择一行
            fixedColumns: true,
            //fixedNumber: 3,
            fixedRightNumber: 1,
            columns: [
                    { field: 'id', title: '主键', align: 'center' ,visible:false},
                    { field: 'storeId', title: '门店ID', align: 'center' },
                    { field: 'accountName', title: '账号名', align: 'center' },
                    { field: 'realName', title: '姓名', align: 'center' },
                    { field: 'mobileNumber', title: '手机号码', align: 'center' },
                    { field: 'qrcodeUrl', title: '二维码', align: 'center' },

                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        if (row.id) {
                            var actions = [];
                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick=""><i class="fa fa-edit"></i>二维码</a> ');
                            return actions.join('');
                        } else {
                            return "";
                        }
                    }
                }]
        };
        $.table.init(options);
    }

    /* 自定义重置-表单重置/隐藏框/树节点选择色/搜索 */
    function resetPre() {
        resetDate();
        $("#SXtszMdzhglAccountmanagement-form")[0].reset();
        $("#deptId").val("");
        $("#parentId").val("");
        $(".curSelectedNode").removeClass("curSelectedNode");
        $.table.search();
        _refresh();
    }

</script>
</body>

</html>
