<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 dropdown-toggle" id="dropdownMenuImportSelect" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
                ng-show="vm.privilege.IsWrite">
                <i class="fa fa-upload"></i>导入
                <span class="caret"></span>
            </button>
            <ul class="dropdown-menu" aria-labelledby="dropdownMenuImportSelect" ng-show="vm.privilege.IsWrite">
                <li>
                    <a href="javascript:void(0)" ng-click='vm.actions.import({
                    Title:"流向数据-导入(按年月锁定)",
                    ModuleName:"DrugFlowImportLockImport",
                    EntityName:"drug_flow_import_lock",
                    Extra:"1",
                    Columns:[                        
                        {ColumnName:"lock_year",DisplayName:"锁定年份*",IsRequired:true,IsKey:true},
                        {ColumnName:"lock_month",DisplayName:"锁定月份*",IsRequired:true,IsKey:true},
                    ]
                })'>
                        <i class="fa fa-upload"></i>导入(按年月锁定)</a>
                </li>
                <li>
                    <a href="javascript:void(0)" ng-click='vm.actions.import({                    
                    Title:"流向数据-导入(按年月+部门锁定)",
                    ModuleName:"DrugFlowImportLockImport",
                    EntityName:"drug_flow_import_lock",
                    Extra:"2",
                    Columns:[ 
                        {ColumnName:"lock_year",DisplayName:"锁定年份*",IsRequired:true,IsKey:true},
                        {ColumnName:"lock_month",DisplayName:"锁定月份*",IsRequired:true,IsKey:true},
                        {ColumnName:"lock_businessunitidName",DisplayName:"锁定部门*",IsRequired:true,IsKey:true}
                    ]
                })'>
                        <i class="fa fa-upload"></i>导入(按年月+部门锁定)</a>
                </li>
                <li>
                    <a href="javascript:void(0)" ng-click='vm.actions.import({
                    Title:"流向数据-导入(按年月+部门+商业锁定)",
                    ModuleName:"DrugFlowImportLockImport",
                    EntityName:"drug_flow_import_lock",
                    Extra:"3",
                    Columns:[
                        {ColumnName:"lock_year",DisplayName:"锁定年份*",IsRequired:true,IsKey:true},
                        {ColumnName:"lock_month",DisplayName:"锁定月份*",IsRequired:true,IsKey:true},
                        {ColumnName:"lock_businessunitidName",DisplayName:"锁定部门*",IsRequired:true,IsKey:true},
                        {ColumnName:"lock_accountidName",DisplayName:"锁定商业*",IsRequired:true,IsKey:true}
                    ]
                })'>
                        <i class="fa fa-upload"></i>导入(按年月+部门+商业锁定)</a>
                </li>
            </ul>
        </div>
    </div>
    <div class="col-sm-4">
        <form class="input-group">
            <input type="search" placeholder="输入部门名称或商业名称快速搜索..." class="form-control" ng-model="vm.view.searchText" />
            <span class="input-group-btn" ng-click="vm.view.search(1)">
                <button type="submit" class="btn btn-default">
                    <i class="fa fa-search"></i>
                </button>
            </span>
        </form>
    </div>
</div>

<div class="box box-primary">
    <div class="box-header with-border" style="cursor: move;">
        <div class="pull-left">
            <div class="btn-group">
                <button class="btn btn-default dropdown-toggle" id="dropdownMenuViewSelect" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    {{vm.view.selectedView.ViewName}}
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" aria-labelledby="dropdownMenuViewSelect">
                    <li ng-repeat="view in vm.view.list track by view.Id" ng-click="vm.view.select(view)">
                        <a href="javascript:void(0)">{{view.ViewName}}</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <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 rt-field-code="lock_typeName">锁定类型</th>
                            <th rt-field-code="lock_year_month">锁定年月</th>
                            <th rt-field-code="lock_businessunitidName">锁定部门</th>
                            <th rt-field-code="lock_accountidName">锁定商业</th>
                            <th>创建时间</th>
                            <th>创建人</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}">查看</a>
                            </td>
                            <td ng-if="vm.view.type=='grid'">
                                <a href="javascript:;" ng-click="vm.actions.showForm(row.Id)">查看</a>
                            </td>
                            <td>{{row.lock_type.Name}}</td>
                            <td>{{row.lock_year_month}}</td>
                            <td>{{row.lock_businessunitid.Name}}</td>
                            <td>{{row.lock_accountid.Name}}</td>
                            <td>{{row.CreatedOn | date:'yyyy-MM-dd HH:mm'}}</td>
                            <td>{{row.CreatedBy.Name}}</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>
<!-- div[.editview] -->