<!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">
     <div class="container-div">
        <div class="row">
            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="people:pass:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
            </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 editFlag = [[${@permission.hasPermi('people:pass:edit')}]];
        var removeFlag = [[${@permission.hasPermi('people:pass:remove')}]];
        var isWuhanDatas = [[${@dict.getType('sys_yes_no')}]];
        var prefix = ctx + "people/pass";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "出入证",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'id', 
                    title : 'null',
                    visible: false
                },
                {
                    field : 'isWuhan', 
                    title : '是否有武汉旅居史',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(isWuhanDatas, value);
                    }
                },
                {
                    field : 'address', 
                    title : '居住地址'
                },
                {
                    field : 'qrCode', 
                    title : '出入证二维码'
                },
                {
                    field : 'residentNum', 
                    title : '常驻人数'
                },
                {
                    field : 'householdRelation', 
                    title : '与屋主关系'
                },
                {
                    field : 'ownership', 
                    title : '房产证或租房合同'
                },
                {
                    field : 'auditOpinion', 
                    title : '审核意见'
                },
                {
                    field : 'status', 
                    title : '状态0未审核  1 通过审核  -1未通过审核'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        if(row.status=="0"){
                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>审核</a> ');
                        }
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>