<style>
    .form-group .control-label {
        font-weight: 500;
        color: #555;
    }
    
    #rt-report-header > thead > tr >th {
        text-align: center;
        vertical-align: inherit;
        border: 1px solid #f0f0f0;
        color: #555;
        font-weight: 500;
        white-space: nowrap;
    }
    
    #rt-report-header > tbody > tr >td {
        text-align: center;
        vertical-align: inherit;
        border: 1px solid #f0f0f0;
        color: #555;
        font-weight: 500;
        white-space: nowrap;
    }
</style>
<div class="row">
    <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>
        <div class="form-group">
            <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 class="col-sm-1">
                <button class="btn btn-primary" ng-click="vm.search()">查询</button>
            </div>
        </div>
        <div class="form-group">
            <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>
<div class="row">
    <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;" id="rt-report-header">
            <thead>
                <tr>
                    <th rowspan="4">
                        事业部
                    </th>
                    <th rowspan="4">
                        大区
                    </th>
                    <th rowspan="4">
                        地区
                    </th>
                    <th rowspan="4">
                        代表
                    </th>
                    <th rowspan="4">
                        门店
                    </th>
                    <th rowspan="3">
                        拜访日期
                    </th>
                    <th rowspan="3">
                        促销活动
                    </th>
                    <th rowspan="4">
                        堆头照片
                    </th>
                    <th rowspan="4">
                        端架照片
                    </th>
                    <th rowspan="4">
                        促销人员照片
                    </th>
                    <th rowspan="4">
                        POP照片
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="row in vm.data ">
                    <td>{{row.buidName}}</td>
                    <td>{{row.bigdeptidName}}</td>
                    <td>{{row.BusinessUnitIdName}}</td>
                    <td>{{row.UserName}}</td>
                    <td>{{row.accountidName}}</td>
                    <td>{{row.end_time|date:'yyyy-MM-dd'}}</td>
                    <td>{{row.name}}</td>
                    <td>
                        <a ng-if="row.photo1!=0" href="javascript:;" ng-click="vm.actions.showImage(row.photo_01_objectid)">{{row.photo1}}</a>
                        <span ng-if="row.photo1==0">-</span>
                    </td>
                    <td>
                        <a ng-if="row.photo2!=0" href="javascript:;" ng-click="vm.actions.showImage(row.photo_02_objectid)">{{row.photo2}}</a>
                        <span ng-if="row.photo2==0">-</span>
                    </td>
                    <td>
                        <a ng-if="row.photo3!=0" href="javascript:;" ng-click="vm.actions.showImage(row.photo_03_objectid)">{{row.photo3}}</a>
                        <span ng-if="row.photo3==0">-</span>
                    </td>
                    <td>
                        <a ng-if="row.photo4!=0" href="javascript:;" ng-click="vm.actions.showImage(row.photo_04_objectid)">{{row.photo4}}</a>
                        <span ng-if="row.photo4==0">-</span>
                    </td>
                </tr>
            </tbody>
        </table>
    </rt-data-grid>
</div>