<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"></label>
        <div class="col-sm-3">

        </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.startYM"
                     rt-type="month"
                     rt-title="开始日期" rt-required="true" rt-col="3" rt-label-col="1">
        </rt-datetime>
        <rt-datetime ng-model="vm.endYM"
                     rt-type="month"
                     rt-title="结束日期" rt-required="true" rt-col="3" rt-label-col="1">
        </rt-datetime>
    </div>

    <div class="form-group">
        <rt-lookup2 rt-title="发货企业"
                    ng-model="vm.fromEntInfoName"
                    rt-get-data-name="Account.GetAllBusiness"
                    rt-order-by="accountnumber"
                    rt-col-list="[{Code:'name',Name:'客户名称'},{Code:'accountnumber',Name:'客户编码'}]"
                    rt-label-col="1"
                    rt-col="3"></rt-lookup2>
        <rt-lookup2 rt-title="收获企业"
                    ng-model="vm.toEntInfoName"
                    rt-get-data-name="Account.GetAllBusiness"
                    rt-order-by="accountnumber"
                    rt-col-list="[{Code:'name',Name:'客户名称'},{Code:'accountnumber',Name:'客户编码'}]"
                    rt-label-col="1"
                    rt-col="3"></rt-lookup2>
        <!--<rt-input ng-model="vm.fromEntInfoName" rt-title="发货企业" rt-col="3" rt-label-col="1"></rt-input>-->
        <!--<rt-input ng-model="vm.toEntInfoName" rt-title="收货企业" rt-col="3" rt-label-col="1"></rt-input>-->
    </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>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="row in vm.reportData">
                    <td>
                        {{$index+1}}
                    </td>
                    <td>
                        {{row.billdate}}
                    </td>
                    <td>
                        {{row.acc_levelName}}
                    </td>
                    <td>
                        {{row.fromaccountidName}}
                    </td>
                    <td>
                        {{row.fromprovinceidName}}
                    </td>
                    <td>
                        {{row.fromcityidName}}
                    </td>
                    <td>
                        {{row.saleto_entname}}
                    </td>
                    <td>
                        {{row.toprovinceidName}}
                    </td>
                    <td>
                        {{row.tocityidName}}
                    </td>
                    <td>
                        {{row.lotno}}
                    </td>
                    <td>
                        {{row.saleto_count}}
                    </td>
                </tr>
                </tbody>
            </table>
        </rt-data-grid>
    </div>
</div>