<div class="row rt-margin-bottom-before-box">
    <div class="col-sm-8">
        <div class="btn-group">
            <button class="btn btn-link" data-toggle="sidebar" data-target=".sidebar-right" ng-if="vm.view.type=='default'" ng-show="vm.privilege.IsCreate"
                ui-sref=".edit({id:''})" ui-sref-opts="{location:true}">
                <i class="fa fa-plus"></i> 新建
            </button>
            <button class="btn btn-link" ng-if="vm.view.type=='grid'" ng-click="vm.actions.showForm('')" ng-show="vm.privilege.IsCreate">
                <i class="fa fa-plus"></i> 新建
            </button>
            <button class="btn btn-link" ng-click="vm.actions.del()" ng-show="vm.privilege.IsDelete">
                <i class="fa fa-trash"></i> 删除
            </button>
            <button class="btn btn-link" ng-click="vm.actions.activate()" ng-show="vm.privilege.IsWrite">
                <i class="fa fa-check"></i> 激活
            </button>
            <button class="btn btn-link" ng-click="vm.actions.deactivate()" ng-show="vm.privilege.IsWrite">
                <i class="fa fa-ban"></i> 停用
            </button>
            <button class="btn btn-link" ng-disabled="false" ng-show="vm.privilege.IsWrite" ng-click='vm.actions.import({
                        Title:"部门投入费用",
                        ModuleName:"BusinessUnitExpenseImport",
                        EntityName:"businessunit_expense",
                        Columns:[
                            {ColumnName:"year",DisplayName:"年份*",IsRequired:true,IsKey:false},
                            {ColumnName:"month",DisplayName:"月份*",IsRequired:true,IsKey:false},
                            {ColumnName:"BusinessUnitId",DisplayName:"办事处*",IsRequired:true,IsKey:false},
                            {ColumnName:"expence_c",DisplayName:"费用类型C*",IsRequired:false,IsKey:false}
                        ]
                    })'>
                <i class="fa fa-upload"></i> 导入
            </button>
            <button class="btn btn-link" ng-show="vm.privilege.IsExport" ng-click='vm.actions.export({
                    "upload_ym":"统计年月",
                    "BusinessUnitIdName":"办事处",
                    "expence_c":"费用类型C"
                    })'>
                <i class="fa fa-download"></i> 导出
            </button>
        </div>
    </div>
</div>

<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.sDate" rt-type="month" rt-title="开始年月" rt-col="3" rt-label-col="2"></rt-datetime>
                <rt-datetime ng-model="vm.eDate" rt-type="month" rt-title="结束年月" rt-col="3" rt-label-col="2"></rt-datetime>
                <div class="col-sm-1">
                    <button class="btn btn-primary" ng-click="vm.view.search(1)">查询</button>
                </div>
            </div>
            <div class="form-group">
                <rt-picklist rt-title="状态" rt-col="3" ng-model="vm.stateSelected" rt-options="vm.picklist.StateCode"></rt-picklist>
            </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-condensed table-hover">
                    <thead>
                        <tr>
                            <th>
                                <rt-header-checkbox></rt-header-checkbox>
                            </th>
                            <th>统计年月</th>
                            <th>办事处</th>
                            <th>费用类型C</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-repeat="row in vm.data track by row.Id">
                            <td>
                                <rt-data-checkbox value="{{row.Id}}" />
                            </td>
                            <!-- @@ 视图列表值 -->
                            <td ng-if="vm.view.type=='default'">
                                <a id="{{row.Id}}" data-toggle="sidebar" data-target=".sidebar-right" ui-sref=".edit({id:row.Id})" ui-sref-opts="{location:true}">{{row.year}}-{{row.month}}</a>
                            </td>
                            <td ng-if="vm.view.type=='grid'">
                                <a href="javascript:;" ng-click="vm.actions.showForm(row.Id)">{{row.year}}-{{row.month}}</a>
                            </td>
                            <td>
                                {{ row.BusinessUnitId.Name}}
                            </td>
                            <td>
                                {{ row.expence_c}}
                            </td>
                        </tr>
                    </tbody>
                </table>
            </rt-data-grid>
        </div>
    </div>
</div>

<div class="sidebar sidebar-right sidebar-animate rt-shadow-border-left content-wrapper" ng-if="vm.view.type=='default'">
    <div ui-view class="content"></div>
</div>