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

Merge branch 'feature/dxp' into 'develop'

Feature/dxp

See merge request com.pica.cloud.education.frontend/pica-admin-consultation!220
...@@ -253,7 +253,11 @@ ...@@ -253,7 +253,11 @@
created() { created() {
vm = this; vm = this;
this.getDoctorList(); this.getDoctorList();
if (!(this.doctorList || []).some(item => { item.doctorId == this.formData.receptionId;})) { if (
!(this.doctorList || []).some((item) => {
item.doctorId == this.formData.receptionId;
})
) {
this.refreshData(); this.refreshData();
} }
}, },
......
...@@ -146,9 +146,10 @@ ...@@ -146,9 +146,10 @@
const now = new Date(); const now = new Date();
const day = now.getDay(); const day = now.getDay();
const oneDayTime = 24 * 60 * 60 * 1000; const oneDayTime = 24 * 60 * 60 * 1000;
const SundayTime = ((7 - day) * oneDayTime) + 21 * 24 * 60 * 60 * 1000; const SundayTime = (7 - day) * oneDayTime + 21 * 24 * 60 * 60 * 1000;
return ( return (
time.getTime() + 1 * 24 * 60 * 60 * 1000 < new Date() || time.getTime() > new Date().getTime() + SundayTime time.getTime() + 1 * 24 * 60 * 60 * 1000 < new Date() ||
time.getTime() > new Date().getTime() + SundayTime
); );
}, },
}, },
...@@ -183,7 +184,9 @@ ...@@ -183,7 +184,9 @@
const day = now.getDay(); const day = now.getDay();
const SundayTime = 7 - day; const SundayTime = 7 - day;
console.log(SundayTime, 'SundayTime'); console.log(SundayTime, 'SundayTime');
const maxDate = dayjs(new Date()).add((SundayTime + 20), 'day').unix(); const maxDate = dayjs(new Date())
.add(SundayTime + 20, 'day')
.unix();
if (dayjs(this.chooseTime).unix() > maxDate) { if (dayjs(this.chooseTime).unix() > maxDate) {
this.$message({ this.$message({
message: '时间不能超过28天', message: '时间不能超过28天',
......
...@@ -124,8 +124,7 @@ ...@@ -124,8 +124,7 @@
], ],
}, },
allTilst: [], allTilst: [],
allList: { allList: {},
},
}; };
}, },
watch: { watch: {
...@@ -251,7 +250,7 @@ ...@@ -251,7 +250,7 @@
if (checkedNodes.length > 0) { if (checkedNodes.length > 0) {
this.model.triageDepartmentId = checkedNodes[0].value; this.model.triageDepartmentId = checkedNodes[0].value;
this.model.triageDepartment = checkedNodes[0].label; this.model.triageDepartment = checkedNodes[0].label;
}else{ } else {
this.model.triageDepartmentId = ''; this.model.triageDepartmentId = '';
this.model.triageDepartment = ''; this.model.triageDepartment = '';
} }
......
...@@ -532,7 +532,7 @@ ...@@ -532,7 +532,7 @@
getDepartments, getDepartments,
diagnoseExport, diagnoseExport,
diagnoseList, diagnoseList,
departmentAll departmentAll,
} from '@/api/diagnosis'; } from '@/api/diagnosis';
import MatchComponent from '@/components/common/match'; import MatchComponent from '@/components/common/match';
...@@ -658,7 +658,7 @@ ...@@ -658,7 +658,7 @@
triageDepartment: '', triageDepartment: '',
departmentId: '', departmentId: '',
allTilst: [], allTilst: [],
allList: {} allList: {},
}; };
}, },
watch: { watch: {
...@@ -734,10 +734,13 @@ ...@@ -734,10 +734,13 @@
const checkedNodes = this.$refs['cascader'].getCheckedNodes(); const checkedNodes = this.$refs['cascader'].getCheckedNodes();
if (checkedNodes.length > 0) { if (checkedNodes.length > 0) {
this.searchParam.triageDepartmentId = checkedNodes[0].value; this.searchParam.triageDepartmentId = checkedNodes[0].value;
}else{ } else {
this.searchParam.triageDepartmentId = ''; this.searchParam.triageDepartmentId = '';
} }
console.log(this.searchParam.triageDepartmentId, 'this.searchParam.triageDepartmentId'); console.log(
this.searchParam.triageDepartmentId,
'this.searchParam.triageDepartmentId'
);
}, },
changeStartTime(time) { changeStartTime(time) {
this.rangeTimeData = time this.rangeTimeData = time
......
.agment-box { .schedul-box {
width: 100%;
height: auto;
position: relative;
display: flex;
justify-content: space-between;
.agment-box {
height: 100%; height: 100%;
background: #fff; background: #fff;
overflow: hidden; overflow: hidden;
padding: 20px; padding: 20px;
border-radius: 6px; border-radius: 6px;
flex: 3.8; flex: 3.8;
} }
.setMaxNum { .setMaxNum {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
} }
.input-value { .input-value {
width: 100px; width: 100px;
/deep/.el-input-number__decrease { /deep/.el-input-number__decrease {
width: 20px; width: 20px;
...@@ -21,42 +27,42 @@ ...@@ -21,42 +27,42 @@
/deep/.el-input__inner { /deep/.el-input__inner {
padding: 0; padding: 0;
} }
} }
.list-item { .list-item {
width: 86px; width: 86px;
height: 25px; height: 25px;
background: #ffffff; background: #ffffff;
border-radius: 16px; border-radius: 16px;
border: 1px solid rgba(0, 0, 0, 0.15); border: 1px solid rgba(0, 0, 0, 0.15);
text-align: center; text-align: center;
} }
.list-item-noth { .list-item-noth {
width: 86px; width: 86px;
height: 25px; height: 25px;
background: red; background: red;
border-radius: 16px; border-radius: 16px;
border: 1px solid rgba(0, 0, 0, 0.15); border: 1px solid rgba(0, 0, 0, 0.15);
text-align: center; text-align: center;
} }
.w2 { .w2 {
/deep/.fc-prev-button { /deep/.fc-prev-button {
background: #f4f4f5; background: #f4f4f5;
cursor: not-allowed; cursor: not-allowed;
border: 1px solid #d9d9d9; border: 1px solid #d9d9d9;
} }
} }
.w3 { .w3 {
/deep/.fc-next-button { /deep/.fc-next-button {
background: #f4f4f5; background: #f4f4f5;
border: 1px solid #d9d9d9; border: 1px solid #d9d9d9;
cursor: not-allowed; cursor: not-allowed;
} }
} }
/deep/.fc-timegrid-event-harness { /deep/.fc-timegrid-event-harness {
// position: absolute !important; // position: absolute !important;
left: 0 !important; left: 0 !important;
} }
.agment-box-left { .agment-box-left {
flex: 1; flex: 1;
height: 100%; height: 100%;
margin-left: 12px; margin-left: 12px;
...@@ -65,8 +71,8 @@ ...@@ -65,8 +71,8 @@
text-align: center; text-align: center;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.el-dialog-show { .el-dialog-show {
.set-agment-maxNum { .set-agment-maxNum {
.first-show-num { .first-show-num {
text-align: center; text-align: center;
...@@ -92,8 +98,8 @@ ...@@ -92,8 +98,8 @@
} }
} }
} }
} }
.ag-left-change { .ag-left-change {
// position: relative; // position: relative;
// border:1px solid #ccc; // border:1px solid #ccc;
// height:40px; // height:40px;
...@@ -114,25 +120,18 @@ ...@@ -114,25 +120,18 @@
right: 1%; right: 1%;
top: 18px; top: 18px;
} }
} }
.show-work-set { .show-work-set {
margin-top: 100px; margin-top: 100px;
padding: 10px; }
} .agment-left-con {
.agment-left-con {
padding: 15px; padding: 15px;
text-align: center; text-align: center;
background: #f2f2f2; background: #f2f2f2;
border-radius: 12px; border-radius: 12px;
}
.maxNum-first-show {
padding: 20px 15px 5px 15px;
.show-sep-num {
color: red;
} }
} .reset-doctor-schedu {
.reset-doctor-schedu { padding: 30px 15px 5px 15px;
padding: 10px 15px 5px 15px;
text-align: center; text-align: center;
.copy-submit { .copy-submit {
background: #fff; background: #fff;
...@@ -142,8 +141,8 @@ ...@@ -142,8 +141,8 @@
font-weight: 400; font-weight: 400;
color: #0d9078; color: #0d9078;
} }
} }
.copy-doctor-schedu { .copy-doctor-schedu {
padding: 5px; padding: 5px;
margin: 0 auto; margin: 0 auto;
text-align: center; text-align: center;
...@@ -155,8 +154,8 @@ ...@@ -155,8 +154,8 @@
font-weight: 400; font-weight: 400;
color: #0d9078; color: #0d9078;
} }
} }
.agment-left-copy { .agment-left-copy {
padding: 5px; padding: 5px;
margin: 0 auto; margin: 0 auto;
text-align: center; text-align: center;
...@@ -182,8 +181,8 @@ ...@@ -182,8 +181,8 @@
cursor: pointer; cursor: pointer;
} }
} }
} }
.first-left-max { .first-left-max {
padding: 5px; padding: 5px;
margin: 0 auto; margin: 0 auto;
text-align: center; text-align: center;
...@@ -192,51 +191,51 @@ ...@@ -192,51 +191,51 @@
font-weight: 400; font-weight: 400;
color: #0d9078; color: #0d9078;
cursor: pointer; cursor: pointer;
} }
.agment-head { .agment-head {
border-radius: 5px; border-radius: 5px;
text-align: center; text-align: center;
} }
.agment-head-name { .agment-head-name {
font-size: 20px; font-size: 20px;
color: #02120f; color: #02120f;
font-weight: 600; font-weight: 600;
padding: 3px; padding: 3px;
} }
.agment-head-phone { .agment-head-phone {
font-size: 18px; font-size: 18px;
margin-left: 16px; margin-left: 16px;
} }
.agment-hospital { .agment-hospital {
color: #89888b; color: #89888b;
font-size: 16px; font-size: 16px;
margin-top: 10px; margin-top: 10px;
} }
.agment-hospital-show { .agment-hospital-show {
margin-right: 10px; margin-right: 10px;
} }
.agment-hospital-ks { .agment-hospital-ks {
margin-top: 8px; margin-top: 8px;
} }
.agment-head-title { .agment-head-title {
font-size: 14px; font-size: 14px;
color: #02120f; color: #02120f;
margin-top: 19px; margin-top: 19px;
} }
.agment-head-none { .agment-head-none {
background: #fff; background: #fff;
pointer-events: none; pointer-events: none;
} }
.new-max { .new-max {
text-align: center; text-align: center;
margin-top: 20px; margin-top: 20px;
} }
.new-max-none { .new-max-none {
text-align: center; text-align: center;
margin-top: 20px; margin-top: 20px;
pointer-events: none; pointer-events: none;
} }
.agment-head-priority { .agment-head-priority {
padding-top: 20px; padding-top: 20px;
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -256,64 +255,64 @@ ...@@ -256,64 +255,64 @@
background: #0d9078; background: #0d9078;
border: none; border: none;
} }
} }
.agment-left-button { .agment-left-button {
margin-top: 34px; margin-top: 34px;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.copy-submit { .copy-submit {
background: #0d9078; background: #0d9078;
border: 1px solid #0d9078; border: 1px solid #0d9078;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #ffffff; color: #ffffff;
} }
.reset-submit { .reset-submit {
background: #fff; background: #fff;
border: 1px solid #0d9078; border: 1px solid #0d9078;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #0d9078; color: #0d9078;
} }
/deep/.fc-timegrid-event { /deep/.fc-timegrid-event {
border-radius: 1px !important; border-radius: 1px !important;
} }
/deep/thead .fc-scroller-harness { /deep/thead .fc-scroller-harness {
background: #fcfbff; background: #fcfbff;
} }
/deep/.fc-col-header-cell-cushion { /deep/.fc-col-header-cell-cushion {
color: #333; color: #333;
height: 45px; height: 45px;
line-height: 45px; line-height: 45px;
} }
/deep/.fc .fc-highlight { /deep/.fc .fc-highlight {
background: transparent; background: transparent;
} }
/deep/.fc-header-toolbar { /deep/.fc-header-toolbar {
position: absolute; position: absolute;
right: 0; right: 0;
top: 15px; top: 15px;
padding: 20px; padding: 20px;
width: 20%; width: 20%;
} }
/deep/.fc-toolbar-title { /deep/.fc-toolbar-title {
font-size: 6px; font-size: 6px;
} }
/deep/.fc-toolbar-chunk { /deep/.fc-toolbar-chunk {
display: flex; display: flex;
} }
/deep/.fc-button-primary { /deep/.fc-button-primary {
background: #fff; background: #fff;
color: #02120f; color: #02120f;
border-color: #d9d9d9; border-color: #d9d9d9;
border-radius: 20px; border-radius: 20px;
padding: 6px 16px; padding: 6px 16px;
flex-shrink: 0; 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 { /deep/.fc-header-toolbar {
right: 3%; right: 6%;
} }
.ag-left1 { .ag-left1 {
width: 12% !important; width: 12% !important;
...@@ -324,22 +323,22 @@ ...@@ -324,22 +323,22 @@
width: 12% !important; width: 12% !important;
right: 1% !important; right: 1% !important;
} }
} }
/deep/.fc-myCustomButton-button { /deep/.fc-myCustomButton-button {
padding: 6px 24px; padding: 6px 24px;
} }
/deep/.fc-button-primary:hover { /deep/.fc-button-primary:hover {
background: #fff; background: #fff;
color: #02120f; color: #02120f;
border: 1px solid #0d9078; border: 1px solid #0d9078;
} }
/deep/.fc-event-time { /deep/.fc-event-time {
font-size: 14px; font-size: 14px;
color: #0d9078; color: #0d9078;
word-wrap: break-word; word-wrap: break-word;
white-space: normal; white-space: normal;
} }
/deep/.fc-col-header-cell-cushion { /deep/.fc-col-header-cell-cushion {
background: #fff; background: #fff;
border: 1px solid #0d9078; border: 1px solid #0d9078;
color: #0d9078; color: #0d9078;
...@@ -349,7 +348,8 @@ ...@@ -349,7 +348,8 @@
font-size: 14px; font-size: 14px;
margin: 10px 0; margin: 10px 0;
text-decoration: none; text-decoration: none;
} }
/deep/a:hover { /deep/a:hover {
text-decoration: none; text-decoration: none;
}
} }
<template> <template>
<div <div
v-loading="loading" v-loading="loading"
style=" class="schedul-box"
width: 100%;
height: auto;
position: relative;
display: flex;
justifycontent: space-between;
"
> >
<div <div
ref="agment" ref="agment"
...@@ -166,7 +160,7 @@ ...@@ -166,7 +160,7 @@
getLevelAndDayCount, getLevelAndDayCount,
} from '@/api/serviceSchedule'; } from '@/api/serviceSchedule';
export default { export default {
name: 'Index', name: 'Scheduing',
components: { components: {
FullCalendar, FullCalendar,
}, },
...@@ -194,7 +188,6 @@ ...@@ -194,7 +188,6 @@
selectOverlap: false, selectOverlap: false,
select: this.selectInfo, select: this.selectInfo,
selectMinDistance: 0, selectMinDistance: 0,
eventResize: this.eventResize,
eventOverlap: false, eventOverlap: false,
navLinks: true, navLinks: true,
navLinkDayClick: this.navLinkDayClick, navLinkDayClick: this.navLinkDayClick,
...@@ -259,7 +252,7 @@ ...@@ -259,7 +252,7 @@
scrollerHeight: 0, scrollerHeight: 0,
loading: false, loading: false,
isDoIt: false, isDoIt: false,
getEveryDay: '', getStartWeek: '',
copyArr: [], copyArr: [],
centerDialogVisible: false, centerDialogVisible: false,
maxNumValue: '', maxNumValue: '',
...@@ -277,7 +270,6 @@ ...@@ -277,7 +270,6 @@
if (newV !== oldV) { if (newV !== oldV) {
this.handleInitSearch(); this.handleInitSearch();
this.saveDoctoreScheduling(2, oldV); this.saveDoctoreScheduling(2, oldV);
// this.getLevelAndDayCount(newV);
} }
}, },
}, },
...@@ -301,7 +293,6 @@ ...@@ -301,7 +293,6 @@
}, },
mounted() { mounted() {
this.scrollerHeight = this.$refs.agment.clientHeight + 'px'; this.scrollerHeight = this.$refs.agment.clientHeight + 'px';
// this.scrollerHeight = 400 + 'px';
this.init(); this.init();
}, },
methods: { methods: {
...@@ -314,6 +305,7 @@ ...@@ -314,6 +305,7 @@
* view是当前视图对象。 * view是当前视图对象。
*/ */
init() { init() {
// schedulingType 1,2 表示编辑新加,其他表示查看
if (this.schedulingType == 1 || this.schedulingType == 2) { if (this.schedulingType == 1 || this.schedulingType == 2) {
this.calendarOptions.editable = true; this.calendarOptions.editable = true;
} else { } else {
...@@ -347,17 +339,17 @@ ...@@ -347,17 +339,17 @@
selectDate = dayjs(selectDate).unix(); selectDate = dayjs(selectDate).unix();
const nowDate = dayjs(new Date()).unix(); const nowDate = dayjs(new Date()).unix();
let isAddAllDay = true; let isAddAllDay = true;
const data = this.calendarOptions.events; const haveSelectDate = this.calendarOptions.events;
const len = data.length; const len = haveSelectDate.length;
const cz = ((nowDate - selectDate) / 3600) | 0; const differenceTime = ((nowDate - selectDate) / 3600) | 0;
if (cz > 0 && cz >= 24) { if (differenceTime > 0 && differenceTime >= 24) {
return this.$message.info('你不能添加过去的时间的排班'); return this.$message.info('你不能添加过去的时间的排班');
} }
for (var i = 0; i < len; i++) { for (var i = 0; i < len; i++) {
const itemDay = dayjs(data[i].start).day(); const itemDay = dayjs(haveSelectDate[i].start).day();
if (!data[i].constraint && day === itemDay) { if (!haveSelectDate[i].constraint && day === itemDay) {
data[i].allStatus && (isAddAllDay = false); haveSelectDate[i].allStatus && (isAddAllDay = false);
const index = this.getIdDeleteData(data[i].id); const index = this.getIdDeleteData(haveSelectDate[i].id);
this.isDoIt = true; this.isDoIt = true;
this.calendarOptions.events.splice(index, 1); this.calendarOptions.events.splice(index, 1);
i--; i--;
...@@ -365,49 +357,50 @@ ...@@ -365,49 +357,50 @@
} }
if (isAddAllDay) { if (isAddAllDay) {
// 添加日期 // 添加日期
const list = [ const selectAllDay = [
{ startTime: '09:00:00', endTime: '12:00:00' }, { startTime: '09:00:00', endTime: '12:00:00' },
{ startTime: '13:00:00', endTime: '17:00:00' }, { startTime: '13:00:00', endTime: '21:00:00' },
{ startTime: '18:00:00', endTime: '21:00:00' },
]; ];
list.forEach((item) => { selectAllDay.forEach((item) => {
const obj = {}; const allDayData = {};
obj.id = dayDate + (this.calendarOptions.events.length + 1) * 10; allDayData.id =
obj.week = this.week; dayDate + (this.calendarOptions.events.length + 1) * 10;
obj.end = dayFormat + ' ' + item.endTime; allDayData.week = this.week;
obj.start = dayFormat + ' ' + item.startTime; allDayData.end = dayFormat + ' ' + item.endTime;
obj.allStatus = true; allDayData.start = dayFormat + ' ' + item.startTime;
console.log(obj); allDayData.allStatus = true;
this.calendarOptions.events.push(obj); console.log(allDayData);
this.calendarOptions.events.push(allDayData);
}); });
this.isDoIt = true; this.isDoIt = true;
} }
}, },
getCopyData(data) { getCopyData(lastWeekData) {
const copyList = []; const copyDate = [];
const addDay = 7; const addDay = 7;
data.noAcceptList.map((item) => { lastWeekData.noAcceptList.map((item) => {
const obj = {}; const nowWeekTime = {};
obj['startTime'] = dayjs(item.startTime) nowWeekTime['startTime'] = dayjs(item.startTime)
.add(addDay, 'day') .add(addDay, 'day')
.format('YYYY-MM-DD HH:mm:ss'); .format('YYYY-MM-DD HH:mm:ss');
obj['endTime'] = dayjs(item.endTime) nowWeekTime['endTime'] = dayjs(item.endTime)
.add(addDay, 'day') .add(addDay, 'day')
.format('YYYY-MM-DD HH:mm:ss'); .format('YYYY-MM-DD HH:mm:ss');
copyList.push(obj); copyDate.push(nowWeekTime);
}); });
this.calendarOptions.events = []; this.calendarOptions.events = [];
data.noAcceptList = copyList; lastWeekData.noAcceptList = copyDate;
this.isDoIt = true; this.isDoIt = true;
}, },
handleInitSearch(isReset, type) { handleInitSearch(isReset, isLoopLast) {
if (isReset && type != 1) { //
if (isReset && isLoopLast != 1) {
this.calendarOptions.events = this.calendarOptions.events.filter( this.calendarOptions.events = this.calendarOptions.events.filter(
(v) => v.week !== this.week (v) => v.week !== this.week
); );
} }
let copyWeek = ''; let copyWeek = '';
if (type == 1) { if (isLoopLast == 1) {
if (this.week == 1) { if (this.week == 1) {
copyWeek = 2; copyWeek = 2;
} else if (this.week == 3) { } else if (this.week == 3) {
...@@ -418,20 +411,20 @@ ...@@ -418,20 +411,20 @@
copyWeek = 4; copyWeek = 4;
} }
} }
const objParms = {}; const searchLastWeek = {};
objParms.doctorId = this.doctorId; searchLastWeek.doctorId = this.doctorId;
objParms.week = type == 1 ? copyWeek : this.week; searchLastWeek.week = isLoopLast == 1 ? copyWeek : this.week;
// type == 1 表示 copy // isLoopLast == 1 表示 copy
objParms.workId = this.id; searchLastWeek.workId = this.id;
dutyRosterQuery(objParms).then((res) => { dutyRosterQuery(searchLastWeek).then((res) => {
if (res.code == '000000') { if (res.code == '000000') {
console.log(res.data.noAcceptList, 'res.data.noAcceptList'); 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('没有上周的排班信息可以用'); return this.$toast('没有上周的排班信息可以用');
} else { } else {
this.calendarOptions.events = []; this.calendarOptions.events = [];
} }
if (type == 1 && res.data.noAcceptList.length) { if (isLoopLast == 1 && res.data.noAcceptList.length) {
this.getCopyData(res.data); this.getCopyData(res.data);
} }
this.handleInitData(res.data); this.handleInitData(res.data);
...@@ -440,59 +433,52 @@ ...@@ -440,59 +433,52 @@
} }
}); });
}, },
handleInitData(data) { handleInitData(weekData) {
var newDate = null; var newDate = null;
if (this.schedulingType != 3) { if (this.schedulingType != 3) {
newDate = [].concat(data.noAcceptList); newDate = [].concat(weekData.noAcceptList);
} else { } else {
var acceptList = []; var acceptList = [];
data.acceptList.forEach((item) => { weekData.acceptList.forEach((item) => {
item.type = 88; item.type = 88;
acceptList.push(item); acceptList.push(item);
}); });
newDate = [].concat(acceptList, data.noAcceptList); newDate = [].concat(acceptList, weekData.noAcceptList);
} }
newDate.forEach((item) => { newDate.forEach((item) => {
const dataObj = {}; const selectDate = {};
const id = (this.calendarOptions.events.length + 1) * 10; const id = (this.calendarOptions.events.length + 1) * 10;
dataObj['week'] = this.week; selectDate['week'] = this.week;
dataObj['id'] = id; selectDate['id'] = id;
dataObj['end'] = item.endTime; selectDate['end'] = item.endTime;
dataObj['start'] = item.startTime; selectDate['start'] = item.startTime;
dataObj['type'] = item.type; selectDate['type'] = item.type;
if (item.type == 88) { if (item.type == 88) {
dataObj['color'] = '#FFEDE9'; selectDate['color'] = '#FFEDE9';
} }
this.calendarOptions.events.push(dataObj); this.calendarOptions.events.push(selectDate);
}); });
this.limmitDateFun(); this.limmitDateFun();
}, },
limmitDateFun() { limmitDateFun() {
const list = [];
for (let i = 0; i < 7; i++) { for (let i = 0; i < 7; i++) {
const obj = {}; const limitTime = {};
const lastObj = {};
const day = dayjs(this.getEveryDay) const day = dayjs(this.getEveryDay)
.add(i, 'day') .add(i, 'day')
.format('YYYY-MM-DD HH:mm:ss'); .format('YYYY-MM-DD HH:mm:ss');
obj.start = dayjs(day).add(12, 'hour').format('YYYY-MM-DD HH:mm:ss'); limitTime.start = dayjs(day)
obj.end = dayjs(day).add(13, 'hour').format('YYYY-MM-DD HH:mm:ss'); .add(12, 'hour')
lastObj.start = dayjs(day)
.add(17, 'hour')
.format('YYYY-MM-DD HH:mm:ss'); .format('YYYY-MM-DD HH:mm:ss');
lastObj.end = dayjs(day).add(18, 'hour').format('YYYY-MM-DD HH:mm:ss'); limitTime.end = dayjs(day)
obj.constraint = 'businessHours'; .add(13, 'hour')
obj.color = '#ccc'; .format('YYYY-MM-DD HH:mm:ss');
obj.display = 'background'; limitTime.constraint = 'businessHours';
obj.editable = false; limitTime.color = '#ccc';
lastObj.constraint = 'businessHours'; limitTime.display = 'background';
lastObj.color = '#ccc'; limitTime.editable = false;
lastObj.display = 'background'; this.calendarOptions.events.push(limitTime);
lastObj.editable = false;
this.calendarOptions.events.push(obj);
this.calendarOptions.events.push(lastObj);
} }
console.log(list, 'obj', this.getEveryDay); console.log('obj', this.getEveryDay);
}, },
handleDatesSet(dataInfo) { handleDatesSet(dataInfo) {
this.getEveryDay = dayjs(dataInfo.start).format('YYYY-MM-DD HH:mm:ss'); this.getEveryDay = dayjs(dataInfo.start).format('YYYY-MM-DD HH:mm:ss');
...@@ -501,32 +487,34 @@ ...@@ -501,32 +487,34 @@
const cz = currentTime - getTime; // 每周周一时间戳 - 今天的时间 const cz = currentTime - getTime; // 每周周一时间戳 - 今天的时间
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 weekHeadTitle = this.calendarOptions.customButtons.myCustomButton;
const czCorrert = cz / oneHour; console.log(timeDifference, 'timeDifference', cz / oneHour);
if (timeDifference == 0 && czCorrert > 0) { // debugger;
const exactTime = cz / oneHour;
if (timeDifference == 0 && exactTime > 0) {
this.week = 1; this.week = 1;
headObj.text = '本周'; weekHeadTitle.text = '本周';
return; return;
} }
if (timeDifference > 0 && timeDifference <= 6) { if (timeDifference > 0 && timeDifference <= 6) {
// 过去 // 过去
this.week = 1; this.week = 1;
headObj.text = '本周'; weekHeadTitle.text = '本周';
} else if (timeDifference >= -6 && timeDifference <= 0) { } else if (timeDifference >= -6 && timeDifference <= 0) {
// 未来 // 未来
this.week = 3; this.week = 3;
headObj.text = '下周'; weekHeadTitle.text = '下周';
} else if (timeDifference >= -13 && timeDifference <= -7) { } else if (timeDifference >= -13 && timeDifference <= -7) {
// 未来 // 未来
this.week = 4; this.week = 4;
headObj.text = '第三周 '; weekHeadTitle.text = '第二周';
} else if (timeDifference >= -20 && timeDifference <= -14) { } else if (timeDifference >= -20 && timeDifference <= -14) {
// 未来 // 未来
this.week = 5; this.week = 5;
headObj.text = '第四周'; weekHeadTitle.text = '第三周';
} else if (timeDifference >= 7) { } else if (timeDifference >= 7) {
// 现在 // 现在
headObj.text = '上周'; weekHeadTitle.text = '上周';
this.week = 2; this.week = 2;
} }
}, },
...@@ -549,20 +537,15 @@ ...@@ -549,20 +537,15 @@
if (!this.calendarOptions.selectable || event.event.constraint) { if (!this.calendarOptions.selectable || event.event.constraint) {
return; return;
} }
console.log(event, event, 'iiiieventeventevent');
this.$confirm('你要取消日期吗?', '提示', { this.$confirm('你要取消日期吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}) }).then((_) => {
.then((_) => {
console.log(_); console.log(_);
const index = this.getIdDeleteData(event.event.id); const index = this.getIdDeleteData(event.event.id);
this.isDoIt = true; this.isDoIt = true;
this.calendarOptions.events.splice(index, 1); this.calendarOptions.events.splice(index, 1);
})
.catch((_) => {
console.log(_);
}); });
}, },
eventDrop(event) { eventDrop(event) {
...@@ -598,22 +581,17 @@ ...@@ -598,22 +581,17 @@
const day = dayjs(info.start).date(); const day = dayjs(info.start).date();
const id = day + (this.calendarOptions.events.length + 1) * 10; const id = day + (this.calendarOptions.events.length + 1) * 10;
info.id = id; info.id = id;
const keyAll = ['end', 'endStr', 'id', 'start', 'startStr', 'week']; const keyAll = ['end', 'id', 'start', 'week'];
const dataObj = {}; const selectTime = {};
keyAll.forEach((item) => { keyAll.forEach((item) => {
if (item == 'week') { if (item == 'week') {
dataObj[item] = this.week; selectTime[item] = this.week;
} else { } else {
dataObj[item] = info[item]; selectTime[item] = info[item];
} }
}); });
console.log(dataObj, 'dataObjdataObj'); console.log(selectTime, 'dataObjdataObj');
this.calendarOptions.events.push(dataObj); this.calendarOptions.events.push(selectTime);
// this.calendarOptions.events.forEach(item=>{
// if(!item.constraint){
// console.log(item.id);
// }
// });
}, },
selectAllow(info) { selectAllow(info) {
this.isDoIt = true; this.isDoIt = true;
...@@ -621,10 +599,7 @@ ...@@ -621,10 +599,7 @@
const endDay = new Date(info.end).getDay(); const endDay = new Date(info.end).getDay();
const startHour = dayjs(info.start).hour(); const startHour = dayjs(info.start).hour();
console.log(dayjs(info.start).format('YYYY-MM-DD HH:mm:ss')); console.log(dayjs(info.start).format('YYYY-MM-DD HH:mm:ss'));
if (startDay != endDay) { if (startDay != endDay || startHour == 12) {
return false;
}
if (startHour == 12 || startHour == 17) {
return false; return false;
} }
const currentDate = new Date(); const currentDate = new Date();
...@@ -642,24 +617,24 @@ ...@@ -642,24 +617,24 @@
// 对于排班交叉部分处理 // 对于排班交叉部分处理
const infoStart = new Date(info.start).getTime(); const infoStart = new Date(info.start).getTime();
const infoEnd = new Date(info.end).getTime(); const infoEnd = new Date(info.end).getTime();
const data = this.calendarOptions.events; const haveSelectTime = this.calendarOptions.events;
const newDate = []; const correctDate = [];
let indexObj = false; let isRepeat = false;
data.forEach((item) => { haveSelectTime.forEach((item) => {
const d = new Date(item.end).getTime(); const selectEndTime = new Date(item.end).getTime();
const s = new Date(item.start).getTime(); const selectStartTime = new Date(item.start).getTime();
if (s > infoStart && infoEnd >= d) { if (selectStartTime > infoStart && infoEnd >= selectEndTime) {
indexObj = true; isRepeat = true;
} else if (s > infoStart && infoEnd >= s) { } else if (selectStartTime > infoStart && infoEnd >= selectStartTime) {
indexObj = true; isRepeat = true;
} else { } else {
const id = (newDate.length + 1) * 10; const id = (correctDate.length + 1) * 10;
item.id = id; item.id = id;
newDate.push(item); correctDate.push(item);
} }
}); });
this.calendarOptions.events = newDate; this.calendarOptions.events = correctDate;
return indexObj; return isRepeat;
}, },
handlePriority(index) { handlePriority(index) {
this.isDoIt = true; this.isDoIt = true;
...@@ -674,28 +649,26 @@ ...@@ -674,28 +649,26 @@
saveDoctoreScheduling(type, weekV = 0) { saveDoctoreScheduling(type, weekV = 0) {
if (this.isDoIt) { if (this.isDoIt) {
this.loading = true; this.loading = true;
const objParms = {}; const saveParms = {};
objParms.week = weekV ? weekV : this.week; saveParms.week = weekV ? weekV : this.week;
objParms.workId = this.schedulingTypeValue.id; saveParms.workId = this.schedulingTypeValue.id;
const lastData = []; const lastData = [];
const data = this.calendarOptions.events; const haveSelectDate = this.calendarOptions.events;
console.log('data=======', data); haveSelectDate.forEach((item) => {
data.forEach((item) => { if (item.week == (weekV ? weekV : this.week)) {
if (item.week == (weekV ? weekV : this.week) && !item.constraint) { const saveDate = {};
const obj = {}; saveDate.startTime = dayjs(item.start).format(
obj.startTime = this.dateFormat('YYYY-mm-dd HH:MM:SS', item.start); 'YYYY-MM-DD HH:mm:ss'
obj.endTime = this.dateFormat('YYYY-mm-dd HH:MM:SS', item.end); );
lastData.push(obj); saveDate.endTime = dayjs(item.end).format('YYYY-MM-DD HH:mm:ss');
lastData.push(saveDate);
} }
}); });
console.log('objParms=======', objParms); console.log('saveParms=======', saveParms);
objParms.list = lastData.filter((item) => { saveParms.list = lastData.filter((item) => {
return ( return item.startTime.split(' ')[1] !== '12:00:00';
item.startTime.split(' ')[1] !== '12:00:00' &&
item.startTime.split(' ')[1] !== '17:00:00'
);
}); });
saveDutyRoster(objParms).then((res) => { saveDutyRoster(saveParms).then((res) => {
if (res.code === '000000') { if (res.code === '000000') {
this.loading = false; this.loading = false;
this.$message({ this.$message({
...@@ -716,29 +689,6 @@ ...@@ -716,29 +689,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> </script>
......
...@@ -268,7 +268,7 @@ ...@@ -268,7 +268,7 @@
const checkedNodes = this.$refs['cascader'].getCheckedNodes(); const checkedNodes = this.$refs['cascader'].getCheckedNodes();
if (checkedNodes.length > 0) { if (checkedNodes.length > 0) {
this.departmentId = checkedNodes[0].value; this.departmentId = checkedNodes[0].value;
}else{ } else {
this.departmentId = ''; this.departmentId = '';
} }
}, },
......
...@@ -284,7 +284,7 @@ ...@@ -284,7 +284,7 @@
const checkedNodes = this.$refs['cascader'].getCheckedNodes(); const checkedNodes = this.$refs['cascader'].getCheckedNodes();
if (checkedNodes.length > 0) { if (checkedNodes.length > 0) {
this.searchParam.departmentId = checkedNodes[0].value; this.searchParam.departmentId = checkedNodes[0].value;
}else{ } else {
this.searchParam.departmentId = ''; this.searchParam.departmentId = '';
} }
}, },
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册