From a7f8b9e44ae8e5349bb7f80d799ad9fd3085ab0e Mon Sep 17 00:00:00 2001
From: BAOLH <baolh@yhzhg.cn>
Date: Thu, 17 Sep 2026 07:52:28 +0000
Subject: [PATCH] Merge branch 'wcd-2411-update' into wcd
---
eladmin-web-master/src/views/attendance/attendanceLeave/index.vue | 55 +++++++++++++++++++++++++++++--------------------------
1 files changed, 29 insertions(+), 26 deletions(-)
diff --git a/eladmin-web-master/src/views/attendance/attendanceLeave/index.vue b/eladmin-web-master/src/views/attendance/attendanceLeave/index.vue
index df4eea7..65ec532 100644
--- a/eladmin-web-master/src/views/attendance/attendanceLeave/index.vue
+++ b/eladmin-web-master/src/views/attendance/attendanceLeave/index.vue
@@ -508,33 +508,36 @@
if (this.form.leaveType == null || this.form.leaveStartTime == null || this.form.leaveEndTime == null) {
return
}
- // 获取年假剩余时长
- crudAttendanceLeave.getYearTimeLength((this.form.userId == null ? 1 : this.form.userId), this.form.leaveStartTime.substring(0, 4)).then(res => {
- this.yearTimeLength = res
- })
- // 获取调休假剩余时长
- crudAttendanceLeave.getOverTimeLength((this.form.userId == null ? 1 : this.form.userId), this.form.leaveStartTime.substring(0, 7)).then(res => {
- this.overTimeLength = res
- })
- // 通过后台计算时长
- var data = JSON.stringify({
- 'leaveType': this.form.leaveType,
- 'leaveStartTime': this.form.leaveStartTime,
- 'leaveEndTime': this.form.leaveEndTime
- })
- crudAttendanceLeave.calcTimeLength(data).then(res => {
- // 年假和计算的时长作比较
- if (this.form.leaveType === this.dictLeaveTypeAnnualLeave && this.yearTimeLength < res.leaveDuration) {
+ Promise.all([
+ // 获取年假剩余时长
+ crudAttendanceLeave.getYearTimeLength((this.form.userId == null ? 1 : this.form.userId), this.form.leaveStartTime.substring(0, 4)).then(res => {
+ this.yearTimeLength = res
+ }),
+ // 获取调休假剩余时长
+ crudAttendanceLeave.getOverTimeLength((this.form.userId == null ? 1 : this.form.userId), this.form.leaveStartTime.substring(0, 7)).then(res => {
+ this.overTimeLength = res
+ })
+ ]).then(() => {
+ // 通过后台计算时长
+ var data = JSON.stringify({
+ 'leaveType': this.form.leaveType,
+ 'leaveStartTime': this.form.leaveStartTime,
+ 'leaveEndTime': this.form.leaveEndTime
+ })
+ crudAttendanceLeave.calcTimeLength(data).then(res => {
+ // 年假和计算的时长作比较
+ if (this.form.leaveType === this.dictLeaveTypeAnnualLeave && this.yearTimeLength < res.leaveDuration) {
+ this.form.leaveDuration = null
+ this.crud.notify('年假剩余时间不足', CRUD.NOTIFICATION_TYPE.ERROR)
+ } else if (this.form.leaveType === this.dictLeaveTypeReplace && this.overTimeLength < res.leaveDuration) {
+ this.form.leaveDuration = null
+ this.crud.notify('调休假剩余时间不足', CRUD.NOTIFICATION_TYPE.ERROR)
+ } else {
+ this.form.leaveDuration = res.leaveDuration
+ }
+ }).catch(() => {
this.form.leaveDuration = null
- this.crud.notify('年假剩余时间不足', CRUD.NOTIFICATION_TYPE.ERROR)
- } else if (this.form.leaveType === this.dictLeaveTypeReplace && this.overTimeLength < res.leaveDuration) {
- this.form.leaveDuration = null
- this.crud.notify('调休假剩余时间不足', CRUD.NOTIFICATION_TYPE.ERROR)
- } else {
- this.form.leaveDuration = res.leaveDuration
- }
- }).catch(() => {
- this.form.leaveDuration = null
+ })
})
},
// 审批页面赋值
--
Gitblit v1.9.3