|
@@ -1,15 +1,21 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <CtForm ref="formPageRef" :items="items" style="width: 600px;">
|
|
|
+ <CtForm ref="formPageRef" :items="items" style="width: 650px;">
|
|
|
<template #explain>
|
|
|
- <span style="color: var(--v-error-base); cursor: pointer;" @click="handleViewRule">
|
|
|
- <v-icon size="25" color="error">mdi-help-circle-outline</v-icon>
|
|
|
- 众聘岗位规则说明
|
|
|
- </span>
|
|
|
+ <div class="d-flex align-center font-size-13">
|
|
|
+ <div style="color: var(--v-error-base); cursor: pointer;" @click="handleViewRule">
|
|
|
+ <v-icon size="20" color="error">mdi-help-circle-outline</v-icon>
|
|
|
+ 众聘岗位规则说明;
|
|
|
+ </div>
|
|
|
+ <div class=" ml-5" style="color: var(--v-error-base);">
|
|
|
+ 众聘岗位分配比例:推荐人占比{{ ratio.recommendRate }}% 平台占比{{ ratio.headhuntRate }}% 投递人占比{{ ratio.cvRate }}%
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
- <template #ratio>
|
|
|
- <div class="font-size-13 mb-3" style="color: red;">
|
|
|
- 众聘岗位分配比例:平台占比{{ ratio.headhuntRate }}% 推荐人占比{{ ratio.recommendRate }}% 投递人占比{{ ratio.cvRate }}%
|
|
|
+ <template #numericalValue>
|
|
|
+ <div class="font-size-14 color-error my-1">
|
|
|
+ <div>按众聘岗位分配比例计算后的赏金: 推荐人{{ calculation('hirePrice', 1) }}元、平台{{ calculation('hirePrice', 0) }}元、投递人{{ calculation('hirePrice', 2) }}元</div>
|
|
|
+ <div>按众聘岗位分配比例计算后的积分: 推荐人{{ calculation('hirePoint', 1) }}点、平台{{ calculation('hirePoint', 0) }}点、投递人{{ calculation('hirePoint', 2) }}点</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #positionId="{ item }">
|
|
@@ -40,6 +46,7 @@ import { reactive, ref, defineExpose, watch } from 'vue'
|
|
|
import textUI from '@/components/FormUI/TextInput'
|
|
|
import jobTypeCard from '@/components/jobTypeCard'
|
|
|
import RulePage from './rule.vue'
|
|
|
+import { commissionCalculation } from '@/utils/position'
|
|
|
import { getPublicRatio } from '@/api/recruit/enterprise/position'
|
|
|
|
|
|
const props = defineProps({
|
|
@@ -49,42 +56,26 @@ const props = defineProps({
|
|
|
const show = ref(false)
|
|
|
const ratio = ref({})
|
|
|
|
|
|
-const getValue = (key) => {
|
|
|
- return items.value.options.find(e => e.key === key)
|
|
|
+// 按分配比例计算金额积分
|
|
|
+const calculation = (key, type) => {
|
|
|
+ const value = items.value.options.find(e => e.key === key).value
|
|
|
+ return commissionCalculation(value, type)
|
|
|
}
|
|
|
|
|
|
-// 众聘奖励类型
|
|
|
-const handleChangeHireType = () => {
|
|
|
- const hireType = getValue('hireType')
|
|
|
- let hirePrice = getValue('hirePrice')
|
|
|
- let hirePoint = getValue('hirePoint')
|
|
|
- if (hireType.value) {
|
|
|
- hirePrice.hide = false
|
|
|
- hirePoint.hide = true
|
|
|
- hirePoint.value = null
|
|
|
- } else {
|
|
|
- hirePoint.hide = false
|
|
|
- hirePrice.hide = true
|
|
|
- hirePrice.value = null
|
|
|
- }
|
|
|
+const getValue = (key) => {
|
|
|
+ return items.value.options.find(e => e.key === key)
|
|
|
}
|
|
|
|
|
|
// 是否众聘岗位
|
|
|
const handleChangePublic = (val) => {
|
|
|
- let hireType
|
|
|
items.value.options.forEach(e => {
|
|
|
if (!val && Object.prototype.hasOwnProperty.call(e, 'hide')) {
|
|
|
e.hide = true
|
|
|
e.value = null
|
|
|
return
|
|
|
}
|
|
|
- if (e.key === 'hireType') {
|
|
|
- e.hide = !val
|
|
|
- e.value = props.itemData && props.itemData.hirePoint ? false : true
|
|
|
- hireType = e
|
|
|
- }
|
|
|
- if (Object.prototype.hasOwnProperty.call(e, 'show')) {
|
|
|
- if (hireType.value === e.show) e.hide = false
|
|
|
+ if (val && Object.prototype.hasOwnProperty.call(e, 'show')) {
|
|
|
+ e.hide = false
|
|
|
return
|
|
|
}
|
|
|
if (e.slotName === 'explain') e.hide = val ? false : true
|
|
@@ -118,68 +109,37 @@ const items = ref({
|
|
|
hide: true,
|
|
|
flexStyle: 'mb-3'
|
|
|
},
|
|
|
- {
|
|
|
- type: 'ifRadio',
|
|
|
- key: 'hireType',
|
|
|
- value: null,
|
|
|
- label: '众聘奖励类型 *',
|
|
|
- width: 120,
|
|
|
- hide: true,
|
|
|
- disabled: false,
|
|
|
- noParam: true,
|
|
|
- hideDetails: true,
|
|
|
- items: [
|
|
|
- { label: '赏金', value: true },
|
|
|
- { label: '积分', value: false }
|
|
|
- ],
|
|
|
- change: handleChangeHireType
|
|
|
- },
|
|
|
- {
|
|
|
- slotName: 'ratio',
|
|
|
- noParam: true,
|
|
|
- show: true,
|
|
|
- hide: true
|
|
|
- },
|
|
|
{
|
|
|
type: 'number',
|
|
|
key: 'hirePrice',
|
|
|
value: null,
|
|
|
- label: '众聘赏金 *',
|
|
|
+ label: '众聘赏金',
|
|
|
suffix: '元',
|
|
|
hide: true,
|
|
|
show: true,
|
|
|
- rules: [
|
|
|
- value => {
|
|
|
- if (value) return true
|
|
|
- return '请填写众聘赏金'
|
|
|
- },
|
|
|
- value => {
|
|
|
- if (value >= 1) return true
|
|
|
- return '赏金金额不得小于1'
|
|
|
- }
|
|
|
- ]
|
|
|
+ disabled: false,
|
|
|
+ hideDetails: true,
|
|
|
+ col: 6,
|
|
|
+ flexStyle: 'mr-3'
|
|
|
},
|
|
|
{
|
|
|
type: 'number',
|
|
|
key: 'hirePoint',
|
|
|
value: null,
|
|
|
- label: '众聘奖励积分数 *',
|
|
|
+ label: '众聘奖励积分数',
|
|
|
suffix: '点',
|
|
|
hide: true,
|
|
|
+ col: 6,
|
|
|
disabled: false,
|
|
|
- show: false,
|
|
|
- rules: [
|
|
|
- value => {
|
|
|
- if (value) return true
|
|
|
- return '请填写众聘众聘奖励积分数'
|
|
|
- },
|
|
|
- value => {
|
|
|
- if (value >= 1) return true
|
|
|
- return '积分数不得小于1'
|
|
|
- }
|
|
|
- ]
|
|
|
+ hideDetails: true,
|
|
|
+ show: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slotName: 'numericalValue',
|
|
|
+ noParam: true,
|
|
|
+ show: true,
|
|
|
+ hide: true
|
|
|
},
|
|
|
-
|
|
|
{
|
|
|
type: 'text',
|
|
|
key: 'name',
|