|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
|
|
- <el-form ref="formRef" :model="formData" :rules="formRules" label-width="200px" v-loading="formLoading">
|
|
|
+ <el-form ref="formRef" :model="formData" :rules="formRules" label-width="200px" v-loading="formLoading" class="p-10px">
|
|
|
<template v-if="formType == 'update1'">
|
|
|
<el-form-item label="毛利百分比" prop="grossProfitPerc">
|
|
|
<template #label>
|
|
@@ -10,108 +10,106 @@
|
|
|
<template #append>%</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="用户自得" prop="grossProfitUserQuotaPerc">
|
|
|
- <template #label>
|
|
|
- <Tooltip message="例(35),用户自得+直推奖+合赢奖+平台服务费,总和不能超过100" title="用户自得" />
|
|
|
- </template>
|
|
|
- <el-input v-model="formData.grossProfitUserQuotaPerc" placeholder="请输入用户自得">
|
|
|
- <template #append>%</template>
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
<el-form-item label="直推奖" prop="grossProfitAncestorQuotaPerc">
|
|
|
<template #label>
|
|
|
- <Tooltip message="例(35),用户自得+直推奖+合赢奖+平台服务费,总和不能超过100" title="直推奖" />
|
|
|
+ <Tooltip message="例(35)" title="直推奖" />
|
|
|
</template>
|
|
|
<el-input v-model="formData.grossProfitAncestorQuotaPerc" placeholder="请输入直推奖">
|
|
|
<template #append>%</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="合赢奖" prop="grossProfitBonusQuotaPerc">
|
|
|
+ <el-form-item label="团队奖" prop="grossProfitBonusQuotaPerc">
|
|
|
<template #label>
|
|
|
- <Tooltip message="例(22),用户自得+直推奖+合赢奖+平台服务费,总和不能超过100" title="合赢奖" />
|
|
|
+ <Tooltip message="例(22)" title="团队奖" />
|
|
|
</template>
|
|
|
- <el-input v-model="formData.grossProfitBonusQuotaPerc" placeholder="请输入合赢奖">
|
|
|
+ <el-input v-model="formData.grossProfitBonusQuotaPerc" placeholder="请输入团队奖">
|
|
|
<template #append>%</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="平台服务费" prop="grossProfitPlatformQuotaPerc">
|
|
|
+ <el-form-item label="幸运奖" prop="grossProfitLuckyQuotaPerc">
|
|
|
<template #label>
|
|
|
- <Tooltip message="例(35),用户自得+直推奖+合赢奖+平台服务费,总和不能超过100" title="平台服务费" />
|
|
|
+ <Tooltip message="例(22)" title="幸运奖" />
|
|
|
</template>
|
|
|
- <el-input v-model="formData.grossProfitPlatformQuotaPerc" placeholder="请输入平台服务费">
|
|
|
+ <el-input v-model="formData.grossProfitLuckyQuotaPerc" placeholder="请输入幸运奖">
|
|
|
<template #append>%</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="分成" prop="divideIntoPerc">
|
|
|
- <el-input v-model="formData.divideIntoPerc" placeholder="请输入分成">
|
|
|
+ <el-form-item label="黄积分所占百分比" prop="bonusYellowIntegral">
|
|
|
+ <template #label>
|
|
|
+ <Tooltip message="例(80,黄积分所占+绿积分所占=100)" title="黄积分所占百分比" />
|
|
|
+ </template>
|
|
|
+ <el-input v-model="formData.bonusYellowIntegral" placeholder="请输入黄积分所占百分比">
|
|
|
<template #append>%</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
- </template>
|
|
|
- <template v-else-if="formType == 'withdraw'">
|
|
|
- <el-form-item label="提现比例" prop="withdrawCommission">
|
|
|
+ <el-form-item label="绿积分所占百分比" prop="bonusGreenIntegral">
|
|
|
<template #label>
|
|
|
- <Tooltip message="例80%,提现比例+消费分比例必须等于100%" title="提现比例" />
|
|
|
+ <Tooltip message="例(20,黄积分所占+绿积分所占=100)" title="绿积分所占百分比" />
|
|
|
</template>
|
|
|
- <el-input v-model="formData.withdrawCommission" placeholder="请输入提现比例">
|
|
|
+ <el-input v-model="formData.bonusGreenIntegral" placeholder="请输入绿积分所占百分比">
|
|
|
<template #append>%</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="消费分比例" prop="withdrawConsumption">
|
|
|
+ <el-form-item label="平台服务费" prop="grossProfitPlatformQuotaPerc">
|
|
|
<template #label>
|
|
|
- <Tooltip message="例20%,提现比例+消费分比例必须等于100%" title="消费分比例" />
|
|
|
+ <Tooltip message="例(35)" title="平台服务费" />
|
|
|
</template>
|
|
|
- <el-input v-model="formData.withdrawConsumption" placeholder="请输入消费分比例">
|
|
|
+ <el-input v-model="formData.grossProfitPlatformQuotaPerc" placeholder="请输入平台服务费">
|
|
|
<template #append>%</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
</template>
|
|
|
<template v-else-if="formType == 'update2'">
|
|
|
- <el-form-item label="购物自得" prop="orderUserSocialStatus">
|
|
|
- <el-input v-model="formData.orderUserSocialStatus" placeholder="请输入购物自得" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="购物推荐人获得" prop="orderAncestorSocialStatus">
|
|
|
- <el-input v-model="formData.orderAncestorSocialStatus" placeholder="请输入购物推荐人获得" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="注册默认身价" prop="registerSocialStatus">
|
|
|
- <el-input v-model="formData.registerSocialStatus" placeholder="请输入注册默认身价" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="推荐注册身价" prop="registerAncestorSocialStatus">
|
|
|
- <el-input v-model="formData.registerAncestorSocialStatus" placeholder="请输入推荐注册身价" />
|
|
|
+ <el-form-item label="会员转换比例(黄转红)" prop="memberYellowTransitionRed">
|
|
|
+ <template #label>
|
|
|
+ <Tooltip message="例(80)" title="会员黄积分转红积分比例" />
|
|
|
+ </template>
|
|
|
+ <el-input v-model="formData.memberYellowTransitionRed" placeholder="请输入会员转换比例(黄转红)">
|
|
|
+ <template #append>%</template>
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="收藏获得" prop="collectSocialStatus">
|
|
|
- <el-input v-model="formData.collectSocialStatus" placeholder="请输入收藏获得" />
|
|
|
+ <el-form-item label="会员转换比例(红转绿)" prop="memberRedTransitionGreen">
|
|
|
+ <template #label>
|
|
|
+ <Tooltip message="例(80)" title="会员红积分转绿积分比例" />
|
|
|
+ </template>
|
|
|
+ <el-input v-model="formData.memberRedTransitionGreen" placeholder="请输入会员转换比例(红转绿)">
|
|
|
+ <template #append>%</template>
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="签到获得" prop="signInsocialstatus">
|
|
|
- <el-input v-model="formData.signInSocialStatus" placeholder="请输入签到获得" />
|
|
|
+ <el-form-item label="代理商转换比例(黄转红)" prop="agentYellowTransitionRed">
|
|
|
+ <template #label>
|
|
|
+ <Tooltip message="例(80)" title="代理商黄积分转红积分比例" />
|
|
|
+ </template>
|
|
|
+ <el-input v-model="formData.agentYellowTransitionRed" placeholder="请输入代理商转换比例(黄转红)">
|
|
|
+ <template #append>%</template>
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="签到可获得最大身价值" prop="signInsocialstatusMax">
|
|
|
- <el-input v-model="formData.signInSocialStatusMax" placeholder="请输入签到获得" />
|
|
|
+ <el-form-item label="代理商转换比例(红转绿)" prop="agentRedTransitionGreen">
|
|
|
+ <template #label>
|
|
|
+ <Tooltip message="例(80)" title="代理商红积分转绿积分比例" />
|
|
|
+ </template>
|
|
|
+ <el-input v-model="formData.agentRedTransitionGreen" placeholder="请输入代理商转换比例(红转绿)">
|
|
|
+ <template #append>%</template>
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
- <template v-else>
|
|
|
- <el-form-item label="充值倍率" prop="consumptionMagnification">
|
|
|
- <el-input v-model="formData.consumptionMagnification" placeholder="请输入充值倍率" >
|
|
|
+ <template v-else-if="formType == 'update3'">
|
|
|
+ <el-form-item label="充值倍率" prop="integralMagnification">
|
|
|
+ <template #label>
|
|
|
+ <Tooltip message="例(0.5)表示50%" title="充值倍率" />
|
|
|
+ </template>
|
|
|
+ <el-input v-model="formData.integralMagnification" placeholder="请输入充值倍率">
|
|
|
<template #append>%</template>
|
|
|
- </el-input>
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="触发倍率的最低金额" prop="triggerMagnificationPoints">
|
|
|
+ <template #label>
|
|
|
+ <Tooltip message="触发充值倍率所需的最低金额" title="触发倍率的最低金额" />
|
|
|
+ </template>
|
|
|
<el-input v-model="formData.triggerMagnificationPoints" placeholder="请输入触发倍率的最低金额" />
|
|
|
</el-form-item>
|
|
|
- <!-- <el-form-item label="首次最低充值金额" prop="firstTopUpConsumption">
|
|
|
- <el-input v-model="formData.firstTopUpConsumption" placeholder="请输入首次最低充值金额" />
|
|
|
- </el-form-item> -->
|
|
|
- <!-- <el-form-item label="后续单次最低充值金额" prop="followUpConsumption">
|
|
|
- <el-input v-model="formData.followUpConsumption" placeholder="请输入后续单次最低充值金额" />
|
|
|
- </el-form-item>-->
|
|
|
- <el-form-item label="用户单次最低充值金额" prop="userTopUpConsumptionPoints">
|
|
|
- <el-input v-model="formData.userTopUpConsumptionPoints" placeholder="用户单次最低充值金额" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="成为代理商所需额度" prop="userTopUpConsumptionPoints">
|
|
|
- <el-input v-model="formData.agentQuota" placeholder="成为代理商所需额度" />
|
|
|
- </el-form-item>
|
|
|
</template>
|
|
|
+
|
|
|
</el-form>
|
|
|
|
|
|
<template #footer>
|
|
@@ -135,46 +133,26 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
|
|
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
|
|
const formData = ref({
|
|
|
id: undefined,
|
|
|
+ // update1 字段
|
|
|
grossProfitPerc: undefined,
|
|
|
- grossProfitUserQuotaPerc: undefined,
|
|
|
grossProfitAncestorQuotaPerc: undefined,
|
|
|
grossProfitBonusQuotaPerc: undefined,
|
|
|
+ grossProfitLuckyQuotaPerc: undefined,
|
|
|
+ bonusYellowIntegral: undefined,
|
|
|
+ bonusGreenIntegral: undefined,
|
|
|
grossProfitPlatformQuotaPerc: undefined,
|
|
|
- divideIntoPerc: undefined,
|
|
|
- orderUserSocialStatus: undefined,
|
|
|
- orderAncestorSocialStatus: undefined,
|
|
|
- registerSocialStatus: undefined,
|
|
|
- registerAncestorSocialStatus: undefined,
|
|
|
- collectSocialStatus: undefined,
|
|
|
- signInSocialStatus:undefined,
|
|
|
- signInSocialStatusMax:undefined,
|
|
|
- consumptionMagnification: undefined,
|
|
|
- firstTopUpConsumption: undefined,
|
|
|
- followUpConsumption: undefined,
|
|
|
- withdrawCommission: undefined,
|
|
|
- withdrawConsumption:undefined,
|
|
|
- userTopUpConsumptionPoints:undefined,
|
|
|
- triggerMagnificationPoints:undefined,
|
|
|
- agentQuota:undefined
|
|
|
+
|
|
|
+ // update2 字段
|
|
|
+ memberYellowTransitionRed: undefined,
|
|
|
+ memberRedTransitionGreen: undefined,
|
|
|
+ agentYellowTransitionRed: undefined,
|
|
|
+ agentRedTransitionGreen: undefined,
|
|
|
+
|
|
|
+ // update3 字段
|
|
|
+ integralMagnification: undefined,
|
|
|
+ triggerMagnificationPoints: undefined
|
|
|
}) // 表单数据
|
|
|
|
|
|
-const totalPercentage = computed(() => {
|
|
|
- return Number(formData.value.grossProfitUserQuotaPerc) +
|
|
|
- Number(formData.value.grossProfitAncestorQuotaPerc) +
|
|
|
- Number(formData.value.grossProfitBonusQuotaPerc) +
|
|
|
- Number(formData.value.grossProfitPlatformQuotaPerc);
|
|
|
-});
|
|
|
-const isSubmitDisabled = computed(() => {
|
|
|
- return totalPercentage.value > 100;
|
|
|
-});
|
|
|
-
|
|
|
-const withdrawPercentage = computed(() => {
|
|
|
- return Number(formData.value.withdrawCommission) +
|
|
|
- Number(formData.value.withdrawConsumption)
|
|
|
-});
|
|
|
-const withdrawIsSubmitDisabled = computed(() => {
|
|
|
- return withdrawPercentage.value !== 100;
|
|
|
-});
|
|
|
const formRules = reactive({
|
|
|
})
|
|
|
const formRef = ref() // 表单 Ref
|
|
@@ -195,39 +173,44 @@ const open = async (type: string, id?: number) => {
|
|
|
}
|
|
|
percKeys.forEach(key => {
|
|
|
if (formData.value.hasOwnProperty(key)) {
|
|
|
- formData.value[key] = (formData.value[key] * 100);
|
|
|
+ formData.value[key] = (formData.value[key] * 100).toFixed(0);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
|
const percKeys = [
|
|
|
+ // update1 相关的百分比字段
|
|
|
"grossProfitPerc",
|
|
|
- "grossProfitUserQuotaPerc",
|
|
|
"grossProfitAncestorQuotaPerc",
|
|
|
"grossProfitBonusQuotaPerc",
|
|
|
+ "grossProfitLuckyQuotaPerc",
|
|
|
+ "bonusYellowIntegral",
|
|
|
+ "bonusGreenIntegral",
|
|
|
"grossProfitPlatformQuotaPerc",
|
|
|
- "divideIntoPerc",
|
|
|
- "consumptionMagnification",
|
|
|
- "withdrawCommission",
|
|
|
- "withdrawConsumption",
|
|
|
+
|
|
|
+ // update2 相关的百分比字段
|
|
|
+ "memberYellowTransitionRed",
|
|
|
+ "memberRedTransitionGreen",
|
|
|
+ "agentYellowTransitionRed",
|
|
|
+ "agentRedTransitionGreen",
|
|
|
+
|
|
|
+ // update3 相关的百分比字段
|
|
|
+ "integralMagnification"
|
|
|
];
|
|
|
/** 提交表单 */
|
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
|
|
const submitForm = async () => {
|
|
|
-
|
|
|
-
|
|
|
- // 如果用户自得+直推奖+合赢奖+平台服务费> 100那就不给保存
|
|
|
- if (isSubmitDisabled.value) {
|
|
|
- message.error('用户自得+直推奖+合赢奖+平台服务费,总和不能超过100%');
|
|
|
- return;
|
|
|
- }
|
|
|
- // 如果提现佣金+提现消费金额 != 100那就不给保存
|
|
|
- if (withdrawIsSubmitDisabled.value) {
|
|
|
- message.error('提现佣金+提现消费金额,总和必须为100%');
|
|
|
- return;
|
|
|
+ if (formData.value.bonusYellowIntegral && formData.value.bonusGreenIntegral) {
|
|
|
+ const yellowIntegral = Number(formData.value.bonusYellowIntegral)
|
|
|
+ const greenIntegral = Number(formData.value.bonusGreenIntegral)
|
|
|
+ const total = yellowIntegral + greenIntegral
|
|
|
+
|
|
|
+ if (total !== 100) {
|
|
|
+ message.error('黄积分所占百分比与绿积分所占百分比之和必须等于100%')
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
// 转换百分比为小数并转为字符串
|
|
|
percKeys.forEach(key => {
|
|
|
if (formData.value.hasOwnProperty(key)) {
|
|
@@ -261,11 +244,18 @@ const resetForm = () => {
|
|
|
formData.value = {
|
|
|
id: undefined,
|
|
|
grossProfitPerc: undefined,
|
|
|
- grossProfitUserQuotaPerc: undefined,
|
|
|
grossProfitAncestorQuotaPerc: undefined,
|
|
|
grossProfitBonusQuotaPerc: undefined,
|
|
|
+ grossProfitLuckyQuotaPerc: undefined,
|
|
|
+ bonusYellowIntegral: undefined,
|
|
|
+ bonusGreenIntegral: undefined,
|
|
|
grossProfitPlatformQuotaPerc: undefined,
|
|
|
- divideIntoPerc: undefined
|
|
|
+ memberYellowTransitionRed: undefined,
|
|
|
+ memberRedTransitionGreen: undefined,
|
|
|
+ agentYellowTransitionRed: undefined,
|
|
|
+ agentRedTransitionGreen: undefined,
|
|
|
+ integralMagnification: undefined,
|
|
|
+ triggerMagnificationPoints: undefined
|
|
|
}
|
|
|
formRef.value?.resetFields()
|
|
|
}
|