<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.sYm" rt-type="month" rt-title="开始年月" rt-required="true" rt-col="3" rt-label-col="2"></rt-datetime>
                <rt-datetime ng-model="vm.eYm" rt-type="month" 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.provinceSelected" rt-get-data-name="Province.GetProvince" rt-order-by="name asc" rt-col-list="[{Code:'name',Name:'省份'}]" rt-col="3" rt-label-col="2"></rt-lookup2>
            </div>
            <div class="form-group">
                <rt-lookup2 rt-title="产品名称" rt-multiple="true" ng-model="vm.productSelected" rt-get-data-name="Product.GetProductSize" rt-order-by="name asc" rt-col-list="[{Code:'name',Name:'产品名称'},{Code:'size',Name:'规格'},{Code:'code',Name:'产品编号'}]" rt-col="8" rt-label-col="2"></rt-lookup2>
            </div>
            <div class="form-group">
                <rt-lookup2 rt-title="医院" ng-model="vm.accSelected" rt-get-data-name="Account.GetHospital" rt-order-by="name asc" rt-col-list="[{Code:'name',Name:'医院'},{Code:'accountnumber',Name:'编号'}]" rt-col="8" 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.getReportData()">查询</button>
                <button class="btn btn-default" ng-click='vm.actions.export({
                "accountidName":"医院",
                "year_month":"年月",
                "productIdName":"品种",
                "productSize":"规格",
                "fromaccountIdName":"商业",
                "done_qty":"销量",
                "sales_proportion":"占比",
                "rebate_rate":"返利系数" 
               },"AccountRebateAnalyzeExport","商业返利占比分析报表")'>导出</button>
            </div>
        </div>
    </form>
</div>
<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.getReportData()" 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-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>{{row.accountidName}}</td>
                        <td class="rt-align-left">{{row.year+'年'+row.month +'月'}}</td>
                        <td class="rt-align-left">{{row.productIdName}}</td>
                        <td class="rt-align-left">{{row.productSize}}</td>
                        <td class="rt-align-left">{{row.fromaccountIdName}}</td>
                        <td class="rt-number-align">{{row.done_qty}}</td>
                        <td class="rt-number-align">{{row.proportion | toFixNumber: 2}}%</td>
                        <td class="rt-number-align">{{row.rebate_rate}}</td>
                    </tr>
                </tbody>
            </table>
        </rt-data-grid>
    </div>
</div>