Commit 852d902e authored by 黄奎's avatar 黄奎

页面修改

parent f6ef0ecc
...@@ -640,8 +640,8 @@ ...@@ -640,8 +640,8 @@
}) })
return return
} }
for(let j = 0; j < this.DefaultPlanTimeList[i].TimeList.length;j++ ){ for (let j = 0; j < this.DefaultPlanTimeList[i].TimeList.length; j++) {
if(this.DefaultPlanTimeList[i].TimeList[j].StartTime==''){ if (this.DefaultPlanTimeList[i].TimeList[j].StartTime == '') {
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
position: "top", position: "top",
...@@ -649,7 +649,7 @@ ...@@ -649,7 +649,7 @@
}) })
return return
} }
if(this.DefaultPlanTimeList[i].TimeList[j].EndTime==''){ if (this.DefaultPlanTimeList[i].TimeList[j].EndTime == '') {
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
position: "top", position: "top",
...@@ -657,7 +657,7 @@ ...@@ -657,7 +657,7 @@
}) })
return return
} }
if(this.DefaultPlanTimeList[i].TimeList[j].TimeHour==''){ if (this.DefaultPlanTimeList[i].TimeList[j].TimeHour == '') {
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
position: "top", position: "top",
...@@ -688,60 +688,61 @@ ...@@ -688,60 +688,61 @@
this.saveCourseLoading = true; this.saveCourseLoading = true;
saveClass(this.objOption).then(res => { saveClass(this.objOption).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
var newClassId = res.Data.ClassId
var PlanList = res.Data.ClassPlanList;
//有上课计划 //有上课计划
if (res.Data && res.Data.ClassPlanList && res.Data.ClassPlanList.length > 0) { if (res.Data && res.Data.ClassPlanList && res.Data.ClassPlanList.length > 0 && this.objOption
if (this.objOption.ClassDateList.length < 2) { .ClassDateList.length < 2) {
this.BtnStr = "正在检查排班是否存在冲突"; this.checkPlan(newClassId, PlanList)
var newMsg = {
ClassId: res.Data.ClassId,
PlanList: res.Data.ClassPlanList,
}
var NewClassId = res.Data.ClassId;
batchSaveClassPlan(newMsg).then(res => {
this.saveCourseLoading = false
if (res.Code == 1) {
if (res.Data) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!但存在上课冲突数据,请调整。',
position: 'top'
})
this.$emit('getClassFlict', NewClassId);
} else {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
}
this.$emit("success")
this.closeCourseForm()
}
})
}
} else { } else {
this.saveCourseLoading = false this.refreshForm();
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
this.closeCourseForm()
} }
} }
}).catch(() => { }).catch(() => {
this.BtnStr="立即提交" this.BtnStr = "立即提交"
this.saveCourseLoading = false this.saveCourseLoading = false
}) })
} }
}, },
//检查上课计划是否冲突
checkPlan(ClassId, ClassPlanList) {
this.BtnStr = "正在检查排班是否存在冲突";
var newMsg = {
ClassId: ClassId,
PlanList: ClassPlanList,
}
var NewClassId = ClassId;
batchSaveClassPlan(newMsg).then(res => {
this.saveCourseLoading = false
if (res.Code == 1) {
if (res.Data) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!但存在上课冲突数据,请调整。',
position: 'top'
})
this.$emit('getClassFlict', NewClassId);
} else {
this.refreshForm()
}
}
});
},
//刷新表单
refreshForm() {
this.saveCourseLoading = false
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success");
this.closeCourseForm();
},
//获取课程 //获取课程
getCourseList() { getCourseList() {
queryCourseDropdownList({ queryCourseDropdownList({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment