<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>
                <label style="margin-right: 5%;">机构名称</label>
                <input type="text" placeholder="请输入机构名称进行搜索" ng-model="vm.searchText" style="width: 30%;min-height: 34px;" />
                <button class="btn btn-primary" ng-click="vm.pageIndex = 1;vm.form.searchAccount();" style="margin-left: 2%;">搜索</button>
            </div>

            <div ng-if="vm.accountList.length===0" style="margin-top: 10px;">
                <p style="border-top:1px solid #f0f0f0;"></p>
                <label>
                    <p>搜索结果：</p>
                    <p style="white-space: normal;">{{vm.searchAccountIdName}}在系统中不存在，请先选择客户类型，再点击"新增"按钮新增客户</p>
                </label>
                <button class="btn btn-primary" ng-click="vm.form.addAccount()" style="margin-left: 2%;">新增</button>
                <table class="table table-condensed table-hover">
                    <tbody>
                        <tr ng-repeat="v in vm.accountTypes track by $index">
                            <td><input name="accountTypes" type="radio" ng-click="vm.form.selectAccountType($index)" />{{v.name}}</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <div ng-if="vm.accountList.length>0" style="margin-top: 10px;">
                <p style="border-top:1px solid #f0f0f0;"></p>
                <label>
                    <p>搜索结果：</p>
                    <p style="white-space: normal;">根据{{vm.searchAccountIdName}}查询的结果如下，请选择一家机构进行变更</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.searchAccount();"
                    rt-rows="vm.accountList">
                    <table class="table table-condensed table-hover">
                        <tbody>
                            <tr ng-repeat="v in vm.accountList track by $index">
                                <td><input name="accountList" type="radio" value="{{v.Id}}" ng-click="vm.form.selectAccount($index)"
                                        ng-checked="vm.selectedAccountId==v.Id" />{{v.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.changeAccountPrivilege()" style="width: 15%;">申请客户权限</button>
                    <button type="button" class="btn btn-warning" ng-click="vm.form.changeAccountInfo()" style="width: 15%;margin-left: 20px;">变更客户信息</button>
                </div>
            </div>
        </div>
    </div>
</rt-form>