<template>
  <div class="divBox">
    <el-card class="box-card">
      <el-form ref="config" :model="config" :rules="rules" label-width="200px" class="demo-config">
        <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tab-pane label="人员入驻设置" name="pay_money">
            <el-alert type="warning" show-icon :closable="false">
              <template slot="title">费用及佣金说明</template>
              1、费用为该角色加入时需要支付的金额，例如：总部外勤邀请省发起人加入，则省发起人需要支付【成为省发起人费用】所设置的金额<br />
              2、费用设置为0时则无需支付，且【推荐奖励佣金】设置将失效，无奖励佣金<br />
              3、奖励仅邀请人归属的上级可得，例如：合伙人加入且支付后→邀请该合伙人的运营商可获得奖励→邀请该运营商的省公司外勤可获得奖励→邀请该省公司外勤的省发起人可获得奖励→邀请该省发起人的总部外勤可获得奖励<br />
            </el-alert>
            <el-divider content-position="left">总部外勤费用及佣金</el-divider>
            <el-row :gutter="24" class="ml20">
              <el-col :span="24">
                <el-form-item prop="field_personnel_money">
                  <span slot="label">成为总部外勤费用：</span>
                  <el-input v-model="config.field_personnel_money" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                    <template slot="append">元</template>
                  </el-input>
                </el-form-item>
                <el-form-item>
                  <span slot="label">是否需要审核：</span>
                  <el-radio-group v-model="config.field_personnel_process">
                    <el-radio :label="0">需要审核</el-radio>
                    <el-radio :label="1">无需审核</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
              <el-col :span="24" v-if="config.field_personnel_money > 0">
                <el-form-item prop="field_personnel_money_commission">
                  <span slot="label">推荐奖励佣金：</span>
                  <el-col :span="8">
                    <el-input v-model="config.field_personnel_money_platform" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">平台奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.field_personnel_money_initiator" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">总部发起人奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                </el-form-item>
              </el-col>
            </el-row>
            <el-divider content-position="left">总部内勤费用及佣金</el-divider>
            <el-row :gutter="24" class="ml20">
              <el-col :span="24">
                <el-form-item prop="external_personnel_money">
                  <span slot="label">成为总部内勤费用：</span>
                  <el-input v-model="config.external_personnel_money" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                    <template slot="append">元</template>
                  </el-input>
                </el-form-item>
                <el-form-item>
                  <span slot="label">是否需要审核：</span>
                  <el-radio-group v-model="config.external_personnel_process">
                    <el-radio :label="0">需要审核</el-radio>
                    <el-radio :label="1">无需审核</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
              <el-col :span="24" v-if="config.external_personnel_money > 0">
                <el-form-item prop="external_personnel_money_commission">
                  <span slot="label">推荐奖励佣金：</span>
                  <el-col :span="8">
                    <el-input v-model="config.external_personnel_money_platform" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">平台奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.external_personnel_money_initiator" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">总部发起人奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                </el-form-item>
              </el-col>
            </el-row>
            <el-divider content-position="left">省发起人费用及佣金</el-divider>
            <el-row :gutter="24" class="ml20">
              <el-col :span="24">
                <el-form-item prop="province_money">
                  <span slot="label">成为省发起人费用：</span>
                  <el-input v-model="config.province_money" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                    <template slot="append">元</template>
                  </el-input>
                </el-form-item>
                <el-form-item>
                  <span slot="label">是否需要审核：</span>
                  <el-radio-group v-model="config.province_process">
                    <el-radio :label="0">需要审核</el-radio>
                    <el-radio :label="1">无需审核</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
              <el-col :span="24" v-if="config.province_money > 0">
                <el-form-item prop="province_money_commission">
                  <span slot="label">推荐奖励佣金：</span>
                  <el-col :span="8">
                    <el-input v-model="config.province_money_platform" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">平台奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.province_money_initiator" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">总部发起人奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.province_money_field_personnel" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">总部外勤奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                </el-form-item>
              </el-col>
            </el-row>
            <el-divider content-position="left">省公司外勤费用及佣金</el-divider>
            <el-row :gutter="24" class="ml20">
              <el-col :span="24">
                <el-form-item prop="field_staff_money">
                  <span slot="label">成为省公司外勤费用：</span>
                  <el-input v-model="config.field_staff_money" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                    <template slot="append">元</template>
                  </el-input>
                </el-form-item>
                <el-form-item>
                  <span slot="label">是否需要审核：</span>
                  <el-radio-group v-model="config.field_staff_process">
                    <el-radio :label="0">需要审核</el-radio>
                    <el-radio :label="1">无需审核</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
              <el-col :span="24" v-if="config.field_staff_money > 0">
                <el-form-item prop="field_staff_money_commission">
                  <span slot="label">推荐奖励佣金：</span>
                  <el-col :span="8">
                    <el-input v-model="config.field_staff_money_platform" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">平台奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.field_staff_money_initiator" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">总部发起人奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.field_staff_money_field_personnel" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">总部外勤奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.field_staff_money_province" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">省发起人奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                </el-form-item>
              </el-col>
            </el-row>
            <el-divider content-position="left">省公司内勤费用及佣金</el-divider>
            <el-row :gutter="24" class="ml20">
              <el-col :span="24">
                <el-form-item prop="internal_staff_money">
                  <span slot="label">成为省公司内勤费用：</span>
                  <el-input v-model="config.internal_staff_money" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                    <template slot="append">元</template>
                  </el-input>
                </el-form-item>
                <el-form-item>
                  <span slot="label">是否需要审核：</span>
                  <el-radio-group v-model="config.internal_staff_process">
                    <el-radio :label="0">需要审核</el-radio>
                    <el-radio :label="1">无需审核</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
              <el-col :span="24" v-if="config.internal_staff_money > 0">
                <el-form-item prop="internal_staff_money_commission">
                  <span slot="label">推荐奖励佣金：</span>
                  <el-col :span="8">
                    <el-input v-model="config.internal_staff_money_platform" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">平台奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.internal_staff_money_initiator" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">总部发起人奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.internal_staff_money_field_personnel" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">总部外勤奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.internal_staff_money_province" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">省发起人奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                </el-form-item>
              </el-col>
            </el-row>
            <el-divider content-position="left">运营商费用及佣金</el-divider>
            <el-row :gutter="24" class="ml20">
              <el-col :span="24">
                <el-form-item prop="operator_money">
                  <span slot="label">成为运营商费用：</span>
                  <el-input v-model="config.operator_money" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                    <template slot="append">元</template>
                  </el-input>
                </el-form-item>
                <el-form-item>
                  <span slot="label">是否需要审核：</span>
                  <el-radio-group v-model="config.operator_process">
                    <el-radio :label="0">需要审核</el-radio>
                    <el-radio :label="1">无需审核</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
              <el-col :span="24" v-if="config.operator_money > 0">
                <el-form-item prop="operator_money_commission">
                  <span slot="label">推荐奖励佣金：</span>
                  <el-col :span="8">
                    <el-input v-model="config.operator_money_platform" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">平台奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.operator_money_initiator" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">总部发起人奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.operator_money_field_personnel" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">总部外勤奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.operator_money_province" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">省发起人奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.operator_money_field_staff" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">省公司外勤奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                </el-form-item>
              </el-col>
            </el-row>
            <el-divider content-position="left">合伙人费用及佣金</el-divider>
            <el-row :gutter="24" class="ml20">
              <el-col :span="24">
                <el-form-item prop="partner_money">
                  <span slot="label">成为合伙人费用：</span>
                  <el-input v-model="config.partner_money" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                    <template slot="append">元</template>
                  </el-input>
                </el-form-item>
                <el-form-item>
                  <span slot="label">是否需要审核：</span>
                  <el-radio-group v-model="config.partner_process">
                    <el-radio :label="0">需要审核</el-radio>
                    <el-radio :label="1">无需审核</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
              <el-col :span="24" v-if="config.partner_money > 0">
                <el-form-item prop="partner_money_commission">
                  <span slot="label">推荐奖励佣金：</span>
                  <el-col :span="8">
                    <el-input v-model="config.partner_money_platform" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">平台奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.partner_money_initiator" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">总部发起人奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.partner_money_field_personnel" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">总部外勤奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.partner_money_province" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">省发起人奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.partner_money_field_staff" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">省公司外勤奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.partner_money_operator" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">运营商奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                </el-form-item>
              </el-col>
            </el-row>
            <el-divider content-position="left">餐厅费用及佣金</el-divider>
            <el-row :gutter="24" class="ml20">
              <el-col :span="24">
                <el-form-item prop="mer_money">
                  <span slot="label">成为餐厅费用：</span>
                  <el-input v-model="config.mer_money" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                    <template slot="append">元</template>
                  </el-input>
                </el-form-item>
                <el-form-item>
                  <span slot="label">是否需要审核：</span>
                  <el-radio-group v-model="config.mer_process">
                    <el-radio :label="0">需要审核</el-radio>
                    <el-radio :label="1">无需审核</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
              <el-col :span="24" v-if="config.mer_money > 0">
                <el-form-item prop="mer_money_commission">
                  <span slot="label">推荐奖励佣金：</span>
                  <el-col :span="8">
                    <el-input v-model="config.mer_money_platform" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">平台奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.mer_money_initiator" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">总部发起人奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.mer_money_field_personnel" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">总部外勤奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.mer_money_province" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">省发起人奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.mer_money_field_staff" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">省公司外勤奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.mer_money_operator" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">运营商奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.mer_money_partner" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">合伙人奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                </el-form-item>
              </el-col>
            </el-row>
            <el-divider content-position="left">配送费用及佣金</el-divider>
            <el-row :gutter="24" class="ml20">
              <el-col :span="24">
                <el-form-item prop="delivery_money">
                  <span slot="label">成为配送商费用：</span>
                  <el-input v-model="config.delivery_money" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                    <template slot="append">元</template>
                  </el-input>
                </el-form-item>
                <el-form-item>
                  <span slot="label">是否需要审核：</span>
                  <el-radio-group v-model="config.delivery_process">
                    <el-radio :label="0">需要审核</el-radio>
                    <el-radio :label="1">无需审核</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
              <el-col :span="24" v-if="config.delivery_money > 0">
                <el-form-item prop="delivery_money_commission">
                  <span slot="label">推荐奖励佣金：</span>
                  <el-col :span="8">
                    <el-input v-model="config.delivery_money_platform" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">平台奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.delivery_money_initiator" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">总部发起人奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.delivery_money_field_personnel" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">总部外勤奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.delivery_money_province" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">省发起人奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.delivery_money_field_staff" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">省公司外勤奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.delivery_money_operator" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">运营商奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                  <el-col :span="8">
                    <el-input v-model="config.delivery_money_partner" :precision="2" :step="0.01" :min="0" type="number" class="selWidth">
                      <template slot="prepend">合伙人奖励</template>
                      <template slot="append">元</template>
                    </el-input>
                  </el-col>
                </el-form-item>
              </el-col>
            </el-row>
          </el-tab-pane>
          <el-tab-pane label="邀请限制" name="invite_limit">
            <!--类型：1=总部发起人,2=省公司发起人,3=省合伙人(外勤),4=省合伙人(内勤),5=区县运营商,6=区县合伙人,7=餐厅,8=配送商,9=总部外勤,10=总部内勤-->
            <div class="invite-limit">
              <!-- 总部发起人 -->
              <el-form-item>
                <span slot="label">总部发起人：</span>
                <el-input v-model="invite_limit.invite_1_9" :min="0" type="number" class="selWidth">
                  <template slot="prepend">最多可邀请</template>
                  <template slot="append">位【总部外勤】</template>
                </el-input>
                <el-input v-model="invite_limit.invite_1_10" :min="0" type="number" class="selWidth">
                  <template slot="prepend">最多可邀请</template>
                  <template slot="append">位【总部内勤】</template>
                </el-input>
              </el-form-item>
              <!-- 总部外勤 -->
              <el-form-item>
                <span slot="label">总部外勤：</span>
                <el-input v-model="invite_limit.invite_9_2" :min="0" type="number" class="selWidth">
                  <template slot="prepend">最多可邀请</template>
                  <template slot="append">位【省发起人】</template>
                </el-input>
              </el-form-item>
              <!--省公司发起人-->
              <el-form-item>
                <span slot="label">省公司发起人：</span>
                <el-input v-model="invite_limit.invite_2_3" :min="0" type="number" class="selWidth">
                  <template slot="prepend">最多可邀请</template>
                  <template slot="append">位【省公司外勤】</template>
                </el-input>
                <el-input v-model="invite_limit.invite_2_4" :min="0" type="number" class="selWidth">
                  <template slot="prepend">最多可邀请</template>
                  <template slot="append">位【省公司内勤】</template>
                </el-input>
              </el-form-item>
              <!--省公司外勤-->
              <el-form-item>
                <span slot="label">省公司外勤：</span>
                <el-input v-model="invite_limit.invite_3_5" :min="0" type="number" class="selWidth">
                  <template slot="prepend">最多可邀请</template>
                  <template slot="append">位【区县运营商】</template>
                </el-input>
              </el-form-item>
              <!--区县运营商-->
              <el-form-item>
                <span slot="label">区县运营商：</span>
                <el-input v-model="invite_limit.invite_5_6" :min="0" type="number" class="selWidth">
                  <template slot="prepend">最多可邀请</template>
                  <template slot="append">位【区县合伙人】</template>
                </el-input>
              </el-form-item>
              <!--区县合伙人-->
              <el-form-item>
                <span slot="label">区县合伙人：</span>
                <el-input v-model="invite_limit.invite_6_7" :min="0" type="number" class="selWidth">
                  <template slot="prepend">最多可邀请</template>
                  <template slot="append">位【餐厅】</template>
                </el-input>
                <el-input v-model="invite_limit.invite_6_8" :min="0" type="number" class="selWidth">
                  <template slot="prepend">最多可邀请</template>
                  <template slot="append">位【配送商】</template>
                </el-input>
              </el-form-item>
            </div>
          </el-tab-pane>
        </el-tabs>
        <!-- 提交按钮 -->
        <el-form-item>
          <el-button type="primary" @click="setConfig('config')">保存</el-button>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script>

import {getAgentConfig, setAgentConfig} from "@/api/marketing";

export default {
  name: 'Index',
  data() {
    return {
      // 配置信息
      activeName: 'pay_money',
      config: {
        province_money: 0.00,
        province_process: 0,
        field_staff_money: 0.00,
        field_staff_process: 0,
        internal_staff_money: 0.00,
        internal_staff_process: 0,
        operator_money: 0.00,
        operator_process: 0,
        partner_money: 0.00,
        partner_process: 0,
        mer_money: 0.00,
        mer_process: 0,
        delivery_money: 0.00,
        delivery_process: 0,
        province_money_field_personnel: 0.00,
        field_staff_money_field_personnel: 0.00,
        internal_staff_money_field_personnel: 0.00,
        operator_money_field_personnel: 0.00,
        partner_money_field_personnel: 0.00,
        mer_money_field_personnel: 0.00,
        delivery_money_field_personnel: 0.00,
        field_personnel_money: 0,
        field_personnel_process: 0,
        field_personnel_money_platform: 0,
        field_personnel_money_initiator: 0,
        external_personnel_money: 0,
        external_personnel_process: 0,
        external_personnel_money_platform: 0,
        external_personnel_money_initiator: 0,
      },
      invite_limit: {},// 邀请人数限制
      // 加载及验证
      rules: {
        province_money: [{ required: true, message: '请输入成为省发起人费用', trigger: 'change'}],
        field_staff_money: [{ required: true, message: '请输入成为省公司外勤费用', trigger: 'change'}],
        internal_staff_money: [{ required: true, message: '请输入成为省公司内勤费用', trigger: 'change'}],
        operator_money: [{ required: true, message: '请输入成为成为运营商费用', trigger: 'change'}],
        partner_money: [{ required: true, message: '请输入成为合伙人费用', trigger: 'change'}],
        mer_money: [{ required: true, message: '请输入成为餐厅费用', trigger: 'change'}],
        delivery_money: [{ required: true, message: '请输入成为配送商费用', trigger: 'change'}],
      }
    }
  },
  mounted() {
    this.getConfig();
  },
  methods: {
    // 切换tab
    handleClick(tab, event){},
    // 提交配置信息
    setConfig(){
      let _this = this;
      // 信息处理
      let config = Object.assign({}, _this.config);
      config.invite_limit = Object.assign({}, _this.invite_limit) || {};
      // 提交配置信息
      setAgentConfig(config).then((res) => {
        _this.$message.success(res.message);
        _this.getConfig();
      }).catch((res) => {
        _this.$message.error(res.message);
      });
    },
    // 获取配置信息
    getConfig(){
      let _this = this;
      getAgentConfig().then((res) => {
        _this.config = res.data || {};
        _this.invite_limit = Object.assign({}, res.data.invite_limit) || {};
      }).catch((res) => {
        _this.$message.error(res.message);
      });
    }
  }
}
</script>

<style scoped lang="scss">
.selWidth{
  margin-bottom: 10px!important;
}
.invite-limit{
  .el-form-item{
    margin-bottom: 0!important;
  }
  .selWidth{
    width: 350px!important;
  }
}

</style>
