<form class="form-horizontal">
    <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:'size',Name:'规格'},{Code:'code',Name:'产品编号'}]" rt-required="true" rt-col="3"
            rt-label-col="1"></rt-lookup2>

        <label class="col-sm-1 control-label">
            <span style="color:red;">*</span>省份</label>
        <div class="col-sm-3">
            <ui-select allow-clear ng-model="vm.provinceSelected" theme="bootstrap">
                <ui-select-match>{{$select.selected.NAME}}</ui-select-match>
                <ui-select-choices repeat="item in vm.provinceList | 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.showReport()">查询</button>
        </div>
    </div>
    <div class="form-group">
        <rt-datetime rt-type="month" ng-model="vm.startDate" rt-title="开始年月" rt-required="true" rt-label-col="1" rt-col="3"></rt-datetime>
        <rt-datetime rt-type="month" ng-model="vm.endDate" rt-title="结束年月" rt-required="true" rt-label-col="1" rt-col="3"></rt-datetime>
    </div>
</form>

<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>

<div class="tab-content">
    <div class="tab-pane active" id="c1">
        <div class="row" style="border-top: 1px dotted #d5c4c4; padding-top: 20px">
            <div class="col-sm-8">
                <div id="report1" style="height:800px;" ng-style="{ width: chartWidth + 'px' }" />
            </div>
            <div class="col-sm-3">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>城市</th>
                            <th>数量</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-repeat="row in vm.reportData.Grid1Data">
                            <td>
                                {{$index+1}}
                            </td>
                            <td>
                                {{row.ToCityName}}
                            </td>
                            <td>
                                {{row.SalesCount}}
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <div class="tab-pane" id="c2">
        <div class="row" style="border-top: 1px dotted #d5c4c4; padding-top: 20px">
            <div class="col-sm-8">
                <div id="report2" style="height:400px;" ng-style="{ width: chartWidth + 'px' }" />
            </div>

            <div class="col-sm-3">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>终端类型</th>
                            <th>数量</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-repeat="row in vm.reportData.Grid2Data">
                            <td>
                                {{$index+1}}
                            </td>
                            <td>
                                {{row.EntTypeName}}
                            </td>
                            <td>
                                {{row.SalesCount}}
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>