|
|
|
@ -50,16 +50,12 @@ |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>课程</label> |
|
|
|
|
<el-select v-model="curriculumId" |
|
|
|
|
placeholder="请选择" |
|
|
|
|
@change="initData"> |
|
|
|
|
<el-option label="不限" |
|
|
|
|
value=""></el-option> |
|
|
|
|
<el-option v-for="item in curriculumList" |
|
|
|
|
:key="item.cid" |
|
|
|
|
:label="item.goodsName" |
|
|
|
|
:value="item.cid"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
<el-cascader v-model="mallIds" |
|
|
|
|
:options="curs" |
|
|
|
|
:props="{ checkStrictly: true, value: 'id' }" |
|
|
|
|
popper-class="course-cas" |
|
|
|
|
@expand-change="curChange" |
|
|
|
|
@change="curChange"></el-cascader> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</div> |
|
|
|
@ -272,12 +268,15 @@ export default { |
|
|
|
|
curriculumId: "", |
|
|
|
|
keyWord: "", // 搜索框筛选条件 |
|
|
|
|
searchTimer: null, |
|
|
|
|
mallIds: [], |
|
|
|
|
curs: [], |
|
|
|
|
form: { |
|
|
|
|
type: "", |
|
|
|
|
status: "", |
|
|
|
|
startTime: "", |
|
|
|
|
endTime: "", |
|
|
|
|
month: "" |
|
|
|
|
month: "", |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
pageNum: +this.$route.query.page || 1, // 当前页数 |
|
|
|
|
pageSize: 10, // 每页10条 |
|
|
|
@ -326,8 +325,7 @@ export default { |
|
|
|
|
clearInterval(this.ticker); |
|
|
|
|
this.ticker = null; |
|
|
|
|
}); |
|
|
|
|
this.getData(1); |
|
|
|
|
this.getschoolCourse(); |
|
|
|
|
this.getCourse(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
pickerInput () { |
|
|
|
@ -368,12 +366,16 @@ export default { |
|
|
|
|
}, |
|
|
|
|
getData (counddown) { |
|
|
|
|
this.listLoading = true; |
|
|
|
|
const { mallIds } = this |
|
|
|
|
const cur = this.curs.find(e => e.mallId == mallIds[0]) |
|
|
|
|
let data = { |
|
|
|
|
...this.form, |
|
|
|
|
keyWord: this.keyWord, |
|
|
|
|
pageNum: this.pageNum, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
curriculumId: this.curriculumId |
|
|
|
|
cid: cur.cid, |
|
|
|
|
mallId: mallIds[0], |
|
|
|
|
systemId: mallIds[1] |
|
|
|
|
}; |
|
|
|
|
this.$post(this.api.pageByCondition, data).then(res => { |
|
|
|
|
this.listData = res.list; |
|
|
|
@ -409,16 +411,37 @@ export default { |
|
|
|
|
}, |
|
|
|
|
initData () { |
|
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
|
this.pageNum = 1; |
|
|
|
|
this.pageNum = 1 |
|
|
|
|
this.getData(); |
|
|
|
|
}, |
|
|
|
|
getschoolCourse () { // 获取课程下拉框数据 |
|
|
|
|
this.$get(this.api.schoolCourse).then(res => { |
|
|
|
|
this.curriculumList = res.data; |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// 获取课程 |
|
|
|
|
async getCourse () { |
|
|
|
|
const { data } = await this.$get(this.api.getSystemIdBySchool) |
|
|
|
|
const res = await this.$get(this.api.getSchoolEffectiveCourse) |
|
|
|
|
if (res.data.length) { |
|
|
|
|
res.data.map(e => { |
|
|
|
|
e.id = e.mallId |
|
|
|
|
e.label = e.curriculumName |
|
|
|
|
e.children = data.filter(n => e.systemId.split(',').includes(n.id + '')) // 筛选出该课程下的系统 |
|
|
|
|
}) |
|
|
|
|
this.curs = res.data |
|
|
|
|
this.mallIds = [res.data[0].mallId, data[0].id] |
|
|
|
|
this.pageNum = 1 |
|
|
|
|
this.getData(1) |
|
|
|
|
console.log("🚀 ~ file: index.vue:431 ~ getSystemData ~ res.data:", this.mallIds) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 课程选择回调 |
|
|
|
|
curChange (val) { |
|
|
|
|
const id = val[0] |
|
|
|
|
if (val.length === 1) { |
|
|
|
|
// 如果选择的是课程,则默认选中下面第一个系统 |
|
|
|
|
this.mallIds = [id, this.curs.find(e => e.id == id).children[0].id] |
|
|
|
|
} |
|
|
|
|
this.initData() |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
add () { |
|
|
|
|
this.$router.push("add"); |
|
|
|
|
}, |
|
|
|
|