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

切换周保存数据

上级 ca74b348
...@@ -191,6 +191,7 @@ ...@@ -191,6 +191,7 @@
workingTicketVisible: false, // 工作表票详情页面 workingTicketVisible: false, // 工作表票详情页面
scrollerHeight: 0, scrollerHeight: 0,
loading: false, loading: false,
isDoIt:false
}; };
}, },
watch: { watch: {
...@@ -224,6 +225,7 @@ ...@@ -224,6 +225,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;'); // console.log(this.$refs.agment.clientHeight, 'this.$refs.agment.offsetHeight;');
this.init(); this.init();
...@@ -269,12 +271,14 @@ ...@@ -269,12 +271,14 @@
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);
} }
// const keyAll = ['end', 'endStr', 'id', 'start', 'startStr']; // const keyAll = ['end', 'endStr', 'id', 'start', 'startStr'];
...@@ -372,6 +376,7 @@ ...@@ -372,6 +376,7 @@
this.calendarOptions.events.push(dataObj); this.calendarOptions.events.push(dataObj);
}, },
selectAllow(info) { selectAllow(info) {
this.isDoIt = true;
const startDay = new Date(info.start).getDay(); const startDay = new Date(info.start).getDay();
const endDay = new Date(info.end).getDay(); const endDay = new Date(info.end).getDay();
if (startDay != endDay) { if (startDay != endDay) {
...@@ -418,40 +423,44 @@ ...@@ -418,40 +423,44 @@
this.handleInitSearch(true); this.handleInitSearch(true);
}, },
saveDoctoreScheduling(type) { saveDoctoreScheduling(type) {
console.log(this.week, 'this.week'); console.log(this.isDoIt, 'this.isDoIt');
this.loading = true; if(this.isDoIt) {
const objParms = {}; console.log(this.week, 'this.week');
objParms.week = this.week; this.loading = true;
objParms.workId = this.schedulingTypeValue.id; const objParms = {};
objParms.level = this.currentIndex; objParms.week = this.week;
objParms.list = []; objParms.workId = this.schedulingTypeValue.id;
const data = this.calendarOptions.events; objParms.level = this.currentIndex;
data.forEach((item) => { objParms.list = [];
// if (item.week == this.week) { const data = this.calendarOptions.events;
const obj = {}; console.log(data, 'data');
obj.startTime = this.dateFormat('YYYY-mm-dd HH:MM:SS', item.start); data.forEach((item) => {
obj.endTime = this.dateFormat('YYYY-mm-dd HH:MM:SS', item.end); // if (item.week == this.week) {
objParms.list.push(obj); 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);
saveDutyRoster(objParms).then((res) => { objParms.list.push(obj);
if (res.code === '000000') { // }
// this.$toast(res.message); });
// this.handleInitSearch(true); saveDutyRoster(objParms).then((res) => {
// this.$router.go(0); if (res.code === '000000') {
this.loading = false; // this.$toast(res.message);
if(type == 1) { // this.handleInitSearch(true);
this.$message({ // this.$router.go(0);
message: '排班保存成功', this.loading = false;
type: 'success' if(type == 1) {
}); this.$message({
message: '排班保存成功',
type: 'success'
});
}
this.isDoIt = false;
} else {
// this.$toast(res.message);
this.$message.error(res.message || '排班保存失败');
} }
});
} else { }
// this.$toast(res.message);
this.$message.error(res.message || '排班保存失败');
}
});
}, },
dateFormat(fmt, date2) { dateFormat(fmt, date2) {
const date = new Date(date2); const date = new Date(date2);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册