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

    #rt-report-table>tbody>tr>td {
        vertical-align: inherit;
        border: 1px solid #f0f0f0;
        color: #555;
        font-weight: 500;
        white-space: nowrap;
    }
</style>

<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==='thisWeek', 'btn-default':dateSelect!='thisWeek'}" style="margin-left: 15px;float: left;"
                        ng-click="vm.changeDate('thisWeek')">本周</button>
                    <button class="btn" ng-class="{'btn-primary': dateSelect==='lastWeek', 'btn-default':dateSelect!='lastWeek'}" style="margin-left: 15px;float: left;"
                        ng-click="vm.changeDate('lastWeek')">上周</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==='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="date"></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="date"></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>
        <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({},"SamZhsDoneExport","招商经理行为统计")'>导出</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-get-data="vm.showReport()" rt-page-index="vm.pageIndex" rt-page-size="vm.pageSize"
            rt-rows="vm.reportData">
            <table class="table table-condensed table-hover ng-scope" style="white-space: nowrap;" id="rt-report-table">
                <thead>
                    <tr>
                        <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>
                        <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 == null ? '-' : row.BusinessUnitIdName}}
                        </td>
                        <td class="rt-text-align">
                            {{row.OwnerIdName == null ? '-' : row.OwnerIdName}}
                        </td>
                        <td class="rt-number-align">{{row.Leads_Created_Count}}</td>
                        <td class="rt-number-align">{{row.Visit_Done_Times_leads}}</td>
                        <td class="rt-number-align">{{row.Visit_Done_Times_account}}</td>
                        <td class="rt-number-align">{{row.Coach_Agent_Done_Count}}</td>
                        <td class="rt-number-align">{{row.Hospital_Develop_Done_Count}}</td>
                        <td class="rt-number-align">{{row.Compaign_Done_times}}</td>
                    </tr>
                </tbody>
            </table>
        </rt-data-grid>
    </div>
</div>