<!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="cdTime"/>-->
                        <!--</li>-->
                        <!--<li>-->
                        <!--<label>操作时间：</label>-->
                        <!--<input type="text" name="cdBatch"/>-->
                        <!--</li>-->
                        <!--<li>-->
                        <!--<label>操作时间：</label>-->
                        <!--<input type="text" name="cdOperation"/>-->
                        <!--</li>-->
                        <!--<li>-->
                        <!--<label>操作时间：</label>-->
                        <!--<input type="text" name="cdSource"/>-->
                        <!--</li>-->
                        <li>
                            <label>读者证号：</label>
                            <input type="text" name="cardno"/>
                        </li>
                        <li>
                            <label>读者姓名：</label>
                            <input type="text" name="name"/>
                        </li>
                        <!--<li>-->
                        <!--<label>图书条码号：</label>-->
                        <!--<input type="text" name="barcode"/>-->
                        <!--</li>-->
                        <!--<li>-->
                        <!--<label>记录类型：</label>-->
                        <!--<select name="recordtype">-->
                        <!--<option value="">所有</option>-->
                        <!--<option value="-1">代码生成请选择字典属性</option>-->
                        <!--</select>-->
                        <!--</li>-->
                        <!--<li>-->
                        <!--<label>财经类型：</label>-->
                        <!--<select name="financialtype">-->
                        <!--<option value="">所有</option>-->
                        <!--<option value="-1">代码生成请选择字典属性</option>-->
                        <!--</select>-->
                        <!--</li>-->
                        <!--<li>-->
                        <!--<label>金额：</label>-->
                        <!--<input type="text" name="money"/>-->
                        <!--</li>-->
                        <!--<li>-->
                        <!--<label>操作员：</label>-->
                        <!--<input type="text" name="operator"/>-->
                        <!--</li>-->
                        <!--<li>-->
                        <!--<label>操作时间：</label>-->
                        <!--<input type="text" name="operationdate"/>-->
                        <!--</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-success" onclick="$.operate.add()" shiro:hasPermission="system:creditpoints:add">-->
            <!--<i class="fa fa-plus"></i> 添加-->
            <!--</a>-->
            <!--<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:creditpoints:edit">-->
            <!--<i class="fa fa-edit"></i> 修改-->
            <!--</a>-->
            <!--<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:creditpoints:remove">-->
            <!--<i class="fa fa-remove"></i> 删除-->
            <!--</a>-->
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:creditpoints: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:creditpoints:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:creditpoints:remove')}]];
    var detailFlag = [[${@permission.hasPermi('system:creditpoints:detail')}]];
    var prefix = ctx + "system/library/creditpoints";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            detailUrl: prefix + "/detail/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "信用积分",
            columns: [{
                checkbox: true
            },
                // {
                //     field: 'id',
                //     title: '主键ID',
                //     visible: false
                // },
                // {
                //     field: 'cdTime',
                //     title: '主键ID'
                // },
                // {
                //     field: 'cdBatch',
                //     title: '主键ID'
                // },
                // {
                //     field: 'cdOperation',
                //     title: '主键ID'
                // },
                // {
                //     field: 'cdSource',
                //     title: '主键ID'
                // },
                {
                    field: 'cardno',
                    title: '读者证号'
                },
                {
                    field: 'name',
                    title: '读者姓名'
                },
                {
                    field: 'barcode',
                    title: '图书条码号'
                },
                // {
                //     field: 'recordtype',
                //     title: '记录类型'
                // },
                // {
                //     field: 'financialtype',
                //     title: '财经类型'
                // },
                {
                    field: 'money',
                    title: '金额'
                },
                {
                    field: 'operator',
                    title: '操作员'
                },
                {
                    field: 'operationdate',
                    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 ' + detailFlag + '" 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>
