<style>
	.form-group .control-label {
		font-weight: 500;
		color: #555;
	}
	
	#rt-report-header th {
		text-align: left;
		vertical-align: inherit;
		border: 1px solid #f0f0f0;
		color: #555;
		font-weight: 500;
	}
	
	#rt-report-header tr,
	td {
		vertical-align: inherit;
		color: #555;
		font-weight: 500;
	}
	
	#misstarget .col-sm-2 input {
		width: 30%;
		border: 1px solid #ccc;
		height: 34px;
	}
</style>
<form class="form-horizontal">
	<div class="form-group">
		<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"></label>
		<div class="col-sm-3">

		</div>
		<div class="col-sm-1">
			<button class="btn btn-primary" ng-click="vm.search()">查询</button>
		</div>
	</div>
	<div class="form-group">
		<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.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"><span style="color:red;"></span>业务线/大区</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 class="col-sm-1">
			<button class="btn btn-primary" ng-click='vm.actions.export({
                        "buidName":"事业部",
                        "bigdepartidName":"大区",
                        "BusinessUnitIdName":"地区",
                        "OwnerIdName":"代表",
                        "accountidName":"客户名称",
                        "account_grade_levelName":"客户分级",
						"target":"指标",
						"accountCount":"拜访次数",
						"achievement":"达成率"
                        },"VisitfrequencyAccExport","客户拜访频率分析报表")'>
                   导出
                </button>
		</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>
	<div class="form-group">
		<label class="col-sm-2 control-label">客户分级</label>
		<div class="col-sm-3">
			<ui-select class="form" multiple allow-clear sortable="true" theme="bootstrap" close-on-select="false" ng-model="vm.accountClassSelected">
				<ui-select-match>{{$item.Name}}</ui-select-match>
				<ui-select-choices repeat="item in vm.accountClass | filter: {Name: $select.search}">
					<span ng-bind-html="item.Name | highlight: $select.search"></span>
				</ui-select-choices>
			</ui-select>
		</div>
		<rt-lookup2 rt-title="代表" ng-model="vm.representativeint" rt-get-data-name="UserInfo.GetAllUser" rt-order-by="code"
			rt-col-list="[{Code:'name',Name:'业务代表名称'},{Code:'code',Name:'业务代表编码'}]" rt-params="{'@queryValue':''}" rt-required="false"
			rt-col="3"></rt-lookup2>
	</div>
	<div class="form-group" id="misstarget">
		<label class="col-sm-2 control-label">指标</label>
		<div class="col-sm-2" ng-repeat="item in vm.accountClass track by $index">
			<span>{{item.Name}}:</span>
			<input type="text"  ng-model="item.target" style="vertical-align: middle;" />
			<span>次/月</span>
		</div>
	</div>

</form>

<div class="row" style="border-top: 1px dotted #d5c4c4; padding-top: 20px">
	<div class="col-sm-30">
		<rt-data-grid rt-page-record-count="vm.recordCount" rt-page-index="vm.pageIndex" rt-page-size="vm.pageSize" rt-get-data="vm.search()" rt-rows="vm.data"
			rt-auto-height="{{tableMaxHeight}}">
			<table class="table table-hover " style="white-space:nowrap;" id="rt-report-header">
				<thead>
					<tr>
						<th>事业部</th>
						<th>大区</th>
						<th>地区</th>
						<th>代表</th>
						<th>客户名称</th>
						<th>客户分级</th>
						<th>指标</th>
						<th>拜访次数</th>
						<th>达成率</th>
					</tr>
				</thead>
				<tbody>
					<tr ng-repeat="row in vm.dataTable ">
						<td>{{row.buidName}}</td>
						<td>{{row.bigdepartidName}}</td>
						<td>{{row.BusinessUnitIdName}}</td>
						<td>{{row.OwnerIdName}}</td>
						<td>{{row.accountidName}}</td>
						<td>{{row.account_grade_levelName}}</td>
						<td>{{row.target}}</td>
						<td>{{row.accountCount}}</td>
						<td>{{row.achievement}}%</td>
					</tr>

				</tbody>
			</table>
		</rt-data-grid>
	</div>
</div>