提交 9a243cea 编写于 作者: xiaoping.di's avatar xiaoping.di

排班

上级 65c38f8f
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
div { div {
width: 9%; width: 9%;
height: 55px; height: 55px;
border: 1px solid #ccc; //border: 1px solid #ccc;
} }
.ag-left1 { .ag-left1 {
position: absolute; position: absolute;
......
...@@ -246,7 +246,6 @@ ...@@ -246,7 +246,6 @@
dataObj['type'] = item.type; dataObj['type'] = item.type;
this.calendarOptions.events.push(dataObj); this.calendarOptions.events.push(dataObj);
}); });
console.log(this.calendarOptions.events, 'wokkkwok');
}, },
handleDatesSet(dataInfo) { handleDatesSet(dataInfo) {
const currentTime = new Date().getTime(); const currentTime = new Date().getTime();
...@@ -255,7 +254,6 @@ ...@@ -255,7 +254,6 @@
const oneHour = 1 * 60 * 60 * 1000 * 24; const oneHour = 1 * 60 * 60 * 1000 * 24;
const timeDifference = (cz / oneHour) | 0; const timeDifference = (cz / oneHour) | 0;
const headObj = this.calendarOptions.customButtons.myCustomButton; const headObj = this.calendarOptions.customButtons.myCustomButton;
console.log(timeDifference, 'sjsjsjsj', cz);
if (timeDifference > 0 && timeDifference < 7) { if (timeDifference > 0 && timeDifference < 7) {
// 过去 // 过去
this.week = 1; this.week = 1;
...@@ -266,7 +264,7 @@ ...@@ -266,7 +264,7 @@
headObj.text = '下周'; headObj.text = '下周';
} else { } else {
// 现在 // 现在
headObj.text = '周'; headObj.text = '周';
this.week = 2; this.week = 2;
} }
}, },
...@@ -298,6 +296,11 @@ ...@@ -298,6 +296,11 @@
return; return;
}, },
selectInfo(info) { selectInfo(info) {
const startDay = new Date(info.start).getDay();
const endDay = new Date(info.end).getDay();
if (startDay != endDay) {
return this.$toast('不能夸天选择排班');
}
const id = (this.calendarOptions.events.length + 1) * 10; const id = (this.calendarOptions.events.length + 1) * 10;
info.id = id; info.id = id;
const keyAll = ['end', 'endStr', 'id', 'start', 'startStr', 'week']; const keyAll = ['end', 'endStr', 'id', 'start', 'startStr', 'week'];
...@@ -312,6 +315,11 @@ ...@@ -312,6 +315,11 @@
this.calendarOptions.events.push(dataObj); this.calendarOptions.events.push(dataObj);
}, },
selectAllow(info) { selectAllow(info) {
const startDay = new Date(info.start).getDay();
const endDay = new Date(info.end).getDay();
if (startDay != endDay) {
return false;
}
const currentDate = new Date(); const currentDate = new Date();
const start = info.start; const start = info.start;
const end = info.end; const end = info.end;
...@@ -406,4 +414,3 @@ ...@@ -406,4 +414,3 @@
<style lang="scss" scoped> <style lang="scss" scoped>
@import 'index'; @import 'index';
</style> </style>
d e c
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册