<div class="box box-primary">
    <div class="box-header with-border">
        <h3 class="box-title">筛选</h3>
        <div class="box-tools pull-right">
            <button type="button" class="btn btn-box-tool" data-widget="collapse">
                <i class="fa fa-minus"></i>
            </button>
        </div>
    </div>
    <form class="form-horizontal">
        <div class="box-body">
            <div class="form-group">
                <div class="col-sm-11.5">
                    <label class="col-sm-2 control-label">时间段</label>
                    <button class="btn" ng-class="{'btn-primary': dateSelect==='fullYear', 'btn-default':dateSelect!='fullYear'}" style="margin-left: 15px;float: left;"
                        ng-click="vm.changeDate('fullYear')">全年</button>
                    <button class="btn" ng-class="{'btn-primary': dateSelect==='thisMonth', 'btn-default':dateSelect!='thisMonth'}" style="margin-left: 15px;float: left;"
                        ng-click="vm.changeDate('thisMonth')">本月</button>
                    <button class="btn" ng-class="{'btn-primary': dateSelect==='lastMonth', 'btn-default':dateSelect!='lastMonth'}" style="margin-left: 15px;float: left;"
                        ng-click="vm.changeDate('lastMonth')">上月</button>
                    <button class="btn" ng-class="{'btn-primary': dateSelect==='thisQuarter', 'btn-default':dateSelect!='thisQuarter'}" style="margin-left: 15px;float: left;"
                        ng-click="vm.changeDate('thisQuarter')">本季度</button>
                    <button class="btn" ng-class="{'btn-primary': dateSelect==='lastQuarter', 'btn-default':dateSelect!='lastQuarter'}" style="margin-left: 15px;float: left;"
                        ng-click="vm.changeDate('lastQuarter')">上季度</button>
                    <button class="btn" ng-class="{'btn-primary': dateSelect==='custom', 'btn-default':dateSelect!='custom'}" style="margin-left: 15px;float: left;"
                        ng-click="vm.changeDate('custom')">自定义</button>
                    <div class="col-sm-3" style="width:15%;" ng-if="dateSelect==='custom'">
                        <rt-datetime-no-label ng-model="vm.sYm" rt-type="month"></rt-datetime-no-label>
                    </div>
                    <div style="float: left;" ng-if="dateSelect=='custom'">~</div>
                    <div class="col-sm-3" style="width:15%;" ng-if="dateSelect==='custom'">
                        <rt-datetime-no-label ng-model="vm.eYm" rt-type="month"></rt-datetime-no-label>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-11.5">
                    <rt-bu-tree-lookup rt-title="区域" rt-multiple="true" ng-model="vm.nodeSelected" rt-col="8" rt-label-col="2"></rt-bu-tree-lookup>
                </div>
            </div>

            <div class="form-group">
                    <div class="col-sm-11.5">
                        <label class="col-sm-2 control-label">门店级别</label>
                        <div class="col-sm-3">
                            <div class="input-group input-group-sm">
                                <ui-select allow-clear ng-model="vm.accountLevel_selected" theme="bootstrap">
                                    <ui-select-match>{{$select.selected.Name}}</ui-select-match>
                                    <ui-select-choices repeat="item in vm.accountLevel | filter: $select.search">
                                        <span ng-bind-html="item.Name | highlight: $select.search"></span>
                                    </ui-select-choices>
                                </ui-select>
                                <span class="input-group-btn">
                                <button ng-click="vm.accountLevel_selected = null" ng-disabled="rtDisabled" class="btn btn-default">
                                        <span class="fa fa-times"></span>
                                </button>
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
        </div>

        <div class="box-footer">
            <div class="btn-group pull-right">
                <button class="btn btn-primary" ng-click="vm.getReportData()">查询</button>
                <button class="btn btn-default" ng-click='vm.actions.export({
                "BusinessUnitIdName":"区域",
                "BusinessunitOwneridname":"负责人",
                "account":"门店数",
                "cover":"巡店数量",
                "count":"巡店次数",
                "duitou":"堆头",
                "huojia":"货架",
                "POP":"POP",
                "mentou":"门头",
                "chuchuang":"橱窗",
                "others":"其他"            
               },"AreaVividExport","区域生动化分析报表")'>导出</button>
            </div>
        </div>
    </form>
</div>

<div class="box box-primary">
    <div class="box box-body">
        <rt-data-grid rt-page-record-count="vm.recordCount" rt-page-index="vm.pageIndex" rt-page-size="vm.pageSize" rt-get-data="vm.getReportData()"
            rt-rows="vm.reportData" rt-auto-height="{{tableMaxHeight}} ">
            <table class="table table-condensed table-hover ng-scope" style="white-space:nowrap;" id="rt-report-header">
                <thead>
                    <tr>
                        <th rowspan="2">区域</th>
                        <th rowspan="2">负责人</th>
                        <th rowspan="2" class="rt-number-align">门店数</th>
                        <th rowspan="2" class="rt-number-align">巡店数量</th>
                        <th rowspan="2" class="rt-number-align">巡店次数</th>
                        <th colspan="6" style="text-align:center;">生动化门店数量</th>
                    </tr>
                    <tr>
                        <th class="rt-number-align">堆头</th>
                        <th class="rt-number-align">货架</th>
                        <th class="rt-number-align">POP</th>
                        <th class="rt-number-align">门头</th>
                        <th class="rt-number-align">橱窗</th>
                        <th class="rt-number-align">其他</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="row in vm.reportData">
                        <td>{{row.BusinessUnitIdName}}</td>
                        <td>{{row.BusinessunitOwneridname}}</td>
                        <td class="rt-number-align">{{row.account}}</td>
                        <td class="rt-number-align">{{row.cover}}</td>
                        <td class="rt-number-align">{{row.count}}</td>
                        <td class="rt-number-align">{{row.duitou}}</td>
                        <td class="rt-number-align">{{row.huojia}}</td>
                        <td class="rt-number-align">{{row.POP}}</td>
                        <td class="rt-number-align">{{row.mentou}}</td>
                        <td class="rt-number-align">{{row.chuchuang}}</td>
                        <td class="rt-number-align">{{row.others}}</td>
                    </tr>
                </tbody>
            </table>
        </rt-data-grid>
    </div>
</div>