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

修改页面模块

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