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

Merge branch 'feature/dxp' into 'develop'

修改页面模块

See merge request !186
......@@ -234,7 +234,6 @@
},
watch: {
week(newV, oldV) {
console.log(newV, oldV, 'newV, oldV');
if (this.haveWeek.indexOf(newV) == -1) {
this.haveWeek.push(newV);
this.handleInitSearch();
......@@ -264,9 +263,7 @@
});
},
mounted() {
console.log(this.calendarOptions.events, 'this.calendarOptions.events');
this.scrollerHeight = this.$refs.agment.clientHeight + 'px';
// console.log(this.$refs.agment.clientHeight, 'this.$refs.agment.offsetHeight;');
this.init();
},
methods: {
......@@ -290,18 +287,14 @@
this.handleInitSearch();
},
handleChange(item, index) {
console.log(this.getEveryDay, 'this.getEveryDay');
this.maxList.map((itemChild, indexChild) => {
console.log(indexChild, 'indexChild');
return (itemChild.weekDay = dayjs(
dayjs(this.getEveryDay).add(indexChild, 'day')
).format('YYYY-MM-DD HH:mm:ss'));
});
this.maxList[index]['preNum'] = item.preNum;
console.log(this.maxList, 'this.maxList');
},
getCopyData(data) {
this.calendarOptions.events = [];
const copyList = [];
const addDay = 7;
data.noAcceptList.map((item) => {
......@@ -314,11 +307,11 @@
.format('YYYY-MM-DD HH:mm:ss');
copyList.push(obj);
});
this.calendarOptions.events = [];
data.noAcceptList = copyList;
this.isDoIt = true;
},
getWeekMax(data) {
console.log(this.maxList, 'this.maxList');
if (data.countList.length > 0) {
data.countList.forEach((item) => {
const clistDay = dayjs(item.workDay).day();
......@@ -328,22 +321,18 @@
} else {
index = 7;
}
// console.log(this.maxList, this.maxList[index - 1].preNum, 'index');
this.maxList[index - 1].preNum = item.preNum;
// debugger;
this.maxList[index - 1].weekDay = dayjs(item.workDay)
.add(7, 'day')
.format('YYYY-MM-DD HH:mm:ss');
console.log(this.maxList, 'clistDay');
});
}
},
handleInitSearch(isReset, type) {
if (isReset) {
if (isReset && type != 1) {
this.calendarOptions.events = this.calendarOptions.events.filter(
(v) => v.week !== this.week
);
console.log(this.calendarOptions.events);
}
let copyWeek = '';
if (type == 1) {
......@@ -357,42 +346,45 @@
copyWeek = 4;
}
}
console.log(this.week, 'this.week');
const objParms = {};
objParms.doctorId = this.doctorId;
objParms.week = type == 1 ? copyWeek : this.week;
// type == 1 表示 copy
objParms.workId = this.id;
console.log(objParms.week, 'objParms.week');
dutyRosterQuery(objParms).then((res) => {
if (res.code == '000000') {
this.calendarOptions.events = [];
if (type == 1) {
console.log(res.data.noAcceptList, 'res.data.noAcceptList');
if (type == 1 && !res.data.noAcceptList.length) {
return this.$toast('没有上周的排班信息可以用');
} else {
this.calendarOptions.events = [];
}
if (type == 1 && res.data.noAcceptList.length) {
this.getCopyData(res.data);
this.getWeekMax(res.data);
}
this.handleInitData(res.data);
if (type != 1) {
if (res.data.countList.length > 0) {
const newAR = res.data.countList.map((item, index) => {
if (item.weekDay == this.maxList[index].weekDay) {
return {
preNum: item.preNum,
};
const countList = res.data.countList;
if (countList.length > 0) {
console.log(this.maxList, 'countListcountListcountListcountList');
countList.forEach((item) => {
let keyC = dayjs(item.workDay).day();
if (keyC == 0) {
keyC = 7;
}
this.maxList[keyC - 1].preNum = item.preNum || 0;
});
this.maxList = newAR;
console.log(newAR, 'newAR');
} else {
this.maxList = [
{ preNum: 0 },
{ preNum: 0 },
{ preNum: 0 },
{ preNum: 0 },
{ preNum: 0 },
{ preNum: 0 },
{ preNum: 0 },
];
for (let i = 0; i < 7; i++) {
const maxListObj = {};
maxListObj.preNum = 0;
maxListObj.weekDay = dayjs(this.getEveryDay)
.add(i, 'day')
.format('YYYY-MM-DD HH:mm:ss');
this.maxList.push(maxListObj);
}
console.log(this.maxList, 'this.maxListthis.maxListthis.maxList');
}
}
} else {
......@@ -404,14 +396,12 @@
var newDate = null;
if (this.schedulingType != 3) {
newDate = [].concat(data.noAcceptList);
console.log(newDate, 'newDate');
} else {
var acceptList = [];
data.acceptList.forEach((item) => {
item.type = 88;
acceptList.push(item);
});
console.log(data.acceptList, 'data.acceptList');
newDate = [].concat(acceptList, data.noAcceptList);
}
newDate.forEach((item) => {
......@@ -421,7 +411,6 @@
dataObj['id'] = id;
dataObj['end'] = item.endTime;
dataObj['start'] = item.startTime;
console.log(item.type);
dataObj['type'] = item.type;
if (item.type == 88) {
dataObj['color'] = '#FFEDE9';
......@@ -431,17 +420,12 @@
},
handleDatesSet(dataInfo) {
this.getEveryDay = dayjs(dataInfo.startStr).format('YYYY-MM-DD HH:mm:ss');
console.log(
this.getEveryDay,
'dataInfo.startStrdataInfo.startStrdataInfo.startStr'
);
const currentTime = new Date().getTime();
const getTime = new Date(dataInfo.startStr).getTime();
const cz = currentTime - getTime;
const oneHour = 1 * 60 * 60 * 1000 * 24;
const timeDifference = (cz / oneHour) | 0;
const headObj = this.calendarOptions.customButtons.myCustomButton;
console.log(timeDifference, 'timeDifference');
// debugger;
if (timeDifference >= 0 && timeDifference < 7) {
// 过去
......@@ -494,7 +478,6 @@
const index = this.getIdDeleteData(event.event.id);
this.isDoIt = true;
this.calendarOptions.events.splice(index, 1);
console.log(this.calendarOptions.events);
})
.catch((_) => {
console.log(_);
......@@ -573,11 +556,9 @@
},
copyDoctoreScheduling() {
this.handleInitSearch(true, 1);
console.log(this.copyArr, 'copyArr');
},
saveDoctoreScheduling(type, weekV = 0) {
if (this.isDoIt) {
console.log(this.week, 'this.week', weekV);
this.loading = true;
const objParms = {};
objParms.week = weekV ? weekV : this.week;
......@@ -585,18 +566,24 @@
objParms.level = this.currentIndex;
objParms.list = [];
const data = this.calendarOptions.events;
console.log(data, 'data');
data.forEach((item) => {
console.log(item.week == (weekV ? weekV : this.week));
if (item.week == (weekV ? weekV : this.week)) {
console.log(item.week, this.week, weekV, 'this.week');
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);
console.log(obj, 'obj');
objParms.list.push(obj);
}
});
// 对上限人数处理
this.maxList.forEach((item, index) => {
console.log(item, 'item');
if (!item.weekDay) {
item.weekDay = dayjs(this.getEveryDay)
.add(index, 'day')
.format('YYYY-MM-DD HH:mm:ss');
}
});
console.log(this.maxList, '122222maxListmaxListmaxListmaxList');
objParms.countReqList = this.maxList;
saveDutyRoster(objParms).then((res) => {
if (res.code === '000000') {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册