|
|
|
@ -27,20 +27,6 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
<el-card class="mb-18px" shadow="never" :body-style="{ padding: '10px' }"> |
|
|
|
|
<div v-if="formData.percentageType == 1"> |
|
|
|
|
<p class="text-red-500">阶梯结算说明:</p> |
|
|
|
|
<p>若设置 0档、1000档、2000档</p> |
|
|
|
|
<p>金额为1500,则未满1000的部分按照0档结算提成,1000-1500的部分按照1000档结算</p> |
|
|
|
|
</div> |
|
|
|
|
<div v-else-if="formData.percentageType == 2"> |
|
|
|
|
<p class="text-red-500">阶梯结算说明:</p> |
|
|
|
|
<p>若设置 0档、1000档、2000档</p> |
|
|
|
|
<p>金额为1500,则全部按照1000档结算</p> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
<el-button type="primary" class="mb-10px" plain @click="handleAddRules"> |
|
|
|
|
添加提成档位 |
|
|
|
|
</el-button> |
|
|
|
@ -52,12 +38,7 @@ |
|
|
|
|
v-for="(item, index) in formData.rules" |
|
|
|
|
:key="index" |
|
|
|
|
> |
|
|
|
|
<el-select |
|
|
|
|
v-model="item.ruleParam1" |
|
|
|
|
style="width: 100px" |
|
|
|
|
:disabled="index > 0" |
|
|
|
|
@change="planChanged('ruleParam1', false)" |
|
|
|
|
> |
|
|
|
|
<el-select v-model="item.ruleParam1" style="width: 100px"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="it in opts.percentage_param1" |
|
|
|
|
:key="it.value" |
|
|
|
@ -65,13 +46,7 @@ |
|
|
|
|
:value="it.value" |
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
<el-select |
|
|
|
|
class="ml-5px" |
|
|
|
|
v-model="item.ruleParam2" |
|
|
|
|
style="width: 100px" |
|
|
|
|
:disabled="index > 0" |
|
|
|
|
@change="planChanged('ruleParam2', false)" |
|
|
|
|
> |
|
|
|
|
<el-select class="ml-5px" v-model="item.ruleParam2" style="width: 100px"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="it in opts.percentage_param2" |
|
|
|
|
:key="it.value" |
|
|
|
@ -110,13 +85,7 @@ |
|
|
|
|
</div> |
|
|
|
|
<div v-else class="inline-flex items-center"> |
|
|
|
|
<span class="ml-5px">取</span> |
|
|
|
|
<el-select |
|
|
|
|
class="ml-5px" |
|
|
|
|
v-model="item.ruleParam5" |
|
|
|
|
style="width: 100px" |
|
|
|
|
:disabled="formData.percentageType == 1" |
|
|
|
|
@change="planChanged('ruleParam5')" |
|
|
|
|
> |
|
|
|
|
<el-select class="ml-5px" v-model="item.ruleParam5" style="width: 100px"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="it in opts.percentage_param5" |
|
|
|
|
:key="it.value" |
|
|
|
@ -136,12 +105,7 @@ |
|
|
|
|
<template #suffix> % </template> |
|
|
|
|
</el-input> |
|
|
|
|
</div> |
|
|
|
|
<Icon |
|
|
|
|
v-if="index > 0" |
|
|
|
|
icon="ep:remove-filled" |
|
|
|
|
class="text-red-500 ml-20px" |
|
|
|
|
@click="handleRemove(index)" |
|
|
|
|
/> |
|
|
|
|
<Icon icon="ep:remove-filled" class="text-red-500 ml-20px" @click="handleRemove(index)" /> |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
@ -238,7 +202,7 @@ const message = useMessage() // 消息弹窗 |
|
|
|
|
const { t } = useI18n() // 国际化 |
|
|
|
|
|
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示 |
|
|
|
|
const dialogTitle = ref('提成方案') |
|
|
|
|
const dialogTitle = ref('工资条设置') |
|
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
|
|
|
|
|
|
|
|
|
const formData = ref({}) |
|
|
|
@ -280,15 +244,9 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
|
|
|
|
|
|
|
/** 重置表单 */ |
|
|
|
|
const resetForm = () => { |
|
|
|
|
opts.value = { |
|
|
|
|
percentage_param1: [], |
|
|
|
|
percentage_param2: [], |
|
|
|
|
percentage_param4: [], |
|
|
|
|
percentage_param5: [] |
|
|
|
|
} |
|
|
|
|
formData.value = { |
|
|
|
|
percentageName: undefined, |
|
|
|
|
percentageType: 2, |
|
|
|
|
percentageType: 1, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
ruleParam1: '2', |
|
|
|
@ -309,7 +267,14 @@ const resetForm = () => { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function handleAddRules() { |
|
|
|
|
formData.value.rules.push(formData.value.rules[0]) |
|
|
|
|
formData.value.rules.push({ |
|
|
|
|
ruleParam1: '2', |
|
|
|
|
ruleParam2: '1', |
|
|
|
|
ruleParam3: 0, |
|
|
|
|
ruleParam4: '1', |
|
|
|
|
ruleParam5: '1', |
|
|
|
|
ruleParam6: 0 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['success']) |
|
|
|
@ -341,24 +306,6 @@ const submitForm = async () => { |
|
|
|
|
function handleRemove(index) { |
|
|
|
|
formData.value.rules.splice(index, 1) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function planChanged(paramName, editble = true) { |
|
|
|
|
const defaultRule = formData.value.rules[0] |
|
|
|
|
formData.value.rules.forEach((it, index) => { |
|
|
|
|
if (formData.value.percentageType == 2) { |
|
|
|
|
if (!editble) { |
|
|
|
|
it[paramName] = defaultRule[paramName] |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (index > 0) { |
|
|
|
|
it[paramName] = defaultRule[paramName] |
|
|
|
|
} |
|
|
|
|
if (paramName == 'ruleParam2') { |
|
|
|
|
it['ruleParam5'] = defaultRule[paramName] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped></style> |
|
|
|
|