提交 dcd391e0 编写于 作者: qian.jie's avatar qian.jie

修改bug

上级 846e54e1
......@@ -203,7 +203,7 @@
}
if(newV !== oldV) {
this.handleInitSearch();
this.saveDoctoreScheduling(2);
this.saveDoctoreScheduling(2, oldV);
}
},
},
......@@ -253,7 +253,8 @@
},
handleInitSearch(isReset) {
if (isReset) {
this.calendarOptions.events = [];
this.calendarOptions.events = this.calendarOptions.events.filter((v) => (v.week !== this.week));
console.log(this.calendarOptions.events);
}
const objParms = {};
objParms.doctorId = this.doctorId;
......@@ -262,6 +263,7 @@
// this.currentIndex = this.schedulingTypeValue.level;
dutyRosterQuery(objParms).then((res) => {
if (res.code == '000000') {
this.calendarOptions.events = [];
this.handleInitData(res.data);
} else {
this.$toast(res.message);
......@@ -346,7 +348,9 @@
.then((_) => {
console.log(_);
const index = this.getIdDeleteData(event.event.id);
return this.calendarOptions.events.splice(index, 1);
this.isDoIt = true;
this.calendarOptions.events.splice(index, 1);
console.log(this.calendarOptions.events);
})
.catch((_) => {
console.log(_);
......@@ -423,25 +427,27 @@
resetDoctoreScheduling() {
this.handleInitSearch(true);
},
saveDoctoreScheduling(type) {
console.log(this.isDoIt, 'this.isDoIt');
saveDoctoreScheduling(type, weekV = 0) {
if(this.isDoIt) {
console.log(this.week, 'this.week');
console.log(this.week, 'this.week', weekV);
this.loading = true;
const objParms = {};
objParms.week = this.week;
objParms.week = weekV ? weekV : this.week;
objParms.workId = this.schedulingTypeValue.id;
objParms.level = this.currentIndex;
objParms.list = [];
const data = this.calendarOptions.events;
console.log(data, 'data');
data.forEach((item) => {
// if (item.week == 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);
objParms.list.push(obj);
// }
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);
}
});
saveDutyRoster(objParms).then((res) => {
if (res.code === '000000') {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册