<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.actions.ddmMatchingAccount()" >
                <i class="fa fa-exchange"></i> 开始进行别名匹配
            </button>
        </div>
    </div>
    <div class="col-sm-4">
    </div>
</div>

<div class="box box-primary">
    <div class="box-header with-border" style="cursor: move;">
        <div class="pull-left">
            <div class="btn-group">
               <button class="btn btn-default dropdown-toggle" id="dropdownMenuBuSelect" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
					{{vm.matchingType.name}}
					<span class="caret"></span>
				</button>
                <ul class="dropdown-menu" aria-labelledby="dropdownMenuBuSelect">
                    <li ng-repeat="item in vm.typeFilter" ng-click="vm.matchingType = item;vm.view.search(1);">
                        <a href="javascript:void(0)">{{item.name}}</a>
                    </li>
                </ul>
            </div>

            <button class="btn btn-default" ng-class="{true:'active',false:'inactive'}[vm.view.isShowSearchList]" ng-click="vm.view.isShowSearchList = !vm.view.isShowSearchList;overHeightTable();">
                <i class="fa fa-filter"></i> 更多筛选 <i class="fa fa-angle-double-down"></i>
            </button>
        </div>
    </div>
    <div ng-show="vm.view.isShowSearchList" 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.Ym" rt-type="month" rt-title="年月" rt-required="true" rt-col="3" rt-label-col="2"></rt-datetime>
                    <rt-lookup2 rt-title="部门" ng-model="vm.unitSelected" 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.busiSelected" 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}}">
            <table class="table table-hover ">
                <thead id="headCode">
                    <tr>
                        <th class="rt-text-align">上游企业名称</th>
                        <th class="rt-text-align">下游企业名称</th>
                        <th class="rt-text-align">下游企业标准名</th>
                        <th class="rt-text-align">下游企业类型</th>
                        <th class="rt-text-align">药品名称</th>
                        <th class="rt-text-align">药品规格</th>
                        <th class="rt-text-align">药品标准名</th>
                        <th class="rt-text-align">药品批号</th>
                        <th class="rt-datetime-align">销售日期</th>
                        <th class="rt-number-align">销售价格</th>
                        <th class="rt-number-align">销售数量</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="row in vm.data track by row.Id">
                        <td class="rt-text-align">{{row.from_accountidName}}</td>
                        <td class="rt-text-align">{{row.to_account_alias_name }}</td>
                        <td class="rt-text-align">
                            <rt-lookup2-no-label ng-model="row.to_accountid" rt-get-data-name="Account.GetAccount" rt-order-by="name" rt-col-list="[{Code:'name',Name:'客户名称'},{Code:'accountnumber',Name:'客户编码'}]"
                                rt-col="18" style="width: 300px;"></rt-lookup2-no-label>
                        </td>
                        <td class="rt-text-align">{{row.to_account_classificationcodeName}}</td>
                        <td class="rt-text-align">{{row.product_alias_name}}</td>
                        <td class="rt-text-align">{{row.product_alias_size}}</td>
                        <td class="rt-text-align">{{row.productidName}}</td>
                        <td class="rt-text-align">{{row.product_lotno}}</td>
                        <td class="rt-datetime-align">{{row.saleto_date | date: 'yyyy-MM-dd'}}</td>
                        <td class="rt-number-align"><span ng-if="row.saleto_price">￥</span>{{row.saleto_price|toFixNumber:4}}</td>
                        <td class="rt-number-align">{{row.saleto_qty |number:2}}</td>
                    </tr>
                </tbody>
            </table>
        </rt-data-grid>
        </div>
    </div>
    <div style="border-top: 1px solid #f4f4f4;">
        <div ng-show="vm.isMatching">
            <div>
                <label style="white-space: pre-line;margin-left:1%;">
            完成别名匹配，还有<span style="color:red"> {{vm.unMatching}} </span>条产品未匹配别名，可以选择：
            1：忽略未匹配的数据，继续进行下一步
            2：在本界面上手工进行别名的匹配
            3：在《别名管理》功能里导入别名映射，然后重新匹配</label>
            </div>
            <button class="btn btn-primary" ng-click="vm.actions.updateAccount(vm.data)" style="margin-top: 10px;margin-left:1%;">修改客户标准名</button>
            <button class="btn btn-primary" ng-click="vm.actions.goCalAssignMent()" style="margin-top: 10px;margin-left: 3%;">下一步，进行流向归属匹配。</button>
        </div>
    </div>
</div>


