<div class="row rt-margin-bottom-before-box">
    <div class="col-sm-8">
        <div class="btn-group">
             <button class="btn btn-link"  ng-click='vm.goNext("ddmrawdataexcel")'>
                <i class="fa fa-upload"></i> 导入原始Excel流向
            </button>
            <button class="btn btn-link"  ng-click='vm.goNext("ddmcleandataproduct")'>
                <i class="fa fa-exchange"></i> 匹配流向别名
            </button>
            <button class="btn btn-link"  ng-click='vm.goNext("caldrugflowassignment")'>
                <i class="fa fa-exchange"></i> 匹配流向归属
            </button>
        </div>
    </div>
    <div class="col-sm-4">
    </div>
</div>

<div class="box box-primary">
    <div  class="box box-widget">
        <!-- /.box-header -->
        <!-- form start -->
        <form class="form-horizontal">
            <div class="box-body">
                <div class="form-group">
                    <rt-datetime ng-model="vm.importDate" rt-type="month" rt-title="年月" rt-required="true" rt-col="3" rt-label-col="2"></rt-datetime>
                    <rt-lookup2 rt-title="部门" ng-model="vm.fromBuSelected" 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>
                    <div class="btn-group" class="col-sm-2">
                        <button class="btn btn-primary" ng-click="vm.view.search(1)">查询</button>
                    </div>
                </div>
                <div class="form-group">
                    <rt-lookup2 rt-title="商业" ng-model="vm.fromAccSelected" rt-get-data-name="Account.GetAllBusiness" rt-order-by="accountnumber"
                        rt-col-list="[{Code:'name',Name:'客户名称'},{Code:'accountnumber',Name:'客户编码'}]" 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}}" style="padding-bottom: 50px;">
            <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>
                        <th>销售数量</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="row in vm.data track by row.ddm_clean_dataId">
                        <!-- @@ 视图列表值 -->
                        <td> {{row.import_businessunitidName}}</td>
                        <td> {{row.from_accountidName}}</td>
                        <td> {{row.from_businessunitidName}}</td>
                        <td> {{row.from_owneridName}}</td>
                        <td> {{row.to_account_alias_name}}</td>
                        <td> {{row.to_accountidName}}</td>
                        <td> {{row.to_businessunitidName}}</td>
                        <td> {{row.to_owneridName}}</td>
                        <td> {{row.product_alias_name}}</td>
                        <td> {{row.product_alias_size}}</td>
                        <td> {{row.productidName}}</td>
                        <td> {{row.product_lotno}}</td>
                        <td> {{row.saleto_date | date:'yyyy-MM-dd'}}</td>
                        <td> <span ng-if="row.saleto_price">￥</span>{{row.saleto_price | toFixNumber: 4 }}</td>
                        <td> {{row.saleto_qty | toFixNumber:2}}</td>
                    </tr>
                </tbody>
            </table>
        </rt-data-grid>
        </div>
    </div>
</div>
