<rt-form id="{{vm.form.name}}" name="{{vm.form.name}}" novalidate>
    <div class="row rt-margin-bottom-before-box">
        <div class="col-sm-2">
            <button class="btn btn-link" type="button" id="btnClose" ng-click="vm.form.hide()">
                <i class="fa fa-sign-out"></i> 关闭
            </button>
        </div>
    </div>
    <div class="nav-tabs-custom">
        <div class="tab-content">
            <div>
                <rt-lookup2 rt-title="医院名称" rt-required="true" ng-model="vm.searchAccountId" rt-get-data-name="Account.GetHospital" rt-order-by="name"
                    rt-col-list="[{Code:'name',Name:'客户名称'}]" rt-filtered="false" rt-col="3" style="line-height:30px;"></rt-lookup2>

                <rt-input rt-type="text" rt-title="医生姓名" rt-required="true" rt-col="3" ng-model="vm.searchText" rt-placeholder="请输入医生姓名进行搜索"
                    style="line-height:30px;"></rt-input>
                <button class="btn btn-primary" ng-click="vm.pageIndex = 1;vm.form.searchContact();" style="margin-left: 2%;">搜索</button>
            </div>

            <div ng-if="vm.contactList.length===0" style="margin-top: 10px;">
                <p style="border-top:1px solid #f0f0f0;"></p>
                <label>
                    <p>搜索结果：</p>
                    <p style="white-space: normal;">{{vm.searchContactIdName}}在系统中不存在，请点击"新增"按钮新增医生</p>
                </label>
                <button class="btn btn-primary" ng-click="vm.form.addContact()" style="margin-left: 2%;">新增</button>
            </div>

            <div ng-if="vm.contactList.length>0" style="margin-top: 10px;">
                <p style="border-top:1px solid #f0f0f0;"></p>
                <label>
                    <p>搜索结果：</p>
                    <p style="white-space: normal;">根据{{vm.searchContactIdName}}查询的结果如下，请选择一名医生进行变更</p>
                </label>

                <rt-data-grid rt-page-record-count="vm.recordCount" rt-page-index="vm.pageIndex" rt-page-size="vm.pageSize" rt-get-data="vm.form.searchContact();"
                    rt-rows="vm.contactList">
                    <table class="table table-condensed table-hover">
                        <tbody>
                            <tr ng-repeat="v in vm.contactList track by $index">
                                <td><input name="contactList" type="radio" value="{{v.Id}}" ng-click="vm.form.selectContact($index)"
                                        ng-checked="vm.selectedContactId==v.Id" />{{v.name}} {{v.departmentid.Name}}</td>
                            </tr>
                        </tbody>
                    </table>
                </rt-data-grid>

                <div style="margin-top: 10px;margin-bottom: 10px;">
                    <button type="button" class="btn btn-success" ng-click="vm.form.changeContactPrivilege()" style="width: 15%;">申请医生权限</button>
                    <button type="button" class="btn btn-warning" ng-click="vm.form.changeContactInfo()" style="width: 15%;margin-left: 20px;">变更医生信息</button>
                </div>
            </div>
        </div>
    </div>
</rt-form>