Commit 3b6dabb6 by lizhi

年份学期必填

parent a5998f7d
...@@ -1037,29 +1037,46 @@ export default { ...@@ -1037,29 +1037,46 @@ export default {
}); });
}, },
submitGoOnForm() { submitGoOnForm() {
this.$confirm("是否要提交", "提示", { this.goOnForm.userCourseList.forEach(item => {
confirmButtonText: "确定", if (!item.yearTime || !item.term) {
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.goOnForm.umsUserCourses = this.goOnForm.userCourseList; //新来的后端比较菜,原来的接口字段不会改,只能搞了个新的名字
this.goOnForm.umsUserCourses.forEach(item => {
item.courseName = item.auditCourseName;
});
addCurrentTermCourse(this.goOnForm).then(response => {
this.$message({ this.$message({
type: "success", type: "error",
message: "提交成功", message: "请填写年份学期",
duration: 1000 duration: 1000
}); });
this.courseInfoVisible = false; // console.log("NO");
this.editCourseInfoVisible = false; this.isOK = false;
this.editCourseTitleVisible = false; } else {
this.goOnVisible = false; // console.log("OK");
this.getCourseList(); this.isOK = true;
this.$forceUpdate(); }
});
}); });
if (this.isOK) {
this.$confirm("是否要提交", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.goOnForm.umsUserCourses = this.goOnForm.userCourseList; //新来的后端比较菜,原来的接口字段不会改,只能搞了个新的名字
this.goOnForm.umsUserCourses.forEach(item => {
item.courseName = item.auditCourseName;
});
addCurrentTermCourse(this.goOnForm).then(response => {
this.$message({
type: "success",
message: "提交成功",
duration: 1000
});
this.courseInfoVisible = false;
this.editCourseInfoVisible = false;
this.editCourseTitleVisible = false;
this.goOnVisible = false;
this.getCourseList();
this.$forceUpdate();
});
});
}
}, },
cancel(formName) { cancel(formName) {
this.courseInfoVisible = false; this.courseInfoVisible = false;
......
...@@ -39,12 +39,7 @@ ...@@ -39,12 +39,7 @@
</p> </p>
<p> <p>
<!-- {{ list.term.slice(0, 1).toUpperCase() + list.term.slice(1) }} --> <!-- {{ list.term.slice(0, 1).toUpperCase() + list.term.slice(1) }} -->
{{ {{ list.term.replace(/( |^)[a-z]/g, L => L.toUpperCase()) }}
list.term
.toLowerCase()
.replace(/( |^)[a-z]/g, L => L.toUpperCase())
}}
{{ list.yearTime }} {{ list.yearTime }}
</p> </p>
<!-- <p>{{ list.yearTime }}</p> --> <!-- <p>{{ list.yearTime }}</p> -->
......
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