From d837263f2438ed70a256912ac0b329c5ae0eea14 Mon Sep 17 00:00:00 2001
From: 赵士淞 <zhaoss@yhzhg.cn>
Date: Mon, 09 Jan 2023 05:04:58 +0000
Subject: [PATCH] 工资管理

---
 eladmin-web-master/src/components/Crud/crud.js                                                                     |   14 +
 eladmin-web-master/src/views/salary/salary/index.vue                                                               |  478 ++++++++++++++++++++++++++++++++++++++++++----------
 eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceServiceImpl.java |    4 
 eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskDaliyServiceImpl.java        |    4 
 eladmin-master/eladmin-system/src/main/java/me/zhengjie/utils/DateUtil.java                                        |   24 ++
 5 files changed, 424 insertions(+), 100 deletions(-)

diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceServiceImpl.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceServiceImpl.java
index 606def6..08e9ef9 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceServiceImpl.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceServiceImpl.java
@@ -401,6 +401,8 @@
             if (attendanceDayList.size() > 1) {
                 throw new BadRequestException("相同日期存在多条考勤记录!");
             } else if (attendanceDayList.size() == 1) {
+                // 本日考勤
+                attendanceDay = attendanceDayList.get(0);
                 // 判断本日考勤排班信息是否完整
                 if (attendanceDay.getRosteringWorkStartTime() == null || "".equals(attendanceDay.getRosteringWorkStartTime()) ||
                         attendanceDay.getRosteringLunchStartTime() == null || "".equals(attendanceDay.getRosteringLunchStartTime()) ||
@@ -408,8 +410,6 @@
                         attendanceDay.getRosteringWorkEndTime() == null || "".equals(attendanceDay.getRosteringWorkEndTime())) {
                     throw new BadRequestException("考勤记录排班信息缺失!");
                 }
-                // 本日考勤
-                attendanceDay = attendanceDayList.get(0);
                 // 判断本日考勤是否有实际工作开始时间、实际工作结束时间
                 if (attendanceDay.getActualWorkStartTime() != null && !"".equals(attendanceDay.getActualWorkStartTime()) && attendanceDay.getActualWorkEndTime() != null && !"".equals(attendanceDay.getActualWorkEndTime())) {
                     // 获取有效时长
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskDaliyServiceImpl.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskDaliyServiceImpl.java
index e73068d..7839970 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskDaliyServiceImpl.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskDaliyServiceImpl.java
@@ -268,6 +268,10 @@
                     }
                     // 已完成工时
                     completedWork += taskUserDay.getTaskHours() * (taskDaliyDayProgress / 100);
+                    // 本日任务日报
+                    taskDaliyDay.setSettlementStatus(Constant.SETTLEMENT_STATUS_SETTLED);
+                    // 保存本日任务日报
+                    taskDaliyRepository.save(taskDaliyDay);
                 }
             }
         }
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/utils/DateUtil.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/utils/DateUtil.java
index c7b0ab3..9cf8339 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/utils/DateUtil.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/utils/DateUtil.java
@@ -130,10 +130,18 @@
 
     /**
      * 设置日初时间
-     * @param cal
+     * @param dayCal
      * @return
      */
