临时外出申请增加上下午
This commit is contained in:
parent
ea5cb4dfc7
commit
bd8ca34855
|
|
@ -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,19 +449,24 @@
|
|||
}
|
||||
|
||||
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
|
||||
},
|
||||
|
|
@ -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
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue