<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">
            <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 class="col-sm-1">
                <button class="btn btn-primary" ng-click="vm.getReportData()">查询</button>
            </div>
            <div class="col-sm-1">
                <button class="btn btn-primary" ng-click='vm.actions.export({},"BusinessCashBackStatisticsExport","按商业回款统计")'>导出</button>
            </div>
        </div>
        <div class="form-group">
            <rt-bu-tree-lookup rt-title="事业部/大区/地区" ng-model="vm.nodeSelected" rt-col="8"></rt-bu-tree-lookup>
        </div>
        <div class="form-group">
            <rt-lookup2 rt-title="商业" rt-multiple="true" ng-model="vm.accSelected" rt-get-data-name="Account.GetAccountByBigDepAndUnit"
                rt-order-by="name asc" rt-col-list="[{Code:'name',Name:'商业'},{Code:'accountnumber',Name:'编号'}]" rt-params="{'@accType':1,'@bigDepId':'','@DepId':vm.nodeSelected?vm.nodeSelected.ids:'','in@DepId':vm.nodeSelected?vm.nodeSelected.ids:''}"
                rt-col="8"></rt-lookup2>
        </div>
    </form>
</div>
<div class="row">
    <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="4">
                        事业部/大区/地区
                    </th>
                    <th rowspan="4">
                        负责人
                    </th>
                    <th rowspan="4">
                        商业公司
                    </th>
                    <th colspan="1" align="center" ng-repeat="item in vm.MonDataList">{{item}} 月</th>
                </tr>
                <tr>
                    <th align="center" ng-repeat="Mtext in vm.TbMessText track by $index">{{Mtext}}
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="row in vm.reportData.DataList ">
                    <td>{{row.BusinessUnitIdName}}</td>
                    <td>{{row.OwnerIdName}}</td>
                    <td>{{row.AccountIdName}}</td>
                    <td ng-repeat="Items in row.monthList track by $index" align="center">{{Items}}
                    </td>
                </tr>
            </tbody>
        </table>
    </rt-data-grid>
</div>