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

切换周保存数据

上级 a7a0b876
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
type="primary" type="primary"
round round
style="width: 110px" style="width: 110px"
@click="saveDoctoreScheduling" @click="saveDoctoreScheduling(1)"
> >
保存 保存
</el-button> </el-button>
...@@ -194,11 +194,15 @@ ...@@ -194,11 +194,15 @@
}; };
}, },
watch: { watch: {
week(newV) { 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();
} }
if(newV !== oldV) {
this.saveDoctoreScheduling(2);
}
}, },
}, },
created() { created() {
...@@ -413,7 +417,8 @@ ...@@ -413,7 +417,8 @@
resetDoctoreScheduling() { resetDoctoreScheduling() {
this.handleInitSearch(true); this.handleInitSearch(true);
}, },
saveDoctoreScheduling() { saveDoctoreScheduling(type) {
console.log(this.week, 'this.week');
this.loading = true; this.loading = true;
const objParms = {}; const objParms = {};
objParms.week = this.week; objParms.week = this.week;
...@@ -422,12 +427,12 @@ ...@@ -422,12 +427,12 @@
objParms.list = []; objParms.list = [];
const data = this.calendarOptions.events; const data = this.calendarOptions.events;
data.forEach((item) => { data.forEach((item) => {
if (item.week == this.week) { // if (item.week == 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);
objParms.list.push(obj); objParms.list.push(obj);
} // }
}); });
saveDutyRoster(objParms).then((res) => { saveDutyRoster(objParms).then((res) => {
if (res.code === '000000') { if (res.code === '000000') {
...@@ -435,10 +440,13 @@ ...@@ -435,10 +440,13 @@
// this.handleInitSearch(true); // this.handleInitSearch(true);
// this.$router.go(0); // this.$router.go(0);
this.loading = false; this.loading = false;
this.$message({ if(type == 1) {
message: '排班保存成功', this.$message({
type: 'success' message: '排班保存成功',
}); type: 'success'
});
}
} else { } else {
// this.$toast(res.message); // this.$toast(res.message);
this.$message.error(res.message || '排班保存失败'); this.$message.error(res.message || '排班保存失败');
......
...@@ -71,7 +71,7 @@ module.exports = { ...@@ -71,7 +71,7 @@ module.exports = {
port: 8080, port: 8080,
proxy: { proxy: {
'/proxy': { '/proxy': {
target: 'https://test1-sc.yunqueyi.com/', target: 'https://dev-sc.yunqueyi.com/',
ws: false, ws: false,
changeOrigin: true, changeOrigin: true,
secure: true, secure: true,
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册