Commit 0a2f2ae2 by lizhi

继续添加课程

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