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

排班设置可选时间

上级 5b5f93b2
......@@ -143,10 +143,12 @@
chooseTimeIndex: 1000,
pickerOptionsStart: {
disabledDate: (time) => {
const month = 28 * 24 * 60 * 60 * 1000; // 限定一个日期范围,这里是28天
const now = new Date();
const day = now.getDay();
const oneDayTime = 24 * 60 * 60 * 1000;
const SundayTime = ((7 - day) * oneDayTime) + 21 * 24 * 60 * 60 * 1000;
return (
time.getTime() + 1 * 24 * 60 * 60 * 1000 < new Date() ||
time.getTime() > new Date().getTime() + month
time.getTime() + 1 * 24 * 60 * 60 * 1000 < new Date() || time.getTime() > new Date().getTime() + SundayTime
);
},
},
......@@ -177,7 +179,11 @@
this.getLeisureTime(this.chooseTime);
},
nextChangeData() {
const maxDate = dayjs(new Date()).add(27, 'day').unix();
const now = new Date();
const day = now.getDay();
const SundayTime = 7 - day;
console.log(SundayTime, 'SundayTime');
const maxDate = dayjs(new Date()).add((SundayTime + 20), 'day').unix();
if (dayjs(this.chooseTime).unix() > maxDate) {
this.$message({
message: '时间不能超过28天',
......
......@@ -129,7 +129,7 @@
],
// timeZone: 'UTC',
locale: 'zh-cn',
aspectRatio: 3, // 设置日历单元格宽度与高度的比例。
aspectRatio: 2.8, // 设置日历单元格宽度与高度的比例。
schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
initialView: 'resourceTimeGridDay',
resources: [],
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册