<!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">
                <input type="hidden" th:value="${flag}"/>
                <div class="select-list">
                    <ul>
                        <li>
                            <label th:if="${flag == 'gr'}">姓名：</label>
                            <label th:if="${flag == 'qy'}">企业名称：</label>
                            <label th:if="${flag == 'qt'}">名称：</label>
                            <input type="text" name="qlrmc"/>
                        </li>
                        <li>
                            <label>证件号码：</label>
                            <input type="text" name="zjhm"/>
                        </li>
                        <li>
                            <label>电话：</label>
                            <input type="text" name="dh"/>
                        </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:grjbxx: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:grjbxx:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:grjbxx:remove')}]];
    var prefix = ctx + "system/grjbxx";
    var flag = [[${flag}]];
    var urlV;
    var qlrmc;
    if (flag == "gr") {
        urlV = prefix + "/list";
        qlrmc = "姓名";
    }
    if (flag == "qy") {
        urlV = prefix + "/qyList";
        qlrmc = "企业名称";
    }
    if (flag == "qt") {
        urlV = prefix + "/qtList";
        qlrmc = "名称";
    }
    $(function () {
        var options = {
            url: urlV,
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "个人基本信息",
            detailUrl: prefix + "/edit/{id}",
            columns: [
                {
                    field: 'id',
                    title: '主键ID',
                    visible: false
                },
                {
                    field: 'qlrbh',
                    title: '权利人编号'
                },
                {
                    field: 'qlrmc',
                    title: qlrmc
                },
                {
                    field: 'zjlb',
                    title: '证件类别',
                    visible: false
                },
                {
                    field: 'zjhm',
                    title: '证件号码'
                },
                {
                    field: 'dh',
                    title: '电话'
                },
                {
                    field: 'qzh',
                    title: '权证号'
                },
                {
                    field: 'zsbh',
                    title: '证书编号',
                    visible: false
                },
                {
                    field: 'cdBatch',
                    title: '批次号',
                    visible: false
                },
                {
                    field: 'cdOperation',
                    title: '操作状态',
                    visible: false
                },
                {
                    field: 'cdSource',
                    title: '数据来源',
                    visible: false
                },
                {
                    field: 'tq',
                    title: '权利其他状况',
                    visible: false
                },
                {
                    field: 'djbh',
                    title: '登记编号',
                    visible: false
                },
                {
                    field: 'qlbh',
                    title: '权利编号',
                    visible: false
                },
                {
                    field: 'qllb',
                    title: '权利类别',
                    visible: false
                },
                {
                    field: 'sxh',
                    title: '顺序号',
                    visible: false
                },
                {
                    field: 'fzjg',
                    title: '发证机关',
                    visible: false
                },
                {
                    field: 'sshy',
                    title: '所属行业',
                    visible: false
                },
                {
                    field: 'hjszss',
                    title: '户籍所在省市',
                    visible: false
                },
                {
                    field: 'xb',
                    title: '性别',
                    visible: false
                },
                {
                    field: 'dz',
                    title: '地址',
                    visible: false
                },
                {
                    field: 'gzdw',
                    title: '工作单位',
                    visible: false
                },
                {
                    field: 'qdfs',
                    title: '取得方式',
                    visible: false
                },
                {
                    field: 'qlrxz',
                    title: '权利人性质',
                    visible: false
                },
                {
                    field: 'qlmj',
                    title: '权利面积',
                    visible: false
                },
                {
                    field: 'qlbl',
                    title: '权利比例',
                    visible: false
                },
                {
                    field: 'qszt',
                    title: '权属状态',
                    visible: false
                },
                {
                    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> ');
                        // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>