Commit 0e18f48c authored by zhengke's avatar zhengke

修改

parent c63d8c66
......@@ -9,12 +9,17 @@
<div class="row wrap">
<q-input filled stack-label maxlength="30" :dense="false" v-model="objOption.CateName" ref="CateName"
class="col-6 q-pr-lg q-pb-lg" label="系列名称" :rules="[val => !!val || '系列名称']" />
<q-input filled stack-label maxlength="5" :dense="false" v-model="objOption.SortNum" ref="SortNum"
<q-select filled class="col-6 q-pr-lg q-pb-lg" v-model="objOption.CourseSubject"
:options="CourseSubjectList" option-label="Name" option-value="Id" emit-value map-options label="所属科目"
clearable />
</div>
<div class="row wrap">
<q-input filled stack-label maxlength="5" :dense="false" v-model="objOption.SortNum" ref="SortNum"
class="col-6 q-pr-lg q-pb-lg" label="排序" @keyup.native="checkInteger(objOption,'SortNum')" />
<div class="col-12 q-pr-lg q-pb-lg q-pt-lg">
<q-toggle size="md" label="状态" color="primary" :false-value="1" :true-value="0" v-model="objOption.Status"
title="注意:关闭后,分类将无法正常使用." />
</div>
</div>
<div class="col-12 q-pr-lg q-pb-lg q-pt-lg">
<q-toggle size="md" label="状态" color="primary" :false-value="1" :true-value="0" v-model="objOption.Status"
title="注意:关闭后,分类将无法正常使用." />
</div>
</q-card-section>
<q-separator />
......@@ -30,7 +35,8 @@
import {
queryCourseCategoryTree,
queryCourseCategoryInfo,
saveCourseCategoryInfo
saveCourseCategoryInfo,
getCourseSubject
} from '../../api/course/index'
export default {
props: {
......@@ -49,19 +55,29 @@
CateName: "", //系列名称
SortNum: 0, //排序
Status: 0, //状态(0-正常,1-禁用)},
CourseSubject:''
},
optionTitle: "",
//树形课程分类列表
TreeCategoryList: [],
saveLoading: false,
chooseCategroyArray: [],
CourseSubjectList:[]
}
},
mounted() {
this.getCategoryTreeList();
this.initObj()
this.initObj();
this.queryCourseSubject();
},
methods: {
queryCourseSubject() {
getCourseSubject({}).then(res => {
if (res.Code == 1) {
this.CourseSubjectList = res.Data;
}
})
},
//获取树形课程分类列表
getCategoryTreeList() {
this.TreeCategoryList = [];
......@@ -82,6 +98,7 @@
this.objOption.CateName = res.Data.CateName;
this.objOption.SortNum = res.Data.SortNum;
this.objOption.Status = res.Data.Status;
this.objOption.CourseSubject = res.Data.CourseSubject;
if (res.Data.ParentId && res.Data.ParentId > 0) {
this.chooseCategroyArray.push(res.Data.ParentId);
}
......
......@@ -87,14 +87,14 @@
ref="ClassHours" class="col-6 q-pr-lg q-pb-lg" label="课时数量" :rules="[(val) => !!val || '请填写课时信息']" />
</div>
<div class="col-6">
<q-select filled stack-label option-value="CateId" option-label="CateName" v-model="objOption.CateId"
<q-select filled stack-label @input="getCourseSubject(objOption.CateId)" option-value="CateId" option-label="CateName" v-model="objOption.CateId"
ref="CateId" :options="TreeCategoryList" label="所属系列" class="col-6 q-pr-lg q-pb-lg" emit-value map-options
:rules="[(val) => !!val || '请选择课程所属系列']" />
</div>
</div>
<div class="row wrap">
<div class="col-6">
<q-select filled stack-label option-value="Id" option-label="Name" v-model="objOption.CourseSubject"
<q-select filled stack-label option-value="Id" disable option-label="Name" v-model="objOption.CourseSubject"
ref="CourseSubject" :options="courseSubjectList" label="所属科目" class="col-6 q-pr-lg q-pb-lg" emit-value
map-options />
</div>
......@@ -237,6 +237,13 @@
this.initObj();
},
methods: {
//根据系列改变获取所属科目
getCourseSubject(Id){
if(Id>0){
let val = this.TreeCategoryList.find(x => x.CateId == Id);
this.objOption.CourseSubject = val.CourseSubject;
}
},
//获取课程等级列表
getCourseRateList() {
getCourseRate({}).then(res => {
......@@ -297,6 +304,10 @@
var qMsg = {};
queryCourseCategoryTree(qMsg).then((res) => {
this.TreeCategoryList = res.Data;
if(this.objOption.CateId>0){
let val = this.TreeCategoryList.find(x => x.CourseSubject == this.objOption.CateId);
this.objOption.CourseSubject = val.CourseSubject;
}
});
},
//新增阶梯定价
......
......@@ -3,9 +3,14 @@
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input @input="resetSearch" clearable standout="bg-primary text-white" v-model="msg.CateName" label="系列名称"
<q-input @input="resetSearch" clearable filled v-model="msg.CateName" label="系列名称"
@clear="resetSearch" maxlength="20" />
</div>
<div class="col-3">
<q-select @input="resetSearch" filled v-model="msg.CourseSubject"
:options="CourseSubjectList" option-label="Name" option-value="Id" emit-value map-options label="所属科目"
clearable />
</div>
</div>
</div>
<div class="page-content">
......@@ -45,7 +50,8 @@
<script>
import {
queryCourseCategoryPage,
deleteCourseCategory
deleteCourseCategory,
getCourseSubject
} from '../../api/course/index'
import categoryForm from '../../components/course/category-form'
......@@ -64,7 +70,9 @@
rowsPerPage: 10,
PageCount: 1,
CateName: "", //系列名称
CourseSubject:'' //所属科目
},
CourseSubjectList: [], //科目列表
currentUrl: "",
dataList: [],
keyWords: '',
......@@ -73,6 +81,11 @@
categoryObj: {},
loading: true,
columns: [{
name: 'CourseSubjectName',
label: '所属科目',
field: 'CourseSubjectName',
align: 'left'
},{
name: 'CateName',
label: '系列名称',
field: 'CateName',
......@@ -114,9 +127,17 @@
mounted() {
this.currentUrl = this.$route.path
this.getcategorypage()
this.getcategorypage();
this.queryCourseSubject()
},
methods: {
queryCourseSubject() {
getCourseSubject({}).then(res => {
if (res.Code == 1) {
this.CourseSubjectList = res.Data;
}
})
},
//重新查询
resetSearch() {
this.msg.PageIndex = 1;
......
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