From bd8ca34855356ff54b0fb87abe4b9665b3da2ae8 Mon Sep 17 00:00:00 2001
From: lSun <15893999301@qq.com>
Date: Tue, 22 Apr 2025 15:03:43 +0800
Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E5=A4=96=E5=87=BA=E7=94=B3?=
=?UTF-8?q?=E8=AF=B7=E5=A2=9E=E5=8A=A0=E4=B8=8A=E4=B8=8B=E5=8D=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/temporary-outing/index.vue | 37 ++++++++++++++++++++--------
1 file changed, 27 insertions(+), 10 deletions(-)
diff --git a/src/pages/temporary-outing/index.vue b/src/pages/temporary-outing/index.vue
index ff428c2..99669d5 100644
--- a/src/pages/temporary-outing/index.vue
+++ b/src/pages/temporary-outing/index.vue
@@ -104,13 +104,16 @@
- 地点
+ 地点
+
+ {{ errors.location }}
+
@@ -416,7 +419,7 @@
if (startDate != null && startDate !== '' && endDate != null && endDate !== '') {
getDays(dateData).then((response) => {
if (response.status === 200) {
- console.log(response)
+ console.log("外出申请",response)
// this.formData.leaveDuration = response.data
this.daysNumber = response.data
this.handleDateChanges()
@@ -446,22 +449,27 @@
}
if (startDate.getTime() === endDate.getTime()) { // 同一天
+ console.log("111");
if (this.formData.leaveStartInterval == 1 && this.formData.leaveEndInterval == 2) {
this.formData.leaveDuration = 1; // 上午到下午,算作1天
} else {
this.formData.leaveDuration = 0.5; // 其他情况,上/下午到同一天的上/下午,算作半天
}
} else { // 不同天
+ console.log("2222");
+ console.log("this.formData.leaveStartInterval",this.formData.leaveStartInterval);
+ console.log("this.formData.leaveEndInterval",this.formData.leaveEndInterval);
let totalDays = this.daysNumber;
- if (this.formData.leaveStartInterval == 1) totalDays -= 0.5; // 开始当天只算半天
+ if (this.formData.leaveStartInterval == 2) totalDays -= 0.5; // 开始当天只算半天
if (this.formData.leaveEndInterval == 1) totalDays -= 0.5; // 结束当天只算半天
this.formData.leaveDuration = totalDays;
}
}
},
- onApprovalChange(e) {
- this.formData.isApproved = e.detail.value
- },
+
+ onApprovalChange(e) {
+ this.formData.isApproved = e.detail.value
+ },
onAgreerovalChange(e){
this.formData.isAgree = e.detail.value
},
@@ -489,9 +497,13 @@
if (!this.formData.hostUserId) {
this.errors.hostUserId = '请选择代理主持工作人员'
}
- // if (!this.formData.leaveReason.trim()) {
- // this.errors.leaveReason = '请输入休假事由'
- // }
+
+ if (!this.formData.location.trim()) {
+ this.errors.location = '请输入地点'
+ }
+ if (!this.formData.leaveReason.trim()) {
+ this.errors.leaveReason = '请输入休假事由'
+ }
return Object.keys(this.errors).length === 0
},
@@ -563,6 +575,12 @@
})
}, 1500) // 可以根据需要调整这个延迟时间,以便用户可以看到成功的提示信息
} else {
+ // uni.showModal({
+ // title: '详细信息', // 标题可以根据实际情况调整
+ // content: response.msg, // 直接使用完整的响应消息
+ // showCancel: false, // 如果不需要取消按钮,则设置为false
+ // confirmText: '确定' // 确认按钮的文字,默认为“确定”
+ // });
uni.showToast({
title: response.msg,
icon: 'none',
@@ -570,7 +588,6 @@
})
}
// 重置表单状态
-
this.isFormDisabled = false
this.isDataUploaded = false
})