<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-12">
                    <rt-datetime ng-model="vm.sDate" rt-type="month" rt-title="开始年月" rt-required="true" rt-col="3" rt-label-col="2"></rt-datetime>
                    <rt-datetime ng-model="vm.eDate" rt-type="month" rt-title="结束年月" rt-required="true" rt-col="3" rt-label-col="2"></rt-datetime>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-12">
                    <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 class="form-group">
                <div class="col-sm-12">
                    <rt-lookup2 rt-title="代表" ng-model="vm.ownerSelected" rt-get-data-name="UserInfo.GetAllUserByOption" rt-order-by="name asc"
                        rt-col-list="[{Code:'name',Name:'姓名'},{Code:'code',Name:'编号'}]" rt-params="{'@buId':'','@bigDepId':'','@depId':''}"
                        rt-col="8"></rt-lookup2>
                </div>
            </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({
                        "upload_ym":"统计年月",
                        "OwnerIdName":"负责人",
                        "expense_a":"费用类型A",
                        "expense_b":"费用类型B",
                        "expense_d":"费用类型D",
                        "expense":"投入",
                        "reach_expense":"达成额",
                        "costBenefit":"费效比"
                        },"UserCostEffectivenessReportExport","代表费效比分析报表")'>导出</button>
            </div>
        </div>
    </form>
</div>

<div class="box box-primary" style="float:left;">
    <div class="box-body">
        <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 rowspan="2">统计年月</th>
                        <th rowspan="2">负责人</th>
                        <th rowspan="2" class="rt-number-align">费用类型A</th>
                        <th rowspan="2" class="rt-number-align">费用类型B</th>
                        <th rowspan="2" class="rt-number-align">费用类型D</th>
                        <th rowspan="2" class="rt-number-align">投入</th>
                        <th rowspan="2" class="rt-number-align">达成额</th>
                        <th rowspan="2" class="rt-number-align">费效比</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="row in vm.reportData">
                        <td>{{row.upload_ym}}</td>
                        <td>{{row.OwnerIdName}}</td>
                        <td class="rt-number-align">{{row.expense_a}}</td>
                        <td class="rt-number-align">{{row.expense_b}}</td>
                        <td class="rt-number-align">{{row.expense_d}}</td>
                        <td class="rt-number-align">{{row.expense}}</td>
                        <td class="rt-number-align">{{row.reach_expense}} </td>
                        <td class="rt-number-align" ng-if="row.cost_benefit==null">无达成</td>
                        <td class="rt-number-align" ng-if="row.cost_benefit!=null">{{row.cost_benefit|number:2}}%</td>
                    </tr>
                </tbody>
            </table>
        </rt-data-grid>
    </div>