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

切换周保存数据

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