<!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="areaName"/>
                            </li>
                            <li>
                                <label>公司名称：</label>
                                <input type="text" name="company"/>
                            </li>
                            <li>
                                <label>机构代码：</label>
                                <input type="text" name="org"/>
                            </li>
                            <li>
                                <label>法人：</label>
                                <input type="text" name="person"/>
                            </li>
                            <li>
                                <label>注册资本：</label>
                                <input type="text" name="register"/>
                            </li>
                            <li>
                                <label>成立日期：</label>
                                <input type="text" name="setupTime"/>
                            </li>
                            <li>
                                <label>注册地址：</label>
                                <input type="text" name="addr"/>
                            </li>
                            <li>
                                <label>经营状态：</label>
                                <input type="text" name="state"/>
                            </li>
                            <li>
                                <label>是招标公司：</label>
                                <input type="text" name="inviteBid"/>
                            </li>
                            <li>
                                <label>是中标公司：</label>
                                <input type="text" name="winBid"/>
                            </li>
                            <li>
                                <label>招标项目数：</label>
                                <input type="text" name="inviteCount"/>
                            </li>
                            <li>
                                <label>中标项目数：</label>
                                <input type="text" name="winCount"/>
                            </li>
                            <li>
                                <label>招标金额：</label>
                                <input type="text" name="inviteSum"/>
                            </li>
                            <li>
                                <label>中标金额：</label>
                                <input type="text" name="winSum"/>
                            </li>
                            <li>
                                <label>收藏次数：</label>
                                <input type="text" name="storeNumber"/>
                            </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="business:company:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="business:company:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="business:company:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:company: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('business:company:edit')}]];
        var removeFlag = [[${@permission.hasPermi('business:company:remove')}]];
        var prefix = ctx + "business/company";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "公司",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'companyId',
                    title: '公司id',
                    visible: false
                },
                {
                    field: 'areaName',
                    title: '区域名称'
                },
                {
                    field: 'company',
                    title: '公司名称'
                },
                {
                    field: 'org',
                    title: '机构代码'
                },
                {
                    field: 'person',
                    title: '法人'
                },
                {
                    field: 'register',
                    title: '注册资本'
                },
                {
                    field: 'setupTime',
                    title: '成立日期'
                },
                {
                    field: 'addr',
                    title: '注册地址'
                },
                {
                    field: 'state',
                    title: '经营状态'
                },
                {
                    field: 'gange',
                    title: '经营范围'
                },
                {
                    field: 'inviteBid',
                    title: '是招标公司'
                },
                {
                    field: 'winBid',
                    title: '是中标公司'
                },
                {
                    field: 'inviteCount',
                    title: '招标项目数'
                },
                {
                    field: 'winCount',
                    title: '中标项目数'
                },
                {
                    field: 'inviteSum',
                    title: '招标金额'
                },
                {
                    field: 'winSum',
                    title: '中标金额'
                },
                {
                    field: 'storeNumber',
                    title: '收藏次数'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.companyId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.companyId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>