<form class="form-horizontal">
    <div class="form-group">
        <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.productSelected" theme="bootstrap">
                <ui-select-match>{{$select.selected.Name }}</ui-select-match>
                <ui-select-choices repeat="item in vm.productList | filter: $select.search">
                    <span ng-bind-html="item.Name| highlight: $select.search"></span>
                </ui-select-choices>
            </ui-select>
        </div>

        <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.showReportButton()">查询</button>
        </div>
    </div>
    <div class="form-group">
        <rt-datetime ng-model="vm.startDate"
                     rt-type="month"
                     rt-title="查询年月" rt-required="true" rt-col="3" rt-label-col="1"></rt-datetime>
    </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">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>发货企业名称</th>
                        <th>商业级别</th>
                        <th>所在省</th>
                        <th>所在市</th>
                        <th>所在县</th>
                        <th>收货企业名称</th>
                        <th>类型</th>
                        <th>所在省</th>
                        <th>所在市</th>
                        <th>所在县</th>
                        <th>生产批号</th>
                        <th>销量</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="row in vm.reportData">
                        <td>
                            {{$index+1}}
                        </td>
                        <td>
                            {{row.fromaccountidName}}
                        </td>
                        <td>
                            {{row.acc_levelName}}
                        </td>
                        <td>
                            {{row.fromprovinceidName}}
                        </td>
                        <td>
                            {{row.fromcityidName}}
                        </td>
                        <td>
                            {{row.fromcountyidName}}
                        </td>
                        <td>
                            {{row.saleto_entname}}
                        </td>
                        <td>
                            {{row.toenttypeName}}
                        </td>
                        <td>
                            {{row.toprovinceidName}}
                        </td>
                        <td>
                            {{row.tocityidName}}
                        </td>
                        <td>
                            {{row.tocountyidName}}
                        </td>
                        <td>
                            {{row.lotno}}
                        </td>
                        <td>
                            {{row.saleto_count}}
                        </td>
                    </tr>
                </tbody>
            </table>
        </rt-data-grid>
    </div>
</div>