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

Merge branch 'feature/dxp' into 'develop'

Feature/dxp

See merge request !168
...@@ -22,19 +22,19 @@ ...@@ -22,19 +22,19 @@
// display:flex; // display:flex;
// z-index:1; // z-index:1;
div { div {
width: 130px; width: 9%;
height: 40px; height: 55px;
//border: 1px solid #ccc; //border: 1px solid #ccc;
} }
.ag-left1 { .ag-left1 {
position: absolute; position: absolute;
right: 140px; right: 12%;
top: 20px; top: 18px;
} }
.ag-left2 { .ag-left2 {
position: absolute; position: absolute;
right: 20px; right: 1%;
top: 20px; top: 18px;
} }
} }
.agment-left-con { .agment-left-con {
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
justifycontent: space-between; justifycontent: space-between;
" "
> >
<div <div
ref="agment" ref="agment"
class="agment-box" class="agment-box"
> >
<FullCalendar :options="calendarOptions" /> <FullCalendar :options="calendarOptions" />
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<div <div
v-if="this.schedulingType != 3" v-if="this.schedulingType != 3"
class="agment-box-left" class="agment-box-left"
:style="{height: scrollerHeight}" :style="{ height: scrollerHeight }"
> >
<div class="ag-left-change"> <div class="ag-left-change">
<div <div
...@@ -136,10 +136,11 @@ ...@@ -136,10 +136,11 @@
defaultDate: new Date(), defaultDate: new Date(),
datesSet: this.handleDatesSet, datesSet: this.handleDatesSet,
events: [], events: [],
slotEventOverlap: false,
header: { header: {
center: 'month,agendaFourDay', // buttons for switching between views center: 'month,agendaFourDay', // buttons for switching between views
}, },
firstDay: new Date().getDay(), // 设置一周中显示的第一天是哪天,周日是0,周一是1,类推 firstDay: 1, // 设置一周中显示的第一天是哪天,周日是0,周一是1,类推
locale: 'zh-cn', // 切换语言,当前为中文 locale: 'zh-cn', // 切换语言,当前为中文
eventColor: '#fff', // 全部日历日程背景色3BB2E3 eventColor: '#fff', // 全部日历日程背景色3BB2E3
eventBackgroundColor: '#E7F4F5', eventBackgroundColor: '#E7F4F5',
...@@ -186,12 +187,11 @@ ...@@ -186,12 +187,11 @@
eventClick: this.handleEventClick, eventClick: this.handleEventClick,
}, },
workingTicketVisible: false, // 工作表票详情页面 workingTicketVisible: false, // 工作表票详情页面
scrollerHeight:0 scrollerHeight: 0,
}; };
}, },
watch: { watch: {
week(newV) { week(newV) {
console.log(newV);
if (this.haveWeek.indexOf(newV) == -1) { if (this.haveWeek.indexOf(newV) == -1) {
this.haveWeek.push(newV); this.haveWeek.push(newV);
this.handleInitSearch(); this.handleInitSearch();
...@@ -241,7 +241,17 @@ ...@@ -241,7 +241,17 @@
}); });
}, },
handleInitData(data) { handleInitData(data) {
const newDate = [].concat(data.acceptList, data.noAcceptList); var newDate = null;
if (this.schedulingType != 3) {
newDate = [].concat(data.acceptList, data.noAcceptList);
} else {
var acceptList = [];
data.acceptList.forEach((item) => {
item.type = 88;
acceptList.push(item);
});
newDate = [].concat(acceptList, data.noAcceptList);
}
// const keyAll = ['end', 'endStr', 'id', 'start', 'startStr']; // const keyAll = ['end', 'endStr', 'id', 'start', 'startStr'];
newDate.forEach((item) => { newDate.forEach((item) => {
const dataObj = {}; const dataObj = {};
...@@ -250,10 +260,13 @@ ...@@ -250,10 +260,13 @@
dataObj['id'] = id; dataObj['id'] = id;
dataObj['end'] = item.endTime; dataObj['end'] = item.endTime;
dataObj['start'] = item.startTime; dataObj['start'] = item.startTime;
console.log(item.type);
dataObj['type'] = item.type; dataObj['type'] = item.type;
if (item.type == 88) {
dataObj['color'] = '#FFEDE9';
}
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();
...@@ -262,18 +275,18 @@ ...@@ -262,18 +275,18 @@
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;
if (timeDifference > 0) { if (timeDifference > 0 && timeDifference < 7) {
// 过去 // 过去
this.week = 2; this.week = 1;
headObj.text = '周'; headObj.text = '周';
} else if (timeDifference < 0) { } else if (timeDifference < 0) {
// 未来 // 未来
this.week = 3; this.week = 3;
headObj.text = '下周'; headObj.text = '下周';
} else { } else {
// 现在 // 现在
headObj.text = '周'; headObj.text = '周';
this.week = 1; this.week = 2;
} }
}, },
eventResize(event) { eventResize(event) {
...@@ -295,8 +308,19 @@ ...@@ -295,8 +308,19 @@
if (!this.calendarOptions.selectable) { if (!this.calendarOptions.selectable) {
return; return;
} }
const index = this.getIdDeleteData(event.event.id); this.$confirm('你要取消日期吗?', '提示', {
return this.calendarOptions.events.splice(index, 1); confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then((_) => {
console.log(_);
const index = this.getIdDeleteData(event.event.id);
return this.calendarOptions.events.splice(index, 1);
})
.catch((_) => {
console.log(_);
});
// alert("你要取消日期吗"); // alert("你要取消日期吗");
}, },
eventDrop(event) { eventDrop(event) {
...@@ -304,6 +328,11 @@ ...@@ -304,6 +328,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'];
...@@ -318,6 +347,11 @@ ...@@ -318,6 +347,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;
...@@ -412,4 +446,3 @@ ...@@ -412,4 +446,3 @@
<style lang="scss" scoped> <style lang="scss" scoped>
@import 'index'; @import 'index';
</style> </style>
d e c
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册