<!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="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>姓名：</label>
                            <input type="text" name="username"/>
                        </li>
                        <li>
                            <label>身份证号：</label>
                            <input type="text" name="cardid"/>
                        </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="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:yyryxx:export">
                <i class="fa fa-download"></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('system:yyryxx:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:yyryxx:remove')}]];
    var prefix = ctx + "system/yyryxx";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            detailUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "预约人员信息",
            columns: [
                {
                    field: 'id',
                    title: '序号',
                    visible: false
                },
                {
                    field: 'cdBatch',
                    title: '批次号',
                    visible: false
                },
                {
                    field: 'cdOperation',
                    title: '标志位',
                    visible: false
                },
                {
                    field: 'cdSource',
                    title: '数据来源',
                    visible: false
                },
                {
                    field: 'cardid',
                    title: '身份证号'
                },
                {
                    field: 'persontype',
                    title: '人员类型'
                },
                {
                    field: 'unitname',
                    title: '单位名称'
                },
                {
                    field: 'username',
                    title: '姓名'
                },
                {
                    field: 'sex',
                    title: '性别'
                },
                {
                    field: 'age',
                    title: '年龄'
                },
                {
                    field: 'nature',
                    title: '民族',
                    visible: false
                },
                {
                    field: 'education',
                    title: '学历',
                    visible: false
                },
                {
                    field: 'cellphone',
                    title: '联系电话'
                },
                {
                    field: 'worktype',
                    title: '工种',
                    visible: false
                },
                {
                    field: 'workage',
                    title: '工龄',
                    visible: false
                },
                {
                    field: 'unitnatrue',
                    title: '单位性质',
                    visible: false
                },
                {
                    field: 'photourl',
                    title: '照片地址',
                    visible: false
                },
                {
                    field: 'licenseurl',
                    title: '营业执照图片地址',
                    visible: false
                },
                {
                    field: 'adddate',
                    title: '添加日期',
                    visible: false
                },
                {
                    field: 'apptime',
                    title: '预约时间'
                },
                {
                    field: 'createTime',
                    title: '数据归集时间',
                    formatter: function (value, row, index) {
                        if (value != null) {
                            var time = new Date(value);
                            var year = time.getFullYear();
                            var month = time.getMonth() + 1;
                            var date = time.getDate();
                            var hours = time.getHours();
                            if (hours == '') {
                                hours = "00"
                            }
                            var minute = time.getMinutes();
                            if (minute == '') {
                                minute = "00"
                            }
                            var second = time.getSeconds();
                            if (second == '') {
                                second = "00"
                            }
                            // return year + '-' + month + '-' + date + ' ' + hours + ":" + minute + ":" + second;
                            return year + '-' + month + '-' + date;
                        }
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-warning btn-xs  ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\''
                            + row.id + '\')"><i class="fa fa-search"></i>详细</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>