提交 2d162680 编写于 作者: qian.jie's avatar qian.jie

设置过滤

上级 d5b3524e
......@@ -511,8 +511,35 @@
});
},
selectInfo(info) {
console.log(info, 'infoinfoinfo');
const startDay = new Date(info.start).getDay();
const endDay = new Date(info.end).getDay();
// const chooseStartH = new Date(info.start).getHours();
// const chooseEndH = new Date(info.end).getHours();
// // const startH = 9;
// const middleH = 12;
// // const middleEH = 18;
// const endH = 21;
// const timeList = [];
// const timeObj = {};
// if (chooseStartH < middleH && chooseEndH >= endH ) {
// console.log(chooseStartH, chooseEndH, 'endDayendDayendDayendDay1111');
// timeList.push(
// {
// start:'2021-11-25 09:00:00',
// end:'2021-11-25 12:00:00'
// },
// {
// start:'2021-11-25 13:00:00',
// end:'2021-11-25 17:00:00'
// },
// {
// start:'2021-11-25 18:00:00',
// end:'2021-11-25 21:00:00'
// }
// );
// }
// this.calendarOptions.events = timeList;
if (startDay != endDay) {
return this.$toast('不能夸天选择排班');
}
......@@ -527,15 +554,30 @@
dataObj[item] = info[item];
}
});
console.log(dataObj, 'dataObjdataObj');
this.calendarOptions.events.push(dataObj);
},
selectAllow(info) {
this.isDoIt = true;
const startDay = new Date(info.start).getDay();
const endDay = new Date(info.end).getDay();
const startHour = dayjs(info.start).hour();
const endHour = dayjs(info.end).hour();
console.log(dayjs(info.start).format('YYYY-MM-DD HH:mm:ss'));
if (startDay != endDay) {
return false;
}
// if (dayjs(info.start).format('YYYY-MM-DD HH:mm:ss').split(' ')[1] == '12:00:00' || dayjs(info.start).format('YYYY-MM-DD HH:mm:ss').split(' ')[1] == '17:00:00') {
// return false;
// }
if (startHour <= 12 && endHour <= 21) {
return false;
} else if (startHour >= 12 && endHour <= 21) {
return false;
}
const currentDate = new Date();
const start = info.start;
const end = info.end;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册