<!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>申请Id：</label>
                            <input type="text" name="sponsorApplyId"/>
                        </li>
                        <li>
                            状态：<select name="applyStatus" th:with="type=${@dict.getType('zhengzai_sponsor_apply_status')}">
                            <option value="-1">所有</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"th:value="${dict.dictValue}"></option>
                        </select>
                        <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-bordered">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var dicSponsorApplyStatus = [[${@dict.getType('zhengzai_sponsor_apply_status')}]];

    var detailFlag = [[${@permission.hasPermi('merchant:sponsor:apply:detail')}]];

    var prefix = ctx + "merchant/sponsor/apply";

    $(function () {
        var options = {
            url: prefix + "/list",
            detailUrl: prefix + "/details/{id}",
            sortName: "createdAt",
            sortOrder: "desc",
            modalName: "-主办审核",
            columns: [{
                checkbox: true
            },
                {
                    field: 'sponsorApplyId',
                    title: '申请id'
                },
                {
                    field: 'name',
                    title: '主办名称'
                },
                {
                    field: 'applyStatus',
                    title: '状态',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(dicSponsorApplyStatus, value);
                    }
                },
                {
                    field: 'createdAt',
                    title: '申请时间',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.common.sprintf("<span>%s</span>", null != value ? value.replace("T"," ").substring(0, 19) : value);
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-info btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.sponsorApplyId + '\')"></i>查看</a> ');
                        return actions.join('');
                    }
                }]
        };

        $.table.init(options);

    });
</script>
</body>
</html>