<rt-form id="{{vm.form.name}}" name="{{vm.form.name}}" novalidate>
    <div class="row rt-margin-bottom-before-box">
        <div class="col-sm-1">
            <button class="btn btn-link" type="button" ng-click="vm.actions.hide()"><i class="fa fa-sign-out"></i> 关闭</button>
        </div>
        <div class="col-sm-offset-3 col-sm-8">
            <div class="pull-right">
                <rt-button id="btnSave" rt-style="link" rt-title="保存" rt-icon="floppy-o" ng-click="vm.actions.save(false)" ng-show="(vm.form.type === 'Create' && vm.privilege.IsCreate) || (vm.form.type === 'Edit' && vm.form.data.StateCode.Value == 0 && vm.privilege.IsWrite)">
                </rt-button>
                <rt-button id="btnSaveAndNew" rt-style="link" rt-title="保存并新建" rt-icon="floppy-o" ng-click="vm.actions.save(true)" ng-show="(vm.form.type === 'Create' && vm.privilege.IsCreate) || (vm.form.type === 'Edit' && vm.form.data.StateCode.Value == 0 && vm.privilege.IsWrite)">
            </div>
        </div>
    </div>
    <div class="nav-tabs-custom">
        <ul class="nav nav-tabs" ng-if="vm.form.type === 'Edit'">
            <li class="active">
                <a href="#tab1{{vm.form.name}}" onclick="return false;" data-toggle="tab">资料</a>
            </li>
            <li>
                <a href="#tab2{{vm.form.name}}" onclick="return false;" data-toggle="tab">区县</a>
            </li>
        </ul>
        <div class="tab-content">
            <div class="tab-pane active" id="tab1{{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-col="4" rt-required="true" ng-model="vm.form.data.name"></rt-input>
                        <rt-input rt-type="text" rt-title="编码" rt-disabled="vm.form.data.StateCode.Value == 1" rt-col="4" rt-required="true" ng-model="vm.form.data.code"></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="XCRM.GetProvince"
                            rt-order-by="province.code asc" rt-col-list="[{Code:'name',Name:'省份名称'},{Code:'code',Name:'省份编码'}]"
                            rt-required="true" rt-col="4"></rt-lookup2>
                    </rt-section-row>
                </rt-section>
                <rt-section rt-title="状态">
                    <rt-section-row>
                        <rt-readonly-field rt-title="状态" ng-model="vm.form.data.StateCode.Name"></rt-readonly-field>
                    </rt-section-row>
                </rt-section>
            </div>
            <div class="tab-pane" id="tab2{{vm.form.name}}">
                <div ng-if="vm.form.type === 'Edit'" rt-include rt-template="cmm/location/countyListView.html" rt-controller="countyListController"
                    rt-include-params='{"relatedAttr": "cityid"}'></div>
            </div>
        </div>
    </div>
</rt-form>