-    public static Calendar setDayStartTime(Calendar cal) {
+    public static Calendar setDayStartTime(Calendar dayCal) {
+        // 日历类
+        Calendar cal = Calendar.getInstance();
+        // 设置年份
+        cal.set(Calendar.YEAR, dayCal.get(Calendar.YEAR));
+        // 设置月份
+        cal.set(Calendar.MONTH, dayCal.get(Calendar.MONTH));
+        // 设置天数
+        cal.set(Calendar.DAY_OF_MONTH, dayCal.get(Calendar.DAY_OF_MONTH));
         // 设置时数
         cal.set(Calendar.HOUR_OF_DAY, 0);
         // 设置分数
@@ -148,10 +156,18 @@
 
     /**
      * 设置日末时间
-     * @param cal
+     * @param dayCal
      * @return
      */
-    public static Calendar setDayEndTime(Calendar cal) {
+    public static Calendar setDayEndTime(Calendar dayCal) {
+        // 日历类
+        Calendar cal = Calendar.getInstance();
+        // 设置年份
+        cal.set(Calendar.YEAR, dayCal.get(Calendar.YEAR));
+        // 设置月份
+        cal.set(Calendar.MONTH, dayCal.get(Calendar.MONTH));
+        // 设置天数
+        cal.set(Calendar.DAY_OF_MONTH, dayCal.get(Calendar.DAY_OF_MONTH));
         // 设置时数
         cal.set(Calendar.HOUR_OF_DAY, 23);
         // 设置分数
diff --git a/eladmin-web-master/src/components/Crud/crud.js b/eladmin-web-master/src/components/Crud/crud.js
index 23f6fe4..146cfc8 100644
--- a/eladmin-web-master/src/components/Crud/crud.js
+++ b/eladmin-web-master/src/components/Crud/crud.js
@@ -531,6 +531,20 @@
       })
     },
     /**
+     * 年月格式化
+     * @param {Object} timestamp 时间戳
+     */
+    toMonth(timestamp) {
+      if (timestamp == null) {
+        return
+      } else {
+        const system = new Date(timestamp)
+        const year = system.getFullYear()
+        const month = system.getMonth() + 1 < 10 ? '0' + (system.getMonth() + 1) : system.getMonth() + 1
+        return year + '-' + month
+      }
+    },
+    /**
      * 日期格式化
      * @param {Object} timestamp 时间戳
      */
diff --git a/eladmin-web-master/src/views/salary/salary/index.vue b/eladmin-web-master/src/views/salary/salary/index.vue
index 65b5ee0..a64746f 100644
--- a/eladmin-web-master/src/views/salary/salary/index.vue
+++ b/eladmin-web-master/src/views/salary/salary/index.vue
@@ -278,66 +278,314 @@
       <!--表格渲染-->
       <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
         <el-table-column type="selection" width="55" />
-        <el-table-column prop="userId" label="员工ID" />
-        <el-table-column prop="salaryYearMonth" label="工资年月" />
-        <el-table-column prop="levelWage" label="级别工资" />
-        <el-table-column prop="basicWageProportion" label="基本工资比例" />
-        <el-table-column prop="basicWage" label="基本工资" />
-        <el-table-column prop="fullDays" label="全勤小时数" />
-        <el-table-column prop="absenceDays" label="缺勤小时数" />
-        <el-table-column prop="actualBasicWage" label="实际基础工资" />
-        <el-table-column prop="achievementsWageProportion" label="绩效工资比例" />
-        <el-table-column prop="achievementsWage" label="绩效工资" />
-        <el-table-column prop="needCompletedAchievementsHours" label="应完成绩效工时" />
-        <el-table-column prop="alreadyCompletedAchievementsHours" label="已完成绩效工时" />
-        <el-table-column prop="actualAchievementsWage" label="实际绩效工资" />
-        <el-table-column prop="performanceWageProportion" label="业绩工资比例" />
-        <el-table-column prop="performanceWage" label="业绩工资" />
-        <el-table-column prop="personalPerformanceProportion" label="个人业绩比例" />
-        <el-table-column prop="needCompletedPerformanceHours" label="应完成业绩工时" />
-        <el-table-column prop="alreadyCompletedPerformanceHours" label="已完成业绩工时" />
-        <el-table-column prop="actualPerformanceWage" label="实际业绩工资" />
-        <el-table-column prop="teamWageProportion" label="团队工资比例" />
-        <el-table-column prop="teamWage" label="团队工资" />
-        <el-table-column prop="actualComplianceTeamHours" label="实达标团队工时" />
-        <el-table-column prop="alreadyCompletedTeamHours" label="已完成团队工时" />
-        <el-table-column prop="actualTeamWage" label="实际团队工资" />
-        <el-table-column prop="accumulationRadix" label="公积金基数" />
-        <el-table-column prop="accumulationPersonalProportion" label="公积金个人缴纳比例" />
-        <el-table-column prop="accumulationPersonalAmount" label="公积金个人缴纳金额" />
-        <el-table-column prop="accumulationCompanyProportion" label="公积金公司缴纳比例" />
-        <el-table-column prop="accumulationCompanyAmount" label="公积金公司缴纳金额" />
-        <el-table-column prop="pensionRadix" label="养老险基数" />
-        <el-table-column prop="pensionPersonalProportion" label="养老险个人缴纳比例" />
-        <el-table-column prop="pensionPersonalAmount" label="养老险个人缴纳金额" />
-        <el-table-column prop="pensionCompanyProportion" label="养老险公司缴纳比例" />
-        <el-table-column prop="pensionCompanyAmount" label="养老险公司缴纳金额" />
-        <el-table-column prop="medicalRadix" label="医疗险基数" />
-        <el-table-column prop="medicalPersonalProportion" label="医疗险个人缴纳比例" />
-        <el-table-column prop="medicalPersonalAmount" label="医疗险个人缴纳金额" />
-        <el-table-column prop="medicalCompanyProportion" label="医疗险公司缴纳比例" />
-        <el-table-column prop="medicalCompanyAmount" label="医疗险公司缴纳金额" />
-        <el-table-column prop="unemploymentRadix" label="失业险基数" />
-        <el-table-column prop="unemploymentPersonalProportion" label="失业险个人缴纳比例" />
-        <el-table-column prop="unemploymentPersonalAmount" label="失业险个人缴纳金额" />
-        <el-table-column prop="unemploymentCompanyProportion" label="失业险公司缴纳比例" />
-        <el-table-column prop="unemploymentCompanyAmount" label="失业险公司缴纳金额" />
-        <el-table-column prop="maternityRadix" label="生育险基数" />
-        <el-table-column prop="maternityPersonalProportion" label="生育险个人缴纳比例" />
-        <el-table-column prop="maternityPersonalAmount" label="生育险个人缴纳金额" />
-        <el-table-column prop="maternityCompanyProportion" label="生育险公司缴纳比例" />
-        <el-table-column prop="maternityCompanyAmount" label="生育险公司缴纳金额" />
-        <el-table-column prop="industrialInjuryRadix" label="工伤险基数" />
-        <el-table-column prop="industrialInjuryPersonalProportion" label="工伤险个人缴纳比例" />
-        <el-table-column prop="industrialInjuryPersonalAmount" label="工伤险个人缴纳金额" />
-        <el-table-column prop="industrialInjuryCompanyProportion" label="工伤险公司缴纳比例" />
-        <el-table-column prop="industrialInjuryCompanyAmount" label="工伤险公司缴纳金额" />
-        <el-table-column prop="preTaxAmount" label="税前金额" />
-        <el-table-column prop="individualIncomeTax" label="个人所得税" />
-        <el-table-column prop="afterTaxAmount" label="税后金额" />
-        <el-table-column prop="remarks" label="备注" />
-        <el-table-column prop="createTime" label="创建时间" />
-        <el-table-column v-if="checkPer(['admin','salary:edit','salary:del'])" label="操作" width="150px" align="center">
+        <el-table-column :show-overflow-tooltip="true" prop="userNickName" label="所属员工" fixed="left" width="100">
+          <template slot-scope="scope">
+            <el-tag>{{ scope.row.userNickName }}</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column :show-overflow-tooltip="true" prop="salaryYearMonth" label="工资年月" fixed="left" width="100">
+          <template slot-scope="scope">
+            {{ crud.toMonth(scope.row.salaryYearMonth) }}
+          </template>
+        </el-table-column>
+        <el-table-column :show-overflow-tooltip="true" prop="levelWage" label="级别工资" width="100">
+          <template slot-scope="scope">
+            {{ crud.toMoney(scope.row.levelWage) }}
+          </template>
+        </el-table-column>
+        <el-table-column label="基础工资">
+          <el-table-column :show-overflow-tooltip="true" prop="basicWageProportion" label="工资比例" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.basicWageProportion }}%
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="basicWage" label="预计工资" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.basicWage) }}
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="fullDays" label="全勤小时数" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.fullDays }}小时
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="absenceDays" label="缺勤小时数" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.absenceDays }}小时
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="actualBasicWage" label="实际工资" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.actualBasicWage) }}
+            </template>
+          </el-table-column>
+        </el-table-column>
+        <el-table-column label="绩效工资">
+          <el-table-column :show-overflow-tooltip="true" prop="achievementsWageProportion" label="工资比例" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.achievementsWageProportion }}%
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="achievementsWage" label="预计工资" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.achievementsWage) }}
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="needCompletedAchievementsHours" label="应完成工时" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.needCompletedAchievementsHours }}小时
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="alreadyCompletedAchievementsHours" label="已完成工时" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.alreadyCompletedAchievementsHours }}小时
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="actualAchievementsWage" label="实际工资" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.actualAchievementsWage) }}
+            </template>
+          </el-table-column>
+        </el-table-column>
+        <el-table-column label="业绩工资">
+          <el-table-column :show-overflow-tooltip="true" prop="performanceWageProportion" label="工资比例" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.performanceWageProportion }}%
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="performanceWage" label="预计工资" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.performanceWage) }}
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="personalPerformanceProportion" label="个人业绩比例" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.personalPerformanceProportion }}%
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="needCompletedPerformanceHours" label="应完成工时" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.needCompletedPerformanceHours }}小时
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="alreadyCompletedPerformanceHours" label="已完成工时" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.alreadyCompletedPerformanceHours }}小时
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="actualPerformanceWage" label="实际工资" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.actualPerformanceWage) }}
+            </template>
+          </el-table-column>
+        </el-table-column>
+        <el-table-column label="团队工资">
+          <el-table-column :show-overflow-tooltip="true" prop="teamWageProportion" label="工资比例" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.teamWageProportion }}%
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="teamWage" label="预计工资" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.teamWage) }}
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="actualComplianceTeamHours" label="实达标工时" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.actualComplianceTeamHours }}小时
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="alreadyCompletedTeamHours" label="已完成工时" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.alreadyCompletedTeamHours }}小时
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="actualTeamWage" label="实际工资" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.actualTeamWage) }}
+            </template>
+          </el-table-column>
+        </el-table-column>
+        <el-table-column label="公积金">
+          <el-table-column :show-overflow-tooltip="true" prop="accumulationRadix" label="基数" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.accumulationRadix) }}
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="accumulationPersonalProportion" label="个人缴纳比例" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.accumulationPersonalProportion }}%
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="accumulationPersonalAmount" label="个人缴纳金额" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.accumulationPersonalAmount) }}
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="accumulationCompanyProportion" label="公司缴纳比例" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.accumulationCompanyProportion }}%
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="accumulationCompanyAmount" label="公司缴纳金额" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.accumulationCompanyAmount) }}
+            </template>
+          </el-table-column>
+        </el-table-column>
+        <el-table-column label="养老险">
+          <el-table-column :show-overflow-tooltip="true" prop="pensionRadix" label="基数" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.pensionRadix) }}
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="pensionPersonalProportion" label="个人缴纳比例" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.pensionPersonalProportion }}%
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="pensionPersonalAmount" label="个人缴纳金额" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.pensionPersonalAmount) }}
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="pensionCompanyProportion" label="公司缴纳比例" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.pensionCompanyProportion }}%
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="pensionCompanyAmount" label="公司缴纳金额" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.pensionCompanyAmount) }}
+            </template>
+          </el-table-column>
+        </el-table-column>
+        <el-table-column label="医疗险">
+          <el-table-column :show-overflow-tooltip="true" prop="medicalRadix" label="基数" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.medicalRadix) }}
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="medicalPersonalProportion" label="个人缴纳比例" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.medicalPersonalProportion }}%
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="medicalPersonalAmount" label="个人缴纳金额" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.medicalPersonalAmount) }}
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="medicalCompanyProportion" label="公司缴纳比例" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.medicalCompanyProportion }}%
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="medicalCompanyAmount" label="公司缴纳金额" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.medicalCompanyAmount) }}
+            </template>
+          </el-table-column>
+        </el-table-column>
+        <el-table-column label="失业险">
+          <el-table-column :show-overflow-tooltip="true" prop="unemploymentRadix" label="基数" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.unemploymentRadix) }}
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="unemploymentPersonalProportion" label="个人缴纳比例" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.unemploymentPersonalProportion }}%
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="unemploymentPersonalAmount" label="个人缴纳金额" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.unemploymentPersonalAmount) }}
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="unemploymentCompanyProportion" label="公司缴纳比例" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.unemploymentCompanyProportion }}%
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="unemploymentCompanyAmount" label="公司缴纳金额" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.unemploymentCompanyAmount) }}
+            </template>
+          </el-table-column>
+        </el-table-column>
+        <el-table-column label="生育险">
+          <el-table-column :show-overflow-tooltip="true" prop="maternityRadix" label="基数" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.maternityRadix) }}
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="maternityPersonalProportion" label="个人缴纳比例" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.maternityPersonalProportion }}%
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="maternityPersonalAmount" label="个人缴纳金额" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.maternityPersonalAmount) }}
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="maternityCompanyProportion" label="公司缴纳比例" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.maternityCompanyProportion }}%
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="maternityCompanyAmount" label="公司缴纳金额" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.maternityCompanyAmount) }}
+            </template>
+          </el-table-column>
+        </el-table-column>
+        <el-table-column label="工伤险">
+          <el-table-column :show-overflow-tooltip="true" prop="industrialInjuryRadix" label="基数" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.industrialInjuryRadix) }}
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="industrialInjuryPersonalProportion" label="个人缴纳比例" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.industrialInjuryPersonalProportion }}%
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="industrialInjuryPersonalAmount" label="个人缴纳金额" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.industrialInjuryPersonalAmount) }}
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="industrialInjuryCompanyProportion" label="公司缴纳比例" width="100">
+            <template slot-scope="scope">
+              {{ scope.row.industrialInjuryCompanyProportion }}%
+            </template>
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" prop="industrialInjuryCompanyAmount" label="公司缴纳金额" width="100">
+            <template slot-scope="scope">
+              {{ crud.toMoney(scope.row.industrialInjuryCompanyAmount) }}
+            </template>
+          </el-table-column>
+        </el-table-column>
+        <el-table-column :show-overflow-tooltip="true" prop="preTaxAmount" label="税前金额" width="100">
+          <template slot-scope="scope">
+            {{ crud.toMoney(scope.row.preTaxAmount) }}
+          </template>
+        </el-table-column>
+        <el-table-column :show-overflow-tooltip="true" prop="individualIncomeTax" label="个人所得税" width="100">
+          <template slot-scope="scope">
+            {{ crud.toMoney(scope.row.individualIncomeTax) }}
+          </template>
+        </el-table-column>
+        <el-table-column :show-overflow-tooltip="true" prop="afterTaxAmount" label="税后金额" width="100">
+          <template slot-scope="scope">
+            {{ crud.toMoney(scope.row.afterTaxAmount) }}
+          </template>
+        </el-table-column>
+        <el-table-column :show-overflow-tooltip="true" prop="remarks" label="备注" width="140" />
+        <el-table-column :show-overflow-tooltip="true" prop="createTime" label="创建时间" width="140" />
+        <el-table-column v-if="checkPer(['admin','salary:edit','salary:del'])" label="操作" width="150px" align="center" fixed="right">
           <template slot-scope="scope">
             <udOperation
               :data="scope.row"
