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

修改bug

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