<!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>
                                <p>公司代码：</p>
                                <input type="text" name="companyCode"/>
                            </li>
                            <li>
                                <p>公司名称：</p>
                                <input type="text" name="companyName"/>
                            </li>
                            <li>
                                <p>销售大区代码：</p>
                                <input type="text" name="saledeptCode"/>
                            </li>
                            <li>
                                <p>销售大区名称：</p>
                                <input type="text" name="saledeptName"/>
                            </li>
                            <li>
                                <p>销售部代码：</p>
                                <input type="text" name="officeCode"/>
                            </li>
                            <li>
                                <p>销售部名称：</p>
                                <input type="text" name="officeName"/>
                            </li>
                            <li>
                                <p>销售分部代码：</p>
                                <input type="text" name="subofficeCode"/>
                            </li>
                            <li>
                                <p>销售分部名称：</p>
                                <input type="text" name="subofficeName"/>
                            </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-primary single disabled" onclick="$.operate.detail()" shiro:hasPermission="order:orderSalesGroup:info">
                    <i class="fa fa-edit"></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 prefix = ctx + "order/orderSalesGroup";

        $(function() {
            var options = {
                url: prefix + "/list",
                detailUrl: prefix + "/info/{id}",
                exportUrl: prefix + "/export",
                modalName: "【销售分部目标达成】",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'id', 
                    title : 'id',
                    visible: false
                },
                {
                    field : 'companyCode', 
                    title : '公司代码'
                },
                {
                    field : 'companyName', 
                    title : '公司名称'
                },
                {
                    field : 'saledeptCode', 
                    title : '销售大区代码'
                },
                {
                    field : 'saledeptName', 
                    title : '销售大区名称'
                },
                {
                    field : 'officeCode', 
                    title : '销售部代码'
                },
                {
                    field : 'officeName', 
                    title : '销售部名称'
                },
                {
                    field : 'subofficeCode', 
                    title : '销售分部代码'
                },
                {
                    field : 'subofficeName', 
                    title : '销售分部名称'
                },
                {
                    field : 'customerGroup', 
                    title : '顾客分组代码',
                    visible: false
                },
                {
                    field : 'customerGroupName', 
                    title : '顾客分组名称',
                    visible: false
                },
                {
                    field : 'calMonth', 
                    title : '日期'
                },
                {
                    field : 'nowYearAct', 
                    title : '已复核(千元)'
                },
                {
                    field : 'nowYearBud', 
                    title : '预算(千元)'
                },
                {
                    field : 'reviewNo', 
                    title : '未复核(千元)'
                },
                {
                    field : 'uncleared', 
                    title : '未清(千元)'
                },
                {
                    field : 'freeze', 
                    title : '冻结(千元)'
                },
                {
                    field : 'runTime', 
                    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.detail(\'' + row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>