|
|
|
@ -5,27 +5,42 @@ |
|
|
|
|
<ul class="filter" style="align-items: flex-start"> |
|
|
|
|
<li> |
|
|
|
|
<label>学科类:</label> |
|
|
|
|
<el-select v-model="form.visibleRange" clearable placeholder="请选择可见范围" @change="getData"> |
|
|
|
|
<el-option v-for="(item,index) in regions" :key="index" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
<el-select v-model="form.categoryId" clearable |
|
|
|
|
@change="getProfessionalClass()" @clear="clearClass()"> |
|
|
|
|
<el-option v-for="(item,index) in subjectList" :key="index" |
|
|
|
|
:label="item.disciplineName" |
|
|
|
|
:value="item.disciplineId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>专业类:</label> |
|
|
|
|
<el-select v-model="form.professionalCategoryId" clearable |
|
|
|
|
:disabled="form.categoryId ? false : true" |
|
|
|
|
@change="getProfessional" @clear="clearProfess()"> |
|
|
|
|
<el-option v-for="(item,index) in professionalClassList" :key="index" |
|
|
|
|
:label="item.professionalClassName" |
|
|
|
|
:value="item.professionalClassId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>专业:</label> |
|
|
|
|
<el-select v-model="form.categoryId" clearable placeholder="请选择课程分类" @change="getData"> |
|
|
|
|
<el-option label="不限" value=""></el-option> |
|
|
|
|
<el-option label="暂无分类" value="0"></el-option> |
|
|
|
|
<el-option v-for="(item,index) in classificationList" :key="index" :label="item.classificationName" :value="item.id"></el-option> |
|
|
|
|
<el-select v-model="form.professionalId" clearable |
|
|
|
|
:disabled="form.professionalCategoryId ? false : true" |
|
|
|
|
@change="initData"> |
|
|
|
|
<el-option v-for="(item,index) in professionalList" :key="index" |
|
|
|
|
:label="item.professionalName" |
|
|
|
|
:value="item.professionalId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>产品分类:</label> |
|
|
|
|
<el-select v-model="form.courseType" clearable placeholder="请选择课程类型" @change="getData"> |
|
|
|
|
<el-option v-for="(item,index) in types" :key="index" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
<el-select v-model="form.productClassification" clearable placeholder="请选择产品分类" @change="initData"> |
|
|
|
|
<el-option v-for="(item, i) in productCategoryList" :key="i" :label="item.classificationName" :value="item.classificationId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>搜索:</label> |
|
|
|
|
<el-input placeholder="请输入" suffix-icon="el-icon-search" v-model="keyword" clearable size="small"></el-input> |
|
|
|
|
<el-input placeholder="请输入" suffix-icon="el-icon-search" v-model="form.productName" clearable size="small"></el-input> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
<div> |
|
|
|
@ -52,7 +67,11 @@ |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="courseName" label="订单量" min-width="150" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="userName" label="最近编辑人" min-width="150" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="courseName" label="精选" min-width="150" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="courseName" label="精选" min-width="150" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<i :class="['icon', scope.row.selected ? 'el-icon-check' : 'el-icon-close']" @click="selected(scope.row)"></i> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="上架/下架" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-switch |
|
|
|
@ -85,52 +104,26 @@ export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
timer: null, |
|
|
|
|
regionName: ['本校内', '全平台可见', '指定院校区域'], |
|
|
|
|
regions: [ |
|
|
|
|
{ |
|
|
|
|
id: '', |
|
|
|
|
name: '不限' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
name: '全平台' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 2, |
|
|
|
|
name: '指定院校区域' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
types: [ |
|
|
|
|
{ |
|
|
|
|
id: '', |
|
|
|
|
name: '不限' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
name: '付费' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 0, |
|
|
|
|
name: '免费' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
form: { |
|
|
|
|
visibleRange: '', |
|
|
|
|
categoryId: '', |
|
|
|
|
courseType: '' |
|
|
|
|
productClassification: '', |
|
|
|
|
productName: '', |
|
|
|
|
professionalCategoryId: '', |
|
|
|
|
professionalId: '', |
|
|
|
|
}, |
|
|
|
|
keyword: "", |
|
|
|
|
classificationId: "", |
|
|
|
|
subjectList: [], //专业学科 |
|
|
|
|
professionalClassList: [], //专业类 |
|
|
|
|
professionalList: [], //专业 |
|
|
|
|
productCategoryList: [], |
|
|
|
|
list: [], |
|
|
|
|
multipleSelection: [], |
|
|
|
|
classificationList: [], |
|
|
|
|
page: +this.$route.query.page || 1, // 当前页码 |
|
|
|
|
pageSize: 10, |
|
|
|
|
total: 0 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
keyword: function(val) { |
|
|
|
|
'form.productName': function(val) { |
|
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
this.initData(); |
|
|
|
@ -138,17 +131,15 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.getClassification(); |
|
|
|
|
this.initData(); |
|
|
|
|
this.getSubject() |
|
|
|
|
this.getCategory() |
|
|
|
|
this.initData() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
getData() { |
|
|
|
|
this.$post(this.api.listOfGoods, { |
|
|
|
|
pageNum: this.page, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
// keyWord: this.keyword, |
|
|
|
|
// createPlatform: 0, |
|
|
|
|
// platformSource: Setting.platformSource, |
|
|
|
|
...this.form |
|
|
|
|
}).then(({ page }) => { |
|
|
|
|
this.list = page.records; |
|
|
|
@ -160,24 +151,61 @@ export default { |
|
|
|
|
this.page = 1; |
|
|
|
|
this.getData(); |
|
|
|
|
}, |
|
|
|
|
getClassification() { |
|
|
|
|
this.$post(this.api.listClassification, { |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 1000, |
|
|
|
|
platformSource: Setting.platformSource |
|
|
|
|
}).then(({ page }) => { |
|
|
|
|
this.classificationList = page.records |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
changeType(type) { |
|
|
|
|
this.classificationId = type; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取产品分类 |
|
|
|
|
getCategory() { |
|
|
|
|
this.$get(this.api.productCategoryList).then(res => { |
|
|
|
|
this.productCategoryList = res.classificationList |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
// 获取学科类别 |
|
|
|
|
getSubject() { |
|
|
|
|
this.$get(this.api.courseDiscipline).then(res => { |
|
|
|
|
this.subjectList = res.list; |
|
|
|
|
}).catch(err => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 清除学科类别 |
|
|
|
|
clearClass() { |
|
|
|
|
this.form.professionalCategoryId = ""; |
|
|
|
|
this.form.professionalId = ""; |
|
|
|
|
}, |
|
|
|
|
// 获取专业类 |
|
|
|
|
getProfessionalClass() { |
|
|
|
|
this.clearClass(); |
|
|
|
|
this.getProfessionalClassData(); |
|
|
|
|
this.page = 1; |
|
|
|
|
this.initData(); |
|
|
|
|
}, |
|
|
|
|
preview(row) { |
|
|
|
|
this.$router.push(`/previewTheoreticalCourse?id=${row.id}`); |
|
|
|
|
getProfessionalClassData() { |
|
|
|
|
let data = { |
|
|
|
|
disciplineId: this.form.categoryId |
|
|
|
|
}; |
|
|
|
|
this.$get(this.api.courseProfessionalClass, data).then(res => { |
|
|
|
|
this.professionalClassList = res.list; |
|
|
|
|
}).catch(err => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 清除专业类 |
|
|
|
|
clearProfess() { |
|
|
|
|
this.form.professionalId = ""; |
|
|
|
|
}, |
|
|
|
|
config(row) { |
|
|
|
|
this.$router.push(`/setTheoreticalCourse?id=${row.id}`); |
|
|
|
|
// 获取专业 |
|
|
|
|
getProfessional() { |
|
|
|
|
this.clearProfess(); |
|
|
|
|
this.getProfessionalData(); |
|
|
|
|
this.page = 1; |
|
|
|
|
this.initData(); |
|
|
|
|
}, |
|
|
|
|
getProfessionalData() { |
|
|
|
|
let data = { |
|
|
|
|
professionalClassId: this.form.professionalCategoryId |
|
|
|
|
}; |
|
|
|
|
this.$get(this.api.courseProfessional, data).then(res => { |
|
|
|
|
this.professionalList = res.list; |
|
|
|
|
}).catch(err => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
addCourse() { |
|
|
|
|
this.$router.push("/shop/addProduct"); |
|
|
|
@ -233,9 +261,14 @@ export default { |
|
|
|
|
changeSwitch(value, row) { |
|
|
|
|
this.$post(`${this.api.goodsOffTheShelf}?mallId=${row.mallId}&isShelves=${value}`).then((res) => { |
|
|
|
|
this.getData(); |
|
|
|
|
this.$message.success("修改上下架状态成功!"); |
|
|
|
|
}).catch((res) => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 精选 |
|
|
|
|
selected(row) { |
|
|
|
|
this.$post(`${this.api.goodsSelection}?mallId=${row.mallId}&selected=${row.selected ? 0 : 1}`).then((res) => { |
|
|
|
|
this.getData(); |
|
|
|
|
}).catch((res) => {}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
@ -249,4 +282,9 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.icon { |
|
|
|
|
font-size: 16px; |
|
|
|
|
color: #9076FF; |
|
|
|
|
cursor: pointer; |
|
|
|
|
} |
|
|
|
|
</style> |