临时外出申请增加上下午

This commit is contained in:
lSun 2025-04-22 15:03:43 +08:00
parent ea5cb4dfc7
commit bd8ca34855
1 changed files with 27 additions and 10 deletions

View File

@ -104,13 +104,16 @@
</view>
<view class="form-item">
<text class="label">地点</text>
<text class="label required">地点</text>
<input
type="text"
v-model="formData.location"
placeholder="请输入"
:disabled="isFormDisabled"
/>
<text v-if="errors.location" class="error-message">
{{ errors.location }}
</text>
</view>
<view class="form-item">
@ -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
})