<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.YmDate" rt-type="month" rt-title="年月" rt-col="3" rt-label-col="2"></rt-datetime>
                <rt-bu-tree-lookup rt-title="部门筛选" rt-multiple="true" ng-model="vm.nodeSelected" rt-col="3" rt-label-col="2"></rt-bu-tree-lookup>
            </div>
            <div class="form-group">
                <rt-lookup2 rt-title="产品" ng-model="vm.productid" rt-get-data-name="Product.GetProductSize" rt-order-by="name asc" rt-col-list="[{Code:'name',Name:'产品'}]"
                    rt-col="3" rt-label-col="2"></rt-lookup2>
                <label class="col-sm-2 control-label">状态</label>
                <div class="col-sm-3">
                    <ui-select allow-clear ng-model="vm.forecaststatusCode" theme="bootstrap">
                        <ui-select-match>{{$select.selected.name}}</ui-select-match>
                        <ui-select-choices repeat="item in vm.forecaststatusList | filter: $select.search">
                            <span ng-bind-html="item.name| highlight: $select.search"></span>
                        </ui-select-choices>
                    </ui-select>
                </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({},"SalesForecastExport","销售预测")'>导出</button>
            </div>
        </div>
    </form>
</div>


<div class="box box-primary" style="float:left;">
    <div class="tab-content">
        <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-sort-field="vm.view.sortField" rt-rows="vm.reportData" rt-selected-ids="vm.view.selectedIds" rt-auto-height="{{vm.view.autoHeight}}">
            <table class="table table-hover">
                <thead>
                    <tr>
                        <th>
                            <rt-header-checkbox></rt-header-checkbox>
                        </th>
                        <!-- @@ 视图表头 -->
                        <th>年月</th>
                        <th>负责人</th>
                        <th>部门</th>
                        <th>客户</th>
                        <th>产品</th>
                        <th>数量</th>
                        <th>状态</th>
                        <th>创建时间</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="row in vm.reportData.DataList ">
                        <td>
                            <rt-data-checkbox value="{{row.Id}}" />
                        </td>
                        <td>{{row.forecast_year_month}}</td>
                        <td>{{row.owneridname}}</td>
                        <td>{{row.businessunitidname}}</td>
                        <td>{{row.accountidname}}</td>
                        <td>{{row.productidname}}</td>
                        <td>{{row.qty}}</td>
                        <td>{{row.forecast_statusname}}</td>
                        <td>{{row.CreatedOn|date:'yyyy-MM-dd'}}</td>
                    </tr>
                </tbody>
            </table>
        </rt-data-grid>     
    </div>
</div>