<div class="row rt-margin-bottom-before-box">
	<div class="col-sm-8">
	</div>
    <div class="col-sm-4">
    </div>
</div>
    <div class="box box-primary" style="width: 20%;float:left;">
        <div class="btn-group" style="padding:10px;">
            <button class="btn btn-link" 
                    data-toggle="sidebar"
                    data-target=".sidebar-right" 
                    ng-if="vm.view.type=='default'" 
                    ng-show="vm.privilege.IsCreate"
                    ng-click="vm.categoryeditclick()"
                    ui-sref=".editcategory({id:'',hasChildren:''})" 
                    ui-sref-opts="{location:true}">
                <i class="fa fa-plus"></i> 
            </button>
            <button class="btn btn-link" 
                    style="margin-left: 30px;" 
                    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" 
                    data-toggle="sidebar"
                    data-target=".sidebar-right" 
                    ng-if="vm.view.type=='default'" 
                    ng-show="vm.privilege.IsCreate"
                    ng-click="vm.categoryeditclick()"
                    ng-disabled="mytree.currentNode.Id === undefined"
                    ui-sref=".editcategory({ id : mytree.currentNode.Id , hasChildren : vm.hasChildren })" 
                    ui-sref-opts="{location:true}">
                <i class="fa fa-pencil-square-o"></i> 
            </button>
            <button class="btn btn-link" 
                    style="margin-left: 30px;" 
                    ng-if="vm.view.type=='grid'" 
                    ng-click="vm.actions.showForm('')" 
                    ng-show="vm.privilege.IsCreate">
                <i class="fa fa-pencil-square-o"></i> 
            </button>
            <button class="btn btn-link" 
                    style="margin-left: 5px;" 
                    ng-click="vm.delCategory(mytree.currentNode)" 
                    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:"ProductCategoryImport",
                        EntityName:"product_category",
                        Columns:[
                            {ColumnName:"code",DisplayName:"品种编码*",IsRequired:true,IsKey:true},
                            {ColumnName:"name",DisplayName:"品种名称*",IsRequired:true,IsKey:false},
                            {ColumnName:"superior",DisplayName:"上级品种*",IsRequired:true,IsKey:false},
                            {ColumnName:"remarks",DisplayName:"备注",IsRequired:false,IsKey:false}
                        ]
                        })'>
                <i class="fa fa-upload"></i> 
            </button>
        </div>
        <div class="box-header" style="cursor: move;">
            <div class="pull-left">
                <div class="btn-group">
                    <button ng-click="selectedViewClick()" 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 id="productCategoryTree"
                style="max-height:{{vm.view.autoHeight*0.8}}px; width:100%; overflow:auto;float: left;padding-right: 10px;padding-bottom: 15px;" 
                data-angular-treeview="true"
                data-tree-id="mytree" 
                data-tree-model="roleList" 
                data-node-id="Id" 
                data-node-label="Name" 
                data-node-children="Children"
                ng-dblclick="vm.mytreedbclick()">
            </div>
        </div>
    </div>
    <div class="box box-primary" style="width: 79%;float: right;">
        <div class="box-header" style="cursor: move;padding:10px;">
            <div class="btn-group col-sm-8">
                <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=".editproduct({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" style="margin-left: 5px;" ng-click="vm.delProductsByIds()" 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:"ProductImport",
                            EntityName:"product",
                            Columns:[
                                {ColumnName:"code",DisplayName:"编码*",IsRequired:true,IsKey:true},
                                {ColumnName:"name",DisplayName:"名称*",IsRequired:true,IsKey:false},
                                {ColumnName:"common_name",DisplayName:"通用名称*",IsRequired:true,IsKey:false},
                                {ColumnName:"productsize",DisplayName:"规格*",IsRequired:true,IsKey:false},
                                {ColumnName:"product_categoryid",DisplayName:"品种*",IsRequired:true,IsKey:false},
                                {ColumnName:"dosage",DisplayName:"药品剂量",IsRequired:false,IsKey:false},
                                {ColumnName:"prepn_type",DisplayName:"药品剂型*",IsRequired:true,IsKey:false},
                                {ColumnName:"english_name",DisplayName:"英文名",IsRequired:false,IsKey:false},
                                {ColumnName:"chemical_name",DisplayName:"化学名",IsRequired:false,IsKey:false},
                                {ColumnName:"ratio",DisplayName:"转换系数",IsRequired:false,IsKey:false}
                            ]
                            })'>
                    <i class="fa fa-upload"></i> 导入规格
                </button>
            </div>
            <form class="input-group">
                <input type="search" placeholder="输入品种名称或规格名称、编码快速搜索..." class="form-control" ng-model="vm.view.searchText" />
                <span class="input-group-btn" ng-click="vm.searchClick()">
                        <button type="submit" class="btn btn-default">
                            <i class="fa fa-search"></i>
                        </button>
                    </span>
            </form>
        </div>
        <div class="nav-tabs-custom">
            <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="name">名称</th>
                            <th rt-field-code="code">编码</th>
                            <th rt-field-code="common_name">通用名称</th>
                            <th rt-field-code="product_categoryid">品种</th>
                            <th rt-field-code="productsize">规格</th>
                            <th rt-field-code="prepn_type">药品剂型</th>
                            <th rt-field-code="dosage">药品剂量</th>
                            <th rt-field-code="uomid">计算单位</th>
                            <th rt-field-code="english_name">英文名</th>
                            <th rt-field-code="chemical_name">化学名</th>
                            <th rt-field-code="ratio">转换系数</th>
                            <th rt-field-code="StateCode">状态</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=".editproduct({id:row.Id})" ui-sref-opts="{location:true}">{{row.name}}</a>
                            </td>
                            <td ng-if="vm.view.type=='grid'">
                                <a href="javascript:;" ng-click="vm.actions.showForm(row.Id)">{{row.name}}</a>
                            </td>
                            <td>
                                {{row.code}}
                            </td>
                            <td>
                                {{row.common_name}}
                            </td>
                            <td>
                                {{row.product_categoryid.Name}}
                            </td>
                            <td>
                                {{row.productsize}}
                            </td>
                            <td>
                                {{row.prepn_type.Name}}
                            </td>
                            <td>
                                {{row.dosage}}
                            </td>
                            <td>
                                {{row.uomid.Name}}
                            </td>
                            <td>
                                {{row.english_name}}
                            </td>
                            <td>
                                {{row.chemical_name}}
                            </td>
                            <td>
                                {{row.ratio}}
                            </td>
                            <td>
                                {{row.StateCode.Name}}
                            </td>
                        </tr>
                    </tbody>
                </table>
            </rt-data-grid>
            <!-- rt-data-grid  -->
        </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] -->