<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-disabled="false" ng-show="vm.privilege.IsWrite" ng-click='vm.actions.import({
                    Title:"产品箱毛利",
                    ModuleName:"ProductBoxProfitImport",
                    EntityName:"product_box_profit",
                    Columns:[
                        {ColumnName:"productidName",DisplayName:"药品名称*",IsRequired:true,IsKey:true},
                        {ColumnName:"productsize",DisplayName:"规格*",IsRequired:true,IsKey:true},
                        {ColumnName:"box_size",DisplayName:"箱盒数*",IsRequired:true,IsKey:false},
                        {ColumnName:"box_profit",DisplayName:"箱毛利*",IsRequired:true,IsKey:false},
                        {ColumnName:"description",DisplayName:"说明",IsRequired:false,IsKey:false} 
                    ]
                })'>
                <i class="fa fa-upload"></i> 导入
            </button>
        </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="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 rt-field-code="productidName">药品名称</th>
                            <th rt-field-code="productsize">规格</th>
                            <th rt-field-code="box_size">箱盒数</th>
                            <th rt-field-code="box_profit">箱毛利</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.productid.Name}}</a>
                            </td>
                            <td ng-if="vm.view.type=='grid'">
                                <a href="javascript:;" ng-click="vm.actions.showForm(row.Id)">{{row.productid.Name}}</a>
                            </td>
                            <td>
                                {{row.productsize}}
                            </td>
                            <td>
                                {{row.box_size}}
                            </td>
                            <td>
                                {{row.box_profit}}
                            </td>
                        </tr>
                    </tbody>
                </table>
            </rt-data-grid>
            <!-- 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] -->