<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="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">
                <rt-datetime ng-model="vm.sDate" rt-type="date" rt-required="true" rt-title="日期-从" rt-required="true" rt-col="3" rt-label-col="2">
                </rt-datetime>
                <rt-datetime ng-model="vm.eDate" rt-type="date" rt-required="true" rt-title="日期-到" rt-required="true" rt-col="3" rt-label-col="2">
                </rt-datetime>
            </div>
            <div class="form-group">
                <rt-bu-tree-lookup rt-title="部门" rt-multiple="true" ng-model="vm.nodeSelected" rt-col="3" rt-label-col="2"></rt-bu-tree-lookup>
                <rt-lookup2 rt-title="代表" ng-model="vm.OwnerId" rt-get-data-name="UserInfo.GetAllUser" rt-order-by="code" rt-col-list="[{Code:'name',Name:'姓名'},{Code:'code',Name:'编号'}]"
                    rt-col="3" rt-label-col="2"></rt-lookup2>
            </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":"代表",
                    "productidname":"品种",
                    "productsize":"规格",
                    "purchase_counts":"进货数"
                    },"RetailPsiStatisticsExport","药店拜访进货统计")'>导出</button>
            </div>
        </div>
    </form>
</div>

<div class="tab-content">
    <div class="tab-pane active">
        <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-right">进货数</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="row in vm.reportData">
                        <td class="rt-align-left">
                            {{row.businessunitidname == null ? "-" : row.businessunitidname}}
                        </td>
                        <td class="rt-align-left">
                            {{row.owneridname == null ? "-" : row.owneridname}}
                        </td>
                        <td class="rt-align-left">
                            {{row.productidname == null ? "-" : row.productidname}}
                        </td>
                        <td class="rt-align-left">
                            {{row.productsize == null ? "-" : row.productsize}}
                        </td>
                        <td class="rt-align-right">
                            {{row.purchase_counts == null ? 0 : row.purchase_counts }}
                        </td>
                    </tr>
                </tbody>
            </table>
        </rt-data-grid>
    </div>
</div>