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

新页面添加预约时间颜色

上级 a02d0db6
...@@ -174,9 +174,15 @@ ...@@ -174,9 +174,15 @@
this.dateTime = value; this.dateTime = value;
}, },
search() { search() {
if(!this.dateTime || !this.departmentId) {
return this.$message({
message: '科室和时间都需要选择哦!',
type: 'warning'
});
}
const params = { const params = {
dateTime: this.dateTime || null, dateTime: this.dateTime,
departmentId: this.departmentId || null, departmentId: this.departmentId,
}; };
previewWork({ ...params }).then((res) => { previewWork({ ...params }).then((res) => {
if (res.code === '000000') { if (res.code === '000000') {
...@@ -188,17 +194,29 @@ ...@@ -188,17 +194,29 @@
}; };
} }
); );
this.calendarOptions.events = res.data.dutyWorkList.map( const dutyRosterPreList = res.data.dutyRosterPreList.map(
(item, index) => { (item, index) => {
return { return {
id: index, id: index,
resourceId: item.doctorId, resourceId: item.doctorId,
end: item.endTime, end: item.endTime,
start: item.startTime, start: item.startTime,
color: ' #FFEDE9', color: '#FFEDE9',
}; };
} }
); );
const dutyWorkList = res.data.dutyWorkList.map(
(item, index) => {
return {
id: index,
resourceId: item.doctorId,
end: item.endTime,
start: item.startTime,
color: '#E7F4F5',
};
}
);
this.calendarOptions.events = [].concat(dutyRosterPreList, dutyWorkList);
const calendarApi = this.$refs.fullCalendar.getApi(); const calendarApi = this.$refs.fullCalendar.getApi();
calendarApi.gotoDate(this.dateTime); calendarApi.gotoDate(this.dateTime);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册