<!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="keyword" placeholder="请输入企业名称/证件号"/>
                            </li>
                            <li>
                                <label>所属企业：</label>
                                <select name="comId" th:with="type=${@com.getCom()}">
                                    <option value="">所有</option>
                                    <option th:each="com : ${type}" th:text="${com.comName}" th:value="${com.comId}"></option>
                                </select>
                            </li>
                        </ul>
                        <ul>
                            <li>
                                <label>开户日期：</label>
                                <input type="text" class="time-input" id="startTime" name="startTime"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" name="endTime"/>
                            </li>
                        </ul>
                        <ul id="element">
                            <li>
                                省：<select class="province"></select>
                            </li>
                            <li>
                                市：<select class="city"></select>
                            </li>
                            <li>
                                区：<select class="area"></select>
                            </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" />
    <th:block th:include="include :: bootstrap-select-js" />
    <th:block th:include="include :: jquery-cxselect-js" />
    <script th:inline="javascript">
        var removeFlag = [[${@permission.hasPermi('per-wallet:remove')}]];
        var prefix = ctx + "manage/per-wallet";

        $(function() {
            var options = {
                url: prefix + "/page-per-wallet-list",
                updateUrl: prefix + "/per-wallet-account-view/{id}",
                modalName: "账户信息",
                columns: [
                {
                    field: 'perId',
                    title: '序号'
                },
                {
                    field: 'name',
                    title: '姓名'
                },
                {
                    field: 'idCardNo',
                    title: '身份证'
                },
                {
                    field: 'comName',
                    title: '所属企业'
                },
                {
                    field: 'region',
                    title: '所属地区'
                },
                {
                    field: 'walletAccountNo',
                    title: '钱包账户号'
                },
                {
                    field: 'createTime',
                    title: '开户时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.perId + '\')"><i class="fa fa-edit"></i>账户信息</a> ');
                        actions.push('<a class="btn btn-success btn-xs" href="/manage/per-wallet/per-wallet-account-trade-detail-view/'+row.perId+'/'+row.walletAccountNo+'"><i class="fa fa-edit"></i>个人收支明细列表</a> ');
                        return actions.join('');
                    }
                }]
            };
            var _n = new Date();
            var initStart = new Date(_n.getTime()-2592000000);
            $('#startTime').val(initStart.format("yyyy-MM-dd"));
            $('#endTime').val(_n.format("yyyy-MM-dd"));
            $.table.init(options);
        });

        var regions = {
            url: ctx + "region/getRegions",
            type: "post",
            dataType: "json",
            beforeSend: function () {
            },
            success: function(data) {
                $('#element').cxSelect({
                    selects: ['province', 'city', 'area'],
                    jsonValue: 'regionId',
                    jsonName: 'regionName',
                    data: data
                });
            }
        };
        $.ajax(regions);
    </script>
</body>
</html>