<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[.col-sm-2] -->
    </div>
    <!-- div[.row] -->
    <div class="nav-tabs-custom">
        <!-- @@表单 -->
        <ul class="nav nav-tabs" ng-if="vm.form.type === 'Edit'">
            <li class="active">
                <a href="#A1{{vm.form.name}}" onclick="return false;" data-toggle="tab">资料</a>
            </li>
            <li>
                <a href="#A2{{vm.form.name}}" onclick="return false;" data-toggle="tab">联系人信息</a>
            </li>
            <li>
                <a href="#A3{{vm.form.name}}" onclick="return false;" data-toggle="tab">下属门店信息</a>
            </li>
        </ul>
        <!-- ui[.nav] -->

        <div class="tab-content">
            <div class="tab-pane active" id="A1{{vm.form.name}}">
                <rt-section rt-title="基本信息">
                    <rt-section-row>
                        <rt-input rt-type="text" rt-title="连锁名称" rt-disabled="vm.form.data.StateCode.Value == 1" rt-required="true" rt-col="4" rt-required="true"
                            ng-model="vm.form.data.name"></rt-input>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-input rt-type="text" rt-title="连锁编码" rt-col="4" rt-required="false" rt-disabled="vm.form.data.StateCode.Value == 1" ng-model="vm.form.data.accountnumber"></rt-input>
                        <rt-lookup2 rt-title="上级客户" rt-disabled="vm.form.data.StateCode.Value == 1" ng-model="vm.form.data.parentaccountid" rt-get-data-name="Account.GetAllChain"
                            rt-order-by="accountnumber" rt-col-list="[{Code:'name',Name:'客户名称'},{Code:'accountnumber',Name:'客户编码'}]"
                            rt-required="false" rt-col="4"></rt-lookup2>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-input rt-type="text" rt-title="传真" rt-disabled="vm.form.data.StateCode.Value == 1" rt-col="4" ng-model="vm.form.data.fax"></rt-input>
                        <rt-input rt-type="text" rt-title="联络电话" rt-disabled="vm.form.data.StateCode.Value == 1" rt-col="4" ng-model="vm.form.data.telephone"></rt-input>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-lookup2 rt-title="省份" rt-disabled="vm.form.data.StateCode.Value == 1" ng-model="vm.form.data.provinceid" rt-get-data-name="Province.GetProvince"
                            rt-order-by="code" rt-col-list="[{Code:'name',Name:'省份名称'},{Code:'code',Name:'省份编码'}]" rt-required="true"
                            rt-col="4"></rt-lookup2>
                        <rt-lookup2 rt-title="城市" rt-disabled="vm.form.data.StateCode.Value == 1||vm.form.data.provinceid==null" ng-model="vm.form.data.cityid"
                            rt-get-data-name="Province.GetCity" rt-order-by="code" rt-col-list="[{Code:'name',Name:'城市名称'},{Code:'code',Name:'城市编码'}]"
                            rt-params="{'@provinceid':vm.form.data.provinceid ? vm.form.data.provinceid.Id :''}" rt-required="true"
                            rt-col="4"></rt-lookup2>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-lookup2 rt-title="区县" rt-disabled="vm.form.data.StateCode.Value == 1||vm.form.data.cityid==null" ng-model="vm.form.data.countyid"
                            rt-get-data-name="Province.GetCounty" rt-order-by="code" rt-col-list="[{Code:'name',Name:'区县名称'},{Code:'code',Name:'区县编码'}]"
                            rt-params="{'@cityid':vm.form.data.cityid ? vm.form.data.cityid.Id :''}" rt-col="4"></rt-lookup2>
                        <rt-picklist rt-title="分级" rt-col="4" rt-required="false" rt-disabled="vm.form.data.StateCode.Value == 1" ng-model="vm.form.data.account_grade_level"
                            rt-options="vm.picklist.account_grade_level"></rt-picklist>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-input rt-type="text" rt-title="地址" rt-disabled="vm.form.data.StateCode.Value == 1" rt-col="10" ng-model="vm.form.data.address"></rt-input>
                    </rt-section-row>
                </rt-section>
                <rt-section rt-title="详细信息">
                    <rt-section-row>
                        <rt-picklist rt-title="连锁类型" rt-col="4" ng-model="vm.form.data.chain_type" rt-disabled="vm.form.data.StateCode.Value == 1"
                            rt-options="vm.picklist.chain_type"></rt-picklist>
                        <rt-input rt-type="int" rt-title="终端数量" rt-col="4" rt-disabled="vm.form.data.StateCode.Value == 1" ng-model="vm.form.data.terminal_count"></rt-input>
                    </rt-section-row>
                </rt-section>
                <rt-section rt-title="状态">
                    <rt-section-row>
                        <rt-picklist rt-title="状态" rt-col="4" ng-model="vm.form.data.StateCode" rt-disabled="true" rt-options="vm.picklist.StateCode"></rt-picklist>
                    </rt-section-row>
                </rt-section>
            </div>
            <!-- div[#1, .tab-pane] -->
            <!--连锁 联系人-->
            <div class="tab-pane" id="A2{{vm.form.name}}">
                <div ng-if="vm.form.type === 'Edit'" rt-include rt-template="Module/ChainContact/chaincontactListView.html" rt-controller="chaincontactListController"
                    rt-include-params='{"relatedAttr": "accountid"}'></div>
            </div>
            <!--连锁 下属门店-->
            <div class="tab-pane" id="A3{{vm.form.name}}">
                <div ng-if="vm.form.type === 'Edit'" rt-include rt-template="Module/TerminalAccount/terminalaccountListView.html" rt-controller="terminalaccountListController"
                    rt-include-params='{"relatedAttr": "parentaccountid"}'></div>
            </div>
        </div>
        <!-- div[.tab-content] -->
    </div>
</rt-form>
<!-- rt-form -->