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

排班数据修改

上级 f8a856cf
.agment-box {
.schedul-box {
width: 100%;
height: auto;
position: relative;
display: flex;
justify-content: space-between;
.agment-box {
height: 100%;
background: #fff;
overflow: hidden;
padding: 20px;
border-radius: 6px;
flex: 3.8;
}
.setMaxNum {
}
.setMaxNum {
display: flex;
justify-content: space-around;
}
.input-value {
}
.input-value {
width: 100px;
/deep/.el-input-number__decrease {
width: 20px;
......@@ -21,42 +27,42 @@
/deep/.el-input__inner {
padding: 0;
}
}
.list-item {
}
.list-item {
width: 86px;
height: 25px;
background: #ffffff;
border-radius: 16px;
border: 1px solid rgba(0, 0, 0, 0.15);
text-align: center;
}
.list-item-noth {
}
.list-item-noth {
width: 86px;
height: 25px;
background: red;
border-radius: 16px;
border: 1px solid rgba(0, 0, 0, 0.15);
text-align: center;
}
.w2 {
}
.w2 {
/deep/.fc-prev-button {
background: #f4f4f5;
cursor: not-allowed;
border: 1px solid #d9d9d9;
}
}
.w3 {
}
.w3 {
/deep/.fc-next-button {
background: #f4f4f5;
border: 1px solid #d9d9d9;
cursor: not-allowed;
}
}
/deep/.fc-timegrid-event-harness {
}
/deep/.fc-timegrid-event-harness {
// position: absolute !important;
left: 0 !important;
}
.agment-box-left {
}
.agment-box-left {
flex: 1;
height: 100%;
margin-left: 12px;
......@@ -65,8 +71,8 @@
text-align: center;
display: flex;
justify-content: center;
}
.el-dialog-show {
}
.el-dialog-show {
.set-agment-maxNum {
.first-show-num {
text-align: center;
......@@ -92,8 +98,8 @@
}
}
}
}
.ag-left-change {
}
.ag-left-change {
// position: relative;
// border:1px solid #ccc;
// height:40px;
......@@ -114,17 +120,17 @@
right: 1%;
top: 18px;
}
}
.show-work-set {
}
.show-work-set {
margin-top: 100px;
}
.agment-left-con {
}
.agment-left-con {
padding: 15px;
text-align: center;
background: #f2f2f2;
border-radius: 12px;
}
.reset-doctor-schedu {
}
.reset-doctor-schedu {
padding: 30px 15px 5px 15px;
text-align: center;
.copy-submit {
......@@ -135,8 +141,8 @@
font-weight: 400;
color: #0d9078;
}
}
.copy-doctor-schedu {
}
.copy-doctor-schedu {
padding: 5px;
margin: 0 auto;
text-align: center;
......@@ -148,8 +154,8 @@
font-weight: 400;
color: #0d9078;
}
}
.agment-left-copy {
}
.agment-left-copy {
padding: 5px;
margin: 0 auto;
text-align: center;
......@@ -175,8 +181,8 @@
cursor: pointer;
}
}
}
.first-left-max {
}
.first-left-max {
padding: 5px;
margin: 0 auto;
text-align: center;
......@@ -185,51 +191,51 @@
font-weight: 400;
color: #0d9078;
cursor: pointer;
}
.agment-head {
}
.agment-head {
border-radius: 5px;
text-align: center;
}
.agment-head-name {
}
.agment-head-name {
font-size: 20px;
color: #02120f;
font-weight: 600;
padding: 3px;
}
.agment-head-phone {
}
.agment-head-phone {
font-size: 18px;
margin-left: 16px;
}
.agment-hospital {
}
.agment-hospital {
color: #89888b;
font-size: 16px;
margin-top: 10px;
}
.agment-hospital-show {
}
.agment-hospital-show {
margin-right: 10px;
}
.agment-hospital-ks {
}
.agment-hospital-ks {
margin-top: 8px;
}
.agment-head-title {
}
.agment-head-title {
font-size: 14px;
color: #02120f;
margin-top: 19px;
}
.agment-head-none {
}
.agment-head-none {
background: #fff;
pointer-events: none;
}
.new-max {
}
.new-max {
text-align: center;
margin-top: 20px;
}
.new-max-none {
}
.new-max-none {
text-align: center;
margin-top: 20px;
pointer-events: none;
}
.agment-head-priority {
}
.agment-head-priority {
padding-top: 20px;
display: flex;
justify-content: center;
......@@ -249,62 +255,62 @@
background: #0d9078;
border: none;
}
}
.agment-left-button {
}
.agment-left-button {
margin-top: 34px;
display: flex;
justify-content: center;
}
.copy-submit {
}
.copy-submit {
background: #0d9078;
border: 1px solid #0d9078;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #ffffff;
}
.reset-submit {
}
.reset-submit {
background: #fff;
border: 1px solid #0d9078;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
}
/deep/.fc-timegrid-event {
}
/deep/.fc-timegrid-event {
border-radius: 1px !important;
}
/deep/thead .fc-scroller-harness {
}
/deep/thead .fc-scroller-harness {
background: #fcfbff;
}
/deep/.fc-col-header-cell-cushion {
}
/deep/.fc-col-header-cell-cushion {
color: #333;
height: 45px;
line-height: 45px;
}
/deep/.fc .fc-highlight {
}
/deep/.fc .fc-highlight {
background: transparent;
}
/deep/.fc-header-toolbar {
}
/deep/.fc-header-toolbar {
position: absolute;
right: 0;
top: 15px;
padding: 20px;
width: 20%;
}
/deep/.fc-toolbar-title {
}
/deep/.fc-toolbar-title {
font-size: 6px;
}
/deep/.fc-toolbar-chunk {
}
/deep/.fc-toolbar-chunk {
display: flex;
}
/deep/.fc-button-primary {
}
/deep/.fc-button-primary {
background: #fff;
color: #02120f;
border-color: #d9d9d9;
border-radius: 20px;
padding: 6px 16px;
flex-shrink: 0;
}
@media screen and (min-width: 1000px) and (max-width: 1300px) {
}
@media screen and (min-width: 1000px) and (max-width: 1300px) {
/deep/.fc-header-toolbar {
right: 6%;
}
......@@ -317,22 +323,22 @@
width: 12% !important;
right: 1% !important;
}
}
/deep/.fc-myCustomButton-button {
}
/deep/.fc-myCustomButton-button {
padding: 6px 24px;
}
/deep/.fc-button-primary:hover {
}
/deep/.fc-button-primary:hover {
background: #fff;
color: #02120f;
border: 1px solid #0d9078;
}
/deep/.fc-event-time {
}
/deep/.fc-event-time {
font-size: 14px;
color: #0d9078;
word-wrap: break-word;
white-space: normal;
}
/deep/.fc-col-header-cell-cushion {
}
/deep/.fc-col-header-cell-cushion {
background: #fff;
border: 1px solid #0d9078;
color: #0d9078;
......@@ -342,7 +348,8 @@
font-size: 14px;
margin: 10px 0;
text-decoration: none;
}
/deep/a:hover {
}
/deep/a:hover {
text-decoration: none;
}
}
<template>
<div
v-loading="loading"
style="
width: 100%;
height: auto;
position: relative;
display: flex;
justifycontent: space-between;
"
class="schedul-box"
>
<div
ref="agment"
......@@ -158,7 +152,7 @@
getLevelAndDayCount,
} from '@/api/serviceSchedule';
export default {
name: 'Index',
name: 'Scheduing',
components: {
FullCalendar,
},
......@@ -251,7 +245,7 @@
scrollerHeight: 0,
loading: false,
isDoIt: false,
getEveryDay: '',
getStartWeek: '',
copyArr: [],
centerDialogVisible: false,
maxNumValue: '',
......@@ -267,7 +261,6 @@
if (newV !== oldV) {
this.handleInitSearch();
this.saveDoctoreScheduling(2, oldV);
// this.getLevelAndDayCount(newV);
}
},
},
......@@ -291,7 +284,6 @@
},
mounted() {
this.scrollerHeight = this.$refs.agment.clientHeight + 'px';
// this.scrollerHeight = 400 + 'px';
this.init();
},
methods: {
......@@ -304,6 +296,7 @@
* view是当前视图对象。
*/
init() {
// schedulingType 1,2 表示编辑新加,其他表示查看
if (this.schedulingType == 1 || this.schedulingType == 2) {
this.calendarOptions.editable = true;
} else {
......@@ -335,17 +328,17 @@
selectDate = dayjs(selectDate).unix();
const nowDate = dayjs(new Date()).unix();
let isAddAllDay = true;
const data = this.calendarOptions.events;
const len = data.length;
const cz = ((nowDate - selectDate) / 3600) | 0;
if (cz > 0 && cz >= 24) {
const haveSelectDate = this.calendarOptions.events;
const len = haveSelectDate.length;
const differenceTime = ((nowDate - selectDate) / 3600) | 0;
if (differenceTime > 0 && differenceTime >= 24) {
return this.$message.info('你不能添加过去的时间的排班');
}
for (var i = 0; i < len; i++) {
const itemDay = dayjs(data[i].start).day();
if (!data[i].constraint && day === itemDay) {
data[i].allStatus && (isAddAllDay = false);
const index = this.getIdDeleteData(data[i].id);
const itemDay = dayjs(haveSelectDate[i].start).day();
if (!haveSelectDate[i].constraint && day === itemDay) {
haveSelectDate[i].allStatus && (isAddAllDay = false);
const index = this.getIdDeleteData(haveSelectDate[i].id);
this.isDoIt = true;
this.calendarOptions.events.splice(index, 1);
i--;
......@@ -353,48 +346,49 @@
}
if (isAddAllDay) {
// 添加日期
const list = [
const selectAllDay = [
{ startTime: '09:00:00', endTime: '12:00:00' },
{ startTime: '13:00:00', endTime: '17:00:00' },
{ startTime: '18:00:00', endTime: '21:00:00' },
{ startTime: '13:00:00', endTime: '21:00:00' },
];
list.forEach((item) => {
const obj = {};
obj.id = dayDate + (this.calendarOptions.events.length + 1) * 10;
obj.week = this.week;
obj.end = dayFormat + ' ' + item.endTime;
obj.start = dayFormat + ' ' + item.startTime;
obj.allStatus = true;
console.log(obj);
this.calendarOptions.events.push(obj);
selectAllDay.forEach((item) => {
const allDayData = {};
allDayData.id =
dayDate + (this.calendarOptions.events.length + 1) * 10;
allDayData.week = this.week;
allDayData.end = dayFormat + ' ' + item.endTime;
allDayData.start = dayFormat + ' ' + item.startTime;
allDayData.allStatus = true;
console.log(allDayData);
this.calendarOptions.events.push(allDayData);
});
}
},
getCopyData(data) {
const copyList = [];
getCopyData(lastWeekData) {
const copyDate = [];
const addDay = 7;
data.noAcceptList.map((item) => {
const obj = {};
obj['startTime'] = dayjs(item.startTime)
lastWeekData.noAcceptList.map((item) => {
const nowWeekTime = {};
nowWeekTime['startTime'] = dayjs(item.startTime)
.add(addDay, 'day')
.format('YYYY-MM-DD HH:mm:ss');
obj['endTime'] = dayjs(item.endTime)
nowWeekTime['endTime'] = dayjs(item.endTime)
.add(addDay, 'day')
.format('YYYY-MM-DD HH:mm:ss');
copyList.push(obj);
copyDate.push(nowWeekTime);
});
this.calendarOptions.events = [];
data.noAcceptList = copyList;
lastWeekData.noAcceptList = copyDate;
this.isDoIt = true;
},
handleInitSearch(isReset, type) {
if (isReset && type != 1) {
handleInitSearch(isReset, isLoopLast) {
//
if (isReset && isLoopLast != 1) {
this.calendarOptions.events = this.calendarOptions.events.filter(
(v) => v.week !== this.week
);
}
let copyWeek = '';
if (type == 1) {
if (isLoopLast == 1) {
if (this.week == 1) {
copyWeek = 2;
} else if (this.week == 3) {
......@@ -405,20 +399,20 @@
copyWeek = 4;
}
}
const objParms = {};
objParms.doctorId = this.doctorId;
objParms.week = type == 1 ? copyWeek : this.week;
// type == 1 表示 copy
objParms.workId = this.id;
dutyRosterQuery(objParms).then((res) => {
const searchLastWeek = {};
searchLastWeek.doctorId = this.doctorId;
searchLastWeek.week = isLoopLast == 1 ? copyWeek : this.week;
// isLoopLast == 1 表示 copy
searchLastWeek.workId = this.id;
dutyRosterQuery(searchLastWeek).then((res) => {
if (res.code == '000000') {
console.log(res.data.noAcceptList, 'res.data.noAcceptList');
if (type == 1 && !res.data.noAcceptList.length) {
if (isLoopLast == 1 && !res.data.noAcceptList.length) {
return this.$toast('没有上周的排班信息可以用');
} else {
this.calendarOptions.events = [];
}
if (type == 1 && res.data.noAcceptList.length) {
if (isLoopLast == 1 && res.data.noAcceptList.length) {
this.getCopyData(res.data);
}
this.handleInitData(res.data);
......@@ -427,59 +421,52 @@
}
});
},
handleInitData(data) {
handleInitData(weekData) {
var newDate = null;
if (this.schedulingType != 3) {
newDate = [].concat(data.noAcceptList);
newDate = [].concat(weekData.noAcceptList);
} else {
var acceptList = [];
data.acceptList.forEach((item) => {
weekData.acceptList.forEach((item) => {
item.type = 88;
acceptList.push(item);
});
newDate = [].concat(acceptList, data.noAcceptList);
newDate = [].concat(acceptList, weekData.noAcceptList);
}
newDate.forEach((item) => {
const dataObj = {};
const selectDate = {};
const id = (this.calendarOptions.events.length + 1) * 10;
dataObj['week'] = this.week;
dataObj['id'] = id;
dataObj['end'] = item.endTime;
dataObj['start'] = item.startTime;
dataObj['type'] = item.type;
selectDate['week'] = this.week;
selectDate['id'] = id;
selectDate['end'] = item.endTime;
selectDate['start'] = item.startTime;
selectDate['type'] = item.type;
if (item.type == 88) {
dataObj['color'] = '#FFEDE9';
selectDate['color'] = '#FFEDE9';
}
this.calendarOptions.events.push(dataObj);
this.calendarOptions.events.push(selectDate);
});
this.limmitDateFun();
},
limmitDateFun() {
const list = [];
for (let i = 0; i < 7; i++) {
const obj = {};
const lastObj = {};
const limitTime = {};
const day = dayjs(this.getEveryDay)
.add(i, 'day')
.format('YYYY-MM-DD HH:mm:ss');
obj.start = dayjs(day).add(12, 'hour').format('YYYY-MM-DD HH:mm:ss');
obj.end = dayjs(day).add(13, 'hour').format('YYYY-MM-DD HH:mm:ss');
lastObj.start = dayjs(day)
.add(17, 'hour')
limitTime.start = dayjs(day)
.add(12, 'hour')
.format('YYYY-MM-DD HH:mm:ss');
lastObj.end = dayjs(day).add(18, 'hour').format('YYYY-MM-DD HH:mm:ss');
obj.constraint = 'businessHours';
obj.color = '#ccc';
obj.display = 'background';
obj.editable = false;
lastObj.constraint = 'businessHours';
lastObj.color = '#ccc';
lastObj.display = 'background';
lastObj.editable = false;
this.calendarOptions.events.push(obj);
this.calendarOptions.events.push(lastObj);
}
console.log(list, 'obj', this.getEveryDay);
limitTime.end = dayjs(day)
.add(13, 'hour')
.format('YYYY-MM-DD HH:mm:ss');
limitTime.constraint = 'businessHours';
limitTime.color = '#ccc';
limitTime.display = 'background';
limitTime.editable = false;
this.calendarOptions.events.push(limitTime);
}
console.log('obj', this.getEveryDay);
},
handleDatesSet(dataInfo) {
this.getEveryDay = dayjs(dataInfo.start).format('YYYY-MM-DD HH:mm:ss');
......@@ -488,34 +475,34 @@
const cz = currentTime - getTime; // 每周周一时间戳 - 今天的时间
const oneHour = 1 * 60 * 60 * 1000 * 24; // 一天的时间戳
const timeDifference = (cz / oneHour) | 0; // 每周一时间距离今天时间数量
const headObj = this.calendarOptions.customButtons.myCustomButton;
const weekHeadTitle = this.calendarOptions.customButtons.myCustomButton;
console.log(timeDifference, 'timeDifference', cz / oneHour);
// debugger;
const czCorrert = cz / oneHour;
if (timeDifference == 0 && czCorrert > 0) {
const exactTime = cz / oneHour;
if (timeDifference == 0 && exactTime > 0) {
this.week = 1;
headObj.text = '本周';
weekHeadTitle.text = '本周';
return;
}
if (timeDifference > 0 && timeDifference <= 6) {
// 过去
this.week = 1;
headObj.text = '本周';
weekHeadTitle.text = '本周';
} else if (timeDifference >= -6 && timeDifference <= 0) {
// 未来
this.week = 3;
headObj.text = '下周';
weekHeadTitle.text = '下周';
} else if (timeDifference >= -13 && timeDifference <= -7) {
// 未来
this.week = 4;
headObj.text = '第二周';
weekHeadTitle.text = '第二周';
} else if (timeDifference >= -20 && timeDifference <= -14) {
// 未来
this.week = 5;
headObj.text = '第三周';
weekHeadTitle.text = '第三周';
} else if (timeDifference >= 7) {
// 现在
headObj.text = '上周';
weekHeadTitle.text = '上周';
this.week = 2;
}
},
......@@ -538,20 +525,15 @@
if (!this.calendarOptions.selectable || event.event.constraint) {
return;
}
console.log(event, event, 'iiiieventeventevent');
this.$confirm('你要取消日期吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then((_) => {
}).then((_) => {
console.log(_);
const index = this.getIdDeleteData(event.event.id);
this.isDoIt = true;
this.calendarOptions.events.splice(index, 1);
})
.catch((_) => {
console.log(_);
});
},
eventDrop(event) {
......@@ -592,22 +574,17 @@
const day = dayjs(info.start).date();
const id = day + (this.calendarOptions.events.length + 1) * 10;
info.id = id;
const keyAll = ['end', 'endStr', 'id', 'start', 'startStr', 'week'];
const dataObj = {};
const keyAll = ['end', 'id', 'start', 'week'];
const selectTime = {};
keyAll.forEach((item) => {
if (item == 'week') {
dataObj[item] = this.week;
selectTime[item] = this.week;
} else {
dataObj[item] = info[item];
selectTime[item] = info[item];
}
});
console.log(dataObj, 'dataObjdataObj');
this.calendarOptions.events.push(dataObj);
// this.calendarOptions.events.forEach(item=>{
// if(!item.constraint){
// console.log(item.id);
// }
// });
console.log(selectTime, 'dataObjdataObj');
this.calendarOptions.events.push(selectTime);
},
selectAllow(info) {
this.isDoIt = true;
......@@ -615,10 +592,7 @@
const endDay = new Date(info.end).getDay();
const startHour = dayjs(info.start).hour();
console.log(dayjs(info.start).format('YYYY-MM-DD HH:mm:ss'));
if (startDay != endDay) {
return false;
}
if (startHour == 12 || startHour == 17) {
if (startDay != endDay || startHour == 12) {
return false;
}
const currentDate = new Date();
......@@ -668,29 +642,26 @@
saveDoctoreScheduling(type, weekV = 0) {
if (this.isDoIt) {
this.loading = true;
const objParms = {};
objParms.week = weekV ? weekV : this.week;
objParms.workId = this.schedulingTypeValue.id;
// objParms.list = [];
const saveParms = {};
saveParms.week = weekV ? weekV : this.week;
saveParms.workId = this.schedulingTypeValue.id;
const lastData = [];
const data = this.calendarOptions.events;
console.log('data=======', data);
data.forEach((item) => {
if (item.week == (weekV ? weekV : this.week) && !item.constraint) {
const obj = {};
obj.startTime = this.dateFormat('YYYY-mm-dd HH:MM:SS', item.start);
obj.endTime = this.dateFormat('YYYY-mm-dd HH:MM:SS', item.end);
lastData.push(obj);
const haveSelectDate = this.calendarOptions.events;
haveSelectDate.forEach((item) => {
if (item.week == (weekV ? weekV : this.week)) {
const saveDate = {};
saveDate.startTime = dayjs(item.start).format(
'YYYY-MM-DD HH:mm:ss'
);
saveDate.endTime = dayjs(item.end).format('YYYY-MM-DD HH:mm:ss');
lastData.push(saveDate);
}
});
console.log('objParms=======', objParms);
objParms.list = lastData.filter((item) => {
return (
item.startTime.split(' ')[1] !== '12:00:00' &&
item.startTime.split(' ')[1] !== '17:00:00'
);
console.log('saveParms=======', saveParms);
saveParms.list = lastData.filter((item) => {
return item.startTime.split(' ')[1] !== '12:00:00';
});
saveDutyRoster(objParms).then((res) => {
saveDutyRoster(saveParms).then((res) => {
if (res.code === '000000') {
this.loading = false;
if (type == 1) {
......@@ -707,29 +678,6 @@
});
}
},
dateFormat(fmt, date2) {
const date = new Date(date2);
let ret;
const opt = {
'Y+': date.getFullYear().toString(), // 年
'm+': (date.getMonth() + 1).toString(), // 月
'd+': date.getDate().toString(), // 日
'H+': date.getHours().toString(), // 时
'M+': date.getMinutes().toString(), // 分
'S+': date.getSeconds().toString() || '00', // 秒
// 有其他格式化字符需求可以继续添加,必须转化成字符串
};
for (const k in opt) {
ret = new RegExp('(' + k + ')').exec(fmt);
if (ret) {
fmt = fmt.replace(
ret[1],
ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
);
}
}
return fmt;
},
},
};
</script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册