@@ -692,21 +940,21 @@
       // 获取用户级别工资
       crudUserLevelWage.getTargetYearMonth({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
         // 级别工资
-        this.form.levelWage = Number(res.levelWage)
+        this.form.levelWage = Number(res.levelWage.toFixed(2))
         // 基本工资比例
-        this.form.basicWageProportion = Number(res.basicWageProportion)
+        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)
+        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)
+        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)
+        this.form.teamWageProportion = Number(res.teamWageProportion.toFixed(2))
         // 预计团队工资
         this.form.teamWage = Number((res.levelWage * (res.teamWageProportion / 100)).toFixed(2))
         // 随机数
@@ -718,63 +966,63 @@
       // 获取用户级别保险
       crudUserLevelInsurance.getTargetYearMonth({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
         // 公积金基数
-        this.form.accumulationRadix = Number(res.accumulationRadix)
+        this.form.accumulationRadix = Number(res.accumulationRadix.toFixed(2))
         // 公积金个人缴纳比例
-        this.form.accumulationPersonalProportion = Number(res.accumulationPersonalProportion)
+        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)
+        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)
+        this.form.pensionRadix = Number(res.pensionRadix.toFixed(2))
         // 养老险个人缴纳比例
-        this.form.pensionPersonalProportion = Number(res.pensionPersonalProportion)
+        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)
+        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)
+        this.form.medicalRadix = Number(res.medicalRadix.toFixed(2))
         // 医疗险个人缴纳比例
