临时外出申请增加上下午

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>
<view class="form-item"> <view class="form-item">
<text class="label">地点</text> <text class="label required">地点</text>
<input <input
type="text" type="text"
v-model="formData.location" v-model="formData.location"
placeholder="请输入" placeholder="请输入"
:disabled="isFormDisabled" :disabled="isFormDisabled"
/> />
<text v-if="errors.location" class="error-message">
{{ errors.location }}
</text>
</view> </view>
<view class="form-item"> <view class="form-item">
@ -416,7 +419,7 @@
if (startDate != null && startDate !== '' && endDate != null && endDate !== '') { if (startDate != null && startDate !== '' && endDate != null && endDate !== '') {
getDays(dateData).then((response) => { getDays(dateData).then((response) => {
if (response.status === 200) { if (response.status === 200) {
console.log(response) console.log("外出申请",response)
// this.formData.leaveDuration = response.data // this.formData.leaveDuration = response.data
this.daysNumber = response.data this.daysNumber = response.data
this.handleDateChanges() this.handleDateChanges()
@ -446,19 +449,24 @@
} }
if (startDate.getTime() === endDate.getTime()) { // if (startDate.getTime() === endDate.getTime()) { //
console.log("111");
if (this.formData.leaveStartInterval == 1 && this.formData.leaveEndInterval == 2) { if (this.formData.leaveStartInterval == 1 && this.formData.leaveEndInterval == 2) {
this.formData.leaveDuration = 1; // 1 this.formData.leaveDuration = 1; // 1
} else { } else {
this.formData.leaveDuration = 0.5; // // this.formData.leaveDuration = 0.5; // //
} }
} else { // } else { //
console.log("2222");
console.log("this.formData.leaveStartInterval",this.formData.leaveStartInterval);
console.log("this.formData.leaveEndInterval",this.formData.leaveEndInterval);
let totalDays = this.daysNumber; 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; // if (this.formData.leaveEndInterval == 1) totalDays -= 0.5; //
this.formData.leaveDuration = totalDays; this.formData.leaveDuration = totalDays;
} }
} }
}, },
onApprovalChange(e) { onApprovalChange(e) {
this.formData.isApproved = e.detail.value this.formData.isApproved = e.detail.value
}, },
@ -489,9 +497,13 @@
if (!this.formData.hostUserId) { if (!this.formData.hostUserId) {
this.errors.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 return Object.keys(this.errors).length === 0
}, },
@ -563,6 +575,12 @@
}) })
}, 1500) // 便 }, 1500) // 便
} else { } else {
// uni.showModal({
// title: '', //
// content: response.msg, // 使
// showCancel: false, // false
// confirmText: '' //
// });
uni.showToast({ uni.showToast({
title: response.msg, title: response.msg,
icon: 'none', icon: 'none',
@ -570,7 +588,6 @@
}) })
} }
// //
this.isFormDisabled = false this.isFormDisabled = false
this.isDataUploaded = false this.isDataUploaded = false
}) })