|
@@ -24,16 +24,16 @@
|
|
|
<el-option label="金额" :value="2" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="直接团长规则" prop="leadersMoney">
|
|
|
- <el-input v-model="formData.leadersMoney" placeholder="请输入直接团长规则" style="width: 150px;">
|
|
|
+ <el-form-item v-if="formData.leadersRule" label="直接团长规则" prop="leadersMoney">
|
|
|
+ <el-input v-model="formData.leadersMoney" placeholder="请输入直接团长规则" style="width: 250px;">
|
|
|
<template #append>
|
|
|
<div v-if="formData.leadersRule === 1">%</div>
|
|
|
<div v-else-if="formData.leadersRule === 2">元</div>
|
|
|
</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="间接团长规则" prop="leadersInMoney">
|
|
|
- <el-input v-model="formData.leadersInMoney" placeholder="请输入间接团长规则" style="width: 150px;">
|
|
|
+ <el-form-item v-if="formData.leadersRule" label="间接团长规则" prop="leadersInMoney">
|
|
|
+ <el-input v-model="formData.leadersInMoney" placeholder="请输入间接团长规则" style="width: 250px;">
|
|
|
<template #append>
|
|
|
<div v-if="formData.leadersRule === 1">%</div>
|
|
|
<div v-else-if="formData.leadersRule === 2">元</div>
|
|
@@ -46,22 +46,50 @@
|
|
|
<el-option label="金额" :value="2" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="直接合伙人规则" prop="partnerMoney">
|
|
|
- <el-input v-model="formData.partnerMoney" placeholder="请输入直接合伙人规则" style="width: 150px;">
|
|
|
+ <el-form-item v-if="formData.partnerRule" label="直接合伙人规则" prop="partnerMoney">
|
|
|
+ <el-input v-model="formData.partnerMoney" placeholder="请输入直接合伙人规则" style="width: 250px;">
|
|
|
<template #append>
|
|
|
<div v-if="formData.partnerRule === 1">%</div>
|
|
|
<div v-else-if="formData.partnerRule === 2">元</div>
|
|
|
</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="间接合伙人规则" prop="partnerInMoney">
|
|
|
- <el-input v-model="formData.partnerInMoney" placeholder="请输入间接合伙人规则" style="width: 150px;">
|
|
|
+ <el-form-item v-if="formData.partnerRule" label="间接合伙人规则" prop="partnerInMoney">
|
|
|
+ <el-input v-model="formData.partnerInMoney" placeholder="请输入间接合伙人规则" style="width: 250px;">
|
|
|
<template #append>
|
|
|
<div v-if="formData.partnerRule === 1">%</div>
|
|
|
<div v-else-if="formData.partnerRule === 2">元</div>
|
|
|
</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="加盟商规则" prop="franchiseeRule">
|
|
|
+ <el-select v-model="formData.franchiseeRule" size="mini" placeholder="请选择加盟商规则">
|
|
|
+ <el-option label="比例" :value="1" />
|
|
|
+ <el-option label="金额" :value="2" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="formData.franchiseeRule" label="加盟商佣金规则" prop="franchiseeMoney">
|
|
|
+ <el-input v-model="formData.franchiseeMoney" placeholder="请输入加盟商佣金规则" style="width: 250px;">
|
|
|
+ <template #append>
|
|
|
+ <div v-if="formData.franchiseeRule === 1">%</div>
|
|
|
+ <div v-else-if="formData.franchiseeRule === 2">元</div>
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="社区店规则" prop="communityRule">
|
|
|
+ <el-select v-model="formData.communityRule" size="mini" placeholder="请选择社区店规则">
|
|
|
+ <el-option label="比例" :value="1" />
|
|
|
+ <el-option label="金额" :value="2" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="formData.communityRule" label="社区店佣金规则" prop="communityMoney">
|
|
|
+ <el-input v-model="formData.communityMoney" placeholder="请输入社区店佣金规则" style="width: 250px;">
|
|
|
+ <template #append>
|
|
|
+ <div v-if="formData.communityRule === 1">%</div>
|
|
|
+ <div v-else-if="formData.communityRule === 2">元</div>
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="分佣来源" prop="sourceType">
|
|
|
<el-select v-model="formData.sourceType" size="mini" placeholder="请选择分佣来源">
|
|
|
<el-option label="订单金额" :value="1" />
|
|
@@ -105,6 +133,10 @@ export default {
|
|
|
partnerRule: '',
|
|
|
partnerMoney: '',
|
|
|
partnerInMoney: '',
|
|
|
+ franchiseeRule: '',
|
|
|
+ franchiseeMoney: '',
|
|
|
+ communityRule: '',
|
|
|
+ communityMoney: '',
|
|
|
sourceType: ''
|
|
|
},
|
|
|
formRules: {
|
|
@@ -136,6 +168,14 @@ export default {
|
|
|
{ required: false, message: '请输入间接合伙人规则' },
|
|
|
{ pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' }
|
|
|
],
|
|
|
+ franchiseeMoney: [
|
|
|
+ { required: false, message: '请输入间接合伙人规则' },
|
|
|
+ { pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' }
|
|
|
+ ],
|
|
|
+ communityMoney: [
|
|
|
+ { required: false, message: '请输入间接合伙人规则' },
|
|
|
+ { pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' }
|
|
|
+ ],
|
|
|
sourceType: [
|
|
|
{ required: true, message: '请选择分佣来源' }
|
|
|
]
|
|
@@ -163,6 +203,10 @@ export default {
|
|
|
partnerRule: params.partnerRule || '',
|
|
|
partnerMoney: (params.partnerRule === 1) && (typeof params.partnerMoney === 'number') ? params.partnerMoney * 100 : params.partnerMoney,
|
|
|
partnerInMoney: (params.partnerRule === 1) && (typeof params.partnerInMoney === 'number') ? params.partnerInMoney * 100 : params.partnerInMoney,
|
|
|
+ franchiseeRule: params.franchiseeRule || '',
|
|
|
+ franchiseeMoney: (params.franchiseeRule === 1) && (typeof params.franchiseeMoney === 'number') ? params.franchiseeMoney * 100 : params.franchiseeMoney,
|
|
|
+ communityRule: params.communityRule || '',
|
|
|
+ communityMoney: (params.communityRule === 1) && (typeof params.communityMoney === 'number') ? params.communityMoney * 100 : params.communityMoney,
|
|
|
sourceType: params.sourceType || ''
|
|
|
})
|
|
|
this.visible = true
|
|
@@ -188,6 +232,10 @@ export default {
|
|
|
partnerRule: res.data.partnerRule || '',
|
|
|
partnerMoney: (res.data.partnerRule === 1) && (typeof res.data.partnerMoney === 'number') ? res.data.partnerMoney * 100 : res.data.partnerMoney,
|
|
|
partnerInMoney: (res.data.partnerRule === 1) && (typeof res.data.partnerInMoney === 'number') ? res.data.partnerInMoney * 100 : res.data.partnerInMoney,
|
|
|
+ franchiseeRule: res.data.franchiseeRule || '',
|
|
|
+ franchiseeMoney: (res.data.franchiseeRule === 1) && (typeof res.data.franchiseeMoney === 'number') ? res.data.franchiseeMoney * 100 : res.data.franchiseeMoney,
|
|
|
+ communityRule: res.data.communityRule || '',
|
|
|
+ communityMoney: (res.data.communityRule === 1) && (typeof res.data.communityMoney === 'number') ? res.data.communityMoney * 100 : res.data.communityMoney,
|
|
|
sourceType: res.data.sourceType || ''
|
|
|
})
|
|
|
this.$nextTick(() => {
|
|
@@ -202,15 +250,19 @@ export default {
|
|
|
if (valid) {
|
|
|
const loading = this.$loading({ text: '提交中,请稍候……' })
|
|
|
try {
|
|
|
- const { leadersRule, partnerRule, leadersMoney, leadersInMoney, partnerMoney, partnerInMoney, ...otps } = this.formData
|
|
|
+ const { leadersRule, partnerRule, leadersMoney, leadersInMoney, partnerMoney, partnerInMoney, franchiseeRule, communityRule, franchiseeMoney, communityMoney, ...otps } = this.formData
|
|
|
const params = {
|
|
|
...otps,
|
|
|
leadersMoney: leadersRule === 1 ? leadersMoney / 100 : leadersMoney,
|
|
|
leadersInMoney: leadersRule === 1 ? leadersInMoney / 100 : leadersInMoney,
|
|
|
partnerMoney: partnerRule === 1 ? partnerMoney / 100 : partnerMoney,
|
|
|
partnerInMoney: partnerRule === 1 ? partnerInMoney / 100 : partnerInMoney,
|
|
|
+ franchiseeMoney: franchiseeRule === 1 ? franchiseeMoney / 100 : franchiseeMoney,
|
|
|
+ communityMoney: communityRule === 1 ? communityMoney / 100 : communityMoney,
|
|
|
leadersRule,
|
|
|
- partnerRule
|
|
|
+ partnerRule,
|
|
|
+ franchiseeRule,
|
|
|
+ communityRule
|
|
|
}
|
|
|
this.formData.ruleId ? await priceControlUpdatePlan(params) : await savePlatformBeeRule(params)
|
|
|
loading.close()
|