-        this.form.medicalPersonalProportion = Number(res.medicalPersonalProportion)
+        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)
+        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)
+        this.form.unemploymentRadix = Number(res.unemploymentRadix.toFixed(2))
         // 失业险个人缴纳比例
-        this.form.unemploymentPersonalProportion = Number(res.unemploymentPersonalProportion)
+        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)
+        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)
+        this.form.maternityRadix = Number(res.maternityRadix.toFixed(2))
         // 生育险个人缴纳比例
-        this.form.maternityPersonalProportion = Number(res.maternityPersonalProportion)
+        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)
+        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)
+        this.form.industrialInjuryRadix = Number(res.industrialInjuryRadix.toFixed(2))
         // 工伤险个人缴纳比例
-        this.form.industrialInjuryPersonalProportion = Number(res.industrialInjuryPersonalProportion)
+        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)
+        this.form.industrialInjuryCompanyProportion = Number(res.industrialInjuryCompanyProportion.toFixed(2))
         // 工伤险公司缴纳金额
         this.form.industrialInjuryCompanyAmount = Number((res.industrialInjuryRadix * (res.industrialInjuryCompanyProportion / 100)).toFixed(2))
         // 随机数
@@ -786,7 +1034,7 @@
       // 获取用户级别其他
       crudUserLevelOther.getTargetYearMonth({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
         // 个人业绩比例
-        this.form.personalPerformanceProportion = Number(res.personalPerformanceProportion)
+        this.form.personalPerformanceProportion = Number(res.personalPerformanceProportion.toFixed(2))
       })
     },
     // 获取工作天数
