Commit 0a2f2ae2 by lizhi

继续添加课程

parent 90a348b7
......@@ -159,14 +159,15 @@
v-model="goOnForm.userCourseList[index].csoCourseCode"
clearable
:disabled="
goOnForm.userCourseList[index].ownCourseCode ||
goOnForm.userCourseList[index].courseCode ||
goOnForm.userCourseList[index].auditCourseCode
? true
: false
"
@change="matchCodeGoon($event, index)"
>
<el-option
v-for="(item, index) in allCode"
v-for="(item, index) in allCode2"
:key="index"
:label="item.label"
:value="item.value"
......@@ -247,7 +248,7 @@
<el-input
v-model="goOnForm.userCourseList[index].auditCourseCode"
:disabled="
goOnForm.userCourseList[index].ownCourseCode ||
goOnForm.userCourseList[index].courseCode ||
goOnForm.userCourseList[index].csoCourseCode
? true
: false
......@@ -756,6 +757,7 @@ export default {
},
allCode: [],
allCode2: [],
allPayCode: [],
isOK: false,
courseList: [],
......@@ -906,21 +908,21 @@ export default {
this.num = null;
// console.log(this.$refs[formName], "this.$refs[formName]");
},
getAllCode() {
allCode({
pageNum: 1,
pageSize: 999
}).then(res => {
// console.log(res.data.list, "getAllCode");
res.data.list.forEach(item => {
let obj = {};
obj.label = item.csoCode;
obj.value = item.csoCode;
this.allCode.push(obj);
});
// console.log(this.allCode, "this.allCode");
});
},
// getAllCode() {
// allCode({
// pageNum: 1,
// pageSize: 999
// }).then(res => {
// // console.log(res.data.list, "getAllCode");
// res.data.list.forEach(item => {
// let obj = {};
// obj.label = item.csoCode;
// obj.value = item.csoCode;
// this.allCode.push(obj);
// });
// // console.log(this.allCode, "this.allCode");
// });
// },
getAllPayCode() {
allPayCode({
pageNum: 1,
......@@ -1009,6 +1011,7 @@ export default {
// this.goOnForm.teachWay = this.courseList[index].teachWay;
// this.goOnForm.auditSchool = this.courseList[index].auditSchool;
this.goOnForm.userCourseList = [];
this.initCsoCode(this.courseList[index].auditSchool);
// console.log(this.goOnForm, "goOn22");
// console.log(this.goOnForm.costTag, "goOn.costTag");
},
......@@ -1033,6 +1036,26 @@ export default {
}
});
},
initCsoCode(val) {
getCsoCode({
school: this.UserInfoDetail.school,
auditSchool: val
}).then(res => {
// console.log(res, "getCsoCode");
if (res.data) {
res.data.csoCodeList.forEach(item => {
let obj = {};
obj.label = item;
obj.value = item;
this.allCode2.push(obj);
});
this.csoCodeInfo = JSON.parse(JSON.stringify(res.data.csoCodeInfo));
// console.log(this.csoCodeInfo, "this.csoCodeInfo");
} else {
this.allCode2 = [];
}
});
},
matchCode(val, index) {
// console.log(val, index, "matchCode");
let arr = [];
......@@ -1053,7 +1076,29 @@ export default {
}
});
}
console.log(this.list.userCourseList, "matchCode");
// console.log(this.list.userCourseList, "matchCode");
},
matchCodeGoon(val, index) {
// console.log(val, index, "matchCode");
let arr = [];
if (val) {
// arr = this.csoCodeInfo.filter(item => {
// return item.csoCode == val;
// });
this.csoCodeInfo.forEach(item => {
if (item.csoCode == val) {
this.goOnForm.userCourseList[index].csoCourseCode = item.csoCode;
this.goOnForm.userCourseList[index].csoName = item.csoName;
// this.list.userCourseList[index].courseCode = item.courseCode;
// this.list.userCourseList[index].courseName = item.courseName;
// this.list.userCourseList[index].auditCourseCode =
// item.auditCourseCode;
// this.list.userCourseList[index].auditCourseName =
// item.auditCourseName;
}
});
}
// console.log(this.list.userCourseList, "matchCode");
}
},
mounted() {
......
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