|
@@ -4,7 +4,7 @@
|
|
|
<u-form-item label="请假类型" prop="type" required>
|
|
|
<u-input v-model="form.type" placeholder="请选择请假类型" :select-open="leaveTypeShow" type="select" @click="leaveTypeShow = true" />
|
|
|
</u-form-item>
|
|
|
- <u-form-item label="请假时间" prop="leaveTime" required>
|
|
|
+ <u-form-item :label="form.type === '病假'?'开始时间':'请假时间'" prop="leaveTime" required>
|
|
|
<u-input v-model="form.leaveTime" placeholder="请选择请假时间" :select-open="leaveTimeShow" type="select" @click="leaveTimeShow = true" />
|
|
|
</u-form-item>
|
|
|
<u-form-item label="上传证明" v-if="form.type === '病假'" prop="leavePic" required>
|
|
@@ -13,6 +13,9 @@
|
|
|
<u-form-item label="请假理由" prop="leaveReason" required>
|
|
|
<u-input v-model="form.leaveReason" placeholder="请输入请假理由" type="text" />
|
|
|
</u-form-item>
|
|
|
+ <u-form-item v-if="form.type === '病假'">
|
|
|
+ 学员重新上课时,教练进行结束病假
|
|
|
+ </u-form-item>
|
|
|
</u-form>
|
|
|
<u-picker mode="selector" v-model="leaveTypeShow" :range="selectorObj" range-key="cateName" @confirm="handleGetType"></u-picker>
|
|
|
<u-calendar v-model="leaveTimeShow" mode="date" :active-bg-color="mainColor" btn-type="error" availableText="有课"
|
|
@@ -137,16 +140,23 @@
|
|
|
// 设置请假日期
|
|
|
setLeaveTime(object) {
|
|
|
// 今天0点的时间戳
|
|
|
- const nowTimeStamp = (new Date(new Date().toLocaleDateString()).getTime()) / 1000
|
|
|
+ let d = new Date()
|
|
|
+ let year = d.getFullYear()
|
|
|
+ let month = d.getMonth() + 1
|
|
|
+ let day = d.getDate()
|
|
|
+ let dateNow = year+'/'+month +'/'+day
|
|
|
+ const nowTimeStamp = this.dateFormatTimeStamp(dateNow)
|
|
|
+ console.log(nowTimeStamp)
|
|
|
// 今天后3天的时间戳
|
|
|
const nextThreeDayTimeStamp = nowTimeStamp + 86400
|
|
|
+ let dateIos = object.year + '/' + object.month + '/' + object.day
|
|
|
let date = object.year + '-' + object.month + '-' + object.day
|
|
|
// 当天是否可请假
|
|
|
if (this.availableList.filter(site => site == date).length) {
|
|
|
// 是否为病假
|
|
|
if(this.form.type === '事假') {
|
|
|
// 病假需提前3天请
|
|
|
- if(this.dateFormatTimeStamp(date) >= nextThreeDayTimeStamp) {
|
|
|
+ if(this.dateFormatTimeStamp(dateIos) >= nextThreeDayTimeStamp) {
|
|
|
this.form.leaveTime = date
|
|
|
} else {
|
|
|
this.form.leaveTime = ''
|
|
@@ -156,7 +166,9 @@
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
|
- if(this.dateFormatTimeStamp(date) >= nowTimeStamp) {
|
|
|
+ let dateStr=this.dateFormatTimeStamp(dateIos)
|
|
|
+ console.log(dateStr)
|
|
|
+ if(dateStr >= nowTimeStamp) {
|
|
|
this.form.leaveTime = date
|
|
|
} else {
|
|
|
this.form.leaveTime = ''
|