<style>
  .pintuan-share .box {
    border-top: 1px solid #E8EAEE;
    border-left: 1px solid #E8EAEE;
    border-right: 1px solid #E8EAEE;
    padding: 16px;
  }

</style>
<template>
  <div>
    <el-form-item label="是否开启分销佣金" size="small">
      <el-switch :active-value="1" :inactive-value="0" v-model="msg.SeparateDistribution">
      </el-switch>
    </el-form-item>
    <template v-if="msg.SeparateDistribution == 1">
      <el-form-item label="分销类型">
        <el-radio v-model="msg.SeparateDistributionType" :label="0">普通设置</el-radio>
        <el-radio v-model="msg.SeparateDistributionType" :label="1">详细设置</el-radio>
      </el-form-item>
      <el-form-item label="分销佣金类型" size="small">
        <el-radio v-model="msg.SeparateDistributionMoneyType" :label="0">固定金额</el-radio>
        <el-radio v-model="msg.SeparateDistributionMoneyType" :label="1">百分比</el-radio>
      </el-form-item>
      <!-- <template v-if="sign !== 'pintuan'">
        <app-goods-share v-model="ruleForm" :is_mch="is_mch" :attr-groups="attrGroups"
          :attr_setting_type="cForm.attr_setting_type" :share_type="ruleForm.share_type" :use_attr="ruleForm.use_attr"
          :sign="sign" pintuan_sign="单独购买"></app-goods-share>
      </template>
      <template v-if="sign === 'pintuan' && cForm.is_alone_buy == 1">
        <app-goods-share v-model="ruleForm" :is_mch="is_mch" :attr-groups="attrGroups"
          :attr_setting_type="ruleForm.attr_setting_type" :share_type="ruleForm.share_type"
          :use_attr="ruleForm.use_attr" :sign="sign" pintuan_sign="单独购买"></app-goods-share>
      </template> -->
      <el-form-item>
        <div class="pintuan-share">
          <el-card v-for="(item,index) in shareGroup_list" :key="index" style="margin-bottom:20px;">
            <div slot="header" class="clearfix">
              <div class="box">
                <div style="display:inline-block;">
                  <el-tag type="danger">{{item.People_Num}}人团</el-tag>
                </div>
                <label style="margin-bottom:0;padding:18px 10px;">批量设置</label>
                <el-select placeholder="请选择层级" v-model="fxVal" style="width:130px;" size="small">
                  <el-option v-for="(item, index) in butorInt" :label="`${index + 1}级分销`" :value="index + 1"
                    :key="index+'12'">
                  </el-option>
                </el-select>
                <el-input type="text" size="small" style="width:150px;margin-top:5px;">
                  <el-button slot="append">
                    <span v-if="msg.SeparateDistributionMoneyType == 2">元</span>
                    <span v-if="msg.SeparateDistributionMoneyType == 1">%</span>
                  </el-button>
                </el-input>
                <el-button size="small" type="primary">设置</el-button>
              </div>
              <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark"
                style="width: 100%;border:1px solid #E8EAEE" @selection-change="handleSelectionChange">
                <el-table-column type="selection" width="55">
                </el-table-column>
                <el-table-column label="等级名称" prop="leval" width="100">
                </el-table-column>
                <el-table-column label="一级分销" width="576">
                  <template slot-scope="scope">
                    <el-input type="text" size="small" v-model="scope.row.yiji">
                      <el-button slot="append">元</el-button>
                    </el-input>
                  </template>
                </el-table-column>
                <el-table-column label="二级分销" width="575">
                  <template slot-scope="scope">
                    <el-input type="text" size="small" v-model="scope.row.erji">
                      <el-button slot="append">元</el-button>
                    </el-input>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-card>
        </div>
      </el-form-item>
    </template>
  </div>
</template>
<script>
  export default {
    props: ["shareGroup_list"],
    data() {
      return {
        fxVal: '',

        butorInt: 0,
        msg: {
          SeparateDistribution: 0, //是否开启分销佣金
          SeparateDistributionType: 1, //分销类型
          SeparateDistributionMoneyType: 1, //分销佣金类型
        },
        tableData: [{
          leval: '默认等级',
          yiji: 0,
          erji: 3
        }]
      };
    },
    created() {
      console.log(this.shareGroup_list, 'shareGroup_list');

    },
    methods: {
      handleSelectionChange() {

      },
      getDistributor() {
        this.apipost("/api/user/GetDistributorBasicsInfo", {}, res => {
          if (res.data.resultCode == 1) {
            console.log(res,'resss');
            this.butorInt = res.data.data.DistributorTier;
          }
        });
      },
    },
    mounted() {
      this.getDistributor();
    },
    computed: {

    },
  };

</script>
