<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:"DdmAdjDataImport",
                            EntityName:"ddm_adj_data",
                            Columns:[
                                {ColumnName:"adj_year",DisplayName:"调整年份*",IsRequired:true,IsKey:false},
                                {ColumnName:"adj_month",DisplayName:"调整月份*",IsRequired:true,IsKey:false},
                                {ColumnName:"from_accountid",DisplayName:"上游企业名称*",IsRequired:true,IsKey:false},
                                {ColumnName:"from_businessunitid",DisplayName:"上游部门*",IsRequired:true,IsKey:false},
                                {ColumnName:"from_ownerid",DisplayName:"上游负责人*",IsRequired:true,IsKey:false},
                                {ColumnName:"to_accountid",DisplayName:"下游企业标准名称*",IsRequired:true,IsKey:false},
                                {ColumnName:"to_account_classificationcode",DisplayName:"下游企业类型*",IsRequired:true,IsKey:false},
                                {ColumnName:"to_businessunitid",DisplayName:"下游部门*",IsRequired:true,IsKey:false},
                                {ColumnName:"to_ownerid",DisplayName:"下游负责人*",IsRequired:true,IsKey:false},
                                {ColumnName:"productid",DisplayName:"标准药品名称*",IsRequired:true,IsKey:false},
                                {ColumnName:"productsize",DisplayName:"标准药品规格",IsRequired:true,IsKey:false},
                                {ColumnName:"saleto_date",DisplayName:"销售日期*",IsRequired:true,IsKey:false},
                                {ColumnName:"saleto_price",DisplayName:"销售价格*",IsRequired:true,IsKey:false},
                                {ColumnName:"saleto_qty",DisplayName:"销售数量*",IsRequired:true,IsKey:false},
                                {ColumnName:"remark",DisplayName:"备注",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({
                        "adj_year":"调整年份",
                        "adj_month":"调整月份",
                        "from_accountidName":"上游企业名称",
                        "from_businessunitidName":"上游部门",
                        "from_owneridName":"上游负责人",
                        "to_accountidName":"下游企业标准名称",
                        "to_account_classificationcodeName":"下游企业类型",
                        "to_businessunitidName":"下游部门",
                        "to_owneridName":"下游负责人",
                        "productidName":"标准药品名称",
                        "productsize":"标准药品规格",
                        "saleto_date":"销售日期",
                        "saleto_price":"销售价格",
                        "saleto_qty":"销售数量",
                        "remark":"备注"
                        })'>
                <i class="fa fa-download"></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="box-header" 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="adj_year_month">调整年月</th>
                        <th rt-field-code="from_accountidName">上游企业名称</th>
                        <th>上游部门</th>
                        <th>上游负责人</th>
                        <th>下游企业标准名称</th>
                        <th>下游企业类型</th>
                        <th>下游部门</th>
                        <th>下游负责人</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.adj_year}}-{{row.adj_month}}
                        </td>
                        <td>
                            {{row.from_accountidName}}
                        </td>
                        <td>
                            {{row.from_businessunitidName}}
                        </td>
                        <td>
                            {{row.from_owneridName}}
                        </td>
                        <td>
                            {{row.to_accountidName}}
                        </td>
                        <td>
                            {{row.to_account_classificationcodeName}}
                        </td>
                        <td>
                            {{row.to_businessunitidName}}
                        </td>
                        <td>
                            {{row.to_owneridName}}
                        </td>
                        <td>
                            {{row.productidName}}
                        </td>
                        <td>
                            {{row.ddm_data_statusName}}
                        </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] -->