Xiao_123 9 месяцев назад
Родитель
Сommit
ed905ebe40

+ 2 - 2
src/utils/position.js

@@ -90,11 +90,11 @@ const getRation = async () => {
 }
 getRation()
 
-export const commissionCalculation = (count, type) => {
+export const commissionCalculation = (count, type, status) => {
   if (count && type === 'emitPay') return ((count - 0)*100) // 众聘职位金额回显需要除以100
   if (count && type === 'realPay') return ((count - 0)/100) // 众聘职位发布金额需要提交时需要乘以100
   if (!data || !Object.keys(data).length) return
   const ratio = parseFloat(data[list[type]]) / 100
-  const value = (count * ratio)/100 // 后端需要除100
+  const value = status ? count * ratio : (count * ratio) / 100 // 后端需要除100
   return value % 1 === 0 ? Math.floor(value) : value.toFixed(2)
 }

+ 5 - 5
src/views/recruit/enterprise/positionManagement/components/baseInfo.vue

@@ -25,9 +25,9 @@
         </div>
           <div class="d-flex">
             按众聘岗位分配比例计算后的赏金: 
-            <span class="calculation ml-3">推荐人{{ calculation('hirePrice', 1) }}元</span>
-            <span class="calculation">平台{{ calculation('hirePrice', 0) }}元</span>
-            <span class="calculation">投递人{{ calculation('hirePrice', 2) }}元</span>
+            <span class="calculation ml-3">推荐人{{ calculation('hirePrice', 1, true) }}元</span>
+            <span class="calculation">平台{{ calculation('hirePrice', 0, true) }}元</span>
+            <span class="calculation">投递人{{ calculation('hirePrice', 2, true) }}元</span>
           </div>
           <!-- <div class="d-flex">
             按众聘岗位分配比例计算后的积分: 
@@ -76,9 +76,9 @@ const show = ref(false)
 const ratio = ref({})
 
 // 按分配比例计算金额积分
-const calculation = (key, type) => {
+const calculation = (key, type, status) => {
   const value = items.value.options.find(e => e.key === key).value
-  return commissionCalculation(value, type)
+  return commissionCalculation(value, type, status)
 }
 
 const getValue = (key) => {