<style>
    .form-group .control-label {
        font-weight: 500;
        color: #555;
    }

    #report-table th {
        vertical-align: inherit;
        border: 1px solid #f0f0f0;
        color: #555;
        font-weight: 500;
    }

    #report-table tr,td {
        vertical-align: inherit;
        border: 1px solid #f0f0f0;
        color: #555;
        font-weight: 500;
    }
</style>
<form class="form-horizontal">
    <div class="form-group">
        <rt-datetime ng-model="vm.yM" rt-type="month" rt-title="查询年月" rt-required="true" rt-col="3" rt-label-col="2">
        </rt-datetime>
        <div class="col-sm-5">
        </div>
        <div class="col-sm-1">
            <button class="btn btn-primary" ng-click="vm.showReportButton()">查询</button>
        </div>
        <div class="col-sm-1">
            <button class="btn btn-primary" ng-click='vm.actions.export({},"DelegateVisitRankExport","代表拜访分析")'>导出
            </button>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">事业部</label>

        <div class="col-sm-3">
            <ui-select allow-clear ng-model="vm.buidSelected" theme="bootstrap">
                <ui-select-match>{{ $select.selected.name }}</ui-select-match>
                <ui-select-choices repeat="item in vm.buidList|filter:$select.search">
                    <span ng-bind-html="item.name | highlight: $select.search"></span>
                </ui-select-choices>
            </ui-select>
        </div>
        <label class="col-sm-2 control-label">业务线/大区</label>

        <div class="col-sm-3">
            <ui-select allow-clear ng-model="vm.bigDepSelected" theme="bootstrap">
                <ui-select-match>{{ $select.selected.name }}</ui-select-match>
                <ui-select-choices repeat="item in vm.bigDepList |filter:$select.search">
                    <span ng-bind-html="item.name | highlight: $select.search"></span>
                </ui-select-choices>
            </ui-select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">省区/地区</label>

        <div class="col-sm-8">
            <ui-select class="form" multiple allow-clear sortable="true" theme="bootstrap" close-on-select="false"
                       ng-model="vm.businessUnitSelected">
                <ui-select-match>{{$item.name}}</ui-select-match>
                <ui-select-choices repeat="item in vm.businessUnitList | filter: {name: $select.search}">
                    <span ng-bind-html="item.name | highlight: $select.search"></span>
                </ui-select-choices>
            </ui-select>
        </div>
    </div>

</form>

<!--<div>&nbsp;&nbsp;&nbsp;&nbsp;人均访次:{{average}}</div>-->

<div class="row" style="border-top: 1px dotted #d5c4c4; padding-top:20px">
    <div class="col-sm-30">
        <div class="row" style="margin-bottom:13px;padding-left:13px;">
            <!--<span style="width:10%;padding-left:17px;">人均访次:{{average}}</span>-->
            <span style="width:10%;padding-left:17px;">客户数量:{{cusqty|toFixNumber:0}}</span>
            <span style="width:10%;padding-left:17px;">覆盖数:{{coverqty|toFixNumber:0}}</span>
            <span style="width:10%;padding-left:17px;">覆盖率:{{coverper}}</span>
        </div>
        <rt-data-grid rt-page-record-count="vm.recordCount" rt-get-data="vm.showReport()" rt-page-index="vm.index" rt-page-size="vm.pageSize"
                      rt-rows="vm.reportData">
            <table class="table table-hover">
                <thead>
                <tr id="report-table">
                    <th class="rt-text-align">代表姓名</th>
                    <th class="rt-text-align">所属部门</th>
                    <th class="rt-number-align">客户数量</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 class="rt-text-align">
                        {{row.OwnerIdName}}
                    </td>
                    <td class="rt-text-align">
                        {{row.BusinessUnitIdName}}
                    </td>
                    <td class="rt-number-align">
                        {{row.shouldVisit|toFixNumber:0}}
                    </td>
                    <td class="rt-number-align">
                        {{row.hasVisit|toFixNumber:0}}
                    </td>
                    <td class="rt-number-align">
                        {{row.coverage|toFixNumber:1}}%
                    </td>
                    <td class="rt-number-align">
                        {{row.visitCount|toFixNumber:0}}
                    </td>
                </tr>
                </tbody>
            </table>
        </rt-data-grid>
    </div>
</div>