<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">
                    <label class="col-sm-2 control-label">日期筛选</label>
                    <div class="col-sm-3" style="width:15%;">
                        <rt-datetime-no-label ng-model="vm.sYm" rt-type="month"></rt-datetime-no-label>
                    </div>
                    <div style="float: left;">~</div>
                    <div class="col-sm-3" style="width:15%;">
                        <rt-datetime-no-label ng-model="vm.eYm" rt-type="month"></rt-datetime-no-label>
                    </div>
                </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="代表" rt-multiple="true" ng-model="vm.ownerSelected" rt-get-data-name="UserInfo.GetUserByOption"
                        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.view.search();">查询</button>
                <button class="btn btn-default" ng-show="vm.privilege.IsExport" ng-click='vm.actions.export({
                    "training_campaignIdName":"活动名称",
                    "uploadedby_typeName":"上传类型",
                    "BusinessUnitIdName":"省区/地区",
                    "owneridName":"代表",
                    "OwnerIdName":"药店",
                    "contactIdName":"店员",
                    "CreatedOn":"时间",
                    "resultName":"结果"
                    })'>导出</button>
            </div>
        </div>
    </form>
</div>

<div class="box box-primary">
    <div class="nav-tabs-custom">
        <div class="tab-content">
            <rt-data-grid rt-page-record-count="vm.page.recordCount" rt-page-index="vm.page.index" rt-page-size="vm.page.size" rt-get-data="vm.view.search()"
                rt-sort-field="vm.view.sortField" rt-rows="vm.data" rt-selected-ids="vm.view.selectedIds" rt-auto-height="{{vm.view.autoHeight}}">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>活动名称</th>
                            <th>上传类型</th>
                            <th>省区/地区</th>
                            <th>代表</th>
                            <th>药店</th>
                            <th>店员</th>
                            <th rt-field-code="CreatedOn">时间</th>
                            <th>结果</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-repeat="row in vm.data track by row.Id">
                            <td>
                                <a href="javascript:;" ng-click="vm.actions.qualified(row)" ng-show="row.result.Value==='10'">合格</a>
                                <a href="javascript:;" ng-click="vm.actions.unqualified(row)" ng-show="row.result.Value==='10'">不合格</a>
                            </td>
                            <!-- @@ 视图列表值 -->
                            <td>
                                {{row.training_campaignId.Name}}
                            </td>
                            <td>
                                {{row.uploadedby_type.Name}}
                            </td>
                            <td>
                                {{row.BusinessUnitId.Name}}
                            </td>
                            <td>
                                {{row.OwnerId.Name}}
                            </td>
                            <td>
                                {{row.accountId.Name}}
                            </td>
                            <td>
                                {{row.contactId.Name}}
                            </td>
                            <td>
                                {{row.CreatedOn | date:'yyyy-MM-dd HH:mm:ss'}}
                            </td>
                            <td>
                                {{row.result.Name}}
                            </td>
                        </tr>
                    </tbody>
                </table>
            </rt-data-grid>
        </div>
    </div>
</div>