|
|
|
@ -89,94 +89,138 @@ |
|
|
|
|
<el-form-item label="等级名称" prop="name"> |
|
|
|
|
<el-input class="sa-w-360" v-model="form.model.name" placeholder="请输入等级名称"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="等级徽章" prop="image"> |
|
|
|
|
<sa-uploader v-model="form.model.image"></sa-uploader> |
|
|
|
|
<!-- <el-form-item label="等级徽章" prop="image">--> |
|
|
|
|
<!-- <sa-uploader v-model="form.model.image"></sa-uploader>--> |
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
<el-form-item label="消费门槛" prop="total_consume"> |
|
|
|
|
<el-input class="sa-w-360" v-model="form.model.total_consume" placeholder="请输入消费门槛"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="一级(自购)佣金比例" prop="commission_rules.commission_1" |
|
|
|
|
:rules="form.rules.commission_rules.commission"> |
|
|
|
|
<el-input class="sa-w-360" v-model="form.model.commission_rules.commission_1" type="number"> |
|
|
|
|
<template #append>%</template> |
|
|
|
|
</el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="二级佣金比例" prop="commission_rules.commission_2" |
|
|
|
|
:rules="form.rules.commission_rules.commission"> |
|
|
|
|
<el-input class="sa-w-360" v-model="form.model.commission_rules.commission_2" type="number"> |
|
|
|
|
<template #append>%</template> |
|
|
|
|
</el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="三级佣金比例" prop="commission_rules.commission_3" |
|
|
|
|
:rules="form.rules.commission_rules.commission"> |
|
|
|
|
<el-input class="sa-w-360" v-model="form.model.commission_rules.commission_3" type="number"> |
|
|
|
|
<template #append>%</template> |
|
|
|
|
</el-input> |
|
|
|
|
<el-form-item label="方案一" prop="coupon_rules"> |
|
|
|
|
<el-button type="primary" link @click="onSelectCoupon1">选择商品券 |
|
|
|
|
</el-button> |
|
|
|
|
<template v-if="form.model.coupon_rules.programme_1.length > 0"> |
|
|
|
|
<div class="header sa-flex"> |
|
|
|
|
<div class="key">券名称</div> |
|
|
|
|
<div class="oper">操作</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="item" v-for="(element, index) in form.model.coupon_rules.programme_1" :key="element"> |
|
|
|
|
<div class="key"> |
|
|
|
|
<div class="goods-title sa-m-b-6">{{ element.name }}</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="oper"> |
|
|
|
|
<el-button type="danger" link @click="onDeleteCoupon1(index)"> |
|
|
|
|
移除 |
|
|
|
|
</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-form-item> |
|
|
|
|
<template v-if="form.model.level != 1"> |
|
|
|
|
<div class="sa-title is-line">添加升级条件</div> |
|
|
|
|
<el-form-item label="升级方式" prop="upgrade_rules"> |
|
|
|
|
<div> |
|
|
|
|
<el-radio-group class="mb-2" v-model="form.model.upgrade_type"> |
|
|
|
|
<el-radio :label="0">满足以下任意条件</el-radio> |
|
|
|
|
<el-radio :label="1">满足以下全部条件</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
<div> |
|
|
|
|
<div class="sa-flex sa-flex-wrap condition-group" v-for="group in upgradeCondition" |
|
|
|
|
:key="group"> |
|
|
|
|
<div :class="[ |
|
|
|
|
'item', |
|
|
|
|
'condition-item', |
|
|
|
|
Object.keys(form.model.upgrade_rules).includes(key) ? 'is-active' : '', |
|
|
|
|
]" v-for="(item, key) in group" :key="item" |
|
|
|
|
@click="onSelectUpgradeCondition(key)"> |
|
|
|
|
{{ item.name }} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<el-form-item label="方案二" prop="form.model.coupon_rules.programme_2"> |
|
|
|
|
<el-button type="primary" link @click="onSelectCoupon2">选择商品券 |
|
|
|
|
</el-button> |
|
|
|
|
<template v-if="form.model.coupon_rules.programme_2.length > 0"> |
|
|
|
|
<div class="header sa-flex"> |
|
|
|
|
<div class="key">券名称</div> |
|
|
|
|
<div class="oper">操作</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="item" v-for="(element, index) in form.model.coupon_rules.programme_2" :key="element"> |
|
|
|
|
<div class="key"> |
|
|
|
|
<div class="goods-title sa-m-b-6">{{ element.name }}</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="oper"> |
|
|
|
|
<el-button type="danger" link @click="onDeleteCoupon2(index)"> |
|
|
|
|
移除 |
|
|
|
|
</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
<template v-for="(group, gkey) in upgradeCondition" :key="group"> |
|
|
|
|
<template v-for="(item, key) in group" :key="item"> |
|
|
|
|
<el-form-item :label="item.name" |
|
|
|
|
v-if="Object.keys(form.model.upgrade_rules).includes(key)" |
|
|
|
|
:prop="`upgrade_rules.${key}`" :rules="form.rules.upgrade_rules_inner.rules"> |
|
|
|
|
<template v-if="gkey != 'agent_level'"> |
|
|
|
|
<el-input class="w-120" v-model="form.model.upgrade_rules[key]" type="number"> |
|
|
|
|
<template #append> {{ initUnit(key) }}</template> |
|
|
|
|
</el-input> |
|
|
|
|
<el-button class="delete" type="danger" link @click="onDeleteRules(key)"> |
|
|
|
|
删除 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
<div v-if="gkey == 'agent_level'"> |
|
|
|
|
<div class="sa-flex sa-flex-wrap mb-4" |
|
|
|
|
v-for="(al, index) in form.model.upgrade_rules[key]" :key="al"> |
|
|
|
|
<el-form-item :prop="`upgrade_rules.${key}.${index}.level`" |
|
|
|
|
:rules="form.rules.upgrade_rules_inner.level"> |
|
|
|
|
<el-select class="w-120" v-model="al.level" placeholder="请选择分销商等级"> |
|
|
|
|
<template v-for="item in level.select" :key="item"> |
|
|
|
|
<el-option v-if="item.level < form.model.level" |
|
|
|
|
:label="item.name" :value="item.level+''"></el-option> |
|
|
|
|
</template> |
|
|
|
|
</el-select> |
|
|
|
|
<span class="ml-2 mr-2">满</span> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item :prop="`upgrade_rules.${key}.${index}.count`" |
|
|
|
|
:rules="form.rules.upgrade_rules_inner.rules"> |
|
|
|
|
<el-input class="w-120" v-model="al.count" type="number"> |
|
|
|
|
<template #append>人</template> |
|
|
|
|
</el-input> |
|
|
|
|
<el-button class="delete" type="danger" link |
|
|
|
|
@click="onDeleteRules(key, index)"> |
|
|
|
|
删除 |
|
|
|
|
</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<el-button type="primary" link size="small" @click="onAddUpgradeRules(key)"> |
|
|
|
|
+ 添加</el-button> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<!-- <el-form-item label="一级(自购)佣金比例" prop="commission_rules.commission_1"--> |
|
|
|
|
<!-- :rules="form.rules.commission_rules.commission">--> |
|
|
|
|
<!-- <el-input class="sa-w-360" v-model="form.model.commission_rules.commission_1" type="number">--> |
|
|
|
|
<!-- <template #append>%</template>--> |
|
|
|
|
<!-- </el-input>--> |
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
<!-- <el-form-item label="二级佣金比例" prop="commission_rules.commission_2"--> |
|
|
|
|
<!-- :rules="form.rules.commission_rules.commission">--> |
|
|
|
|
<!-- <el-input class="sa-w-360" v-model="form.model.commission_rules.commission_2" type="number">--> |
|
|
|
|
<!-- <template #append>%</template>--> |
|
|
|
|
<!-- </el-input>--> |
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
<!-- <el-form-item label="三级佣金比例" prop="commission_rules.commission_3"--> |
|
|
|
|
<!-- :rules="form.rules.commission_rules.commission">--> |
|
|
|
|
<!-- <el-input class="sa-w-360" v-model="form.model.commission_rules.commission_3" type="number">--> |
|
|
|
|
<!-- <template #append>%</template>--> |
|
|
|
|
<!-- </el-input>--> |
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
<!-- <template v-if="form.model.level != 1">--> |
|
|
|
|
<!-- <div class="sa-title is-line">添加升级条件</div>--> |
|
|
|
|
<!-- <el-form-item label="升级方式" prop="upgrade_rules">--> |
|
|
|
|
<!-- <div>--> |
|
|
|
|
<!-- <el-radio-group class="mb-2" v-model="form.model.upgrade_type">--> |
|
|
|
|
<!-- <el-radio :label="0">满足以下任意条件</el-radio>--> |
|
|
|
|
<!-- <el-radio :label="1">满足以下全部条件</el-radio>--> |
|
|
|
|
<!-- </el-radio-group>--> |
|
|
|
|
<!-- <div>--> |
|
|
|
|
<!-- <div class="sa-flex sa-flex-wrap condition-group" v-for="group in upgradeCondition"--> |
|
|
|
|
<!-- :key="group">--> |
|
|
|
|
<!-- <div :class="[--> |
|
|
|
|
<!-- 'item',--> |
|
|
|
|
<!-- 'condition-item',--> |
|
|
|
|
<!-- Object.keys(form.model.upgrade_rules).includes(key) ? 'is-active' : '',--> |
|
|
|
|
<!-- ]" v-for="(item, key) in group" :key="item"--> |
|
|
|
|
<!-- @click="onSelectUpgradeCondition(key)">--> |
|
|
|
|
<!-- {{ item.name }}--> |
|
|
|
|
<!-- </div>--> |
|
|
|
|
<!-- </div>--> |
|
|
|
|
<!-- </div>--> |
|
|
|
|
<!-- </div>--> |
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
<!-- <template v-for="(group, gkey) in upgradeCondition" :key="group">--> |
|
|
|
|
<!-- <template v-for="(item, key) in group" :key="item">--> |
|
|
|
|
<!-- <el-form-item :label="item.name"--> |
|
|
|
|
<!-- v-if="Object.keys(form.model.upgrade_rules).includes(key)"--> |
|
|
|
|
<!-- :prop="`upgrade_rules.${key}`" :rules="form.rules.upgrade_rules_inner.rules">--> |
|
|
|
|
<!-- <template v-if="gkey != 'agent_level'">--> |
|
|
|
|
<!-- <el-input class="w-120" v-model="form.model.upgrade_rules[key]" type="number">--> |
|
|
|
|
<!-- <template #append> {{ initUnit(key) }}</template>--> |
|
|
|
|
<!-- </el-input>--> |
|
|
|
|
<!-- <el-button class="delete" type="danger" link @click="onDeleteRules(key)">--> |
|
|
|
|
<!-- 删除--> |
|
|
|
|
<!-- </el-button>--> |
|
|
|
|
<!-- </template>--> |
|
|
|
|
<!-- <div v-if="gkey == 'agent_level'">--> |
|
|
|
|
<!-- <div class="sa-flex sa-flex-wrap mb-4"--> |
|
|
|
|
<!-- v-for="(al, index) in form.model.upgrade_rules[key]" :key="al">--> |
|
|
|
|
<!-- <el-form-item :prop="`upgrade_rules.${key}.${index}.level`"--> |
|
|
|
|
<!-- :rules="form.rules.upgrade_rules_inner.level">--> |
|
|
|
|
<!-- <el-select class="w-120" v-model="al.level" placeholder="请选择分销商等级">--> |
|
|
|
|
<!-- <template v-for="item in level.select" :key="item">--> |
|
|
|
|
<!-- <el-option v-if="item.level < form.model.level"--> |
|
|
|
|
<!-- :label="item.name" :value="item.level+''"></el-option>--> |
|
|
|
|
<!-- </template>--> |
|
|
|
|
<!-- </el-select>--> |
|
|
|
|
<!-- <span class="ml-2 mr-2">满</span>--> |
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
<!-- <el-form-item :prop="`upgrade_rules.${key}.${index}.count`"--> |
|
|
|
|
<!-- :rules="form.rules.upgrade_rules_inner.rules">--> |
|
|
|
|
<!-- <el-input class="w-120" v-model="al.count" type="number">--> |
|
|
|
|
<!-- <template #append>人</template>--> |
|
|
|
|
<!-- </el-input>--> |
|
|
|
|
<!-- <el-button class="delete" type="danger" link--> |
|
|
|
|
<!-- @click="onDeleteRules(key, index)">--> |
|
|
|
|
<!-- 删除--> |
|
|
|
|
<!-- </el-button>--> |
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
<!-- </div>--> |
|
|
|
|
<!-- <el-button type="primary" link size="small" @click="onAddUpgradeRules(key)">--> |
|
|
|
|
<!-- + 添加</el-button>--> |
|
|
|
|
<!-- </div>--> |
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
<!-- </template>--> |
|
|
|
|
<!-- </template>--> |
|
|
|
|
<!-- </template>--> |
|
|
|
|
</el-form> |
|
|
|
|
</el-scrollbar> |
|
|
|
|
</el-main> |
|
|
|
|