<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 class="col-sm-10">
            <div class="pull-right">
                <rt-button id="btnSave" rt-style="link" rt-title="提交" rt-icon="floppy-o" ng-click="vm.form.showFlowUserList([{name:'accountclassificationcode',value:'6'}])"
                    ng-show="(vm.form.type === 'Create' && vm.privilege.IsCreate) || (vm.form.type === 'Edit' && vm.privilege.IsWrite)">
                </rt-button>
            </div>
        </div>
    </div>
    <div class="nav-tabs-custom">
        <div class="tab-content">
            <div class="tab-pane active">
                <rt-section rt-title="基本信息" ng-if="vm.changeType === 'info'">
                    <rt-section-row>
                        <rt-input rt-type="text" rt-title="连锁名称" rt-required="true" rt-col="4" rt-required="true" ng-model="vm.accountInfo.name"></rt-input>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-input rt-type="text" rt-title="连锁编码" rt-col="4" rt-required="false" ng-model="vm.accountInfo.accountnumber"></rt-input>
                        <rt-lookup2 rt-title="上级客户" ng-model="vm.accountInfo.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-col="4" ng-model="vm.accountInfo.fax"></rt-input>
                        <rt-input rt-type="text" rt-title="联络电话" rt-col="4" ng-model="vm.accountInfo.telephone"></rt-input>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-lookup2 rt-title="省份" ng-model="vm.accountInfo.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.accountInfo.provinceid==null" ng-model="vm.accountInfo.cityid" rt-get-data-name="Province.GetCity"
                            rt-order-by="code" rt-col-list="[{Code:'name',Name:'城市名称'},{Code:'code',Name:'城市编码'}]" rt-params="{'@provinceid':vm.accountInfo.provinceid ? vm.accountInfo.provinceid.Id :''}"
                            rt-required="true" rt-col="4"></rt-lookup2>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-lookup2 rt-title="区县" rt-disabled="vm.accountInfo.cityid==null" ng-model="vm.accountInfo.countyid" rt-get-data-name="Province.GetCounty"
                            rt-order-by="code" rt-col-list="[{Code:'name',Name:'区县名称'},{Code:'code',Name:'区县编码'}]" rt-params="{'@cityid':vm.accountInfo.cityid ? vm.accountInfo.cityid.Id :''}"
                            rt-col="4"></rt-lookup2>
                        <rt-picklist rt-title="分级" rt-col="4" rt-required="false" ng-model="vm.accountInfo.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-col="10" ng-model="vm.accountInfo.address"></rt-input>
                    </rt-section-row>
                </rt-section>
                <rt-section rt-title="客户标签" ng-if="vm.changeType === 'info'">
                    <div class="col-sm-12">
                        <rt-checkbox rt-title="{{tag.value}}" rt-col="1" ng-repeat="tag in vm.tagList" ng-model="tag.checked"></rt-checkbox>
                    </div>
                    <rt-section-row>
                        <div class="col-sm-2" style="padding-top:15px;padding-left:10%;">
                            <button class="btn btn-primary" ng-click="vm.addTag()">增加</button>
                        </div>
                        <div class="col-sm-2" style="padding-top:15px;padding-left:10%;">
                            <button class="btn btn-primary" ng-click="vm.delTag()">删除</button>
                        </div>
                    </rt-section-row>
                </rt-section>
                <rt-section rt-title="详细信息" ng-if="vm.changeType === 'info'">
                    <rt-section-row>
                        <rt-picklist rt-title="连锁类型" rt-col="4" ng-model="vm.accountInfo.chain_type" rt-options="vm.picklist.chain_type"></rt-picklist>
                        <rt-input rt-type="Unsignedint" rt-title="终端数量" rt-col="4" ng-model="vm.accountInfo.terminal_count"></rt-input>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-input rt-type="Unsignedint" rt-title="直营店数量" rt-col="4" ng-model="vm.accountInfo.terminal_count_direct"></rt-input>
                        <rt-input rt-type="Unsignedint" rt-title="加盟店数量" rt-col="4" ng-model="vm.accountInfo.terminal_count_franchise"></rt-input>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-input rt-type="decimal" rt-title="年营业额(万元)" rt-col="4" ng-model="vm.accountInfo.sales"></rt-input>
                    </rt-section-row>
                </rt-section>

                <rt-section rt-title="归属信息" ng-if="vm.changeType === 'privilege'||(vm.changeType === 'info'&&vm.isCreateAccount)">
                    <div class="tab-pane" id="A3">
                        <div>
                            <div class="listview">
                                <div class="row">
                                    <div class="col-sm-8">
                                        <div class="btn-group">
                                            <button class="btn btn-link" ng-click="vm.showForm2(vm.salesRegionInfoList,'Module/ChainAccount/salesRegionInfoEditView.html', 'accountAppChainEditController')">
                                                        <i class="fa fa-plus"></i> 新建
                                                    </button>
                                            <button class="btn btn-link" ng-click="vm.del()">
                                                        <i class="fa fa-trash"></i> 删除
                                                    </button>
                                        </div>
                                    </div>
                                </div>

                                <div class="viewlist">
                                    <table class="table table-hover">
                                        <thead>
                                            <tr>
                                                <th>
                                                    <rt-header-checkbox id="checkboxAll" ng-click="vm.selectAll()"></rt-header-checkbox>
                                                </th>
                                                <!-- @@ 视图表头 -->
                                                <th>小区</th>
                                                <th>代表</th>
                                                <th>部门</th>
                                                <th>品种</th>
                                            </tr>
                                        </thead>
                                        <tbody id="salesRegion">
                                            <tr ng-repeat="row in vm.salesRegionInfoList">
                                                <td>
                                                    <input type="checkbox" id="{{$index}}" ng-click="updateSelection($event,$index)">
                                                </td>
                                                <td>
                                                    {{row.sales_regionidname}}
                                                </td>
                                                <td>
                                                    {{row.owneridname}}
                                                </td>
                                                <td>
                                                    {{row.buidname}}{{row.bigdepartidname}}{{row.businessunitidname}}
                                                </td>
                                                <td>
                                                    {{row.product_categoryidname}}
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>

                            <div class="editview borderShadow sidebar sidebar-right sidebar-animate" ng-if="vm.view.type=='default'">
                                <div ui-view class="content"></div>
                            </div>
                        </div>
                    </div>
                </rt-section>
            </div>
        </div>
    </div>
</rt-form>