<!--<style>
    .form-group .control-label {
        font-weight: 500;
        color: #555;
    }

    #rt-report-header th {
        text-align: center;
        vertical-align: inherit;
        border: 1px solid #f0f0f0;
        color: #555;
        font-weight: 500;
    }

    #rt-report-header tr, td {
        text-align: center;
        vertical-align: inherit;
        border: 1px solid #f0f0f0;
        color: #555;
        font-weight: 500;
    }
</style>-->
<form class="form-horizontal">
    <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>
        <div class="col-sm-1">
            <button class="btn btn-primary" ng-click="vm.showReportButton()">查询</button>
        </div>
        <div class="col-sm-1">
            <button class="btn btn-primary" ng-show="vm.privilege.IsExport" ng-click='vm.actions.export({
                        "buidName":"事业部",
                        "bigdeptidName":"大区",
                        "BusinessUnitIdName":"省区/地区",
                        "OwnerIdName":"招商经理",
                        "provinceidName":"省",
                        "cityidName":"市",
                        "countyidName":"县",
                        "name":"代理商",
                        "Contact_name":"联系人", 
                        "telephone":"联系电话", 
                        "alloc_or_distName":"调拨/配送",
                        "New_or_normalName":"新药/普药",	
                        "Sales_total_qty":"同类药品销售总量",	
                        "Sales_Good_AtName":"优势销售区域",
                        "Sales_PotentialName":"销售潜力",
                        "Cooperate_IntentName":"合作意向"
                        },"LeadsReportExport","潜在代理商创建明细")'>导出
            </button>
        </div>
        <div class="col-sm-1">
            <button class="btn btn-clear btn-small" ng-click="vm.isShowMoreSearch=!vm.isShowMoreSearch;complateTableheight();">
                    <i ng-if="!vm.isShowMoreSearch" class="fa fa-angle-double-down" style="color:#0099ff;" title="更多查询条件"></i>
<i ng-if="vm.isShowMoreSearch" class="fa fa-angle-double-up" style="color:#0099ff;" title="隐藏"></i>
</button>
</div>
</div>

<div class="form-group" ng-hide="!vm.isShowMoreSearch">
    <label class="col-sm-2 control-label">事业部</label>
    <div class="col-sm-3">
        <ui-select allow-clear ng-model="vm.buidSelected" theme="bootstrap">
            <ui-select-match>{{ $select.selected.name }}</ui-select-match>
            <ui-select-choices repeat="item in vm.buidList|filter:$select.search">
                <span ng-bind-html="item.name | highlight: $select.search"></span>
            </ui-select-choices>
        </ui-select>
    </div>
    <label class="col-sm-2 control-label">业务线/大区</label>
    <div class="col-sm-3">
        <ui-select allow-clear ng-model="vm.bigDepSelected" theme="bootstrap">
            <ui-select-match>{{ $select.selected.name }}</ui-select-match>
            <ui-select-choices repeat="item in vm.bigDepList |filter:$select.search">
                <span ng-bind-html="item.name | highlight: $select.search"></span>
            </ui-select-choices>
        </ui-select>
    </div>
</div>
<div class="form-group" ng-hide="!vm.isShowMoreSearch">
    <label class="col-sm-2 control-label">省区/地区</label>
    <div class="col-sm-8">
        <ui-select class="form" multiple allow-clear sortable="true" theme="bootstrap" close-on-select="false" ng-model="vm.businessUnitSelected">
            <ui-select-match>{{$item.name}}</ui-select-match>
            <ui-select-choices repeat="item in vm.businessUnitList | filter: {name: $select.search}">
                <span ng-bind-html="item.name | highlight: $select.search"></span>
            </ui-select-choices>
        </ui-select>
    </div>
</div>
</form>
<div class="row" style="border-top: 1px dotted #d5c4c4; padding-top: 20px">

<div class="col-sm-30">
    <rt-data-grid rt-page-record-count="vm.recordCount" rt-get-data="vm.showReport()" rt-page-index="vm.index" rt-page-size="vm.pageSize" rt-rows="vm.reportData">
        <table class="table table-hover" style="white-space:nowrap;" id="rt-report-header">
<thead>
    <tr id="rt-report-header">
        <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-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>
    </tr>
</thead>
<tbody>
    <tr ng-repeat="row in vm.reportData">
        <!-- 判断数据为空时，将数据设置为“-” -->
        <td class="rt-text-align">
            {{row.buidName == null ? "-" : row.buidName}}
        </td>
        <td class="rt-text-align">
            {{row.bigdeptidName == null ? "-" : row.bigdeptidName}}
        </td>
        <td class="rt-text-align">
            {{row.BusinessUnitIdName == null ? "-" : row.BusinessUnitIdName}}
        </td>
        <td class="rt-text-align">
            {{row.OwnerIdName == null ? "-" : row.OwnerIdName}}
        </td>
        <td class="rt-text-align">{{row.provinceidName}}{{row.cityidName}}{{row.countyidName == null ? "" : row.countyidName}}</td>
        <td class="rt-text-align">{{row.name == null ? "-" : row.name}}</td>
        <td class="rt-text-align">{{row.Contact_name == null ? "-" : row.Contact_name}}</td>
        <td class="rt-text-align">{{row.telephone == null ? "-" : row.telephone}}</td>
        <td class="rt-text-align">{{row.alloc_or_distName == null ? "-" : row.alloc_or_distName}}</td>
        <td class="rt-text-align">{{row.New_or_normalName == null ? "-" : row.New_or_normalName}}</td>
        <td class="rt-text-align">{{row.Sales_total_qty == null ? "-" : row.Sales_total_qty}}</td>
        <td class="rt-text-align">{{row.Sales_Good_AtName == null ? "-" : row.Sales_Good_AtName}}</td>
        <td class="rt-text-align">{{row.Sales_PotentialName == null ? "-" : row.Sales_PotentialName}}</td>
        <td class="rt-text-align">{{row.Cooperate_IntentName == null ? "-" : row.Cooperate_IntentName}}</td>
    </tr>
</tbody>
</table>
</rt-data-grid>
</div>
</div>