<div class="row rt-margin-bottom-before-box">
</div>

<div class="box box-primary">
    <div class="box box-widget">
        <!-- /.box-header -->
        <!-- form start -->
        <form class="form-horizontal">
            <div class="box-body">
                <div class="form-group">
                    <rt-lookup4 rt-title="省份" ng-model="vm.provinceSelected" rt-interface="Hospital/GetAllProvince" rt-order-by="province.code asc"
                        rt-col-list="[{Code:'name',Name:'省份名称'},{Code:'code',Name:'省份编码'}]" rt-col="3"></rt-lookup4>
                    <rt-lookup4 rt-title="城市" ng-model="vm.citySelected" rt-interface="Hospital/GetAllCity" rt-order-by="city.code asc" rt-param-string="provinceid={{vm.provinceSelected ? vm.provinceSelected.Id :''}}"
                        rt-col-list="[{Code:'name',Name:'城市名称'},{Code:'code',Name:'城市编码'}]" rt-col="3"></rt-lookup4>
                    <div class="btn-group" class="col-sm-2">
                        <button class="btn btn-primary" ng-click="vm.getDataList()">查询</button>
                    </div>
                </div>
                <div class="form-group">
                    <rt-lookup4 rt-title="区县" ng-model="vm.countySelected" rt-interface="Hospital/GetAllCounty" rt-order-by="county.code asc"
                        rt-param-string="cityid={{vm.citySelected ? vm.citySelected.Id :''}}" rt-col-list="[{Code:'name',Name:'区县名称'},{Code:'code',Name:'区县编码'}]"
                        rt-col="3"></rt-lookup4>
                    <!-- <rt-checkbox rt-title="只显示未开发的医院" rt-label-col="3" rt-col="1" ng-model="vm.isUndevelop"></rt-checkbox> -->
                </div>
                <div class="form-group">
                    <rt-input rt-type="text" rt-title="医院名称" rt-col="3" ng-model="vm.hospital"></rt-input>
                    <rt-input rt-type="text" rt-title="特色科室" rt-col="3" ng-model="vm.department"></rt-input>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">医院等级</label>
                    <div class="col-sm-2">
                        <ui-select allow-clear ng-model="vm.gradeSelected" theme="bootstrap">
                            <ui-select-match>{{ $select.selected.name }}</ui-select-match>
                            <ui-select-choices repeat="item in vm.hospitalGradeList|filter: {name: $select.search}">
                                <span ng-bind-html="item.name | highlight: $select.search"></span>
                            </ui-select-choices>
                        </ui-select>
                    </div>

                    <div class="col-sm-6">
                        <ui-select class="form" multiple allow-clear sortable="true" theme="bootstrap" close-on-select="false" ng-model="vm.gradeSecondSelected">
                            <ui-select-match>{{$item.name}}</ui-select-match>
                            <ui-select-choices repeat="item in vm.hospitalSecondGradeList | filter: {name: $select.search}">
                                <span ng-bind-html="item.name | highlight: $select.search"></span>
                            </ui-select-choices>
                        </ui-select>
                    </div>
                </div>
            </div>
        </form>
    </div>

    <div class="nav-tabs-custom">
        <div class="tab-content">
            <rt-data-grid rt-page-record-count="vm.recordCount" rt-page-index="vm.pageIndex" rt-page-size="vm.pageSize" rt-get-data="vm.getDataList()"
                rt-rows="vm.data" rt-auto-height="{{tableMaxHeight}}">
                <table class="table table-condensed table-hover">
                    <thead>
                        <tr>
                            <!-- <th>
                                <rt-header-checkbox></rt-header-checkbox>
                            </th> -->
                            <!-- @@ 视图表头 -->
                            <th>省市</th>
                            <th>医院名称</th>
                            <th>医院级别</th>
                            <th>电话</th>
                            <th>地址</th>
                            <th>特色科室</th>
                            <th>备注</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-repeat="row in vm.data track by row.Id">
                            <!-- <td>
                                <rt-data-checkbox value="{{row.Id}}" />
                            </td> -->
                            <!-- @@ 视图列表值 -->
                            <td> {{row.provinceidName}}
                                <span ng-show="row.cityidName!='市辖区'||row.cityidName!='县'">{{row.cityidName}} </span> {{row.countyidName}}
                            </td>
                            <td> {{row.name}} </td>
                            <td>
                                {{row.second_hospital_gradeidName?row.second_hospital_gradeidName:row.first_hospital_gradeidName}}
                            </td>
                            <td> {{row.telephone}} </td>
                            <td> {{row.address}} </td>
                            <td> {{row.goodat_departments}} </td>
                            <td>
                                <div style="text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:150px;">
                                    <a href="javascript:;" ng-click="vm.showRemarks(row.name,row.remarks)">{{row.remarks}}</a>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </rt-data-grid>
        </div>
    </div>
</div>