<style>
    .form-group .control-label {
        font-weight: 500;
        color: #555;
    }
</style>
<form class="form-horizontal">
    <div class="form-group">
        <rt-datetime ng-model="vm.eYm" rt-type="month" rt-title="年月" rt-required="true" rt-col="3" rt-label-col="2"></rt-datetime>
        <rt-input rt-type="Unsignedint" rt-required="true" rt-title="最近N个月未进货" rt-col="3" ng-model="vm.purchasingMonth"></rt-input>
        <div class="col-sm-1">
            <button class="btn btn-primary" ng-click="vm.search()">查询</button>
        </div>
        <div class="col-sm-1">
            <button ng-if="vm.entType==2" class="btn btn-primary" ng-click='vm.actions.export({
                        "entname":"医院名称",
                        "product_categoryidname":"品种",
                        "productsize":"规格",
                        "saleto_business_unit_idName":"销售区域",
                        "BusinessUnitOwnerIdName":"临床/基药经理",
                        "to_owneridName":"代表",
                        "saletocount":"当月销售"
                        },"NewLydevelopedhosExport","新开发医院分析报表")'>
                导出
            </button>
            <button ng-if="vm.entType==3" class="btn btn-primary" ng-click='vm.actions.export({
                        "entname":"门店名称",
                        "product_categoryidname":"品种",
                        "productsize":"规格",
                        "saleto_business_unit_idName":"销售区域",
                        "BusinessUnitOwnerIdName":"临床/基药经理",
                        "to_owneridName":"代表",
                        "saletocount":"当月销售"
                        },"NewLydevelopedhosExport","新开发门店分析报表")'>
                导出
            </button>
            <button ng-if="vm.entType==4" class="btn btn-primary" ng-click='vm.actions.export({
                        "entname":"基层医疗机构名称",
                        "product_categoryidname":"品种",
                        "productsize":"规格",
                        "saleto_business_unit_idName":"销售区域",
                        "BusinessUnitOwnerIdName":"临床/基药经理",
                        "to_owneridName":"代表",
                        "saletocount":"当月销售"
                        },"NewLydevelopedhosExport","新开发基层医疗机构分析报表")'>
                导出
            </button>
        </div>
    </div>

    <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.productSelected" rt-get-data-name="Product.GetProductSize" rt-order-by="name asc"
            rt-col-list="[{Code:'name',Name:'药品名称'},{Code:'code',Name:'编号'},{Code:'size',Name:'药品品规'}]" rt-multiple="true" rt-col="8"></rt-lookup2>
    </div>
</form>

<div class="row" style="border-top: 1px dotted #d5c4c4; padding-top: 20px">
    <rt-data-grid rt-page-record-count="vm.recordCount" rt-page-index="vm.pageIndex" rt-page-size="vm.pageSize" rt-get-data="vm.search()"
        rt-rows="vm.data" rt-auto-height="{{tableMaxHeight}} ">
        <table class="table table-condensed table-hover ng-scope" style="white-space: nowrap;">
            <thead>
                <tr id="rt-report-header">
                    <th class="rt-text-align">{{vm.moduleName}}名称</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-number-align">当月销量</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="row in vm.data">
                    <td class="rt-text-align">{{row.entname}}</td>
                    <td class="rt-text-align">{{row.product_categoryidname}}</td>
                    <td class="rt-text-align">{{row.productsize}}</td>
                    <td class="rt-text-align">{{row.saleto_business_unit_idName}}</td>
                    <td class="rt-text-align">{{row.BusinessUnitOwnerIdName}}</td>
                    <td class="rt-text-align">{{row.to_owneridName}}</td>
                    <td class="rt-number-align">{{row.saletocount}}</td>
                </tr>
            </tbody>
        </table>
    </rt-data-grid>
</div>