<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-12">
					<rt-datetime ng-model="vm.sYm" rt-type="month" rt-title="月份筛选" rt-required="true" rt-col="3" rt-label-col="2">
					</rt-datetime>
					<label class="col-sm-2 control-label">排序方式<span style="color:red;">*</span></label>
					<div class="col-sm-3">
						<ui-select allow-clear ng-model="vm.ordertype" theme="bootstrap">
							<ui-select-match>{{ $select.selected.name }}</ui-select-match>
							<ui-select-choices repeat="item in vm.ordertypeList |filter:$select.search">
								<span ng-bind-html="item.name | highlight: $select.search"></span>
							</ui-select-choices>
						</ui-select>
					</div>
				</div>
			</div>

			<div class="form-group">
				<div class="col-sm-12">
					<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>
		<div class="box-footer">
			<div class="btn-group pull-right">
				<button class="btn btn-primary" ng-click="vm.showReportButton();">查询</button>
				<button class="btn btn-default" ng-click='vm.actions.export({
					"BusinessUnitIdName":"省区/地区",
					"owneridname":"经理",
					"shouldVisit":"客户数",
					"times":"协访数",
					"avgvisit":"人均拜访",
					"coverage":"覆盖率"
					},"ManagervisitAssAnalysisExport","部门执行力分析")'>导出</button>
			</div>
		</div>
	</form>
</div>

<div class="box box-primary" style="float:left;">
	<div class="box-body">
		<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="rt-report-header">
						<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.BusinessUnitIdName}}
						</td>
						<td class="rt-text-align">
							{{row.owneridname}}
						</td>
						<td class="rt-number-align">
							{{row.Account_Count==null?0:row.Account_Count}}
						</td>
						<td class="rt-number-align">
							{{row.Coach_Done_Count==null?0:row.Coach_Done_Count}}
						</td>
						<td class="rt-number-align">
							{{row.Visited_Avg==null?0:row.Visited_Avg|toFixNumber:0}}
						</td>
						<td class="rt-number-align">
							{{row.Visited_Done_Avg==null?0:(row.Visited_Done_Avg)*100|toFixNumber:0}}%
						</td>
					</tr>
				</tbody>
			</table>
		</rt-data-grid>
	</div>
</div>