|
@@ -18,6 +18,7 @@
|
|
|
<el-select
|
|
|
v-model="item.classId"
|
|
|
style="margin-right: 20px"
|
|
|
+ clearable
|
|
|
@change="changeValue"
|
|
|
>
|
|
|
<el-option
|
|
@@ -25,7 +26,7 @@
|
|
|
:value="item.id"
|
|
|
v-for="(item, index) in classList"
|
|
|
:key="index"
|
|
|
- :disabled="isDisabled(item)"
|
|
|
+ :disabled='item.disabled'
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
<el-button
|
|
@@ -39,9 +40,12 @@
|
|
|
|
|
|
<div class="infomsg">
|
|
|
<div class="left" v-if="!isNoCourse">
|
|
|
- 剩余课时:
|
|
|
- <div v-for="(val,key) in item.courseList" :key='key'>
|
|
|
- <p style="margin-right:5px">{{key|courseTypeFormat}}:<span>{{val}}</span>节</p>
|
|
|
+ 剩余课时:
|
|
|
+ <div v-for="(val, key) in item.courseList" :key="key">
|
|
|
+ <p style="margin-right: 5px">
|
|
|
+ {{ key | courseTypeFormat }}:<span>{{ val }}</span
|
|
|
+ >节
|
|
|
+ </p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="left" v-else>
|
|
@@ -67,7 +71,7 @@
|
|
|
:list="studentList"
|
|
|
:chioseList="item.studentList"
|
|
|
v-if="studentListModalVisible"
|
|
|
- :showOk='true'
|
|
|
+ :showOk="true"
|
|
|
:isChiose="true"
|
|
|
@close="closeStudentView"
|
|
|
/>
|
|
@@ -90,36 +94,31 @@ export default {
|
|
|
organizationCourseUnitPriceSettingsByType: [],
|
|
|
eclass: [],
|
|
|
isNoCourse: false,
|
|
|
+ activeClassList: [],
|
|
|
};
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.activeClassList =this.classList
|
|
|
+ },
|
|
|
methods: {
|
|
|
async changeValue(val) {
|
|
|
- this.item.studentList = []
|
|
|
- try {
|
|
|
- let reset = await getClassGroupSubCourseNum({ classGroupId: val });
|
|
|
- this.setClassCourse(reset.data);
|
|
|
- } catch {}
|
|
|
+ this.item.studentList = [];
|
|
|
+ if (val) {
|
|
|
+ try {
|
|
|
+ let reset = await getClassGroupSubCourseNum({ classGroupId: val });
|
|
|
+ this.setClassCourse(reset.data);
|
|
|
+ // 成功之后
|
|
|
+ this.$emit("filterClassList", val);
|
|
|
+ } catch {}
|
|
|
+ } else {
|
|
|
+ this.setClassCourse({});
|
|
|
+ this.$emit("filterClassList", null);
|
|
|
+ }
|
|
|
},
|
|
|
deteleClass() {
|
|
|
this.$emit("deteleClass", this.index);
|
|
|
},
|
|
|
- isDisabled(item) {
|
|
|
- let flag = false;
|
|
|
- this.form?.classList?.forEach((some) => {
|
|
|
- if (item.type != some.type && some.type) {
|
|
|
- flag = true;
|
|
|
- }
|
|
|
- });
|
|
|
- this.form?.classList?.forEach((some) => {
|
|
|
- if (item.id == some.classId) {
|
|
|
- some.type = item.type
|
|
|
- flag = true;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
|
|
|
- return flag;
|
|
|
- },
|
|
|
lookStudentList() {
|
|
|
if (!this.item.classId) {
|
|
|
this.$message.error("请先选择班级,再查询学生列表");
|
|
@@ -146,9 +145,10 @@ export default {
|
|
|
this.studentListModalVisible = false;
|
|
|
},
|
|
|
setClassCourse(data) {
|
|
|
+ console.log(data);
|
|
|
if (Object.keys(data).length > 0) {
|
|
|
-
|
|
|
this.item.courseList = data;
|
|
|
+ this.isNoCourse = false;
|
|
|
} else {
|
|
|
this.isNoCourse = true;
|
|
|
}
|