Commit 0e18f48c authored by zhengke's avatar zhengke

修改

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