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

    #rt-report-header > thead > tr > th {
        text-align: center;
        vertical-align: inherit;
        border: 1px solid #f0f0f0;
        color: #555;
        font-weight: 500;
        white-space: nowrap;
    }

    #rt-report-header > tbody > tr > td {
        text-align: center;
        vertical-align: inherit;
        border: 1px solid #f0f0f0;
        color: #555;
        font-weight: 500;
        white-space: nowrap;
    }
</style>
<div class="row">
    <form class="form-horizontal">
        <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 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({
                        "buidName":"事业部",
                        "bigdepartidName":"业务线/大区",
                        "BusinessUnitIdName":"地区",
                        "OwnerIdName":"代表",
                        "accountIdName":"客户名称",
                        "departmentidName":"科室名称",
                        "contactIdName":"联系人",
                        "contactnumber":"联系人编码",
                        "isTop":"是否TOP10医生"
                        },"RepresentativeOwnerAccountExport","代表负责客户")'>导出
                </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">
            <rt-lookup2 rt-title="代表"
                        ng-model="vm.ownerIdSelected"
                        rt-get-data-name="UserInfo.GetAllUser"
                        rt-order-by="name asc"
                        rt-col-list="[{Code:'name',Name:'名字'},{Code:'code',Name:'编号'}]"
                        rt-col="3"></rt-lookup2>

            <label class="col-sm-2 control-label">是否TOP10</label>

            <div class="col-sm-3">
                <ui-select allow-clear ng-model="vm.isTopSelected" theme="bootstrap">
                    <ui-select-match>{{ $select.selected.name }}</ui-select-match>
                    <ui-select-choices repeat="item in vm.isTopList |filter:$select.search">
                        <span ng-bind-html="item.name | highlight: $select.search"></span>
                    </ui-select-choices>
                </ui-select>
            </div>
        </div>
    </form>
</div>
<div class="row">
    <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"
                  rt-auto-height=" {{tableMaxHeight}}  ">
        <table class="table table-condensed table-hover ng-scope" style="white-space: nowrap;" id="rt-report-header">
            <thead>
            <tr>
                <th class="rt-align-left">
                    事业部
                </th>
                <th class="rt-align-left">
                    大区
                </th>
                <th class="rt-align-left">
                    地区
                </th>
                <th class="rt-align-left">
                    代表
                </th>
                <th class="rt-align-left">
                    客户名称
                </th>
                <th class="rt-align-left">
                    科室名称
                </th>
                <th class="rt-align-left">
                    联系人
                </th>
                <th class="rt-align-left">
                    联系人编码
                </th>
                <th class="rt-align-left">
                    是否TOP10医生
                </th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="row in vm.reportData ">
                <td class="rt-align-left">{{row.buidName}}</td>
                <td class="rt-align-left">{{row.bigdepartidName}}</td>
                <td class="rt-align-left">{{row.BusinessUnitIdName}}</td>
                <td class="rt-align-left">{{row.OwnerIdName}}</td>
                <td class="rt-align-left">{{row.accountIdName}}</td>
                <td class="rt-align-left">{{row.departmentidName}}</td>
                <td class="rt-align-left">{{row.contactidName}}</td>
                <td class="rt-align-left">{{row.contactnumber}}</td>
                <td class="rt-align-left">{{row.contactidName=='-'?'-':row.isTop}}</td>
            </tr>
            </tbody>
        </table>
    </rt-data-grid>
</div>