From 63049a956b17635bbb93d65b5db961f9d90a60e4 Mon Sep 17 00:00:00 2001
From: 赵士淞 <zhaoss@yhzhg.cn>
Date: Thu, 12 Jan 2023 09:26:54 +0000
Subject: [PATCH] 工资管理
---
eladmin-web-master/src/views/assembly/moneyInput/index.vue | 2
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/salary/service/impl/SalaryServiceImpl.java | 18
eladmin-web-master/src/views/salary/salary/index.vue | 1335 +++++++++++++++++++++++++++++++++++++++------------------
3 files changed, 921 insertions(+), 434 deletions(-)
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/salary/service/impl/SalaryServiceImpl.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/salary/service/impl/SalaryServiceImpl.java
index 8c29a0f..c0446d3 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/salary/service/impl/SalaryServiceImpl.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/salary/service/impl/SalaryServiceImpl.java
@@ -610,15 +610,15 @@
// 医疗险个人缴纳金额、失业险个人缴纳金额、生育险个人缴纳金额、工伤险个人缴纳金额 是否为空
if (
salary.getActualBasicWage() != null && !"".equals(salary.getActualBasicWage()) &&
- salary.getActualAchievementsWage() != null && !"".equals(salary.getActualAchievementsWage()) &&
- salary.getActualPerformanceWage() != null && !"".equals(salary.getActualPerformanceWage()) &&
- salary.getActualTeamWage() != null && !"".equals(salary.getActualTeamWage()) &&
- salary.getAccumulationPersonalAmount() != null && !"".equals(salary.getAccumulationPersonalAmount()) &&
- salary.getPensionPersonalAmount() != null && !"".equals(salary.getPensionPersonalAmount()) &&
- salary.getMedicalPersonalAmount() != null && !"".equals(salary.getMedicalPersonalAmount()) &&
- salary.getUnemploymentPersonalAmount() != null && !"".equals(salary.getUnemploymentPersonalAmount()) &&
- salary.getMaternityPersonalAmount() != null && !"".equals(salary.getMaternityPersonalAmount()) &&
- salary.getIndustrialInjuryPersonalAmount() != null && !"".equals(salary.getIndustrialInjuryPersonalAmount())
+ salary.getActualAchievementsWage() != null && !"".equals(salary.getActualAchievementsWage()) &&
+ salary.getActualPerformanceWage() != null && !"".equals(salary.getActualPerformanceWage()) &&
+ salary.getActualTeamWage() != null && !"".equals(salary.getActualTeamWage()) &&
+ salary.getAccumulationPersonalAmount() != null && !"".equals(salary.getAccumulationPersonalAmount()) &&
+ salary.getPensionPersonalAmount() != null && !"".equals(salary.getPensionPersonalAmount()) &&
+ salary.getMedicalPersonalAmount() != null && !"".equals(salary.getMedicalPersonalAmount()) &&
+ salary.getUnemploymentPersonalAmount() != null && !"".equals(salary.getUnemploymentPersonalAmount()) &&
+ salary.getMaternityPersonalAmount() != null && !"".equals(salary.getMaternityPersonalAmount()) &&
+ salary.getIndustrialInjuryPersonalAmount() != null && !"".equals(salary.getIndustrialInjuryPersonalAmount())
) {
// 税前金额
salary.setPreTaxAmount(salary.getActualBasicWage().add(salary.getActualAchievementsWage()).add(salary.getActualPerformanceWage()).add(salary.getActualTeamWage()));
diff --git a/eladmin-web-master/src/views/assembly/moneyInput/index.vue b/eladmin-web-master/src/views/assembly/moneyInput/index.vue
index b5e3ddc..e98762a 100644
--- a/eladmin-web-master/src/views/assembly/moneyInput/index.vue
+++ b/eladmin-web-master/src/views/assembly/moneyInput/index.vue
@@ -84,7 +84,7 @@
// 金额格式化
this.getInputValue(el)
// 函数回调
- this.$emit('onBlur')
+ this.$emit('blur')
},
// 金额格式输入框获取焦点触发
moneyFocus(el) {
diff --git a/eladmin-web-master/src/views/salary/salary/index.vue b/eladmin-web-master/src/views/salary/salary/index.vue
index 78e56d5..310c3f1 100644
--- a/eladmin-web-master/src/views/salary/salary/index.vue
+++ b/eladmin-web-master/src/views/salary/salary/index.vue
@@ -23,7 +23,7 @@
class="filter-item"
size="mini"
type="primary"
- icon="el-icon-share"
+ icon="el-icon-s-check"
:disabled="crud.selections.length === 0"
style="margin-right: 6px;"
@click="multiplePublicity(crud.selections)"
@@ -34,7 +34,7 @@
class="filter-item"
size="mini"
type="primary"
- icon="el-icon-share"
+ icon="el-icon-finished"
:disabled="crud.selections.length === 0"
style="margin-right: 6px;"
@click="multipleApprove(crud.selections)"
@@ -45,14 +45,14 @@
class="filter-item"
size="mini"
type="primary"
- icon="el-icon-share"
+ icon="el-icon-plus"
style="margin-right: 6px;"
@click="openGenerate"
>生成</el-button>
</crudOperation>
<!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="690px">
- <el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="110px">
+ <el-form ref="form" v-loading="formLoading" :inline="true" :model="form" :rules="rules" size="small" label-width="110px">
<el-form-item label="所属员工" prop="userId">
<el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 523px;" :disabled="disabledFlagByApprove" @change="getUserLevel">
<el-option
@@ -75,230 +75,230 @@
/>
</el-form-item>
<el-form-item label="级别工资" prop="levelWage">
- <money-input :key="random" v-model="form.levelWage" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="levelWageRandom" v-model="form.levelWage" :width="200" :disabled="disabledFlagByApprove" @blur="levelWageBlur" />
</el-form-item>
<el-divider>基本工资</el-divider>
<el-form-item label="工资比例" prop="basicWageProportion">
- <el-input v-model="form.basicWageProportion" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.basicWageProportion" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="basicParameterBlur">
<template slot="append">%</template>
</el-input>
</el-form-item>
<el-form-item label="预计工资" prop="basicWage">
- <money-input :key="random" v-model="form.basicWage" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="basicWageRandom" v-model="form.basicWage" :width="200" :disabled="disabledFlagByApprove" @blur="basicWageBlur" />
</el-form-item>
<el-form-item label="全勤小时数" prop="fullDays">
- <el-input v-model="form.fullDays" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.fullDays" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="basicParameterBlur">
<template slot="append">小时</template>
</el-input>
</el-form-item>
<el-form-item label="缺勤小时数" prop="absenceDays">
- <el-input v-model="form.absenceDays" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.absenceDays" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="basicParameterBlur">
<template slot="append">小时</template>
</el-input>
</el-form-item>
<el-form-item label="实际工资" prop="actualBasicWage">
- <money-input :key="random" v-model="form.actualBasicWage" :width="523" :disabled="disabledFlagByApprove" />
+ <money-input :key="actualBasicWageRandom" v-model="form.actualBasicWage" :width="523" :disabled="disabledFlagByApprove" @blur="statisticalAmount" />
</el-form-item>
<el-divider>绩效工资</el-divider>
<el-form-item label="工资比例" prop="achievementsWageProportion">
- <el-input v-model="form.achievementsWageProportion" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.achievementsWageProportion" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="achievementsParameterBlur">
<template slot="append">%</template>
</el-input>
</el-form-item>
<el-form-item label="预计工资" prop="achievementsWage">
- <money-input :key="random" v-model="form.achievementsWage" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="achievementsWageRandom" v-model="form.achievementsWage" :width="200" :disabled="disabledFlagByApprove" @blur="achievementsWageBlur" />
</el-form-item>
<el-form-item label="应完成工时" prop="needCompletedAchievementsHours">
- <el-input v-model="form.needCompletedAchievementsHours" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.needCompletedAchievementsHours" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="achievementsParameterBlur">
<template slot="append">小时</template>
</el-input>
</el-form-item>
<el-form-item label="已完成工时" prop="alreadyCompletedAchievementsHours">
- <el-input v-model="form.alreadyCompletedAchievementsHours" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.alreadyCompletedAchievementsHours" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="achievementsParameterBlur">
<template slot="append">小时</template>
</el-input>
</el-form-item>
<el-form-item label="实际工资" prop="actualAchievementsWage">
- <money-input :key="random" v-model="form.actualAchievementsWage" :width="523" :disabled="disabledFlagByApprove" />
+ <money-input :key="actualAchievementsWageRandom" v-model="form.actualAchievementsWage" :width="523" :disabled="disabledFlagByApprove" @blur="statisticalAmount" />
</el-form-item>
<el-divider>业绩工资</el-divider>
<el-form-item label="工资比例" prop="performanceWageProportion">
- <el-input v-model="form.performanceWageProportion" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.performanceWageProportion" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="performanceParameterBlur">
<template slot="append">%</template>
</el-input>
</el-form-item>
<el-form-item label="预计工资" prop="performanceWage">
- <money-input :key="random" v-model="form.performanceWage" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="performanceWageRandom" v-model="form.performanceWage" :width="200" :disabled="disabledFlagByApprove" @blur="performanceWageBlur" />
</el-form-item>
<el-form-item label="个人业绩比例" prop="personalPerformanceProportion">
- <el-input v-model="form.personalPerformanceProportion" style="width: 523px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.personalPerformanceProportion" style="width: 523px;" :disabled="disabledFlagByApprove" @blur="performanceParameterBlur">
<template slot="append">%</template>
</el-input>
</el-form-item>
<el-form-item label="应完成工时" prop="needCompletedPerformanceHours">
- <el-input v-model="form.needCompletedPerformanceHours" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.needCompletedPerformanceHours" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="performanceParameterBlur">
<template slot="append">小时</template>
</el-input>
</el-form-item>
<el-form-item label="已完成工时" prop="alreadyCompletedPerformanceHours">
- <el-input v-model="form.alreadyCompletedPerformanceHours" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.alreadyCompletedPerformanceHours" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="performanceParameterBlur">
<template slot="append">小时</template>
</el-input>
</el-form-item>
<el-form-item label="实际工资" prop="actualPerformanceWage">
- <money-input :key="random" v-model="form.actualPerformanceWage" :width="523" :disabled="disabledFlagByApprove" />
+ <money-input :key="actualPerformanceWageRandom" v-model="form.actualPerformanceWage" :width="523" :disabled="disabledFlagByApprove" @blur="statisticalAmount" />
</el-form-item>
<el-divider>团队工资</el-divider>
<el-form-item label="工资比例" prop="teamWageProportion">
- <el-input v-model="form.teamWageProportion" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.teamWageProportion" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="teamParameterBlur">
<template slot="append">%</template>
</el-input>
</el-form-item>
<el-form-item label="预计工资" prop="teamWage">
- <money-input :key="random" v-model="form.teamWage" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="teamWageRandom" v-model="form.teamWage" :width="200" :disabled="disabledFlagByApprove" @blur="teamWageBlur" />
</el-form-item>
<el-form-item label="实达标工时" prop="actualComplianceTeamHours">
- <el-input v-model="form.actualComplianceTeamHours" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.actualComplianceTeamHours" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="teamParameterBlur">
<template slot="append">小时</template>
</el-input>
</el-form-item>
<el-form-item label="已完成工时" prop="alreadyCompletedTeamHours">
- <el-input v-model="form.alreadyCompletedTeamHours" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.alreadyCompletedTeamHours" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="teamParameterBlur">
<template slot="append">小时</template>
</el-input>
</el-form-item>
<el-form-item label="实际工资" prop="actualTeamWage">
- <money-input :key="random" v-model="form.actualTeamWage" :width="523" :disabled="disabledFlagByApprove" />
+ <money-input :key="actualTeamWageRandom" v-model="form.actualTeamWage" :width="523" :disabled="disabledFlagByApprove" @blur="statisticalAmount" />
</el-form-item>
<el-divider>公积金</el-divider>
<el-form-item label="基数" prop="accumulationRadix">
- <money-input :key="random" v-model="form.accumulationRadix" :width="523" :disabled="disabledFlagByApprove" />
+ <money-input :key="accumulationRadixRandom" v-model="form.accumulationRadix" :width="523" :disabled="disabledFlagByApprove" @blur="accumulationParameterBlur" />
</el-form-item>
<el-form-item label="个人缴纳比例" prop="accumulationPersonalProportion">
- <el-input v-model="form.accumulationPersonalProportion" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.accumulationPersonalProportion" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="accumulationParameterBlur">
<template slot="append">%</template>
</el-input>
</el-form-item>
<el-form-item label="个人缴纳金额" prop="accumulationPersonalAmount">
- <money-input :key="random" v-model="form.accumulationPersonalAmount" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="accumulationPersonalAmountRandom" v-model="form.accumulationPersonalAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" />
</el-form-item>
<el-form-item label="公司缴纳比例" prop="accumulationCompanyProportion">
- <el-input v-model="form.accumulationCompanyProportion" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.accumulationCompanyProportion" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="accumulationParameterBlur">
<template slot="append">%</template>
</el-input>
</el-form-item>
<el-form-item label="公司缴纳金额" prop="accumulationCompanyAmount">
- <money-input :key="random" v-model="form.accumulationCompanyAmount" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="accumulationCompanyAmountRandom" v-model="form.accumulationCompanyAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" />
</el-form-item>
<el-divider>养老险</el-divider>
<el-form-item label="基数" prop="pensionRadix">
- <money-input :key="random" v-model="form.pensionRadix" :width="523" :disabled="disabledFlagByApprove" />
+ <money-input :key="pensionRadixRandom" v-model="form.pensionRadix" :width="523" :disabled="disabledFlagByApprove" @blur="pensionParameterBlur" />
</el-form-item>
<el-form-item label="个人缴纳比例" prop="pensionPersonalProportion">
- <el-input v-model="form.pensionPersonalProportion" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.pensionPersonalProportion" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="pensionParameterBlur">
<template slot="append">%</template>
</el-input>
</el-form-item>
<el-form-item label="个人缴纳金额" prop="pensionPersonalAmount">
- <money-input :key="random" v-model="form.pensionPersonalAmount" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="pensionPersonalAmountRandom" v-model="form.pensionPersonalAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" />
</el-form-item>
<el-form-item label="公司缴纳比例" prop="pensionCompanyProportion">
- <el-input v-model="form.pensionCompanyProportion" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.pensionCompanyProportion" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="pensionParameterBlur">
<template slot="append">%</template>
</el-input>
</el-form-item>
<el-form-item label="公司缴纳金额" prop="pensionCompanyAmount">
- <money-input :key="random" v-model="form.pensionCompanyAmount" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="pensionCompanyAmountRandom" v-model="form.pensionCompanyAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" />
</el-form-item>
<el-divider>医疗险</el-divider>
<el-form-item label="基数" prop="medicalRadix">
- <money-input :key="random" v-model="form.medicalRadix" :width="523" :disabled="disabledFlagByApprove" />
+ <money-input :key="medicalRadixRandom" v-model="form.medicalRadix" :width="523" :disabled="disabledFlagByApprove" @blur="medicalParameterBlur" />
</el-form-item>
<el-form-item label="个人缴纳比例" prop="medicalPersonalProportion">
- <el-input v-model="form.medicalPersonalProportion" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.medicalPersonalProportion" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="medicalParameterBlur">
<template slot="append">%</template>
</el-input>
</el-form-item>
<el-form-item label="个人缴纳金额" prop="medicalPersonalAmount">
- <money-input :key="random" v-model="form.medicalPersonalAmount" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="medicalPersonalAmountRandom" v-model="form.medicalPersonalAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" />
</el-form-item>
<el-form-item label="公司缴纳比例" prop="medicalCompanyProportion">
- <el-input v-model="form.medicalCompanyProportion" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.medicalCompanyProportion" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="medicalParameterBlur">
<template slot="append">%</template>
</el-input>
</el-form-item>
<el-form-item label="公司缴纳金额" prop="medicalCompanyAmount">
- <money-input :key="random" v-model="form.medicalCompanyAmount" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="medicalCompanyAmountRandom" v-model="form.medicalCompanyAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" />
</el-form-item>
<el-divider>失业险</el-divider>
<el-form-item label="基数" prop="unemploymentRadix">
- <money-input :key="random" v-model="form.unemploymentRadix" :width="523" :disabled="disabledFlagByApprove" />
+ <money-input :key="unemploymentRadixRandom" v-model="form.unemploymentRadix" :width="523" :disabled="disabledFlagByApprove" @blur="unemploymentParameterBlur" />
</el-form-item>
<el-form-item label="个人缴纳比例" prop="unemploymentPersonalProportion">
- <el-input v-model="form.unemploymentPersonalProportion" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.unemploymentPersonalProportion" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="unemploymentParameterBlur">
<template slot="append">%</template>
</el-input>
</el-form-item>
<el-form-item label="个人缴纳金额" prop="unemploymentPersonalAmount">
- <money-input :key="random" v-model="form.unemploymentPersonalAmount" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="unemploymentPersonalAmountRandom" v-model="form.unemploymentPersonalAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" />
</el-form-item>
<el-form-item label="公司缴纳比例" prop="unemploymentCompanyProportion">
- <el-input v-model="form.unemploymentCompanyProportion" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.unemploymentCompanyProportion" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="unemploymentParameterBlur">
<template slot="append">%</template>
</el-input>
</el-form-item>
<el-form-item label="公司缴纳金额" prop="unemploymentCompanyAmount">
- <money-input :key="random" v-model="form.unemploymentCompanyAmount" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="unemploymentCompanyAmountRandom" v-model="form.unemploymentCompanyAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" />
</el-form-item>
<el-divider>生育险</el-divider>
<el-form-item label="基数" prop="maternityRadix">
- <money-input :key="random" v-model="form.maternityRadix" :width="523" :disabled="disabledFlagByApprove" />
+ <money-input :key="maternityRadixRandom" v-model="form.maternityRadix" :width="523" :disabled="disabledFlagByApprove" @blur="maternityParameterBlur" />
</el-form-item>
<el-form-item label="个人缴纳比例" prop="maternityPersonalProportion">
- <el-input v-model="form.maternityPersonalProportion" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.maternityPersonalProportion" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="maternityParameterBlur">
<template slot="append">%</template>
</el-input>
</el-form-item>
<el-form-item label="个人缴纳金额" prop="maternityPersonalAmount">
- <money-input :key="random" v-model="form.maternityPersonalAmount" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="maternityPersonalAmountRandom" v-model="form.maternityPersonalAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" />
</el-form-item>
<el-form-item label="公司缴纳比例" prop="maternityCompanyProportion">
- <el-input v-model="form.maternityCompanyProportion" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.maternityCompanyProportion" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="maternityParameterBlur">
<template slot="append">%</template>
</el-input>
</el-form-item>
<el-form-item label="公司缴纳金额" prop="maternityCompanyAmount">
- <money-input :key="random" v-model="form.maternityCompanyAmount" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="maternityCompanyAmountRandom" v-model="form.maternityCompanyAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" />
</el-form-item>
<el-divider>工伤险</el-divider>
<el-form-item label="基数" prop="industrialInjuryRadix">
- <money-input :key="random" v-model="form.industrialInjuryRadix" :width="523" :disabled="disabledFlagByApprove" />
+ <money-input :key="industrialInjuryRadixRandom" v-model="form.industrialInjuryRadix" :width="523" :disabled="disabledFlagByApprove" @blur="industrialInjuryParameterBlur" />
</el-form-item>
<el-form-item label="个人缴纳比例" prop="industrialInjuryPersonalProportion">
- <el-input v-model="form.industrialInjuryPersonalProportion" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.industrialInjuryPersonalProportion" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="industrialInjuryParameterBlur">
<template slot="append">%</template>
</el-input>
</el-form-item>
<el-form-item label="个人缴纳金额" prop="industrialInjuryPersonalAmount">
- <money-input :key="random" v-model="form.industrialInjuryPersonalAmount" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="industrialInjuryPersonalAmountRandom" v-model="form.industrialInjuryPersonalAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" />
</el-form-item>
<el-form-item label="公司缴纳比例" prop="industrialInjuryCompanyProportion">
- <el-input v-model="form.industrialInjuryCompanyProportion" style="width: 200px;" :disabled="disabledFlagByApprove">
+ <el-input v-model="form.industrialInjuryCompanyProportion" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="industrialInjuryParameterBlur">
<template slot="append">%</template>
</el-input>
</el-form-item>
<el-form-item label="公司缴纳金额" prop="industrialInjuryCompanyAmount">
- <money-input :key="random" v-model="form.industrialInjuryCompanyAmount" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="industrialInjuryCompanyAmountRandom" v-model="form.industrialInjuryCompanyAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" />
</el-form-item>
<el-divider>统计</el-divider>
<el-form-item label="税前金额" prop="preTaxAmount">
- <money-input :key="random" v-model="form.preTaxAmount" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="preTaxAmountRandom" v-model="form.preTaxAmount" :width="200" :disabled="disabledFlagByApprove" @blur="preTaxAmountBlur" />
</el-form-item>
<el-form-item label="个人所得税" prop="individualIncomeTax">
- <money-input :key="random" v-model="form.individualIncomeTax" :width="200" :disabled="disabledFlagByApprove" />
+ <money-input :key="individualIncomeTaxRandom" v-model="form.individualIncomeTax" :width="200" :disabled="disabledFlagByApprove" @blur="individualIncomeTaxBlur" />
</el-form-item>
<el-form-item label="税后金额" prop="afterTaxAmount">
- <money-input :key="random" v-model="form.afterTaxAmount" :width="523" :disabled="disabledFlagByApprove" />
+ <money-input :key="afterTaxAmountRandom" v-model="form.afterTaxAmount" :width="523" :disabled="disabledFlagByApprove" />
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form.remarks" :rows="3" type="textarea" style="width: 523px;" :disabled="disabledFlagByApprove" />
@@ -641,7 +641,7 @@
<el-button size="mini" type="text" @click="publicityCancel(scope.row)">取消</el-button>
<el-button :loading="publicityLoading" type="primary" size="mini" @click="doPublicity(scope.row)">确定</el-button>
</div>
- <el-button slot="reference" type="primary" icon="el-icon-share" size="mini" />
+ <el-button slot="reference" type="primary" icon="el-icon-s-check" size="mini" />
</el-popover>
<el-popover slot="left" :ref="`approve_${scope.row.id}`" v-permission="permission.approve" placement="top" width="180">
<p>确定承认本条数据吗?</p>
@@ -649,7 +649,7 @@
<el-button size="mini" type="text" @click="approveCancel(scope.row)">取消</el-button>
<el-button :loading="approveLoading" type="primary" size="mini" @click="doApprove(scope.row)">确定</el-button>
</div>
- <el-button slot="reference" type="primary" icon="el-icon-share" size="mini" style="margin-left: 3px;" />
+ <el-button slot="reference" type="primary" icon="el-icon-finished" size="mini" style="margin-left: 3px;" />
</el-popover>
</udOperation>
</template>
@@ -990,8 +990,8 @@
approveStatus: constant.APPROVE_STATUS,
// 用户列表
users: [],
- // 随机数
- random: 0,
+ // 表单加载
+ formLoading: false,
// 公示弹窗加载
publicityLoading: false,
// 承认弹窗加载
@@ -1009,7 +1009,67 @@
targetYearMonth: [
{ required: true, message: '工资年月不能为空', trigger: 'change' }
]
- }
+ },
+ // 级别工资随机数
+ levelWageRandom: 0,
+ // 预计基本工资随机数
+ basicWageRandom: 0,
+ // 实际基本工资随机数
+ actualBasicWageRandom: 0,
+ // 预计绩效工资随机数
+ achievementsWageRandom: 0,
+ // 实际绩效工资随机数
+ actualAchievementsWageRandom: 0,
+ // 预计业绩工资随机数
+ performanceWageRandom: 0,
+ // 实际业绩工资随机数
+ actualPerformanceWageRandom: 0,
+ // 预计团队工资随机数
+ teamWageRandom: 0,
+ // 实际团队工资随机数
+ actualTeamWageRandom: 0,
+ // 公积金基数随机数
+ accumulationRadixRandom: 0,
+ // 公积金个人缴纳金额随机数
+ accumulationPersonalAmountRandom: 0,
+ // 公积金公司缴纳金额随机数
+ accumulationCompanyAmountRandom: 0,
+ // 养老险基数随机数
+ pensionRadixRandom: 0,
+ // 养老险个人缴纳金额随机数
+ pensionPersonalAmountRandom: 0,
+ // 养老险公司缴纳金额随机数
+ pensionCompanyAmountRandom: 0,
+ // 医疗险基数随机数
+ medicalRadixRandom: 0,
+ // 医疗险个人缴纳金额随机数
+ medicalPersonalAmountRandom: 0,
+ // 医疗险公司缴纳金额随机数
+ medicalCompanyAmountRandom: 0,
+ // 失业险基数随机数
+ unemploymentRadixRandom: 0,
+ // 失业险个人缴纳金额随机数
+ unemploymentPersonalAmountRandom: 0,
+ // 失业险公司缴纳金额随机数
+ unemploymentCompanyAmountRandom: 0,
+ // 生育险基数随机数
+ maternityRadixRandom: 0,
+ // 生育险个人缴纳金额随机数
+ maternityPersonalAmountRandom: 0,
+ // 生育险公司缴纳金额随机数
+ maternityCompanyAmountRandom: 0,
+ // 工伤险基数随机数
+ industrialInjuryRadixRandom: 0,
+ // 工伤险个人缴纳金额随机数
+ industrialInjuryPersonalAmountRandom: 0,
+ // 工伤险公司缴纳金额随机数
+ industrialInjuryCompanyAmountRandom: 0,
+ // 税前金额随机数
+ preTaxAmountRandom: 0,
+ // 个人所得税随机数
+ individualIncomeTaxRandom: 0,
+ // 税后金额随机数
+ afterTaxAmountRandom: 0
}
},
methods: {
@@ -1037,399 +1097,570 @@
// 表单禁用标记(承认状态)
this.disabledFlagByApprove = false
}
- // 随机数
- this.random = Math.random()
+ // 级别工资随机数
+ this.levelWageRandom = Math.random()
+ // 预计基本工资随机数
+ this.basicWageRandom = Math.random()
+ // 实际基本工资随机数
+ this.actualBasicWageRandom = Math.random()
+ // 预计绩效工资随机数
+ this.achievementsWageRandom = Math.random()
+ // 实际绩效工资随机数
+ this.actualAchievementsWageRandom = Math.random()
+ // 预计业绩工资随机数
+ this.performanceWageRandom = Math.random()
+ // 实际业绩工资随机数
+ this.actualPerformanceWageRandom = Math.random()
+ // 预计团队工资随机数
+ this.teamWageRandom = Math.random()
+ // 实际团队工资随机数
+ this.actualTeamWageRandom = Math.random()
+ // 公积金基数随机数
+ this.accumulationRadixRandom = Math.random()
+ // 公积金个人缴纳金额随机数
+ this.accumulationPersonalAmountRandom = Math.random()
+ // 公积金公司缴纳金额随机数
+ this.accumulationCompanyAmountRandom = Math.random()
+ // 养老险基数随机数
+ this.pensionRadixRandom = Math.random()
+ // 养老险个人缴纳金额随机数
+ this.pensionPersonalAmountRandom = Math.random()
+ // 养老险公司缴纳金额随机数
+ this.pensionCompanyAmountRandom = Math.random()
+ // 医疗险基数随机数
+ this.medicalRadixRandom = Math.random()
+ // 医疗险个人缴纳金额随机数
+ this.medicalPersonalAmountRandom = Math.random()
+ // 医疗险公司缴纳金额随机数
+ this.medicalCompanyAmountRandom = Math.random()
+ // 失业险基数随机数
+ this.unemploymentRadixRandom = Math.random()
+ // 失业险个人缴纳金额随机数
+ this.unemploymentPersonalAmountRandom = Math.random()
+ // 失业险公司缴纳金额随机数
+ this.unemploymentCompanyAmountRandom = Math.random()
+ // 生育险基数随机数
+ this.maternityRadixRandom = Math.random()
+ // 生育险个人缴纳金额随机数
+ this.maternityPersonalAmountRandom = Math.random()
+ // 生育险公司缴纳金额随机数
+ this.maternityCompanyAmountRandom = Math.random()
+ // 工伤险基数随机数
+ this.industrialInjuryRadixRandom = Math.random()
+ // 工伤险个人缴纳金额随机数
+ this.industrialInjuryPersonalAmountRandom = Math.random()
+ // 工伤险公司缴纳金额随机数
+ this.industrialInjuryCompanyAmountRandom = Math.random()
+ // 税前金额随机数
+ this.preTaxAmountRandom = Math.random()
+ // 个人所得税随机数
+ this.individualIncomeTaxRandom = Math.random()
+ // 税后金额随机数
+ this.afterTaxAmountRandom = Math.random()
},
+ // 钩子: 编辑 - 之前
+ // [CRUD.HOOK.beforeToEdit]() {
+ // // 表单加载
+ // this.formLoading = true
+ // },
// 获取用户级别数据
getUserLevel() {
// 判断所属员工、工资年月是否为空
if (this.form.userId != null && this.form.userId !== '' && this.form.salaryYearMonth != null && this.form.salaryYearMonth !== '') {
- // 获取用户级别工资
- this.getUserLevelWage()
- // 获取用户级别保险
- this.getUserLevelInsurance()
- // 获取用户级别其他
- this.getUserLevelOther()
- // 获取工作天数
- this.getWorkDays()
- // 获取出勤小时数
- this.getAttendanceHours()
- // 获取达标工时
- this.getComplianceWork()
- // 获取已完成工时
- this.getCompletedWork()
+ // 表单加载
+ this.formLoading = true
+ // 执行完以下内容才往下走:获取用户级别工资、获取用户级别保险、获取用户级别其他、获取工作天数、获取出勤小时数、获取达标工时、获取已完成工时
+ Promise.all([
+ this.getUserLevelWage(), this.getUserLevelInsurance(), this.getUserLevelOther(), this.getWorkDays(), this.getAttendanceHours(),
+ this.getComplianceWork(), this.getCompletedWork()
+ ]).then(res => {
+ // 表单加载
+ this.formLoading = false
+ }).catch(() => {
+ // 表单加载
+ this.formLoading = false
+ })
}
},
// 获取用户级别工资
getUserLevelWage() {
- // 获取用户级别工资
- crudUserLevelWage.getTargetYearMonth({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
- // 级别工资
- this.form.levelWage = Number(res.levelWage.toFixed(2))
- // 基本工资比例
- this.form.basicWageProportion = Number(res.basicWageProportion.toFixed(2))
- // 预计基本工资
- this.form.basicWage = Number((res.levelWage * (res.basicWageProportion / 100)).toFixed(2))
- // 绩效工资比例
- this.form.achievementsWageProportion = Number(res.achievementsWageProportion.toFixed(2))
- // 预计绩效工资
- this.form.achievementsWage = Number((res.levelWage * (res.achievementsWageProportion / 100)).toFixed(2))
- // 业绩工资比例
- this.form.performanceWageProportion = Number(res.performanceWageProportion.toFixed(2))
- // 预计业绩工资
- this.form.performanceWage = Number((res.levelWage * (res.performanceWageProportion / 100)).toFixed(2))
- // 团队工资比例
- this.form.teamWageProportion = Number(res.teamWageProportion.toFixed(2))
- // 预计团队工资
- this.form.teamWage = Number((res.levelWage * (res.teamWageProportion / 100)).toFixed(2))
- // 随机数
- this.random = Math.random()
- }).catch(() => {
- // 级别工资
- this.form.levelWage = 0
- // 基本工资比例
- this.form.basicWageProportion = 0
- // 预计基本工资
- this.form.basicWage = 0
- // 绩效工资比例
- this.form.achievementsWageProportion = 0
- // 预计绩效工资
- this.form.achievementsWage = 0
- // 业绩工资比例
- this.form.performanceWageProportion = 0
- // 预计业绩工资
- this.form.performanceWage = 0
- // 团队工资比例
- this.form.teamWageProportion = 0
- // 预计团队工资
- this.form.teamWage = 0
- // 随机数
- this.random = Math.random()
+ return new Promise((resolve, reject) => {
+ // 获取用户级别工资
+ crudUserLevelWage.getTargetYearMonth({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
+ // 级别工资
+ this.form.levelWage = Number(res.levelWage.toFixed(2))
+ // 级别工资随机数
+ this.levelWageRandom = Math.random()
+ // 基本工资比例
+ this.form.basicWageProportion = Number(res.basicWageProportion.toFixed(2))
+ // 预计基本工资随机数
+ this.form.basicWage = Number((res.levelWage * (res.basicWageProportion / 100)).toFixed(2))
+ // 预计基本工资
+ this.basicWageRandom = Math.random()
+ // 绩效工资比例
+ this.form.achievementsWageProportion = Number(res.achievementsWageProportion.toFixed(2))
+ // 预计绩效工资
+ this.form.achievementsWage = Number((res.levelWage * (res.achievementsWageProportion / 100)).toFixed(2))
+ // 预计绩效工资随机数
+ this.achievementsWageRandom = Math.random()
+ // 业绩工资比例
+ this.form.performanceWageProportion = Number(res.performanceWageProportion.toFixed(2))
+ // 预计业绩工资
+ this.form.performanceWage = Number((res.levelWage * (res.performanceWageProportion / 100)).toFixed(2))
+ // 预计业绩工资随机数
+ this.performanceWageRandom = Math.random()
+ // 团队工资比例
+ this.form.teamWageProportion = Number(res.teamWageProportion.toFixed(2))
+ // 预计团队工资
+ this.form.teamWage = Number((res.levelWage * (res.teamWageProportion / 100)).toFixed(2))
+ // 预计团队工资随机数
+ this.teamWageRandom = Math.random()
+ // 成功
+ resolve()
+ }).catch(() => {
+ // 级别工资
+ this.form.levelWage = 0
+ // 级别工资随机数
+ this.levelWageRandom = Math.random()
+ // 基本工资比例
+ this.form.basicWageProportion = 0
+ // 预计基本工资
+ this.form.basicWage = 0
+ // 预计基本工资随机数
+ this.basicWageRandom = Math.random()
+ // 绩效工资比例
+ this.form.achievementsWageProportion = 0
+ // 预计绩效工资
+ this.form.achievementsWage = 0
+ // 预计绩效工资随机数
+ this.achievementsWageRandom = Math.random()
+ // 业绩工资比例
+ this.form.performanceWageProportion = 0
+ // 预计业绩工资
+ this.form.performanceWage = 0
+ // 预计业绩工资随机数
+ this.performanceWageRandom = Math.random()
+ // 团队工资比例
+ this.form.teamWageProportion = 0
+ // 预计团队工资
+ this.form.teamWage = 0
+ // 预计团队工资随机数
+ this.teamWageRandom = Math.random()
+ // 失败
+ reject()
+ })
})
},
// 获取用户级别保险
getUserLevelInsurance() {
- // 获取用户级别保险
- crudUserLevelInsurance.getTargetYearMonth({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
- // 公积金基数
- this.form.accumulationRadix = Number(res.accumulationRadix.toFixed(2))
- // 公积金个人缴纳比例
- this.form.accumulationPersonalProportion = Number(res.accumulationPersonalProportion.toFixed(2))
- // 公积金个人缴纳金额
- this.form.accumulationPersonalAmount = Number((res.accumulationRadix * (res.accumulationPersonalProportion / 100)).toFixed(2))
- // 公积金公司缴纳比例
- this.form.accumulationCompanyProportion = Number(res.accumulationCompanyProportion.toFixed(2))
- // 公积金公司缴纳金额
- this.form.accumulationCompanyAmount = Number((res.accumulationRadix * (res.accumulationCompanyProportion / 100)).toFixed(2))
- // 养老险基数
- this.form.pensionRadix = Number(res.pensionRadix.toFixed(2))
- // 养老险个人缴纳比例
- this.form.pensionPersonalProportion = Number(res.pensionPersonalProportion.toFixed(2))
- // 养老险个人缴纳金额
- this.form.pensionPersonalAmount = Number((res.pensionRadix * (res.pensionPersonalProportion / 100)).toFixed(2))
- // 养老险公司缴纳比例
- this.form.pensionCompanyProportion = Number(res.pensionCompanyProportion.toFixed(2))
- // 养老险公司缴纳金额
- this.form.pensionCompanyAmount = Number((res.pensionRadix * (res.pensionCompanyProportion / 100)).toFixed(2))
- // 医疗险基数
- this.form.medicalRadix = Number(res.medicalRadix.toFixed(2))
- // 医疗险个人缴纳比例
- this.form.medicalPersonalProportion = Number(res.medicalPersonalProportion.toFixed(2))
- // 医疗险个人缴纳金额
- this.form.medicalPersonalAmount = Number((res.medicalRadix * (res.medicalPersonalProportion / 100)).toFixed(2))
- // 医疗险公司缴纳比例
- this.form.medicalCompanyProportion = Number(res.medicalCompanyProportion.toFixed(2))
- // 医疗险公司缴纳金额
- this.form.medicalCompanyAmount = Number((res.medicalRadix * (res.medicalCompanyProportion / 100)).toFixed(2))
- // 失业险基数
- this.form.unemploymentRadix = Number(res.unemploymentRadix.toFixed(2))
- // 失业险个人缴纳比例
- this.form.unemploymentPersonalProportion = Number(res.unemploymentPersonalProportion.toFixed(2))
- // 失业险个人缴纳金额
- this.form.unemploymentPersonalAmount = Number((res.unemploymentRadix * (res.unemploymentPersonalProportion / 100)).toFixed(2))
- // 失业险公司缴纳比例
- this.form.unemploymentCompanyProportion = Number(res.unemploymentCompanyProportion.toFixed(2))
- // 失业险公司缴纳金额
- this.form.unemploymentCompanyAmount = Number((res.unemploymentRadix * (res.unemploymentCompanyProportion / 100)).toFixed(2))
- // 生育险基数
- this.form.maternityRadix = Number(res.maternityRadix.toFixed(2))
- // 生育险个人缴纳比例
- this.form.maternityPersonalProportion = Number(res.maternityPersonalProportion.toFixed(2))
- // 生育险个人缴纳金额
- this.form.maternityPersonalAmount = Number((res.maternityRadix * (res.maternityPersonalProportion / 100)).toFixed(2))
- // 生育险公司缴纳比例
- this.form.maternityCompanyProportion = Number(res.maternityCompanyProportion.toFixed(2))
- // 生育险公司缴纳金额
- this.form.maternityCompanyAmount = Number((res.maternityRadix * (res.maternityCompanyProportion / 100)).toFixed(2))
- // 工伤险基数
- this.form.industrialInjuryRadix = Number(res.industrialInjuryRadix.toFixed(2))
- // 工伤险个人缴纳比例
- this.form.industrialInjuryPersonalProportion = Number(res.industrialInjuryPersonalProportion.toFixed(2))
- // 工伤险个人缴纳金额
- this.form.industrialInjuryPersonalAmount = Number((res.industrialInjuryRadix * (res.industrialInjuryPersonalProportion / 100)).toFixed(2))
- // 工伤险公司缴纳比例
- this.form.industrialInjuryCompanyProportion = Number(res.industrialInjuryCompanyProportion.toFixed(2))
- // 工伤险公司缴纳金额
- this.form.industrialInjuryCompanyAmount = Number((res.industrialInjuryRadix * (res.industrialInjuryCompanyProportion / 100)).toFixed(2))
- // 随机数
- this.random = Math.random()
- }).catch(() => {
- // 公积金基数
- this.form.accumulationRadix = 0
- // 公积金个人缴纳比例
- this.form.accumulationPersonalProportion = 0
- // 公积金个人缴纳金额
- this.form.accumulationPersonalAmount = 0
- // 公积金公司缴纳比例
- this.form.accumulationCompanyProportion = 0
- // 公积金公司缴纳金额
- this.form.accumulationCompanyAmount = 0
- // 养老险基数
- this.form.pensionRadix = 0
- // 养老险个人缴纳比例
- this.form.pensionPersonalProportion = 0
- // 养老险个人缴纳金额
- this.form.pensionPersonalAmount = 0
- // 养老险公司缴纳比例
- this.form.pensionCompanyProportion = 0
- // 养老险公司缴纳金额
- this.form.pensionCompanyAmount = 0
- // 医疗险基数
- this.form.medicalRadix = 0
- // 医疗险个人缴纳比例
- this.form.medicalPersonalProportion = 0
- // 医疗险个人缴纳金额
- this.form.medicalPersonalAmount = 0
- // 医疗险公司缴纳比例
- this.form.medicalCompanyProportion = 0
- // 医疗险公司缴纳金额
- this.form.medicalCompanyAmount = 0
- // 失业险基数
- this.form.unemploymentRadix = 0
- // 失业险个人缴纳比例
- this.form.unemploymentPersonalProportion = 0
- // 失业险个人缴纳金额
- this.form.unemploymentPersonalAmount = 0
- // 失业险公司缴纳比例
- this.form.unemploymentCompanyProportion = 0
- // 失业险公司缴纳金额
- this.form.unemploymentCompanyAmount = 0
- // 生育险基数
- this.form.maternityRadix = 0
- // 生育险个人缴纳比例
- this.form.maternityPersonalProportion = 0
- // 生育险个人缴纳金额
- this.form.maternityPersonalAmount = 0
- // 生育险公司缴纳比例
- this.form.maternityCompanyProportion = 0
- // 生育险公司缴纳金额
- this.form.maternityCompanyAmount = 0
- // 工伤险基数
- this.form.industrialInjuryRadix = 0
- // 工伤险个人缴纳比例
- this.form.industrialInjuryPersonalProportion = 0
- // 工伤险个人缴纳金额
- this.form.industrialInjuryPersonalAmount = 0
- // 工伤险公司缴纳比例
- this.form.industrialInjuryCompanyProportion = 0
- // 工伤险公司缴纳金额
- this.form.industrialInjuryCompanyAmount = 0
- // 随机数
- this.random = Math.random()
+ return new Promise((resolve, reject) => {
+ // 获取用户级别保险
+ crudUserLevelInsurance.getTargetYearMonth({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
+ // 公积金基数
+ this.form.accumulationRadix = Number(res.accumulationRadix.toFixed(2))
+ // 公积金基数随机数
+ this.accumulationRadixRandom = Math.random()
+ // 公积金个人缴纳比例
+ this.form.accumulationPersonalProportion = Number(res.accumulationPersonalProportion.toFixed(2))
+ // 公积金个人缴纳金额
+ this.form.accumulationPersonalAmount = Number((res.accumulationRadix * (res.accumulationPersonalProportion / 100)).toFixed(2))
+ // 公积金个人缴纳金额随机数
+ this.accumulationPersonalAmountRandom = Math.random()
+ // 公积金公司缴纳比例
+ this.form.accumulationCompanyProportion = Number(res.accumulationCompanyProportion.toFixed(2))
+ // 公积金公司缴纳金额
+ this.form.accumulationCompanyAmount = Number((res.accumulationRadix * (res.accumulationCompanyProportion / 100)).toFixed(2))
+ // 公积金公司缴纳金额随机数
+ this.accumulationCompanyAmountRandom = Math.random()
+ // 养老险基数
+ this.form.pensionRadix = Number(res.pensionRadix.toFixed(2))
+ // 养老险基数随机数
+ this.pensionRadixRandom = Math.random()
+ // 养老险个人缴纳比例
+ this.form.pensionPersonalProportion = Number(res.pensionPersonalProportion.toFixed(2))
+ // 养老险个人缴纳金额
+ this.form.pensionPersonalAmount = Number((res.pensionRadix * (res.pensionPersonalProportion / 100)).toFixed(2))
+ // 养老险个人缴纳金额随机数
+ this.pensionPersonalAmountRandom = Math.random()
+ // 养老险公司缴纳比例
+ this.form.pensionCompanyProportion = Number(res.pensionCompanyProportion.toFixed(2))
+ // 养老险公司缴纳金额
+ this.form.pensionCompanyAmount = Number((res.pensionRadix * (res.pensionCompanyProportion / 100)).toFixed(2))
+ // 养老险公司缴纳金额随机数
+ this.pensionCompanyAmountRandom = Math.random()
+ // 医疗险基数
+ this.form.medicalRadix = Number(res.medicalRadix.toFixed(2))
+ // 医疗险基数随机数
+ this.medicalRadixRandom = Math.random()
+ // 医疗险个人缴纳比例
+ this.form.medicalPersonalProportion = Number(res.medicalPersonalProportion.toFixed(2))
+ // 医疗险个人缴纳金额
+ this.form.medicalPersonalAmount = Number((res.medicalRadix * (res.medicalPersonalProportion / 100)).toFixed(2))
+ // 医疗险个人缴纳金额随机数
+ this.medicalPersonalAmountRandom = Math.random()
+ // 医疗险公司缴纳比例
+ this.form.medicalCompanyProportion = Number(res.medicalCompanyProportion.toFixed(2))
+ // 医疗险公司缴纳金额
+ this.form.medicalCompanyAmount = Number((res.medicalRadix * (res.medicalCompanyProportion / 100)).toFixed(2))
+ // 医疗险公司缴纳金额随机数
+ this.medicalCompanyAmountRandom = Math.random()
+ // 失业险基数
+ this.form.unemploymentRadix = Number(res.unemploymentRadix.toFixed(2))
+ // 失业险基数随机数
+ this.unemploymentRadixRandom = Math.random()
+ // 失业险个人缴纳比例
+ this.form.unemploymentPersonalProportion = Number(res.unemploymentPersonalProportion.toFixed(2))
+ // 失业险个人缴纳金额
+ this.form.unemploymentPersonalAmount = Number((res.unemploymentRadix * (res.unemploymentPersonalProportion / 100)).toFixed(2))
+ // 失业险个人缴纳金额随机数
+ this.unemploymentPersonalAmountRandom = Math.random()
+ // 失业险公司缴纳比例
+ this.form.unemploymentCompanyProportion = Number(res.unemploymentCompanyProportion.toFixed(2))
+ // 失业险公司缴纳金额
+ this.form.unemploymentCompanyAmount = Number((res.unemploymentRadix * (res.unemploymentCompanyProportion / 100)).toFixed(2))
+ // 失业险公司缴纳金额随机数
+ this.unemploymentCompanyAmountRandom = Math.random()
+ // 生育险基数
+ this.form.maternityRadix = Number(res.maternityRadix.toFixed(2))
+ // 生育险基数随机数
+ this.maternityRadixRandom = Math.random()
+ // 生育险个人缴纳比例
+ this.form.maternityPersonalProportion = Number(res.maternityPersonalProportion.toFixed(2))
+ // 生育险个人缴纳金额
+ this.form.maternityPersonalAmount = Number((res.maternityRadix * (res.maternityPersonalProportion / 100)).toFixed(2))
+ // 生育险个人缴纳金额随机数
+ this.maternityPersonalAmountRandom = Math.random()
+ // 生育险公司缴纳比例
+ this.form.maternityCompanyProportion = Number(res.maternityCompanyProportion.toFixed(2))
+ // 生育险公司缴纳金额
+ this.form.maternityCompanyAmount = Number((res.maternityRadix * (res.maternityCompanyProportion / 100)).toFixed(2))
+ // 生育险公司缴纳金额随机数
+ this.maternityCompanyAmountRandom = Math.random()
+ // 工伤险基数
+ this.form.industrialInjuryRadix = Number(res.industrialInjuryRadix.toFixed(2))
+ // 工伤险基数随机数
+ this.industrialInjuryRadixRandom = Math.random()
+ // 工伤险个人缴纳比例
+ this.form.industrialInjuryPersonalProportion = Number(res.industrialInjuryPersonalProportion.toFixed(2))
+ // 工伤险个人缴纳金额
+ this.form.industrialInjuryPersonalAmount = Number((res.industrialInjuryRadix * (res.industrialInjuryPersonalProportion / 100)).toFixed(2))
+ // 工伤险个人缴纳金额随机数
+ this.industrialInjuryPersonalAmountRandom = Math.random()
+ // 工伤险公司缴纳比例
+ this.form.industrialInjuryCompanyProportion = Number(res.industrialInjuryCompanyProportion.toFixed(2))
+ // 工伤险公司缴纳金额
+ this.form.industrialInjuryCompanyAmount = Number((res.industrialInjuryRadix * (res.industrialInjuryCompanyProportion / 100)).toFixed(2))
+ // 工伤险公司缴纳金额随机数
+ this.industrialInjuryCompanyAmountRandom = Math.random()
+ // 成功
+ resolve()
+ }).catch(() => {
+ // 公积金基数
+ this.form.accumulationRadix = 0
+ // 公积金基数随机数
+ this.accumulationRadixRandom = Math.random()
+ // 公积金个人缴纳比例
+ this.form.accumulationPersonalProportion = 0
+ // 公积金个人缴纳金额
+ this.form.accumulationPersonalAmount = 0
+ // 公积金个人缴纳金额随机数
+ this.accumulationPersonalAmountRandom = Math.random()
+ // 公积金公司缴纳比例
+ this.form.accumulationCompanyProportion = 0
+ // 公积金公司缴纳金额
+ this.form.accumulationCompanyAmount = 0
+ // 公积金公司缴纳金额随机数
+ this.accumulationCompanyAmountRandom = Math.random()
+ // 养老险基数
+ this.form.pensionRadix = 0
+ // 养老险基数随机数
+ this.pensionRadixRandom = Math.random()
+ // 养老险个人缴纳比例
+ this.form.pensionPersonalProportion = 0
+ // 养老险个人缴纳金额
+ this.form.pensionPersonalAmount = 0
+ // 养老险个人缴纳金额随机数
+ this.pensionPersonalAmountRandom = Math.random()
+ // 养老险公司缴纳比例
+ this.form.pensionCompanyProportion = 0
+ // 养老险公司缴纳金额
+ this.form.pensionCompanyAmount = 0
+ // 养老险公司缴纳金额随机数
+ this.pensionCompanyAmountRandom = Math.random()
+ // 医疗险基数
+ this.form.medicalRadix = 0
+ // 医疗险基数随机数
+ this.medicalRadixRandom = Math.random()
+ // 医疗险个人缴纳比例
+ this.form.medicalPersonalProportion = 0
+ // 医疗险个人缴纳金额
+ this.form.medicalPersonalAmount = 0
+ // 医疗险个人缴纳金额随机数
+ this.medicalPersonalAmountRandom = Math.random()
+ // 医疗险公司缴纳比例
+ this.form.medicalCompanyProportion = 0
+ // 医疗险公司缴纳金额
+ this.form.medicalCompanyAmount = 0
+ // 医疗险公司缴纳金额随机数
+ this.medicalCompanyAmountRandom = Math.random()
+ // 失业险基数
+ this.form.unemploymentRadix = 0
+ // 失业险基数随机数
+ this.unemploymentRadixRandom = Math.random()
+ // 失业险个人缴纳比例
+ this.form.unemploymentPersonalProportion = 0
+ // 失业险个人缴纳金额
+ this.form.unemploymentPersonalAmount = 0
+ // 失业险个人缴纳金额随机数
+ this.unemploymentPersonalAmountRandom = Math.random()
+ // 失业险公司缴纳比例
+ this.form.unemploymentCompanyProportion = 0
+ // 失业险公司缴纳金额
+ this.form.unemploymentCompanyAmount = 0
+ // 失业险公司缴纳金额随机数
+ this.unemploymentCompanyAmountRandom = Math.random()
+ // 生育险基数
+ this.form.maternityRadix = 0
+ // 生育险基数随机数
+ this.maternityRadixRandom = Math.random()
+ // 生育险个人缴纳比例
+ this.form.maternityPersonalProportion = 0
+ // 生育险个人缴纳金额
+ this.form.maternityPersonalAmount = 0
+ // 生育险个人缴纳金额随机数
+ this.maternityPersonalAmountRandom = Math.random()
+ // 生育险公司缴纳比例
+ this.form.maternityCompanyProportion = 0
+ // 生育险公司缴纳金额
+ this.form.maternityCompanyAmount = 0
+ // 生育险公司缴纳金额随机数
+ this.maternityCompanyAmountRandom = Math.random()
+ // 工伤险基数
+ this.form.industrialInjuryRadix = 0
+ // 工伤险基数随机数
+ this.industrialInjuryRadixRandom = Math.random()
+ // 工伤险个人缴纳比例
+ this.form.industrialInjuryPersonalProportion = 0
+ // 工伤险个人缴纳金额
+ this.form.industrialInjuryPersonalAmount = 0
+ // 工伤险个人缴纳金额随机数
+ this.industrialInjuryPersonalAmountRandom = Math.random()
+ // 工伤险公司缴纳比例
+ this.form.industrialInjuryCompanyProportion = 0
+ // 工伤险公司缴纳金额
+ this.form.industrialInjuryCompanyAmount = 0
+ // 工伤险公司缴纳金额随机数
+ this.industrialInjuryCompanyAmountRandom = Math.random()
+ // 失败
+ reject()
+ })
})
},
// 获取用户级别其他
getUserLevelOther() {
- // 获取用户级别其他
- crudUserLevelOther.getTargetYearMonth({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
- // 个人业绩比例
- this.form.personalPerformanceProportion = Number(res.personalPerformanceProportion.toFixed(2))
- }).catch(() => {
- // 个人业绩比例
- this.form.personalPerformanceProportion = 0
+ return new Promise((resolve, reject) => {
+ // 获取用户级别其他
+ crudUserLevelOther.getTargetYearMonth({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
+ // 个人业绩比例
+ this.form.personalPerformanceProportion = Number(res.personalPerformanceProportion.toFixed(2))
+ // 成功
+ resolve()
+ }).catch(() => {
+ // 个人业绩比例
+ this.form.personalPerformanceProportion = 0
+ // 失败
+ reject()
+ })
})
},
// 获取工作天数
getWorkDays() {
- // 获取工作天数
- crudSalary.workDays({ targetYearMonth: this.form.salaryYearMonth }).then(res => {
- // 全勤小时数
- this.form.fullDays = Number((res * 8).toFixed(2))
- // 应完成绩效工时
- this.form.needCompletedAchievementsHours = Number((res * 8).toFixed(2))
- // 定时器
- const interval = setInterval(() => {
- // 判断个人业绩比例是否为空
- if (this.form.personalPerformanceProportion != null && this.form.personalPerformanceProportion !== '') {
- // 应完成业绩工时
- this.form.needCompletedPerformanceHours = Number((res * 8 * (1 + this.form.personalPerformanceProportion / 100)).toFixed(2))
- // 清空定时器
- clearInterval(interval)
- }
- }, 500)
- }).catch(() => {
- // 全勤小时数
- this.form.fullDays = 0
- // 应完成绩效工时
- this.form.needCompletedAchievementsHours = 0
- // 应完成业绩工时
- this.form.needCompletedPerformanceHours = 0
+ return new Promise((resolve, reject) => {
+ // 获取工作天数
+ crudSalary.workDays({ targetYearMonth: this.form.salaryYearMonth }).then(res => {
+ // 全勤小时数
+ this.form.fullDays = Number((res * 8).toFixed(2))
+ // 应完成绩效工时
+ this.form.needCompletedAchievementsHours = Number((res * 8).toFixed(2))
+ // 定时器
+ const interval = setInterval(() => {
+ // 判断个人业绩比例是否为空
+ if (this.form.personalPerformanceProportion != null && this.form.personalPerformanceProportion !== '') {
+ // 应完成业绩工时
+ this.form.needCompletedPerformanceHours = Number((res * 8 * (1 + this.form.personalPerformanceProportion / 100)).toFixed(2))
+ // 清空定时器
+ clearInterval(interval)
+ // 成功
+ resolve()
+ }
+ }, 500)
+ }).catch(() => {
+ // 全勤小时数
+ this.form.fullDays = 0
+ // 应完成绩效工时
+ this.form.needCompletedAchievementsHours = 0
+ // 应完成业绩工时
+ this.form.needCompletedPerformanceHours = 0
+ // 失败
+ reject()
+ })
})
},
// 获取出勤小时数
getAttendanceHours() {
- // 获取出勤小时数
- crudAttendance.attendanceHours({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
- // 定时器
- const interval = setInterval(() => {
- // 判断预计基础工资、全勤小时数是否为空
- if (this.form.basicWage != null && this.form.basicWage !== '' && this.form.fullDays != null && this.form.fullDays !== '') {
- // 缺勤小时数
- this.form.absenceDays = Number((this.form.fullDays - res).toFixed(2))
- // 实际基础工资
- this.form.actualBasicWage = Number((this.form.basicWage - (this.form.basicWage / this.form.fullDays) * (this.form.fullDays - res)).toFixed(2))
- // 随机数
- this.random = Math.random()
- // 清空定时器
- clearInterval(interval)
- }
- }, 500)
- }).catch(() => {
- // 缺勤小时数
- this.form.absenceDays = 0
- // 实际基础工资
- this.form.actualBasicWage = 0
- // 随机数
- this.random = Math.random()
+ return new Promise((resolve, reject) => {
+ // 获取出勤小时数
+ crudAttendance.attendanceHours({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
+ // 定时器
+ const interval = setInterval(() => {
+ // 判断预计基础工资、全勤小时数是否为空
+ if (this.form.basicWage != null && this.form.basicWage !== '' && this.form.fullDays != null && this.form.fullDays !== '') {
+ // 缺勤小时数
+ this.form.absenceDays = Number((this.form.fullDays - res).toFixed(2))
+ // 实际基础工资
+ this.form.actualBasicWage = Number((this.form.basicWage - (this.form.basicWage / this.form.fullDays) * (this.form.fullDays - res)).toFixed(2))
+ // 实际基本工资随机数
+ this.actualBasicWageRandom = Math.random()
+ // 清空定时器
+ clearInterval(interval)
+ // 成功
+ resolve()
+ }
+ }, 500)
+ }).catch(() => {
+ // 缺勤小时数
+ this.form.absenceDays = 0
+ // 实际基础工资
+ this.form.actualBasicWage = 0
+ // 实际基本工资随机数
+ this.actualBasicWageRandom = Math.random()
+ // 失败
+ reject()
+ })
})
},
// 获取达标工时
getComplianceWork() {
- // 获取达标工时
- crudTaskDaliy.complianceWork({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
- // 实达标团队工时
- this.form.actualComplianceTeamHours = Number(res.toFixed(2))
- }).catch(() => {
- // 实达标团队工时
- this.form.actualComplianceTeamHours = 0
+ return new Promise((resolve, reject) => {
+ // 获取达标工时
+ crudTaskDaliy.complianceWork({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
+ // 实达标团队工时
+ this.form.actualComplianceTeamHours = Number(res.toFixed(2))
+ // 成功
+ resolve()
+ }).catch(() => {
+ // 实达标团队工时
+ this.form.actualComplianceTeamHours = 0
+ // 失败
+ reject()
+ })
})
},
// 获取已完成工时
getCompletedWork() {
- // 获取已完成工时
- crudTaskDaliy.completedWork({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
- // 已完成绩效工时
- this.form.alreadyCompletedAchievementsHours = Number(res.toFixed(2))
- // 已完成业绩工时
- this.form.alreadyCompletedPerformanceHours = Number(res.toFixed(2))
- // 已完成团队工时
- this.form.alreadyCompletedTeamHours = Number(res.toFixed(2))
- // 绩效定时器
- const achievementsInterval = setInterval(() => {
- // 判断预计绩效工资、应完成绩效工时是否为空
- if (this.form.achievementsWage != null && this.form.achievementsWage !== '' && this.form.needCompletedAchievementsHours != null && this.form.needCompletedAchievementsHours !== '') {
- // 实际绩效工资
- this.form.actualAchievementsWage = Number((this.form.achievementsWage * (res / this.form.needCompletedAchievementsHours)).toFixed(2))
- // 随机数
- this.random = Math.random()
- // 清空绩效定时器
- clearInterval(achievementsInterval)
- }
- }, 500)
- // 业绩定时器
- const performanceInterval = setInterval(() => {
- // 判断预计业绩工资、应完成业绩工时是否为空
- if (this.form.performanceWage != null && this.form.performanceWage !== '' && this.form.needCompletedPerformanceHours != null && this.form.needCompletedPerformanceHours !== '') {
- // 实际业绩工资
- this.form.actualPerformanceWage = Number((res >= this.form.needCompletedPerformanceHours ? this.form.performanceWage : 0).toFixed(2))
- // 随机数
- this.random = Math.random()
- // 清空业绩定时器
- clearInterval(performanceInterval)
- }
- }, 500)
- // 团队定时器
- const teamInterval = setInterval(() => {
- // 判断预计团队工资、实达标团队工时是否为空
- if (this.form.teamWage != null && this.form.teamWage !== '' && this.form.actualComplianceTeamHours != null && this.form.actualComplianceTeamHours !== '') {
- // 实际团队工资
- this.form.actualTeamWage = Number(this.form.actualComplianceTeamHours !== 0 ? (this.form.teamWage * (this.form.actualComplianceTeamHours / res)).toFixed(2) : 0)
- // 随机数
- this.random = Math.random()
- // 清空团队定时器
- clearInterval(teamInterval)
- }
- }, 500)
- // 统计定时器
- const statisticsInterval = setInterval(() => {
- // 判断 实际基础工资、实际绩效工资、实际业绩工资、实际团队工资、公积金个人缴纳金额、
- // 养老险个人缴纳金额、医疗险个人缴纳金额、失业险个人缴纳金额、生育险个人缴纳金额、工伤险个人缴纳金额 是否为空
- if (
- this.form.actualBasicWage != null && this.form.actualBasicWage !== '' &&
- this.form.actualAchievementsWage != null && this.form.actualAchievementsWage !== '' &&
- this.form.actualPerformanceWage != null && this.form.actualPerformanceWage !== '' &&
- this.form.actualTeamWage != null && this.form.actualTeamWage !== '' &&
- this.form.accumulationPersonalAmount != null && this.form.accumulationPersonalAmount !== '' &&
- this.form.pensionPersonalAmount != null && this.form.pensionPersonalAmount !== '' &&
- this.form.medicalPersonalAmount != null && this.form.medicalPersonalAmount !== '' &&
- this.form.unemploymentPersonalAmount != null && this.form.unemploymentPersonalAmount !== '' &&
- this.form.maternityPersonalAmount != null && this.form.maternityPersonalAmount !== '' &&
- this.form.industrialInjuryPersonalAmount != null && this.form.industrialInjuryPersonalAmount !== ''
- ) {
- // 税前金额
- this.form.preTaxAmount = this.form.actualBasicWage + this.form.actualAchievementsWage + this.form.actualPerformanceWage + this.form.actualTeamWage
- // 查询个人所得税列表
- crudSysConfigIndividualIncomeTax.getAll().then(taxRes => {
- // 税额
- let taxAmount = 0
- // 计税金额
- const taxableAmount = this.form.preTaxAmount - this.form.accumulationPersonalAmount - this.form.pensionPersonalAmount - this.form.medicalPersonalAmount - this.form.unemploymentPersonalAmount - this.form.maternityPersonalAmount - this.form.industrialInjuryPersonalAmount
- // 循环个人所得税列表
- for (let i = 0; i < taxRes.length; i++) {
- // 判断计税金额所在个人所得税范围
- if (taxRes[i].gearAmountEnd != null && taxRes[i].gearAmountEnd !== '' && taxableAmount > taxRes[i].gearAmountEnd) {
- // 税额
- taxAmount += (taxRes[i].gearAmountEnd - taxRes[i].gearAmountStart) * (taxRes[i].taxRate / 100)
- } else if (taxableAmount >= taxRes[i].gearAmountStart && (taxRes[i].gearAmountEnd == null || taxRes[i].gearAmountEnd === '' || taxableAmount <= taxRes[i].gearAmountEnd)) {
- // 税额
- taxAmount += (taxableAmount - taxRes[i].gearAmountStart) * (taxRes[i].taxRate / 100)
- }
- // 判断循环是否结束
- if (i === taxRes.length - 1) {
- // 个人所得税
- this.form.individualIncomeTax = taxAmount
- // 税后金额
- this.form.afterTaxAmount = (taxableAmount - taxAmount) < 0 ? 0 : taxableAmount - taxAmount
- // 随机数
- this.random = Math.random()
- }
- }
- })
- // 清空统计定时器
- clearInterval(statisticsInterval)
- }
- }, 500)
- }).catch(() => {
- // 已完成绩效工时
- this.form.alreadyCompletedAchievementsHours = 0
- // 已完成业绩工时
- this.form.alreadyCompletedPerformanceHours = 0
- // 已完成团队工时
- this.form.alreadyCompletedTeamHours = 0
- // 实际绩效工资
- this.form.actualAchievementsWage = 0
- // 实际业绩工资
- this.form.actualPerformanceWage = 0
- // 实际团队工资
- this.form.actualTeamWage = 0
- // 税前金额
- this.form.preTaxAmount = 0
- // 个人所得税
- this.form.individualIncomeTax = 0
- // 税后金额
- this.form.afterTaxAmount = 0
- // 随机数
- this.random = Math.random()
+ return new Promise((resolve, reject) => {
+ // 获取已完成工时
+ crudTaskDaliy.completedWork({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
+ // 已完成绩效工时
+ this.form.alreadyCompletedAchievementsHours = Number(res.toFixed(2))
+ // 已完成业绩工时
+ this.form.alreadyCompletedPerformanceHours = Number(res.toFixed(2))
+ // 已完成团队工时
+ this.form.alreadyCompletedTeamHours = Number(res.toFixed(2))
+ // 绩效定时器
+ const achievementsInterval = setInterval(() => {
+ // 判断预计绩效工资、应完成绩效工时是否为空
+ if (this.form.achievementsWage != null && this.form.achievementsWage !== '' && this.form.needCompletedAchievementsHours != null && this.form.needCompletedAchievementsHours !== '') {
+ // 实际绩效工资
+ this.form.actualAchievementsWage = Number((this.form.achievementsWage * (res / this.form.needCompletedAchievementsHours)).toFixed(2))
+ // 实际绩效工资随机数
+ this.actualAchievementsWageRandom = Math.random()
+ // 清空绩效定时器
+ clearInterval(achievementsInterval)
+ }
+ }, 500)
+ // 业绩定时器
+ const performanceInterval = setInterval(() => {
+ // 判断预计业绩工资、应完成业绩工时是否为空
+ if (this.form.performanceWage != null && this.form.performanceWage !== '' && this.form.needCompletedPerformanceHours != null && this.form.needCompletedPerformanceHours !== '') {
+ // 实际业绩工资
+ this.form.actualPerformanceWage = Number((res >= this.form.needCompletedPerformanceHours ? this.form.performanceWage : 0).toFixed(2))
+ // 实际业绩工资随机数
+ this.actualPerformanceWageRandom = Math.random()
+ // 清空业绩定时器
+ clearInterval(performanceInterval)
+ }
+ }, 500)
+ // 团队定时器
+ const teamInterval = setInterval(() => {
+ // 判断预计团队工资、实达标团队工时是否为空
+ if (this.form.teamWage != null && this.form.teamWage !== '' && this.form.actualComplianceTeamHours != null && this.form.actualComplianceTeamHours !== '') {
+ // 实际团队工资
+ this.form.actualTeamWage = Number(this.form.actualComplianceTeamHours !== 0 ? (this.form.teamWage * (this.form.actualComplianceTeamHours / res)).toFixed(2) : 0)
+ // 实际团队工资随机数
+ this.actualTeamWageRandom = Math.random()
+ // 清空团队定时器
+ clearInterval(teamInterval)
+ }
+ }, 500)
+ // 统计定时器
+ const statisticsInterval = setInterval(() => {
+ // 判断 实际基础工资、实际绩效工资、实际业绩工资、实际团队工资、公积金个人缴纳金额、
+ // 养老险个人缴纳金额、医疗险个人缴纳金额、失业险个人缴纳金额、生育险个人缴纳金额、工伤险个人缴纳金额 是否为空
+ if (
+ this.form.actualBasicWage != null && this.form.actualBasicWage !== '' &&
+ this.form.actualAchievementsWage != null && this.form.actualAchievementsWage !== '' &&
+ this.form.actualPerformanceWage != null && this.form.actualPerformanceWage !== '' &&
+ this.form.actualTeamWage != null && this.form.actualTeamWage !== '' &&
+ this.form.accumulationPersonalAmount != null && this.form.accumulationPersonalAmount !== '' &&
+ this.form.pensionPersonalAmount != null && this.form.pensionPersonalAmount !== '' &&
+ this.form.medicalPersonalAmount != null && this.form.medicalPersonalAmount !== '' &&
+ this.form.unemploymentPersonalAmount != null && this.form.unemploymentPersonalAmount !== '' &&
+ this.form.maternityPersonalAmount != null && this.form.maternityPersonalAmount !== '' &&
+ this.form.industrialInjuryPersonalAmount != null && this.form.industrialInjuryPersonalAmount !== ''
+ ) {
+ // 统计金额
+ this.statisticalAmount()
+ // 清空统计定时器
+ clearInterval(statisticsInterval)
+ // 成功
+ resolve()
+ }
+ }, 500)
+ }).catch(() => {
+ // 已完成绩效工时
+ this.form.alreadyCompletedAchievementsHours = 0
+ // 已完成业绩工时
+ this.form.alreadyCompletedPerformanceHours = 0
+ // 已完成团队工时
+ this.form.alreadyCompletedTeamHours = 0
+ // 实际绩效工资
+ this.form.actualAchievementsWage = 0
+ // 实际绩效工资随机数
+ this.actualAchievementsWageRandom = Math.random()
+ // 实际业绩工资
+ this.form.actualPerformanceWage = 0
+ // 实际业绩工资随机数
+ this.actualPerformanceWageRandom = Math.random()
+ // 实际团队工资
+ this.form.actualTeamWage = 0
+ // 实际团队工资随机数
+ this.actualTeamWageRandom = Math.random()
+ // 税前金额
+ this.form.preTaxAmount = 0
+ // 税前金额随机数
+ this.preTaxAmountRandom = Math.random()
+ // 个人所得税
+ this.form.individualIncomeTax = 0
+ // 个人所得税随机数
+ this.individualIncomeTaxRandom = Math.random()
+ // 税后金额
+ this.form.afterTaxAmount = 0
+ // 税后金额随机数
+ this.afterTaxAmountRandom = Math.random()
+ // 失败
+ reject()
+ })
})
},
// 公示弹窗关闭
@@ -1574,6 +1805,262 @@
this.generateLoading = false
}
})
+ },
+ // 级别工资变更
+ levelWageBlur() {
+ // 预计基本工资 = 级别工资 * (基本工资比例 / 100)
+ this.form.basicWage = Number((this.form.levelWage * (this.form.basicWageProportion / 100)).toFixed(2))
+ // 预计基本工资随机数
+ this.basicWageRandom = Math.random()
+ // 实际基础工资 = 预计基本工资 - (预计基本工资 / 全勤小时数) * 缺勤小时数
+ this.form.actualBasicWage = Number((this.form.basicWage - (this.form.basicWage / this.form.fullDays) * this.form.absenceDays).toFixed(2))
+ // 实际基本工资随机数
+ this.actualBasicWageRandom = Math.random()
+ // 预计绩效工资 = 级别工资 * (绩效工资比例 / 100)
+ this.form.achievementsWage = Number((this.form.levelWage * (this.form.achievementsWageProportion / 100)).toFixed(2))
+ // 预计绩效工资随机数
+ this.achievementsWageRandom = Math.random()
+ // 实际绩效工资 = 预计绩效工资 * (已完成绩效工时 / 应完成绩效工时)
+ this.form.actualAchievementsWage = Number((this.form.achievementsWage * (this.form.alreadyCompletedAchievementsHours / this.form.needCompletedAchievementsHours)).toFixed(2))
+ // 实际绩效工资随机数
+ this.actualAchievementsWageRandom = Math.random()
+ // 预计业绩工资 = 级别工资 * (业绩工资比例 / 100)
+ this.form.performanceWage = Number((this.form.levelWage * (this.form.performanceWageProportion / 100)).toFixed(2))
+ // 预计业绩工资随机数
+ this.performanceWageRandom = Math.random()
+ // 实际业绩工资 = 已完成业绩工时 >= 应完成业绩工时 ? 预计业绩工资 : 0
+ this.form.actualPerformanceWage = Number((this.form.alreadyCompletedPerformanceHours >= this.form.needCompletedPerformanceHours ? this.form.performanceWage : 0).toFixed(2))
+ // 实际业绩工资随机数
+ this.actualPerformanceWageRandom = Math.random()
+ // 预计团队工资 = 级别工资 * (团队工资比例 / 100)
+ this.form.teamWage = Number((this.form.levelWage * (this.form.teamWageProportion / 100)).toFixed(2))
+ // 预计团队工资随机数
+ this.teamWageRandom = Math.random()
+ // 实际团队工资 = 预计团队工资 * (实达标团队工时 / 已完成团队工时)
+ this.form.actualTeamWage = Number(this.form.actualComplianceTeamHours !== 0 ? (this.form.teamWage * (this.form.actualComplianceTeamHours / this.form.alreadyCompletedTeamHours)).toFixed(2) : 0)
+ // 实际团队工资随机数
+ this.actualTeamWageRandom = Math.random()
+ // 统计金额
+ this.statisticalAmount()
+ },
+ // 基本参数变更
+ basicParameterBlur() {
+ // 预计基本工资 = 级别工资 * (基本工资比例 / 100)
+ this.form.basicWage = Number((this.form.levelWage * (this.form.basicWageProportion / 100)).toFixed(2))
+ // 预计基本工资随机数
+ this.basicWageRandom = Math.random()
+ // 实际基础工资 = 预计基本工资 - (预计基本工资 / 全勤小时数) * 缺勤小时数
+ this.form.actualBasicWage = Number((this.form.basicWage - (this.form.basicWage / this.form.fullDays) * this.form.absenceDays).toFixed(2))
+ // 实际基本工资随机数
+ this.actualBasicWageRandom = Math.random()
+ // 统计金额
+ this.statisticalAmount()
+ },
+ // 预计基本工资变更
+ basicWageBlur() {
+ // 实际基础工资 = 预计基本工资 - (预计基本工资 / 全勤小时数) * 缺勤小时数
+ this.form.actualBasicWage = Number((this.form.basicWage - (this.form.basicWage / this.form.fullDays) * this.form.absenceDays).toFixed(2))
+ // 实际基本工资随机数
+ this.actualBasicWageRandom = Math.random()
+ // 统计金额
+ this.statisticalAmount()
+ },
+ // 绩效参数变更
+ achievementsParameterBlur() {
+ // 预计绩效工资 = 级别工资 * (绩效工资比例 / 100)
+ this.form.achievementsWage = Number((this.form.levelWage * (this.form.achievementsWageProportion / 100)).toFixed(2))
+ // 预计绩效工资随机数
+ this.achievementsWageRandom = Math.random()
+ // 实际绩效工资 = 预计绩效工资 * (已完成绩效工时 / 应完成绩效工时)
+ this.form.actualAchievementsWage = Number((this.form.achievementsWage * (this.form.alreadyCompletedAchievementsHours / this.form.needCompletedAchievementsHours)).toFixed(2))
+ // 实际绩效工资随机数
+ this.actualAchievementsWageRandom = Math.random()
+ // 统计金额
+ this.statisticalAmount()
+ },
+ // 预计绩效工资变更
+ achievementsWageBlur() {
+ // 实际绩效工资 = 预计绩效工资 * (已完成绩效工时 / 应完成绩效工时)
+ this.form.actualAchievementsWage = Number((this.form.achievementsWage * (this.form.alreadyCompletedAchievementsHours / this.form.needCompletedAchievementsHours)).toFixed(2))
+ // 实际绩效工资随机数
+ this.actualAchievementsWageRandom = Math.random()
+ // 统计金额
+ this.statisticalAmount()
+ },
+ // 业绩参数变更
+ performanceParameterBlur() {
+ // 预计业绩工资 = 级别工资 * (业绩工资比例 / 100)
+ this.form.performanceWage = Number((this.form.levelWage * (this.form.performanceWageProportion / 100)).toFixed(2))
+ // 预计业绩工资随机数
+ this.performanceWageRandom = Math.random()
+ // 应完成业绩工时 = 全勤小时数 * ( 1 + 个人业绩比例 / 100)
+ this.form.needCompletedPerformanceHours = Number((this.form.fullDays * (1 + this.form.personalPerformanceProportion / 100)).toFixed(2))
+ // 实际业绩工资 = 已完成业绩工时 >= 应完成业绩工时 ? 预计业绩工资 : 0
+ this.form.actualPerformanceWage = Number((this.form.alreadyCompletedPerformanceHours >= this.form.needCompletedPerformanceHours ? this.form.performanceWage : 0).toFixed(2))
+ // 实际业绩工资随机数
+ this.actualPerformanceWageRandom = Math.random()
+ // 统计金额
+ this.statisticalAmount()
+ },
+ // 预计业绩工资变更
+ performanceWageBlur() {
+ // 实际业绩工资 = 已完成业绩工时 >= 应完成业绩工时 ? 预计业绩工资 : 0
+ this.form.actualPerformanceWage = Number((this.form.alreadyCompletedPerformanceHours >= this.form.needCompletedPerformanceHours ? this.form.performanceWage : 0).toFixed(2))
+ // 实际业绩工资随机数
+ this.actualPerformanceWageRandom = Math.random()
+ // 统计金额
+ this.statisticalAmount()
+ },
+ // 团队参数变更
+ teamParameterBlur() {
+ // 预计团队工资 = 级别工资 * (团队工资比例 / 100)
+ this.form.teamWage = Number((this.form.levelWage * (this.form.teamWageProportion / 100)).toFixed(2))
+ // 预计团队工资随机数
+ this.teamWageRandom = Math.random()
+ // 实际团队工资 = 预计团队工资 * (实达标团队工时 / 已完成团队工时)
+ this.form.actualTeamWage = Number(this.form.actualComplianceTeamHours !== 0 ? (this.form.teamWage * (this.form.actualComplianceTeamHours / this.form.alreadyCompletedTeamHours)).toFixed(2) : 0)
+ // 实际团队工资随机数
+ this.actualTeamWageRandom = Math.random()
+ // 统计金额
+ this.statisticalAmount()
+ },
+ // 预计团队工资变更
+ teamWageBlur() {
+ // 实际团队工资 = 预计团队工资 * (实达标团队工时 / 已完成团队工时)
+ this.form.actualTeamWage = Number(this.form.actualComplianceTeamHours !== 0 ? (this.form.teamWage * (this.form.actualComplianceTeamHours / this.form.alreadyCompletedTeamHours)).toFixed(2) : 0)
+ // 实际团队工资随机数
+ this.actualTeamWageRandom = Math.random()
+ // 统计金额
+ this.statisticalAmount()
+ },
+ // 公积金参数变更
+ accumulationParameterBlur() {
+ // 公积金个人缴纳金额 = 公积金基数 * (公积金个人缴纳比例 / 100)
+ this.form.accumulationPersonalAmount = Number((this.form.accumulationRadix * (this.form.accumulationPersonalProportion / 100)).toFixed(2))
+ // 公积金个人缴纳金额随机数
+ this.accumulationPersonalAmountRandom = Math.random()
+ // 公积金公司缴纳金额 = 公积金基数 * (公积金公司缴纳比例 / 100)
+ this.form.accumulationCompanyAmount = Number((this.form.accumulationRadix * (this.form.accumulationCompanyProportion / 100)).toFixed(2))
+ // 公积金公司缴纳金额随机数
+ this.accumulationCompanyAmountRandom = Math.random()
+ // 统计金额
+ this.statisticalAmount()
+ },
+ // 养老险参数变更
+ pensionParameterBlur() {
+ // 养老险个人缴纳金额 = 养老险基数 * (养老险个人缴纳比例 / 100)
+ this.form.pensionPersonalAmount = Number((this.form.pensionRadix * (this.form.pensionPersonalProportion / 100)).toFixed(2))
+ // 养老险个人缴纳金额随机数
+ this.pensionPersonalAmountRandom = Math.random()
+ // 养老险公司缴纳金额 = 养老险基数 * (养老险公司缴纳比例 / 100)
+ this.form.pensionCompanyAmount = Number((this.form.pensionRadix * (this.form.pensionCompanyProportion / 100)).toFixed(2))
+ // 养老险公司缴纳金额随机数
+ this.pensionCompanyAmountRandom = Math.random()
+ // 统计金额
+ this.statisticalAmount()
+ },
+ // 医疗险参数变更
+ medicalParameterBlur() {
+ // 医疗险个人缴纳金额 = 医疗险基数 * (医疗险个人缴纳比例 / 100)
+ this.form.medicalPersonalAmount = Number((this.form.medicalRadix * (this.form.medicalPersonalProportion / 100)).toFixed(2))
+ // 医疗险个人缴纳金额随机数
+ this.medicalPersonalAmountRandom = Math.random()
+ // 医疗险公司缴纳金额 = 医疗险基数 * (医疗险公司缴纳比例 / 100)
+ this.form.medicalCompanyAmount = Number((this.form.medicalRadix * (this.form.medicalCompanyProportion / 100)).toFixed(2))
+ // 医疗险公司缴纳金额随机数
+ this.medicalCompanyAmountRandom = Math.random()
+ // 统计金额
+ this.statisticalAmount()
+ },
+ // 失业险参数变更
+ unemploymentParameterBlur() {
+ // 失业险个人缴纳金额 = 失业险基数 * (失业险个人缴纳比例 / 100)
+ this.form.unemploymentPersonalAmount = Number((this.form.unemploymentRadix * (this.form.unemploymentPersonalProportion / 100)).toFixed(2))
+ // 失业险个人缴纳金额随机数
+ this.unemploymentPersonalAmountRandom = Math.random()
+ // 失业险公司缴纳金额 = 失业险基数 * (失业险公司缴纳比例 / 100)
+ this.form.unemploymentCompanyAmount = Number((this.form.unemploymentRadix * (this.form.unemploymentCompanyProportion / 100)).toFixed(2))
+ // 失业险公司缴纳金额随机数
+ this.unemploymentCompanyAmountRandom = Math.random()
+ // 统计金额
+ this.statisticalAmount()
+ },
+ // 生育险参数变更
+ maternityParameterBlur() {
+ // 生育险个人缴纳金额 = 生育险基数 * (生育险个人缴纳比例 / 100)
+ this.form.maternityPersonalAmount = Number((this.form.maternityRadix * (this.form.maternityPersonalProportion / 100)).toFixed(2))
+ // 生育险个人缴纳金额随机数
+ this.maternityPersonalAmountRandom = Math.random()
+ // 生育险公司缴纳金额 = 生育险基数 * (生育险公司缴纳比例 / 100)
+ this.form.maternityCompanyAmount = Number((this.form.maternityRadix * (this.form.maternityCompanyProportion / 100)).toFixed(2))
+ // 生育险公司缴纳金额随机数
+ this.maternityCompanyAmountRandom = Math.random()
+ // 统计金额
+ this.statisticalAmount()
+ },
+ // 工伤险参数变更
+ industrialInjuryParameterBlur() {
+ // 工伤险个人缴纳金额 = 工伤险基数 * (工伤险个人缴纳比例 / 100)
+ this.form.industrialInjuryPersonalAmount = Number((this.form.industrialInjuryRadix * (this.form.industrialInjuryPersonalProportion / 100)).toFixed(2))
+ // 工伤险个人缴纳金额随机数
+ this.industrialInjuryPersonalAmountRandom = Math.random()
+ // 工伤险公司缴纳金额 = 工伤险基数 * (工伤险公司缴纳比例 / 100)
+ this.form.industrialInjuryCompanyAmount = Number((this.form.industrialInjuryRadix * (this.form.industrialInjuryCompanyProportion / 100)).toFixed(2))
+ // 工伤险公司缴纳金额随机数
+ this.industrialInjuryCompanyAmountRandom = Math.random()
+ // 统计金额
+ this.statisticalAmount()
+ },
+ // 统计金额
+ statisticalAmount() {
+ console.log('统计金额')
+ // 税前金额
+ this.form.preTaxAmount = this.form.actualBasicWage + this.form.actualAchievementsWage + this.form.actualPerformanceWage + this.form.actualTeamWage
+ // 税前金额随机数
+ this.preTaxAmountRandom = Math.random()
+ // 税前金额变更
+ this.preTaxAmountBlur()
+ },
+ // 税前金额变更
+ preTaxAmountBlur() {
+ // 查询个人所得税列表
+ crudSysConfigIndividualIncomeTax.getAll().then(res => {
+ // 税额
+ let taxAmount = 0
+ // 计税金额 = 税前金额 - 五险一金个人缴纳金额
+ const taxableAmount = this.form.preTaxAmount - this.form.accumulationPersonalAmount - this.form.pensionPersonalAmount - this.form.medicalPersonalAmount - this.form.unemploymentPersonalAmount - this.form.maternityPersonalAmount - this.form.industrialInjuryPersonalAmount
+ // 循环个人所得税列表
+ for (let i = 0; i < res.length; i++) {
+ // 判断计税金额所在个人所得税范围
+ if (res[i].gearAmountEnd != null && res[i].gearAmountEnd !== '' && taxableAmount > res[i].gearAmountEnd) {
+ // 税额
+ taxAmount += (res[i].gearAmountEnd - res[i].gearAmountStart) * (res[i].taxRate / 100)
+ } else if (taxableAmount >= res[i].gearAmountStart && (res[i].gearAmountEnd == null || res[i].gearAmountEnd === '' || taxableAmount <= res[i].gearAmountEnd)) {
+ // 税额
+ taxAmount += (taxableAmount - res[i].gearAmountStart) * (res[i].taxRate / 100)
+ }
+ // 判断循环是否结束
+ if (i === res.length - 1) {
+ // 个人所得税 = 税额
+ this.form.individualIncomeTax = taxAmount
+ // 个人所得税随机数
+ this.individualIncomeTaxRandom = Math.random()
+ // 税后金额 = 计税金额 - 税额
+ this.form.afterTaxAmount = (taxableAmount - taxAmount) < 0 ? 0 : taxableAmount - taxAmount
+ // 税后金额随机数
+ this.afterTaxAmountRandom = Math.random()
+ }
+ }
+ })
+ },
+ // 个人所得税变更
+ individualIncomeTaxBlur() {
+ // 计税金额 = 税前金额 - 五险一金个人缴纳金额
+ const taxableAmount = this.form.preTaxAmount - this.form.accumulationPersonalAmount - this.form.pensionPersonalAmount - this.form.medicalPersonalAmount - this.form.unemploymentPersonalAmount - this.form.maternityPersonalAmount - this.form.industrialInjuryPersonalAmount
+ // 税后金额 = 计税金额 - 个人所得税
+ this.form.afterTaxAmount = (taxableAmount - this.form.individualIncomeTax) < 0 ? 0 : taxableAmount - this.form.individualIncomeTax
+ // 税后金额随机数
+ this.afterTaxAmountRandom = Math.random()
}
}
}
--
Gitblit v1.9.3