From 0d8097836616b8990c9e79c3e9e7ff502ce308ea Mon Sep 17 00:00:00 2001
From: 赵士淞 <zhaoss@yhzhg.cn>
Date: Thu, 05 Jan 2023 08:16:54 +0000
Subject: [PATCH] Merge branch 'zhaoss' of http://192.168.1.110:5678/r/pms-upgrade into master
---
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/domain/Attendance.java | 10 +
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/dto/AttendanceDto.java | 6
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/TaskDaliyService.java | 7 +
eladmin-web-master/src/api/task/taskDaliy.js | 10 +
eladmin-web-master/src/views/task/taskUser/index.vue | 12 +
eladmin-web-master/src/api/attendance/attendance.js | 10 +
eladmin-web-master/src/views/task/taskDaliy/index.vue | 6
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/dto/TaskDaliyQueryCriteria.java | 6
eladmin-web-master/src/views/task/task/index.vue | 20 +-
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskUserRepository.java | 7 +
eladmin-web-master/src/views/salary/salary/index.vue | 137 ++++++++++++------
eladmin-web-master/src/views/system/userLevelOther/index.vue | 4
eladmin-web-master/src/views/system/userLevelInsurance/index.vue | 4
eladmin-web-master/src/views/system/userLevelWage/index.vue | 22 +-
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskDaliyServiceImpl.java | 85 +++++++++++
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskDaliyRepository.java | 8 -
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/rest/TaskDaliyController.java | 8 +
17 files changed, 270 insertions(+), 92 deletions(-)
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/domain/Attendance.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/domain/Attendance.java
index 50138ae..750e909 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/domain/Attendance.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/domain/Attendance.java
@@ -70,6 +70,16 @@
@ApiModelProperty(value = "开始打卡结果")
private String startClockResults;
+ @Column(name = "`rostering_lunch_start_time`",nullable = false)
+ @NotNull
+ @ApiModelProperty(value = "排班午休开始时间")
+ private Timestamp rosteringLunchStartTime;
+
+ @Column(name = "`rostering_lunch_end_time`",nullable = false)
+ @NotNull
+ @ApiModelProperty(value = "排班午休结束时间")
+ private Timestamp rosteringLunchEndTime;
+
@Column(name = "`rostering_work_end_time`",nullable = false)
@NotNull
@ApiModelProperty(value = "排班工作结束时间")
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/dto/AttendanceDto.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/dto/AttendanceDto.java
index 5c46e97..bf70086 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/dto/AttendanceDto.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/dto/AttendanceDto.java
@@ -50,6 +50,12 @@
/** 开始打卡结果 */
private String startClockResults;
+
+ /** 排班午休开始时间 */
+ private Timestamp rosteringLunchStartTime;
+
+ /** 排班午休结束时间 */
+ private Timestamp rosteringLunchEndTime;
/** 排班工作结束时间 */
private Timestamp rosteringWorkEndTime;
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskDaliyRepository.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskDaliyRepository.java
index c1c072b..b9b2fc6 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskDaliyRepository.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskDaliyRepository.java
@@ -21,7 +21,6 @@
import org.springframework.data.jpa.repository.Query;
import java.sql.Timestamp;
-import java.util.List;
/**
* @website https://eladmin.vip
@@ -45,11 +44,4 @@
*/
@Query(value = "SELECT * FROM task_daliy WHERE project_id = ?1 AND task_id = ?2 AND user_id = ?3 AND fill_date > ?4 ORDER BY fill_date ASC LIMIT 1", nativeQuery = true)
TaskDaliy findNextByProjectIdAndTaskIdAndAndUserId(Long projectId, Long taskId, Long userId, Timestamp fillDate);
-
- /**
- * 根据项目ID、任务ID、用户ID、填报日期查询
- * @param userId
- * @return
- */
- List<TaskDaliy> findByProjectIdAndTaskIdAndAndUserIdAndFillDate(Long projectId, Long taskId, Long userId, Timestamp fillDate);
}
\ No newline at end of file
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskUserRepository.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskUserRepository.java
index 2e35677..89c6241 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskUserRepository.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskUserRepository.java
@@ -68,4 +68,11 @@
*/
@Query(value = "SELECT task_id FROM task_user WHERE user_id = ?1 AND project_id = ?2", nativeQuery = true)
List<Long> findTaskIdByUserIdAndProjectId(Long userId, Long projectId);
+
+ /**
+ * 根据多任务ID查询
+ * @param taskIds
+ * @return
+ */
+ List<TaskUser> findByTaskIdIn(List<Long> taskIds);
}
\ No newline at end of file
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/rest/TaskDaliyController.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/rest/TaskDaliyController.java
index d1c9daf..f031522 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/rest/TaskDaliyController.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/rest/TaskDaliyController.java
@@ -92,4 +92,12 @@
taskDaliyService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
+
+ @GetMapping(value = "/completedWork")
+ @Log("查询某月已完成工时")
+ @ApiOperation("查询某月已完成工时")
+ @PreAuthorize("@el.check('taskDaliy:list')")
+ public ResponseEntity<Object> queryCompletedWork(TaskDaliyQueryCriteria criteria){
+ return new ResponseEntity<>(taskDaliyService.queryCompletedWork(criteria),HttpStatus.OK);
+ }
}
\ No newline at end of file
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/TaskDaliyService.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/TaskDaliyService.java
index 24b83ee..cd16dca 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/TaskDaliyService.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/TaskDaliyService.java
@@ -80,4 +80,11 @@
* @throws IOException /
*/
void download(List<TaskDaliyDto> all, HttpServletResponse response) throws IOException;
+
+ /**
+ * 查询某月已完成工时
+ * @param criteria 条件参数
+ * @return List<TaskDaliyDto>
+ */
+ Double queryCompletedWork(TaskDaliyQueryCriteria criteria);
}
\ No newline at end of file
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/dto/TaskDaliyQueryCriteria.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/dto/TaskDaliyQueryCriteria.java
index e0295a8..b5d97b0 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/dto/TaskDaliyQueryCriteria.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/dto/TaskDaliyQueryCriteria.java
@@ -44,4 +44,10 @@
/** 精确 */
@Query
private Long taskId;
+
+ /* 两者之间 */
+ @Query(propName = "fillDate", type = Query.Type.INNER_LIKE)
+ private String fillDateLike;
+
+ private String targetYearMonth;
}
\ No newline at end of file
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 61c1c47..780fb72 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
@@ -25,9 +25,10 @@
import me.zhengjie.modules.system.repository.UserRepository;
import me.zhengjie.modules.task.domain.Task;
import me.zhengjie.modules.task.domain.TaskDaliy;
+import me.zhengjie.modules.task.domain.TaskUser;
import me.zhengjie.modules.task.repository.TaskRepository;
-import me.zhengjie.utils.ValidationUtil;
-import me.zhengjie.utils.FileUtil;
+import me.zhengjie.modules.task.repository.TaskUserRepository;
+import me.zhengjie.utils.*;
import lombok.RequiredArgsConstructor;
import me.zhengjie.modules.task.repository.TaskDaliyRepository;
import me.zhengjie.modules.task.service.TaskDaliyService;
@@ -38,14 +39,13 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
-import me.zhengjie.utils.PageUtil;
-import me.zhengjie.utils.QueryHelp;
import java.sql.Timestamp;
import java.util.*;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import java.util.function.Function;
+import java.util.stream.Collectors;
/**
* @website https://eladmin.vip
@@ -63,6 +63,7 @@
private final TaskRepository taskRepository;
private final UserRepository userRepository;
private final DictDetailRepository dictDetailRepository;
+ private final TaskUserRepository taskUserRepository;
@Override
public Map<String,Object> queryAll(TaskDaliyQueryCriteria criteria, Pageable pageable){
@@ -136,8 +137,14 @@
* @param resources
*/
private void checkAddOrUpdate(TaskDaliy resources) {
+ // 任务日报检索类
+ TaskDaliyQueryCriteria criteria = new TaskDaliyQueryCriteria();
+ criteria.setProjectId(resources.getProjectId());
+ criteria.setTaskId(resources.getTaskId());
+ criteria.setUserId(resources.getUserId());
+ criteria.setFillDate(resources.getFillDate());
// 根据项目ID、任务ID、用户ID、填报日期查询
- List<TaskDaliy> taskDaliyList = taskDaliyRepository.findByProjectIdAndTaskIdAndAndUserIdAndFillDate(resources.getProjectId(), resources.getTaskId(), resources.getUserId(), resources.getFillDate());
+ List<TaskDaliy> taskDaliyList = taskDaliyRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder));
// 判断是否已有日报
if (taskDaliyList.size() > 1 || (taskDaliyList.size() == 1 && taskDaliyList.get(0).getId() != resources.getId())) {
throw new BadRequestException("每个任务每天只能填写一次日报!");
@@ -200,4 +207,72 @@
}
FileUtil.downloadExcel(list, response);
}
+
+ @Override
+ public Double queryCompletedWork(TaskDaliyQueryCriteria criteria){
+ // 已完成工时
+ Double completedWork = 0D;
+ // 国际时间转中国时间
+ String targetYearMonth = DateUtil.internationalTimeToChinaTime(criteria.getTargetYearMonth());
+ // 任务日报检索类
+ criteria.setFillDateLike(targetYearMonth.substring(0,7));
+ // 获取本月任务日报列表
+ List<TaskDaliy> taskDaliyMonthList = taskDaliyRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder));
+ // 判断是否有本月任务日报
+ if (taskDaliyMonthList.size() != 0) {
+ // 获取本月任务日报中所有任务ID
+ List<Long> taskIds = taskDaliyMonthList.stream().map(item -> item.getTaskId()).collect(Collectors.toList());
+ // 获取本月任务分配列表
+ List<TaskUser> taskUserMonthList = taskUserRepository.findByTaskIdIn(taskIds);
+ // 日历类
+ Calendar cal = Calendar.getInstance();
+ // 设置年份
+ cal.set(Calendar.YEAR, Integer.valueOf(targetYearMonth.substring(0,4)));
+ // 设置月份
+ cal.set(Calendar.MONTH, Integer.valueOf(targetYearMonth.substring(5,7)) - 1);
+ // 设置时数
+ cal.set(Calendar.HOUR_OF_DAY, 0);
+ // 设置分数
+ cal.set(Calendar.MINUTE, 0);
+ // 设置秒数
+ cal.set(Calendar.SECOND, 0);
+ // 设置毫秒数
+ cal.set(Calendar.MILLISECOND, 0);
+ // 获取本月最大天数
+ int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
+ // 循环本月最大天数
+ for (int i = 1; i <= lastDay; i ++) {
+ // 设置天数
+ cal.set(Calendar.DAY_OF_MONTH, i);
+ // 获取本日任务日报列表
+ List<TaskDaliy> taskDaliyDayList = taskDaliyMonthList.stream().filter(item -> item.getFillDate().getTime() == cal.getTime().getTime()).collect(Collectors.toList());
+ // 循环本日任务日报列表
+ for (int j = 0; j < taskDaliyDayList.size(); j ++) {
+ // 本日任务日报
+ TaskDaliy taskDaliyDay = taskDaliyDayList.get(j);
+ // 本日任务分配
+ TaskUser taskUserDay = taskUserMonthList.stream().filter(item -> item.getTaskId() == taskDaliyDay.getTaskId()).collect(Collectors.toList()).get(0);
+ // 根据项目ID、任务ID、用户ID查询填报日期前最近的任务日报信息
+ TaskDaliy taskDaliyHistory = taskDaliyRepository.findPreviousByProjectIdAndTaskIdAndAndUserId(taskDaliyDay.getProjectId(), taskDaliyDay.getTaskId(), taskDaliyDay.getUserId(), taskDaliyDay.getFillDate());
+ // 本日任务日报进度
+ Double taskDaliyDayProgress = taskDaliyDay.getTaskProgress();
+ // 判断最近的任务日报是否为空
+ if (taskDaliyHistory != null) {
+ // 本日任务日报相关历史进度
+ Double taskDaliyHistoryProgress = taskDaliyHistory.getTaskProgress();
+ // 判断进度是否正常
+ if (taskDaliyDayProgress - taskDaliyHistoryProgress <= 0) {
+ throw new BadRequestException("任务日报进度计算存在异常!");
+ }
+ // 本日任务日报进度
+ taskDaliyDayProgress = taskDaliyDayProgress - taskDaliyHistoryProgress;
+ }
+ // 已完成工时
+ completedWork += taskUserDay.getTaskHours() * (taskDaliyDayProgress / 100);
+ }
+ }
+ }
+ // 已完成工时
+ return completedWork;
+ }
}
\ No newline at end of file
diff --git a/eladmin-web-master/src/api/attendance/attendance.js b/eladmin-web-master/src/api/attendance/attendance.js
index 2ad53c8..0d37e6c 100644
--- a/eladmin-web-master/src/api/attendance/attendance.js
+++ b/eladmin-web-master/src/api/attendance/attendance.js
@@ -32,4 +32,12 @@
})
}
-export default { add, edit, del, getAll }
+export function attendanceHours(params) {
+ return request({
+ url: 'api/attendance/attendanceHours',
+ method: 'get',
+ params
+ })
+}
+
+export default { add, edit, del, getAll, attendanceHours }
diff --git a/eladmin-web-master/src/api/task/taskDaliy.js b/eladmin-web-master/src/api/task/taskDaliy.js
index 34b2b9b..d43c309 100644
--- a/eladmin-web-master/src/api/task/taskDaliy.js
+++ b/eladmin-web-master/src/api/task/taskDaliy.js
@@ -32,4 +32,12 @@
})
}
-export default { getAll, add, edit, del }
+export function completedWork(params) {
+ return request({
+ url: 'api/taskDaliy/completedWork',
+ method: 'get',
+ params
+ })
+}
+
+export default { getAll, add, edit, del, completedWork }
diff --git a/eladmin-web-master/src/views/salary/salary/index.vue b/eladmin-web-master/src/views/salary/salary/index.vue
index f037921..319e59c 100644
--- a/eladmin-web-master/src/views/salary/salary/index.vue
+++ b/eladmin-web-master/src/views/salary/salary/index.vue
@@ -352,6 +352,8 @@
import crudUserLevelWage from '@/api/system/userLevelWage'
import crudUserLevelInsurance from '@/api/system/userLevelInsurance'
import crudUserLevelOther from '@/api/system/userLevelOther'
+import crudAttendance from '@/api/attendance/attendance'
+import crudTaskDaliy from '@/api/task/taskDaliy'
const defaultForm = { id: null, userId: null, salaryYearMonth: null, levelWage: null, basicWageProportion: null, basicWage: null, fullDays: null, absenceDays: null, actualBasicWage: null, achievementsWageProportion: null, achievementsWage: null, needCompletedAchievementsHours: null, alreadyCompletedAchievementsHours: null, actualAchievementsWage: null, performanceWageProportion: null, performanceWage: null, personalPerformanceProportion: null, needCompletedPerformanceHours: null, alreadyCompletedPerformanceHours: null, actualPerformanceWage: null, teamWageProportion: null, teamWage: null, actualTeamWage: null, accumulationRadix: null, accumulationPersonalProportion: null, accumulationPersonalAmount: null, accumulationCompanyProportion: null, accumulationCompanyAmount: null, pensionRadix: null, pensionPersonalProportion: null, pensionPersonalAmount: null, pensionCompanyProportion: null, pensionCompanyAmount: null, medicalRadix: null, medicalPersonalProportion: null, medicalPersonalAmount: null, medicalCompanyProportion: null, medicalCompanyAmount: null, unemploymentRadix: null, unemploymentPersonalProportion: null, unemploymentPersonalAmount: null, unemploymentCompanyProportion: null, unemploymentCompanyAmount: null, maternityRadix: null, maternityPersonalProportion: null, maternityPersonalAmount: null, maternityCompanyProportion: null, maternityCompanyAmount: null, industrialInjuryRadix: null, industrialInjuryPersonalProportion: null, industrialInjuryPersonalAmount: null, industrialInjuryCompanyProportion: null, industrialInjuryCompanyAmount: null, preTaxAmount: null, individualIncomeTax: null, afterTaxAmount: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null }
export default {
@@ -657,8 +659,10 @@
this.getUserLevelOther()
// 获取工作天数
this.getWorkDays()
- // 获取出勤天数
- this.getAttendanceDays()
+ // 获取出勤小时数
+ this.getAttendanceHours()
+ // 获取已完成工时
+ this.getCompletedWork()
}
},
// 获取用户级别工资
@@ -666,23 +670,23 @@
// 获取用户级别工资
crudUserLevelWage.getTargetYearMonth({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
// 级别工资
- this.form.levelWage = res.levelWage
+ this.form.levelWage = Number(res.levelWage)
// 基本工资比例
- this.form.basicWageProportion = res.basicWageProportion
+ this.form.basicWageProportion = Number(res.basicWageProportion)
// 预计基本工资
- this.form.basicWage = (res.levelWage * (res.basicWageProportion / 100)).toFixed(2)
+ this.form.basicWage = Number((res.levelWage * (res.basicWageProportion / 100)).toFixed(2))
// 绩效工资比例
- this.form.achievementsWageProportion = res.achievementsWageProportion
+ this.form.achievementsWageProportion = Number(res.achievementsWageProportion)
// 预计绩效工资
- this.form.achievementsWage = (res.levelWage * (res.achievementsWageProportion / 100)).toFixed(2)
+ this.form.achievementsWage = Number((res.levelWage * (res.achievementsWageProportion / 100)).toFixed(2))
// 业绩工资比例
- this.form.performanceWageProportion = res.performanceWageProportion
+ this.form.performanceWageProportion = Number(res.performanceWageProportion)
// 预计业绩工资
- this.form.performanceWage = (res.levelWage * (res.performanceWageProportion / 100)).toFixed(2)
+ this.form.performanceWage = Number((res.levelWage * (res.performanceWageProportion / 100)).toFixed(2))
// 团队工资比例
- this.form.teamWageProportion = res.teamWageProportion
+ this.form.teamWageProportion = Number(res.teamWageProportion)
// 预计团队工资
- this.form.teamWage = (res.levelWage * (res.teamWageProportion / 100)).toFixed(2)
+ this.form.teamWage = Number((res.levelWage * (res.teamWageProportion / 100)).toFixed(2))
// 随机数
this.random = Math.random()
})
@@ -692,65 +696,65 @@
// 获取用户级别保险
crudUserLevelInsurance.getTargetYearMonth({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
// 公积金基数
- this.form.accumulationRadix = res.accumulationRadix
+ this.form.accumulationRadix = Number(res.accumulationRadix)
// 公积金个人缴纳比例
- this.form.accumulationPersonalProportion = res.accumulationPersonalProportion
+ this.form.accumulationPersonalProportion = Number(res.accumulationPersonalProportion)
// 公积金个人缴纳金额
- this.form.accumulationPersonalAmount = (res.accumulationRadix * (res.accumulationPersonalProportion / 100)).toFixed(2)
+ this.form.accumulationPersonalAmount = Number((res.accumulationRadix * (res.accumulationPersonalProportion / 100)).toFixed(2))
// 公积金公司缴纳比例
- this.form.accumulationCompanyProportion = res.accumulationCompanyProportion
+ this.form.accumulationCompanyProportion = Number(res.accumulationCompanyProportion)
// 公积金公司缴纳金额
- this.form.accumulationCompanyAmount = (res.accumulationRadix * (res.accumulationCompanyProportion / 100)).toFixed(2)
+ this.form.accumulationCompanyAmount = Number((res.accumulationRadix * (res.accumulationCompanyProportion / 100)).toFixed(2))
// 养老险基数
- this.form.pensionRadix = res.pensionRadix
+ this.form.pensionRadix = Number(res.pensionRadix)
// 养老险个人缴纳比例
- this.form.pensionPersonalProportion = res.pensionPersonalProportion
+ this.form.pensionPersonalProportion = Number(res.pensionPersonalProportion)
// 养老险个人缴纳金额
- this.form.pensionPersonalAmount = (res.pensionRadix * (res.pensionPersonalProportion / 100)).toFixed(2)
+ this.form.pensionPersonalAmount = Number((res.pensionRadix * (res.pensionPersonalProportion / 100)).toFixed(2))
// 养老险公司缴纳比例
- this.form.pensionCompanyProportion = res.pensionCompanyProportion
+ this.form.pensionCompanyProportion = Number(res.pensionCompanyProportion)
// 养老险公司缴纳金额
- this.form.pensionCompanyAmount = (res.pensionRadix * (res.pensionCompanyProportion / 100)).toFixed(2)
+ this.form.pensionCompanyAmount = Number((res.pensionRadix * (res.pensionCompanyProportion / 100)).toFixed(2))
// 医疗险基数
- this.form.medicalRadix = res.medicalRadix
+ this.form.medicalRadix = Number(res.medicalRadix)
// 医疗险个人缴纳比例
- this.form.medicalPersonalProportion = res.medicalPersonalProportion
+ this.form.medicalPersonalProportion = Number(res.medicalPersonalProportion)
// 医疗险个人缴纳金额
- this.form.medicalPersonalAmount = (res.medicalRadix * (res.medicalPersonalProportion / 100)).toFixed(2)
+ this.form.medicalPersonalAmount = Number((res.medicalRadix * (res.medicalPersonalProportion / 100)).toFixed(2))
// 医疗险公司缴纳比例
- this.form.medicalCompanyProportion = res.medicalCompanyProportion
+ this.form.medicalCompanyProportion = Number(res.medicalCompanyProportion)
// 医疗险公司缴纳金额
- this.form.medicalCompanyAmount = (res.medicalRadix * (res.medicalCompanyProportion / 100)).toFixed(2)
+ this.form.medicalCompanyAmount = Number((res.medicalRadix * (res.medicalCompanyProportion / 100)).toFixed(2))
// 失业险基数
- this.form.unemploymentRadix = res.unemploymentRadix
+ this.form.unemploymentRadix = Number(res.unemploymentRadix)
// 失业险个人缴纳比例
- this.form.unemploymentPersonalProportion = res.unemploymentPersonalProportion
+ this.form.unemploymentPersonalProportion = Number(res.unemploymentPersonalProportion)
// 失业险个人缴纳金额
- this.form.unemploymentPersonalAmount = (res.unemploymentRadix * (res.unemploymentPersonalProportion / 100)).toFixed(2)
+ this.form.unemploymentPersonalAmount = Number((res.unemploymentRadix * (res.unemploymentPersonalProportion / 100)).toFixed(2))
// 失业险公司缴纳比例
- this.form.unemploymentCompanyProportion = res.unemploymentCompanyProportion
+ this.form.unemploymentCompanyProportion = Number(res.unemploymentCompanyProportion)
// 失业险公司缴纳金额
- this.form.unemploymentCompanyAmount = (res.unemploymentRadix * (res.unemploymentCompanyProportion / 100)).toFixed(2)
+ this.form.unemploymentCompanyAmount = Number((res.unemploymentRadix * (res.unemploymentCompanyProportion / 100)).toFixed(2))
// 生育险基数
- this.form.maternityRadix = res.maternityRadix
+ this.form.maternityRadix = Number(res.maternityRadix)
// 生育险个人缴纳比例
- this.form.maternityPersonalProportion = res.maternityPersonalProportion
+ this.form.maternityPersonalProportion = Number(res.maternityPersonalProportion)
// 生育险个人缴纳金额
- this.form.maternityPersonalAmount = (res.maternityRadix * (res.maternityPersonalProportion / 100)).toFixed(2)
+ this.form.maternityPersonalAmount = Number((res.maternityRadix * (res.maternityPersonalProportion / 100)).toFixed(2))
// 生育险公司缴纳比例
- this.form.maternityCompanyProportion = res.maternityCompanyProportion
+ this.form.maternityCompanyProportion = Number(res.maternityCompanyProportion)
// 生育险公司缴纳金额
- this.form.maternityCompanyAmount = (res.maternityRadix * (res.maternityCompanyProportion / 100)).toFixed(2)
+ this.form.maternityCompanyAmount = Number((res.maternityRadix * (res.maternityCompanyProportion / 100)).toFixed(2))
// 工伤险基数
- this.form.industrialInjuryRadix = res.industrialInjuryRadix
+ this.form.industrialInjuryRadix = Number(res.industrialInjuryRadix)
// 工伤险个人缴纳比例
- this.form.industrialInjuryPersonalProportion = res.industrialInjuryPersonalProportion
+ this.form.industrialInjuryPersonalProportion = Number(res.industrialInjuryPersonalProportion)
// 工伤险个人缴纳金额
- this.form.industrialInjuryPersonalAmount = (res.industrialInjuryRadix * (res.industrialInjuryPersonalProportion / 100)).toFixed(2)
+ this.form.industrialInjuryPersonalAmount = Number((res.industrialInjuryRadix * (res.industrialInjuryPersonalProportion / 100)).toFixed(2))
// 工伤险公司缴纳比例
- this.form.industrialInjuryCompanyProportion = res.industrialInjuryCompanyProportion
+ this.form.industrialInjuryCompanyProportion = Number(res.industrialInjuryCompanyProportion)
// 工伤险公司缴纳金额
- this.form.industrialInjuryCompanyAmount = (res.industrialInjuryRadix * (res.industrialInjuryCompanyProportion / 100)).toFixed(2)
+ this.form.industrialInjuryCompanyAmount = Number((res.industrialInjuryRadix * (res.industrialInjuryCompanyProportion / 100)).toFixed(2))
// 随机数
this.random = Math.random()
})
@@ -760,7 +764,7 @@
// 获取用户级别其他
crudUserLevelOther.getTargetYearMonth({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
// 个人业绩比例
- this.form.personalPerformanceProportion = res.personalPerformanceProportion
+ this.form.personalPerformanceProportion = Number(res.personalPerformanceProportion)
})
},
// 获取工作天数
@@ -768,24 +772,61 @@
// 获取工作天数
crudSalary.workDays({ targetYearMonth: this.form.salaryYearMonth }).then(res => {
// 全勤小时数
- this.form.fullDays = res * 8
+ this.form.fullDays = Number(res * 8)
// 应完成绩效工时
- this.form.needCompletedAchievementsHours = res * 8
+ this.form.needCompletedAchievementsHours = Number(res * 8)
// 定时器
const interval = setInterval(() => {
// 判断个人业绩比例是否为空
if (this.form.personalPerformanceProportion != null && this.form.personalPerformanceProportion !== '') {
// 应完成业绩工时
- this.form.needCompletedPerformanceHours = res * 8 * (1 + Number(this.form.personalPerformanceProportion) / 100)
+ this.form.needCompletedPerformanceHours = Number(res * 8 * (1 + Number(this.form.personalPerformanceProportion) / 100))
// 清空定时器
clearInterval(interval)
}
}, 500)
})
},
- // 获取出勤天数
- getAttendanceDays() {
-
+ // 获取出勤小时数
+ getAttendanceHours() {
+ // 获取出勤小时数
+ crudAttendance.attendanceHours({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
+ console.log(res)
+ })
+ },
+ // 获取已完成工时
+ getCompletedWork() {
+ // 获取已完成工时
+ crudTaskDaliy.completedWork({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => {
+ // 已完成绩效工时
+ this.form.alreadyCompletedAchievementsHours = Number(res)
+ // 已完成业绩工时
+ this.form.alreadyCompletedPerformanceHours = Number(res)
+ // 绩效定时器
+ 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)
+ // 随机数
+ this.random = Math.random()
+ // 清空业绩定时器
+ clearInterval(performanceInterval)
+ }
+ }, 500)
+ })
}
}
}
diff --git a/eladmin-web-master/src/views/system/userLevelInsurance/index.vue b/eladmin-web-master/src/views/system/userLevelInsurance/index.vue
index 8037f71..c1d34a7 100644
--- a/eladmin-web-master/src/views/system/userLevelInsurance/index.vue
+++ b/eladmin-web-master/src/views/system/userLevelInsurance/index.vue
@@ -426,14 +426,14 @@
startDatePickerOptions: {
// 禁用日期
disabledDate(time) {
- return _this.form.endDate != null && _this.form.endDate !== '' ? time.getTime() > _this.form.endDate : false
+ return _this.form.endDate != null && _this.form.endDate !== '' ? time.getTime() > new Date(_this.form.endDate).getTime() : false
}
},
// 结束日期选项
endDatePickerOptions: {
// 禁用日期
disabledDate(time) {
- return _this.form.startDate != null && _this.form.startDate !== '' ? time.getTime() < _this.form.startDate : false
+ return _this.form.startDate != null && _this.form.startDate !== '' ? time.getTime() < new Date(_this.form.startDate).getTime() : false
}
},
// CRUD状态
diff --git a/eladmin-web-master/src/views/system/userLevelOther/index.vue b/eladmin-web-master/src/views/system/userLevelOther/index.vue
index 48e911c..288805e 100644
--- a/eladmin-web-master/src/views/system/userLevelOther/index.vue
+++ b/eladmin-web-master/src/views/system/userLevelOther/index.vue
@@ -196,14 +196,14 @@
startDatePickerOptions: {
// 禁用日期
disabledDate(time) {
- return _this.form.endDate != null && _this.form.endDate !== '' ? time.getTime() > _this.form.endDate : false
+ return _this.form.endDate != null && _this.form.endDate !== '' ? time.getTime() > new Date(_this.form.endDate).getTime() : false
}
},
// 结束日期选项
endDatePickerOptions: {
// 禁用日期
disabledDate(time) {
- return _this.form.startDate != null && _this.form.startDate !== '' ? time.getTime() < _this.form.startDate : false
+ return _this.form.startDate != null && _this.form.startDate !== '' ? time.getTime() < new Date(_this.form.startDate).getTime() : false
}
},
// CRUD状态
diff --git a/eladmin-web-master/src/views/system/userLevelWage/index.vue b/eladmin-web-master/src/views/system/userLevelWage/index.vue
index d89c0d6..f22da0c 100644
--- a/eladmin-web-master/src/views/system/userLevelWage/index.vue
+++ b/eladmin-web-master/src/views/system/userLevelWage/index.vue
@@ -90,48 +90,48 @@
<!--表格渲染-->
<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 :show-overflow-tooltip="true" prop="userNickName" label="所属用户" fixed="left" width="100">
+ <el-table-column :show-overflow-tooltip="true" prop="userNickName" label="所属用户" fixed="left">
<template slot-scope="scope">
<el-tag>{{ scope.row.userNickName }}</el-tag>
</template>
</el-table-column>
- <el-table-column :show-overflow-tooltip="true" prop="levelName" label="所属级别" fixed="left" width="100">
+ <el-table-column :show-overflow-tooltip="true" prop="levelName" label="所属级别" fixed="left">
<template slot-scope="scope">
<el-tag>{{ scope.row.levelName }}</el-tag>
</template>
</el-table-column>
- <el-table-column :show-overflow-tooltip="true" prop="startDate" label="开始日期" width="100">
+ <el-table-column :show-overflow-tooltip="true" prop="startDate" label="开始日期">
<template slot-scope="scope">
{{ crud.toDate(scope.row.startDate) }}
</template>
</el-table-column>
- <el-table-column :show-overflow-tooltip="true" prop="endDate" label="结束日期" width="100">
+ <el-table-column :show-overflow-tooltip="true" prop="endDate" label="结束日期">
<template slot-scope="scope">
{{ crud.toDate(scope.row.endDate) }}
</template>
</el-table-column>
- <el-table-column :show-overflow-tooltip="true" prop="levelWage" label="级别工资" width="100">
+ <el-table-column :show-overflow-tooltip="true" prop="levelWage" label="级别工资">
<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">
+ <el-table-column :show-overflow-tooltip="true" prop="basicWageProportion" label="基本工资">
<template slot-scope="scope">
{{ scope.row.basicWageProportion }}%
</template>
</el-table-column>
- <el-table-column :show-overflow-tooltip="true" prop="achievementsWageProportion" label="绩效工资" width="100">
+ <el-table-column :show-overflow-tooltip="true" prop="achievementsWageProportion" label="绩效工资">
<template slot-scope="scope">
{{ scope.row.achievementsWageProportion }}%
</template>
</el-table-column>
- <el-table-column :show-overflow-tooltip="true" prop="performanceWageProportion" label="业绩工资" width="100">
+ <el-table-column :show-overflow-tooltip="true" prop="performanceWageProportion" label="业绩工资">
<template slot-scope="scope">
{{ scope.row.performanceWageProportion }}%
</template>
</el-table-column>
- <el-table-column :show-overflow-tooltip="true" prop="teamWageProportion" label="团队工资" width="100">
+ <el-table-column :show-overflow-tooltip="true" prop="teamWageProportion" label="团队工资">
<template slot-scope="scope">
{{ scope.row.teamWageProportion }}%
</template>
@@ -239,14 +239,14 @@
startDatePickerOptions: {
// 禁用日期
disabledDate(time) {
- return _this.form.endDate != null && _this.form.endDate !== '' ? time.getTime() > _this.form.endDate : false
+ return _this.form.endDate != null && _this.form.endDate !== '' ? time.getTime() > new Date(_this.form.endDate).getTime() : false
}
},
// 结束日期选项
endDatePickerOptions: {
// 禁用日期
disabledDate(time) {
- return _this.form.startDate != null && _this.form.startDate !== '' ? time.getTime() < _this.form.startDate : false
+ return _this.form.startDate != null && _this.form.startDate !== '' ? time.getTime() < new Date(_this.form.startDate).getTime() : false
}
},
// CRUD状态
diff --git a/eladmin-web-master/src/views/task/task/index.vue b/eladmin-web-master/src/views/task/task/index.vue
index 191cb6c..f0c4a6d 100644
--- a/eladmin-web-master/src/views/task/task/index.vue
+++ b/eladmin-web-master/src/views/task/task/index.vue
@@ -53,7 +53,7 @@
<el-input v-model="form.name" style="width: 340px;" />
</el-form-item>
<el-form-item label="所属项目" prop="projectId">
- <el-select v-model="form.projectId" filterable clearable placeholder="请选择" style="width: 340px;" @change="projectChange">
+ <el-select v-model="form.projectId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="crud.status.edit == crudStatusPrepared" @change="projectChange">
<el-option
v-for="item in projects"
:key="item.id"
@@ -103,7 +103,9 @@
<el-date-picker v-model="form.planEndTime" type="datetime" :picker-options="planEndTimePickerOptions" style="width: 340px;" />
</el-form-item>
<el-form-item label="计划工时" prop="planHours">
- <el-input v-model="form.planHours" style="width: 340px;" />
+ <el-input v-model="form.planHours" style="width: 340px;">
+ <template slot="append">小时</template>
+ </el-input>
</el-form-item>
<el-form-item label="计划工作量" prop="planWorkload">
<el-input v-model="form.planWorkload" style="width: 340px;" />
@@ -215,7 +217,9 @@
<el-date-picker v-model="divideForm.taskEndDate" type="datetime" :picker-options="taskEndDatePickerOptions" style="width: 340px;" />
</el-form-item>
<el-form-item label="任务工时" prop="taskHours">
- <el-input v-model="divideForm.taskHours" style="width: 340px;" />
+ <el-input v-model="divideForm.taskHours" style="width: 340px;">
+ <template slot="append">小时</template>
+ </el-input>
</el-form-item>
<el-form-item label="任务工作量" prop="taskWorkload">
<el-input v-model="divideForm.taskWorkload" style="width: 340px;" />
@@ -307,14 +311,14 @@
planStartTimePickerOptions: {
// 禁用日期
disabledDate(time) {
- return _this.form.planEndTime != null && _this.form.planEndTime !== '' ? time.getTime() > _this.form.planEndTime.getTime() : false
+ return _this.form.planEndTime != null && _this.form.planEndTime !== '' ? time.getTime() > new Date(_this.form.planEndTime).getTime() : false
}
},
// 计划结束时间选项
planEndTimePickerOptions: {
// 禁用日期
disabledDate(time) {
- return _this.form.planStartTime != null && _this.form.planStartTime !== '' ? time.getTime() < _this.form.planStartTime.getTime() - (86400000 - 1) : false
+ return _this.form.planStartTime != null && _this.form.planStartTime !== '' ? time.getTime() < new Date(_this.form.planStartTime).getTime() - (86400000 - 1) : false
}
},
// 字典:优先度
@@ -323,6 +327,8 @@
taskClassification: constant.TAST_CLASSIFICATION,
// 字典:标准工作量单位
standardWorkloadUnit: constant.STANDARD_WORKLOAD_UNIT,
+ // CRUD状态
+ crudStatusPrepared: CRUD.STATUS.PREPARED,
// 项目列表
projects: [],
// 父级任务列表
@@ -356,14 +362,14 @@
taskStartDatePickerOptions: {
// 禁用日期
disabledDate(time) {
- return _this.divideForm.taskEndDate != null && _this.divideForm.taskEndDate !== '' ? time.getTime() > _this.divideForm.taskEndDate.getTime() : false
+ return _this.divideForm.taskEndDate != null && _this.divideForm.taskEndDate !== '' ? time.getTime() > new Date(_this.divideForm.taskEndDate).getTime() : false
}
},
// 任务结束时间选项
taskEndDatePickerOptions: {
// 禁用日期
disabledDate(time) {
- return _this.divideForm.taskStartDate != null && _this.divideForm.taskStartDate !== '' ? time.getTime() < _this.divideForm.taskStartDate.getTime() - (86400000 - 1) : false
+ return _this.divideForm.taskStartDate != null && _this.divideForm.taskStartDate !== '' ? time.getTime() < new Date(_this.divideForm.taskStartDate).getTime() - (86400000 - 1) : false
}
},
// 用户列表
diff --git a/eladmin-web-master/src/views/task/taskDaliy/index.vue b/eladmin-web-master/src/views/task/taskDaliy/index.vue
index e5ab3e4..e21bea6 100644
--- a/eladmin-web-master/src/views/task/taskDaliy/index.vue
+++ b/eladmin-web-master/src/views/task/taskDaliy/index.vue
@@ -50,7 +50,7 @@
</el-select>
</el-form-item>
<el-form-item label="所属项目" prop="projectId">
- <el-select v-model="form.projectId" filterable clearable placeholder="请选择" style="width: 340px;" @change="formProjectChange">
+ <el-select v-model="form.projectId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="crud.status.edit == crudStatusPrepared" @change="formProjectChange">
<el-option
v-for="item in formProjects"
:key="item.id"
@@ -70,7 +70,9 @@
</el-select>
</el-form-item>
<el-form-item label="消耗工时" prop="consumedHours">
- <el-input v-model="form.consumedHours" style="width: 340px;" />
+ <el-input v-model="form.consumedHours" style="width: 340px;">
+ <template slot="append">小时</template>
+ </el-input>
</el-form-item>
<el-form-item label="消耗工作量" prop="consumedWorkload">
<el-input v-model="form.consumedWorkload" style="width: 340px;" />
diff --git a/eladmin-web-master/src/views/task/taskUser/index.vue b/eladmin-web-master/src/views/task/taskUser/index.vue
index 100d308..b19753e 100644
--- a/eladmin-web-master/src/views/task/taskUser/index.vue
+++ b/eladmin-web-master/src/views/task/taskUser/index.vue
@@ -55,7 +55,7 @@
</el-select>
</el-form-item>
<el-form-item label="所属项目" prop="projectId">
- <el-select v-model="form.projectId" filterable clearable placeholder="请选择" style="width: 340px;" @change="formProjectChange">
+ <el-select v-model="form.projectId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="crud.status.edit == crudStatusPrepared" @change="formProjectChange">
<el-option
v-for="item in projects"
:key="item.id"
@@ -75,13 +75,15 @@
</el-select>
</el-form-item>
<el-form-item label="任务开始时间" prop="taskStartDate">
- <el-date-picker v-model="form.taskStartDate" type="datetime" :picker-options="taskStartDatePickerOptions" :disabled="crud.status.edit == crudStatusPrepared" style="width: 340px;" />
+ <el-date-picker v-model="form.taskStartDate" type="datetime" :picker-options="taskStartDatePickerOptions" style="width: 340px;" />
</el-form-item>
<el-form-item label="任务结束时间" prop="taskEndDate">
<el-date-picker v-model="form.taskEndDate" type="datetime" :picker-options="taskEndDatePickerOptions" style="width: 340px;" />
</el-form-item>
<el-form-item label="任务工时" prop="taskHours">
- <el-input v-model="form.taskHours" style="width: 340px;" />
+ <el-input v-model="form.taskHours" style="width: 340px;">
+ <template slot="append">小时</template>
+ </el-input>
</el-form-item>
<el-form-item label="任务工作量" prop="taskWorkload">
<el-input v-model="form.taskWorkload" style="width: 340px;" />
@@ -234,14 +236,14 @@
taskStartDatePickerOptions: {
// 禁用日期
disabledDate(time) {
- return _this.form.taskEndDate != null && _this.form.taskEndDate !== '' ? time.getTime() > _this.form.taskEndDate : false
+ return _this.form.taskEndDate != null && _this.form.taskEndDate !== '' ? time.getTime() > new Date(_this.form.taskEndDate).getTime() : false
}
},
// 任务结束时间选项
taskEndDatePickerOptions: {
// 禁用日期
disabledDate(time) {
- return _this.form.taskStartDate != null && _this.form.taskStartDate !== '' ? time.getTime() < _this.form.taskStartDate - (86400000 - 1) : false
+ return _this.form.taskStartDate != null && _this.form.taskStartDate !== '' ? time.getTime() < new Date(_this.form.taskStartDate).getTime() - (86400000 - 1) : false
}
},
// 字典:任务状态
--
Gitblit v1.9.3