<div class="row rt-margin-bottom-before-box">
    <div class="col-sm-8">
        <div class="btn-group">
            <button class="btn btn-link"  ng-show="vm.privilege.IsExport" ng-click='vm.actions.export({
                            "ddm_raw_typeName":"来源",
                            "fromaccountidName":"上游企业名称",
                            "business_unit_idName":"上游部门",
                            "from_owneridName":"上游代表",
                            "saleto_entname":"下游企业名称",
                            "toaccountidName":"下游企业标准名",
                            "saleto_business_unit_idName":"下游部门",
                            "to_owneridName":"下游代表",
                            "drugidName": "药品标准名",
                            "lotno":"药品批号",
                            "billdate":"销售日期",
                            "saleto_price":"销售价格",
                            "saleto_count":"销售数量"
                            },"DrugflowConfirmExport","流向审核数据")' >
                <i class="fa fa-download"></i> 导出
            </button>
        </div>
    </div>
    <div class="col-sm-4">
    </div>
</div>

<div class="box box-primary">
    <div  class="box box-widget">
        <!-- form start -->
        <form class="form-horizontal">
            <div class="box-body">
                <div class="form-group">
                   <rt-datetime ng-model="vm.startDate" rt-type="month" rt-title="年月" rt-required="true" rt-col="3" rt-label-col="2"></rt-datetime>
                    <label class="col-sm-2 control-label">流向状态</label>
                    <div class="col-sm-3">
                        <ui-select allow-clear ng-model="vm.selectedCheck" theme="bootstrap">
                            <ui-select-match>{{$select.selected.Name}}</ui-select-match>
                            <ui-select-choices repeat="item in vm.CheckList | filter: $select.search">
                                <span ng-bind-html="item.Name| highlight: $select.search"></span>
                            </ui-select-choices>
                        </ui-select>
                    </div>
                    <div class="btn-group" class="col-sm-2">
                        <button class="btn btn-primary" ng-click="vm.view.search(1)">查询</button>
                        <button class="btn btn-warning" style="margin-left:15px;" ng-click="vm.actions.approve();">审核确认</button>
                    </div>
                </div>
                <div class="form-group">
                    <rt-lookup2 rt-title="部门" ng-model="vm.toBuSelected" rt-get-data-name="TblBusinessUnit.BusinessUnitId" rt-order-by="code" rt-col-list="[{Code:'name',Name:'部门名称'},{Code:'code',Name:'部门编码'}]"  
                    rt-label-col="2" rt-col="3"></rt-lookup2>
                    <rt-lookup2 rt-title="销售代表"  ng-model="vm.toOwnerId" rt-get-data-name="UserInfo.GetUserByBu" rt-order-by="code" rt-col-list="[{Code:'name',Name:'下游代表名称'},{Code:'code',Name:'下游代表编码'}]" rt-params="{'@businessunitid':vm.toBuSelected ? vm.toBuSelected.Id :''}"
                    rt-label-col="2" rt-col="3"></rt-lookup2>
                </div>
            </div>
        </form>
    </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-hover">
                <thead>
                    <tr>
                        <th>状态</th>
                        <th>来源</th>
                        <th>上游企业名称</th>
                        <th>上游部门</th>
                        <th>上游代表</th>
                        <th>下游企业名称</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.ddm_raw_dataId">
                        <!-- @@ 视图列表值 -->
                        <td> {{row.ddm_data_statusName }} </td>
                        <td> {{row.ddm_raw_typeName}} </td>
                        <td> {{row.fromaccountidName}}</td>
                        <td> {{row.business_unit_idName}}</td>
                        <td> {{row.from_owneridName}}</td>
                        <td> {{row.saleto_entname}}</td>
                        <td> {{row.toaccountidName}}</td>
                        <td> {{row.saleto_business_unit_idName}}</td>
                        <td> {{row.to_owneridName}}</td>
                        <td> {{row.drugidName}}</td>
                        <td> {{row.lotno}}</td>
                        <td> {{row.billdate | date:'yyyy-MM-dd'}}</td>
                        <td> {{row.saleto_price}}</td>
                        <td> {{row.saleto_count}}</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] -->