<div class="box box-primary">
    <div class="box-header with-border">
        <h3 class="box-title">筛选</h3>
        <div class="box-tools pull-right">
            <button type="button" class="btn btn-box-tool" data-widget="collapse">
                <i class="fa fa-minus"></i>
            </button>
        </div>
    </div>
    <form class="form-horizontal">
        <div class="box-body">
           
            <div class="form-group">
                <rt-bu-tree-lookup rt-title="区域" rt-multiple="true" ng-model="vm.nodeSelected" rt-col="8" rt-label-col="2"></rt-bu-tree-lookup>
            </div>

            <div class="form-group">
                <rt-lookup2 rt-title="品种" ng-model="vm.salesRegionProductCategory" rt-get-data-name="Product.GetProductSize" rt-order-by="code"
                    rt-col-list="[{Code:'name',Name:'品种名称'},{Code:'size',Name:'品种规格'}]" rt-required="false" rt-col="4" rt-multiple="true"></rt-lookup2>
            </div>

            <div class="form-group">
                <rt-lookup2 rt-title="门店" ng-model="vm.accountSeleted" rt-get-data-name="Account.GetAllRetail" rt-order-by="name asc" rt-col-list="[{Code:'name',Name:'门店名称'},{Code:'accountnumber',Name:'门店编号'}]"
                    rt-required="false" rt-col="8" rt-label-col="2"></rt-lookup2>

            </div>
        </div>

        <div class="box-footer" ng-if="vm.hasBarCode==='false'">
            <div class="btn-group pull-right">
                <button class="btn btn-primary" ng-click="vm.getReportData()">查询</button>
                <button class="btn btn-default" ng-click='vm.actions.export({
                        "BusinessUnitIdName":"区域",
                        "accountIdName":"门店",
                        "productIdName":"品种",
                        "productSize":"规格",
                        "qty":"库存数量"
                    },"DTPStockExport","DTP库存查询-药品库存")'>导出</button>
            </div>
        </div>

        <div class="box-footer" ng-if="vm.hasBarCode==='true'">
            <div class="btn-group pull-right">
                <button class="btn btn-primary" ng-click="vm.getReportData()">查询</button>
                <button class="btn btn-default" ng-click='vm.actions.export({
                        "BusinessUnitIdName":"区域",
                        "accountIdName":"门店",
                        "productIdName":"品种",
                        "productSize":"规格",
                        "code":"条码",                        
                        "qty":"库存数量"
                    },"DTPStockExport","DTP库存查询-库存条码清单")'>导出</button>
            </div>
        </div>
    </form>
</div>

<div class="box box-primary">
    <div class="box box-body">
        <ul class="nav nav-tabs">
            <li class="active" ng-click="selectTab('tab1')">
                <a href="#c1" onclick="return false;" data-toggle="tab">药品库存</a>
            </li>
            <li ng-click="selectTab('tab2')">
                <a href="#c2" onclick="return false;" data-toggle="tab">库存条码清单</a>
            </li>
        </ul>
        <rt-data-grid rt-page-record-count="vm.recordCount" rt-page-index="vm.pageIndex" rt-page-size="vm.pageSize" rt-get-data="vm.getReportData()"
            rt-rows="vm.reportData" rt-auto-height="{{tableMaxHeight}} ">
            <table class="table table-condensed table-hover ng-scope" style="white-space:nowrap;" id="rt-report-header">
                <thead>
                    <tr>
                        <th rowspan="2" class="rt-text-align">区域</th>
                        <th rowspan="2" class="rt-text-align">门店</th>
                        <th rowspan="2" class="rt-text-align">品种</th>
                        <th rowspan="2" class="rt-text-align">规格</th>
                        <th rowspan="2" class="rt-text-align" ng-if="vm.hasBarCode==='true'">条码</th>
                        <th rowspan="2" class="rt-number-align">库存数量</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="row in vm.reportData">
                        <td class="rt-text-align">{{row.BusinessUnitIdName}}</td>
                        <td class="rt-text-align">{{row.accountIdName}}</td>
                        <td class="rt-text-align">{{row.productIdName}}</td>
                        <td class="rt-text-align">{{row.productSize}}</td>
                        <th class="rt-text-align" ng-if="vm.hasBarCode==='true'">{{row.code}}</th>
                        <td class="rt-number-align">{{row.qty}}</td>
                    </tr>
                </tbody>
            </table>
        </rt-data-grid>
    </div>
</div>