|
@@ -3,13 +3,13 @@
|
|
|
<el-form ref="formData" :model="formData" :rules="formRules" size="mini" label-suffix=":" label-width="150px">
|
|
|
<el-form-item label="关联活动" prop="activityId">
|
|
|
<el-select
|
|
|
- v-model="formData.activityId" size="mini" placeholder="请选择关联活动" filterable
|
|
|
- @change="(e) => formData.activityName = activityList.find(i => i.currencyId === e).currencyName"
|
|
|
+ v-model="formData.activityId"
|
|
|
+ size="mini"
|
|
|
+ placeholder="请选择关联活动"
|
|
|
+ filterable
|
|
|
+ @change="(e) => (formData.activityName = activityList.find((i) => i.currencyId === e).currencyName)"
|
|
|
>
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in activityList" :key="item.currencyId"
|
|
|
- :label="`${item.currencyName}(${item.currencyId})`" :value="item.currencyId"
|
|
|
- />
|
|
|
+ <el-option v-for="(item, index) in activityList" :key="item.currencyId" :label="`${item.currencyName}(${item.currencyId})`" :value="item.currencyId" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="活动类型" prop="activityType">
|
|
@@ -25,7 +25,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="formData.leadersRule" label="直接团长规则" prop="leadersMoney">
|
|
|
- <el-input v-model="formData.leadersMoney" placeholder="请输入直接团长规则" style="width: 250px;">
|
|
|
+ <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>
|
|
@@ -33,7 +33,7 @@
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="formData.leadersRule" label="间接团长规则" prop="leadersInMoney">
|
|
|
- <el-input v-model="formData.leadersInMoney" placeholder="请输入间接团长规则" style="width: 250px;">
|
|
|
+ <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>
|
|
@@ -47,7 +47,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="formData.partnerRule" label="直接合伙人规则" prop="partnerMoney">
|
|
|
- <el-input v-model="formData.partnerMoney" placeholder="请输入直接合伙人规则" style="width: 250px;">
|
|
|
+ <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>
|
|
@@ -55,7 +55,7 @@
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="formData.partnerRule" label="间接合伙人规则" prop="partnerInMoney">
|
|
|
- <el-input v-model="formData.partnerInMoney" placeholder="请输入间接合伙人规则" style="width: 250px;">
|
|
|
+ <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>
|
|
@@ -69,13 +69,27 @@
|
|
|
</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;">
|
|
|
+ <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="agentRule">
|
|
|
+ <el-select v-model="formData.agentRule" size="mini" placeholder="请选择代理商规则">
|
|
|
+ <el-option label="比例" :value="1" />
|
|
|
+ <el-option label="金额" :value="2" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="formData.agentRule" label="代理商佣金规则" prop="agentMoney">
|
|
|
+ <el-input v-model="formData.agentMoney" placeholder="请输入代理商佣金规则" style="width: 250px">
|
|
|
+ <template #append>
|
|
|
+ <div v-if="formData.agentRule === 1">%</div>
|
|
|
+ <div v-else-if="formData.agentRule === 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" />
|
|
@@ -83,7 +97,7 @@
|
|
|
</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;">
|
|
|
+ <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>
|
|
@@ -112,8 +126,7 @@ import { getAllPlatformBeeCurrency, getByIdPlatformBeeRule, savePlatformBeeRule,
|
|
|
|
|
|
export default {
|
|
|
name: 'EditModal',
|
|
|
- components: {
|
|
|
- },
|
|
|
+ components: {},
|
|
|
data() {
|
|
|
return {
|
|
|
modalOptions: {
|
|
@@ -137,18 +150,14 @@ export default {
|
|
|
franchiseeMoney: '',
|
|
|
communityRule: '',
|
|
|
communityMoney: '',
|
|
|
- sourceType: ''
|
|
|
+ sourceType: '',
|
|
|
+ agentRule: '',
|
|
|
+ agentMoney: ''
|
|
|
},
|
|
|
formRules: {
|
|
|
- activityId: [
|
|
|
- { required: true, message: '缺少活动' }
|
|
|
- ],
|
|
|
- activityType: [
|
|
|
- { required: true, message: '请选择活动' }
|
|
|
- ],
|
|
|
- leadersRule: [
|
|
|
- { required: true, message: '请选择团长规则' }
|
|
|
- ],
|
|
|
+ activityId: [{ required: true, message: '缺少活动' }],
|
|
|
+ activityType: [{ required: true, message: '请选择活动' }],
|
|
|
+ leadersRule: [{ required: true, message: '请选择团长规则' }],
|
|
|
leadersMoney: [
|
|
|
{ required: false, message: '请输入直接团长规则' },
|
|
|
{ pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' } // >0的数字, 最多2位小数正则
|
|
@@ -157,9 +166,7 @@ export default {
|
|
|
{ required: false, message: '请输入间接团长规则' },
|
|
|
{ pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' }
|
|
|
],
|
|
|
- partnerRule: [
|
|
|
- { required: true, message: '请选择合伙人规则' }
|
|
|
- ],
|
|
|
+ partnerRule: [{ required: true, message: '请选择合伙人规则' }],
|
|
|
partnerMoney: [
|
|
|
{ required: false, message: '请输入直接合伙人规则' },
|
|
|
{ pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' }
|
|
@@ -176,9 +183,11 @@ export default {
|
|
|
{ required: false, message: '请输入间接合伙人规则' },
|
|
|
{ pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' }
|
|
|
],
|
|
|
- sourceType: [
|
|
|
- { required: true, message: '请选择分佣来源' }
|
|
|
- ]
|
|
|
+ agentMoney: [
|
|
|
+ { required: false, message: '请输入间接合伙人规则' },
|
|
|
+ { pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' }
|
|
|
+ ],
|
|
|
+ sourceType: [{ required: true, message: '请选择分佣来源' }]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -198,15 +207,17 @@ export default {
|
|
|
activityName: params.activityName || '',
|
|
|
activityType: params.activityType || '',
|
|
|
leadersRule: params.leadersRule || '',
|
|
|
- leadersMoney: (params.leadersRule === 1) && (typeof params.leadersMoney === 'number') ? params.leadersMoney * 100 : params.leadersMoney,
|
|
|
- leadersInMoney: (params.leadersRule === 1) && (typeof params.leadersInMoney === 'number') ? params.leadersInMoney * 100 : params.leadersInMoney,
|
|
|
+ leadersMoney: params.leadersRule === 1 && typeof params.leadersMoney === 'number' ? params.leadersMoney * 100 : params.leadersMoney,
|
|
|
+ leadersInMoney: params.leadersRule === 1 && typeof params.leadersInMoney === 'number' ? params.leadersInMoney * 100 : params.leadersInMoney,
|
|
|
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,
|
|
|
+ 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,
|
|
|
+ franchiseeMoney: params.franchiseeRule === 1 && typeof params.franchiseeMoney === 'number' ? params.franchiseeMoney * 100 : params.franchiseeMoney,
|
|
|
+ agentRule: params.agentRule || '',
|
|
|
+ agentMoney: params.agentRule === 1 && typeof params.agentMoney === 'number' ? params.agentMoney * 100 : params.agentMoney,
|
|
|
communityRule: params.communityRule || '',
|
|
|
- communityMoney: (params.communityRule === 1) && (typeof params.communityMoney === 'number') ? params.communityMoney * 100 : params.communityMoney,
|
|
|
+ communityMoney: params.communityRule === 1 && typeof params.communityMoney === 'number' ? params.communityMoney * 100 : params.communityMoney,
|
|
|
sourceType: params.sourceType || ''
|
|
|
})
|
|
|
this.visible = true
|
|
@@ -227,15 +238,15 @@ export default {
|
|
|
activityName: res.data.activityName || '',
|
|
|
activityType: res.data.activityType || '',
|
|
|
leadersRule: res.data.leadersRule || '',
|
|
|
- leadersMoney: (res.data.leadersRule === 1) && (typeof res.data.leadersMoney === 'number') ? res.data.leadersMoney * 100 : res.data.leadersMoney,
|
|
|
- leadersInMoney: (res.data.leadersRule === 1) && (typeof res.data.leadersInMoney === 'number') ? res.data.leadersInMoney * 100 : res.data.leadersInMoney,
|
|
|
+ leadersMoney: res.data.leadersRule === 1 && typeof res.data.leadersMoney === 'number' ? res.data.leadersMoney * 100 : res.data.leadersMoney,
|
|
|
+ leadersInMoney: res.data.leadersRule === 1 && typeof res.data.leadersInMoney === 'number' ? res.data.leadersInMoney * 100 : res.data.leadersInMoney,
|
|
|
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,
|
|
|
+ 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,
|
|
|
+ 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,
|
|
|
+ communityMoney: res.data.communityRule === 1 && typeof res.data.communityMoney === 'number' ? res.data.communityMoney * 100 : res.data.communityMoney,
|
|
|
sourceType: res.data.sourceType || ''
|
|
|
})
|
|
|
this.$nextTick(() => {
|