提交 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 @@
created() {
vm = this;
this.getDoctorList();
if (!(this.doctorList || []).some(item => { item.doctorId == this.formData.receptionId;})) {
if (
!(this.doctorList || []).some((item) => {
item.doctorId == this.formData.receptionId;
})
) {
this.refreshData();
}
},
......
......@@ -143,12 +143,13 @@
chooseTimeIndex: 1000,
pickerOptionsStart: {
disabledDate: (time) => {
const now = new Date();
const now = new Date();
const day = now.getDay();
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 (
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
);
},
},
......@@ -179,11 +180,13 @@
this.getLeisureTime(this.chooseTime);
},
nextChangeData() {
const now = new Date();
const now = new Date();
const day = now.getDay();
const SundayTime = 7 - day;
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) {
this.$message({
message: '时间不能超过28天',
......@@ -232,7 +235,7 @@
})
.catch(function () {
vm.isClick = false;
// vm.$message.error(err.message);
// vm.$message.error(err.message);
});
},
cancel() {
......
......@@ -124,8 +124,7 @@
],
},
allTilst: [],
allList: {
},
allList: {},
};
},
watch: {
......@@ -251,7 +250,7 @@
if (checkedNodes.length > 0) {
this.model.triageDepartmentId = checkedNodes[0].value;
this.model.triageDepartment = checkedNodes[0].label;
}else{
} else {
this.model.triageDepartmentId = '';
this.model.triageDepartment = '';
}
......
......@@ -532,7 +532,7 @@
getDepartments,
diagnoseExport,
diagnoseList,
departmentAll
departmentAll,
} from '@/api/diagnosis';
import MatchComponent from '@/components/common/match';
......@@ -658,7 +658,7 @@
triageDepartment: '',
departmentId: '',
allTilst: [],
allList: {}
allList: {},
};
},
watch: {
......@@ -676,7 +676,7 @@
},
created() {
vm = this;
// this.getDep();
// this.getDep();
},
mounted() {
this.setTableHeight();
......@@ -729,15 +729,18 @@
console.log(arr);
this.allTilst = arr;
},
},
changeDepart() {
const checkedNodes = this.$refs['cascader'].getCheckedNodes();
if (checkedNodes.length > 0) {
this.searchParam.triageDepartmentId = checkedNodes[0].value;
}else{
} else {
this.searchParam.triageDepartmentId = '';
}
console.log(this.searchParam.triageDepartmentId, 'this.searchParam.triageDepartmentId');
console.log(
this.searchParam.triageDepartmentId,
'this.searchParam.triageDepartmentId'
);
},
changeStartTime(time) {
this.rangeTimeData = time
......
.agment-box {
height: 100%;
background: #fff;
overflow: hidden;
padding: 20px;
border-radius: 6px;
flex: 3.8;
}
.setMaxNum {
.schedul-box {
width: 100%;
height: auto;
position: relative;
display: flex;
justify-content: space-around;
}
.input-value {
width: 100px;
/deep/.el-input-number__decrease {
width: 20px;
justify-content: space-between;
.agment-box {
height: 100%;
background: #fff;
overflow: hidden;
padding: 20px;
border-radius: 6px;
flex: 3.8;
}
/deep/.el-input-number__increase {
width: 20px;
.setMaxNum {
display: flex;
justify-content: space-around;
}
/deep/.el-input__inner {
padding: 0;
.input-value {
width: 100px;
/deep/.el-input-number__decrease {
width: 20px;
}
/deep/.el-input-number__increase {
width: 20px;
}
/deep/.el-input__inner {
padding: 0;
}
}
}
.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 {
width: 86px;
height: 25px;
background: red;
border-radius: 16px;
border: 1px solid rgba(0, 0, 0, 0.15);
text-align: center;
}
.w2 {
/deep/.fc-prev-button {
background: #f4f4f5;
cursor: not-allowed;
border: 1px solid #d9d9d9;
.list-item {
width: 86px;
height: 25px;
background: #ffffff;
border-radius: 16px;
border: 1px solid rgba(0, 0, 0, 0.15);
text-align: center;
}
}
.w3 {
/deep/.fc-next-button {
background: #f4f4f5;
border: 1px solid #d9d9d9;
cursor: not-allowed;
.list-item-noth {
width: 86px;
height: 25px;
background: red;
border-radius: 16px;
border: 1px solid rgba(0, 0, 0, 0.15);
text-align: center;
}
}
/deep/.fc-timegrid-event-harness {
// position: absolute !important;
left: 0 !important;
}
.agment-box-left {
flex: 1;
height: 100%;
margin-left: 12px;
background: #fff;
border-radius: 6px;
text-align: center;
display: flex;
justify-content: center;
}
.el-dialog-show {
.set-agment-maxNum {
.first-show-num {
text-align: center;
padding-bottom: 30px;
.w2 {
/deep/.fc-prev-button {
background: #f4f4f5;
cursor: not-allowed;
border: 1px solid #d9d9d9;
}
.num-max {
text-align: center;
.hour-num-title {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #02120f;
}
.w3 {
/deep/.fc-next-button {
background: #f4f4f5;
border: 1px solid #d9d9d9;
cursor: not-allowed;
}
}
/deep/.fc-timegrid-event-harness {
// position: absolute !important;
left: 0 !important;
}
.agment-box-left {
flex: 1;
height: 100%;
margin-left: 12px;
background: #fff;
border-radius: 6px;
text-align: center;
display: flex;
justify-content: center;
}
.el-dialog-show {
.set-agment-maxNum {
.first-show-num {
text-align: center;
padding-bottom: 30px;
}
.num-input-show {
padding-top: 10px;
.el-input {
width: 50%;
/deep/.el-input__inner {
border-radius: 20px;
text-align: center;
.num-max {
text-align: center;
.hour-num-title {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #02120f;
}
.num-input-show {
padding-top: 10px;
.el-input {
width: 50%;
/deep/.el-input__inner {
border-radius: 20px;
text-align: center;
}
}
}
}
}
}
}
.ag-left-change {
// position: relative;
// border:1px solid #ccc;
// height:40px;
// width:100%;
// display:flex;
// z-index:1;
div {
width: 9%;
height: 55px;
}
.ag-left1 {
position: absolute;
right: 12%;
top: 18px;
}
.ag-left2 {
position: absolute;
right: 1%;
top: 18px;
}
}
.show-work-set {
margin-top: 100px;
padding: 10px;
}
.agment-left-con {
padding: 15px;
text-align: center;
background: #f2f2f2;
border-radius: 12px;
}
.maxNum-first-show {
padding: 20px 15px 5px 15px;
.show-sep-num {
color: red;
.ag-left-change {
// position: relative;
// border:1px solid #ccc;
// height:40px;
// width:100%;
// display:flex;
// z-index:1;
div {
width: 9%;
height: 55px;
}
.ag-left1 {
position: absolute;
right: 12%;
top: 18px;
}
.ag-left2 {
position: absolute;
right: 1%;
top: 18px;
}
}
}
.reset-doctor-schedu {
padding: 10px 15px 5px 15px;
text-align: center;
.copy-submit {
background: #fff;
border: 1px solid #9ed4ca;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
.show-work-set {
margin-top: 100px;
}
}
.copy-doctor-schedu {
padding: 5px;
margin: 0 auto;
text-align: center;
.copy-submit {
background: #fff;
border: 1px solid #9ed4ca;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
.agment-left-con {
padding: 15px;
text-align: center;
background: #f2f2f2;
border-radius: 12px;
}
}
.agment-left-copy {
padding: 5px;
margin: 0 auto;
text-align: center;
.copy-reset-schedu {
padding-top: 14px;
.copy-week-schedu {
.reset-doctor-schedu {
padding: 30px 15px 5px 15px;
text-align: center;
.copy-submit {
background: #fff;
border: 1px solid #9ed4ca;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
margin-right: 5px;
cursor: pointer;
}
.copy-reaset-line {
color: #d9d9d9;
}
.reset-week-schedu {
}
.copy-doctor-schedu {
padding: 5px;
margin: 0 auto;
text-align: center;
.copy-submit {
background: #fff;
border: 1px solid #9ed4ca;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
margin-left: 5px;
cursor: pointer;
}
}
}
.first-left-max {
padding: 5px;
margin: 0 auto;
text-align: center;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
cursor: pointer;
}
.agment-head {
border-radius: 5px;
text-align: center;
}
.agment-head-name {
font-size: 20px;
color: #02120f;
font-weight: 600;
padding: 3px;
}
.agment-head-phone {
font-size: 18px;
margin-left: 16px;
}
.agment-hospital {
color: #89888b;
font-size: 16px;
margin-top: 10px;
}
.agment-hospital-show {
margin-right: 10px;
}
.agment-hospital-ks {
margin-top: 8px;
}
.agment-head-title {
font-size: 14px;
color: #02120f;
margin-top: 19px;
}
.agment-head-none {
background: #fff;
pointer-events: none;
}
.new-max {
text-align: center;
margin-top: 20px;
}
.new-max-none {
text-align: center;
margin-top: 20px;
pointer-events: none;
}
.agment-head-priority {
padding-top: 20px;
display: flex;
justify-content: center;
align-items: center;
.item {
width: 42px;
height: 32px;
margin-right: 10px;
border: 1px solid #d9d9d9;
border-radius: 8px;
.agment-left-copy {
padding: 5px;
margin: 0 auto;
text-align: center;
line-height: 32px;
.copy-reset-schedu {
padding-top: 14px;
.copy-week-schedu {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
margin-right: 5px;
cursor: pointer;
}
.copy-reaset-line {
color: #d9d9d9;
}
.reset-week-schedu {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
margin-left: 5px;
cursor: pointer;
}
}
}
.first-left-max {
padding: 5px;
margin: 0 auto;
text-align: center;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
cursor: pointer;
}
.active {
color: #fff;
.agment-head {
border-radius: 5px;
text-align: center;
}
.agment-head-name {
font-size: 20px;
color: #02120f;
font-weight: 600;
padding: 3px;
}
.agment-head-phone {
font-size: 18px;
margin-left: 16px;
}
.agment-hospital {
color: #89888b;
font-size: 16px;
margin-top: 10px;
}
.agment-hospital-show {
margin-right: 10px;
}
.agment-hospital-ks {
margin-top: 8px;
}
.agment-head-title {
font-size: 14px;
color: #02120f;
margin-top: 19px;
}
.agment-head-none {
background: #fff;
pointer-events: none;
}
.new-max {
text-align: center;
margin-top: 20px;
}
.new-max-none {
text-align: center;
margin-top: 20px;
pointer-events: none;
}
.agment-head-priority {
padding-top: 20px;
display: flex;
justify-content: center;
align-items: center;
.item {
width: 42px;
height: 32px;
margin-right: 10px;
border: 1px solid #d9d9d9;
border-radius: 8px;
text-align: center;
line-height: 32px;
cursor: pointer;
}
.active {
color: #fff;
background: #0d9078;
border: none;
}
}
.agment-left-button {
margin-top: 34px;
display: flex;
justify-content: center;
}
.copy-submit {
background: #0d9078;
border: none;
border: 1px solid #0d9078;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #ffffff;
}
.reset-submit {
background: #fff;
border: 1px solid #0d9078;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
}
/deep/.fc-timegrid-event {
border-radius: 1px !important;
}
/deep/thead .fc-scroller-harness {
background: #fcfbff;
}
/deep/.fc-col-header-cell-cushion {
color: #333;
height: 45px;
line-height: 45px;
}
/deep/.fc .fc-highlight {
background: transparent;
}
}
.agment-left-button {
margin-top: 34px;
display: flex;
justify-content: center;
}
.copy-submit {
background: #0d9078;
border: 1px solid #0d9078;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #ffffff;
}
.reset-submit {
background: #fff;
border: 1px solid #0d9078;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
}
/deep/.fc-timegrid-event {
border-radius: 1px !important;
}
/deep/thead .fc-scroller-harness {
background: #fcfbff;
}
/deep/.fc-col-header-cell-cushion {
color: #333;
height: 45px;
line-height: 45px;
}
/deep/.fc .fc-highlight {
background: transparent;
}
/deep/.fc-header-toolbar {
position: absolute;
right: 0;
top: 15px;
padding: 20px;
width: 20%;
}
/deep/.fc-toolbar-title {
font-size: 6px;
}
/deep/.fc-toolbar-chunk {
display: flex;
}
/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) {
/deep/.fc-header-toolbar {
right: 3%;
position: absolute;
right: 0;
top: 15px;
padding: 20px;
width: 20%;
}
.ag-left1 {
width: 12% !important;
right: 18% !important;
// border: 1px solid red !important;
/deep/.fc-toolbar-title {
font-size: 6px;
}
.ag-left2 {
width: 12% !important;
right: 1% !important;
/deep/.fc-toolbar-chunk {
display: flex;
}
/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) {
/deep/.fc-header-toolbar {
right: 6%;
}
.ag-left1 {
width: 12% !important;
right: 18% !important;
// border: 1px solid red !important;
}
.ag-left2 {
width: 12% !important;
right: 1% !important;
}
}
/deep/.fc-myCustomButton-button {
padding: 6px 24px;
}
/deep/.fc-button-primary:hover {
background: #fff;
color: #02120f;
border: 1px solid #0d9078;
}
/deep/.fc-event-time {
font-size: 14px;
color: #0d9078;
word-wrap: break-word;
white-space: normal;
}
/deep/.fc-col-header-cell-cushion {
background: #fff;
border: 1px solid #0d9078;
color: #0d9078;
border-radius: 20px;
height: 30px;
line-height: 25px;
font-size: 14px;
margin: 10px 0;
text-decoration: none;
}
/deep/a:hover {
text-decoration: none;
}
}
/deep/.fc-myCustomButton-button {
padding: 6px 24px;
}
/deep/.fc-button-primary:hover {
background: #fff;
color: #02120f;
border: 1px solid #0d9078;
}
/deep/.fc-event-time {
font-size: 14px;
color: #0d9078;
word-wrap: break-word;
white-space: normal;
}
/deep/.fc-col-header-cell-cushion {
background: #fff;
border: 1px solid #0d9078;
color: #0d9078;
border-radius: 20px;
height: 30px;
line-height: 25px;
font-size: 14px;
margin: 10px 0;
text-decoration: none;
}
/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"
......@@ -166,7 +160,7 @@
getLevelAndDayCount,
} from '@/api/serviceSchedule';
export default {
name: 'Index',
name: 'Scheduing',
components: {
FullCalendar,
},
......@@ -194,7 +188,6 @@
selectOverlap: false,
select: this.selectInfo,
selectMinDistance: 0,
eventResize: this.eventResize,
eventOverlap: false,
navLinks: true,
navLinkDayClick: this.navLinkDayClick,
......@@ -259,7 +252,7 @@
scrollerHeight: 0,
loading: false,
isDoIt: false,
getEveryDay: '',
getStartWeek: '',
copyArr: [],
centerDialogVisible: false,
maxNumValue: '',
......@@ -277,7 +270,6 @@
if (newV !== oldV) {
this.handleInitSearch();
this.saveDoctoreScheduling(2, oldV);
// this.getLevelAndDayCount(newV);
}
},
},
......@@ -301,7 +293,6 @@
},
mounted() {
this.scrollerHeight = this.$refs.agment.clientHeight + 'px';
// this.scrollerHeight = 400 + 'px';
this.init();
},
methods: {
......@@ -314,6 +305,7 @@
* view是当前视图对象。
*/
init() {
// schedulingType 1,2 表示编辑新加,其他表示查看
if (this.schedulingType == 1 || this.schedulingType == 2) {
this.calendarOptions.editable = true;
} else {
......@@ -347,17 +339,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--;
......@@ -365,49 +357,50 @@
}
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);
});
this.isDoIt = true;
}
},
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) {
......@@ -418,20 +411,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);
......@@ -440,59 +433,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');
limitTime.end = dayjs(day)
.add(13, '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);
limitTime.constraint = 'businessHours';
limitTime.color = '#ccc';
limitTime.display = 'background';
limitTime.editable = false;
this.calendarOptions.events.push(limitTime);
}
console.log(list, 'obj', this.getEveryDay);
console.log('obj', this.getEveryDay);
},
handleDatesSet(dataInfo) {
this.getEveryDay = dayjs(dataInfo.start).format('YYYY-MM-DD HH:mm:ss');
......@@ -501,32 +487,34 @@
const cz = currentTime - getTime; // 每周周一时间戳 - 今天的时间
const oneHour = 1 * 60 * 60 * 1000 * 24; // 一天的时间戳
const timeDifference = (cz / oneHour) | 0; // 每周一时间距离今天时间数量
const headObj = this.calendarOptions.customButtons.myCustomButton;
const czCorrert = cz / oneHour;
if (timeDifference == 0 && czCorrert > 0) {
const weekHeadTitle = this.calendarOptions.customButtons.myCustomButton;
console.log(timeDifference, 'timeDifference', cz / oneHour);
// debugger;
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;
}
},
......@@ -549,21 +537,16 @@
if (!this.calendarOptions.selectable || event.event.constraint) {
return;
}
console.log(event, event, 'iiiieventeventevent');
this.$confirm('你要取消日期吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then((_) => {
console.log(_);
const index = this.getIdDeleteData(event.event.id);
this.isDoIt = true;
this.calendarOptions.events.splice(index, 1);
})
.catch((_) => {
console.log(_);
});
}).then((_) => {
console.log(_);
const index = this.getIdDeleteData(event.event.id);
this.isDoIt = true;
this.calendarOptions.events.splice(index, 1);
});
},
eventDrop(event) {
event.revert();
......@@ -598,22 +581,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;
......@@ -621,10 +599,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();
......@@ -642,24 +617,24 @@
// 对于排班交叉部分处理
const infoStart = new Date(info.start).getTime();
const infoEnd = new Date(info.end).getTime();
const data = this.calendarOptions.events;
const newDate = [];
let indexObj = false;
data.forEach((item) => {
const d = new Date(item.end).getTime();
const s = new Date(item.start).getTime();
if (s > infoStart && infoEnd >= d) {
indexObj = true;
} else if (s > infoStart && infoEnd >= s) {
indexObj = true;
const haveSelectTime = this.calendarOptions.events;
const correctDate = [];
let isRepeat = false;
haveSelectTime.forEach((item) => {
const selectEndTime = new Date(item.end).getTime();
const selectStartTime = new Date(item.start).getTime();
if (selectStartTime > infoStart && infoEnd >= selectEndTime) {
isRepeat = true;
} else if (selectStartTime > infoStart && infoEnd >= selectStartTime) {
isRepeat = true;
} else {
const id = (newDate.length + 1) * 10;
const id = (correctDate.length + 1) * 10;
item.id = id;
newDate.push(item);
correctDate.push(item);
}
});
this.calendarOptions.events = newDate;
return indexObj;
this.calendarOptions.events = correctDate;
return isRepeat;
},
handlePriority(index) {
this.isDoIt = true;
......@@ -674,28 +649,26 @@
saveDoctoreScheduling(type, weekV = 0) {
if (this.isDoIt) {
this.loading = true;
const objParms = {};
objParms.week = weekV ? weekV : this.week;
objParms.workId = this.schedulingTypeValue.id;
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;
this.$message({
......@@ -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>
......
......@@ -51,7 +51,7 @@
}"
>{{ data.text }}</span>
</template>
</el-cascader>
</el-cascader>
<el-date-picker
v-model="dateTime"
class="serviceSchedule_dateTime"
......@@ -268,7 +268,7 @@
const checkedNodes = this.$refs['cascader'].getCheckedNodes();
if (checkedNodes.length > 0) {
this.departmentId = checkedNodes[0].value;
}else{
} else {
this.departmentId = '';
}
},
......
......@@ -284,7 +284,7 @@
const checkedNodes = this.$refs['cascader'].getCheckedNodes();
if (checkedNodes.length > 0) {
this.searchParam.departmentId = checkedNodes[0].value;
}else{
} else {
this.searchParam.departmentId = '';
}
},
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册