@@ -794,15 +1042,15 @@
       // 获取工作天数
       crudSalary.workDays({ targetYearMonth: this.form.salaryYearMonth }).then(res => {
         // 全勤小时数
-        this.form.fullDays = Number(res * 8)
+        this.form.fullDays = Number((res * 8).toFixed(2))
         // 应完成绩效工时
-        this.form.needCompletedAchievementsHours = Number(res * 8)
+        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 + Number(this.form.personalPerformanceProportion) / 100))
+            this.form.needCompletedPerformanceHours = Number((res * 8 * (1 + this.form.personalPerformanceProportion / 100)).toFixed(2))
             // 清空定时器
             clearInterval(interval)
           }
@@ -813,7 +1061,20 @@
     getAttendanceHours() {
       // 获取出勤小时数
       crudAttendance.attendanceHours({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
-        // console.log(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)
       })
     },
     // 获取达标工时
@@ -821,7 +1082,7 @@
       // 获取达标工时
       crudTaskDaliy.complianceWork({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
         // 实达标团队工时
-        this.form.actualComplianceTeamHours = Number(res)
+        this.form.actualComplianceTeamHours = Number(res.toFixed(2))
       })
     },
     // 获取已完成工时
@@ -829,11 +1090,11 @@
       // 获取已完成工时
       crudTaskDaliy.completedWork({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
         // 已完成绩效工时
-        this.form.alreadyCompletedAchievementsHours = Number(res)
+        this.form.alreadyCompletedAchievementsHours = Number(res.toFixed(2))
         // 已完成业绩工时
-        this.form.alreadyCompletedPerformanceHours = Number(res)
+        this.form.alreadyCompletedPerformanceHours = Number(res.toFixed(2))
         // 已完成团队工时
-        this.form.alreadyCompletedTeamHours = Number(res)
+        this.form.alreadyCompletedTeamHours = Number(res.toFixed(2))
         // 绩效定时器
         const achievementsInterval = setInterval(() => {
           // 判断预计绩效工资、应完成绩效工时是否为空
@@ -851,7 +1112,7 @@
           // 判断预计业绩工资、应完成业绩工时是否为空
           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)
+            this.form.actualPerformanceWage = Number((res >= this.form.needCompletedPerformanceHours ? this.form.performanceWage : 0).toFixed(2))
             // 随机数
             this.random = Math.random()
             // 清空业绩定时器
@@ -863,13 +1124,42 @@
           // 判断预计团队工资、实达标团队工时是否为空
           if (this.form.teamWage != null && this.form.teamWage !== '' && this.form.actualComplianceTeamHours != null && this.form.actualComplianceTeamHours !== '') {
             // 实际团队工资
-            this.form.actualTeamWage = Number((this.form.teamWage * (this.form.actualComplianceTeamHours / res)).toFixed(2))
+            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 - this.form.accumulationPersonalAmount - this.form.pensionPersonalAmount - this.form.medicalPersonalAmount - this.form.unemploymentPersonalAmount - this.form.maternityPersonalAmount - this.form.industrialInjuryPersonalAmount
+            this.form.preTaxAmount = 100
+            // 个人所得税
+            this.form.individualIncomeTax = 0
+            // 税后金额
+            this.form.afterTaxAmount = 100
+            // 随机数
+            this.random = Math.random()
+            // 清空统计定时器
+            clearInterval(statisticsInterval)
+          }
+        }, 500)
       })
     }
   }

--
Gitblit v1.9.3