Commit ce913a28 authored by 黄奎's avatar 黄奎

页面修改

parent f4e5b148
...@@ -403,9 +403,40 @@ export function BeatchReadMsgLog(data) { ...@@ -403,9 +403,40 @@ export function BeatchReadMsgLog(data) {
}) })
} }
/**
* 新增修改班级课程
* @param {JSON对象} data
*/
export function setClassCourse(data) {
return request({
url: '/Class/SetClassCourse',
method: 'post',
data
})
}
/**
* 获取班级关联课程列表
* @param {JSON对象} data
*/
export function queryClassCourseList(data) {
return request({
url: '/Class/GetClassCourseList',
method: 'post',
data
})
}
/**
* 获取班级关联课程列表
* @param {JSON对象} data
*/
export function deleteClassCourse(data) {
return request({
url: '/Class/RemoveClassCourse',
method: 'post',
data
})
}
\ No newline at end of file
\ No newline at end of file
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<q-card-section class="q-pt-none scroll" style="max-height: 70vh"> <q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<q-select dense standout behavior="menu" filled v-model="chosenCourse" :options="courseOptions" <q-select dense standout behavior="menu" filled v-model="selectCourse" :options="courseOptions"
@filter="filterCourseFn" input-debounce="0" use-input option-label="CourseName" option-value="CourseId" @filter="filterCourseFn" input-debounce="0" use-input option-label="CourseName" option-value="CourseId"
emit-value map-options placeholder="请选择" clearable /> emit-value map-options placeholder="请选择" clearable />
</div> </div>
...@@ -18,11 +18,17 @@ ...@@ -18,11 +18,17 @@
<q-btn color="primary" label="添加" @click="addCourse"></q-btn> <q-btn color="primary" label="添加" @click="addCourse"></q-btn>
</div> </div>
</div> </div>
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat style="margin-top:20px;" class="sticky-column-table" <q-table :pagination="msg" no-data-label="暂无相关数据" flat style="margin-top:20px;" class="sticky-column-table"
separator="none" :data="dataList" :columns="columns"> separator="none" :data="dataList" :columns="columns">
<template v-slot:body-cell-Id="props">
<q-td auto-width :props="props">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="删除"
@click="deleteClassCourse(props.row,props.row.index)" />
</q-td>
</template>
<template v-slot:bottom> <template v-slot:bottom>
<!-- <q-pagination class="full-width justify-end" v-model="msg.PageIndex" color="primary" :max="msg.PageCount" <!-- <q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" /> --> :input="true" @input="changePage" /> -->
</template> </template>
</q-table> </q-table>
</q-card-section> </q-card-section>
...@@ -37,25 +43,29 @@ ...@@ -37,25 +43,29 @@
</template> </template>
<script> <script>
import {
queryCourseDropdownList,
setClassCourse,
queryClassCourseList,
deleteClassCourse
} from '../../api/course/index'
export default { export default {
components: {}, components: {},
props: { props: {
setingObj: {
type: Object,
default: null
}
}, },
data() { data() {
return { return {
msg: {},
persistent: true, persistent: true,
saveCourseLoading: false, saveCourseLoading: false,
chosenCourse: null, //选中的课程 selectCourse: "", //选中的课程
chosenCourses: [], CourseList: [], //课程列表
courseOptions: [{ courseOptions: [], //筛选的课程列表
CourseName: '考级保研班1', dataList: [],
CourseId: 1
}, {
CourseName: '考级保研班2',
CourseId: 2
}],
dataList:[],
columns: [{ columns: [{
name: 'CourseName', name: 'CourseName',
label: '课程名称', label: '课程名称',
...@@ -63,34 +73,70 @@ ...@@ -63,34 +73,70 @@
align: 'left' align: 'left'
}, },
{ {
name: 'Price', name: 'SellPrice',
label: '价格', label: '价格',
field: 'Price', field: 'SellPrice',
align: 'left' align: 'left'
}, },
{ {
name: 'CourseHour', name: 'ClassHours',
label: '课时数', label: '课时数',
field: 'CourseHour', field: 'ClassHours',
align: 'left' align: 'left'
}, },
{ {
name: 'CateId', name: 'Id',
label: '操作', label: '操作',
field: 'CateId' field: 'Id'
} }
], ],
} }
}, },
created() { created() {
this.getCourseList();
}, },
mounted() { mounted() {
this.getClassCourse();
}, },
methods: { methods: {
//获取课程列表
getCourseList() {
queryCourseDropdownList({
IsQPrice: 1
}).then(res => {
if (res.Code == 1) {
this.CourseList = res.Data;
this.courseOptions = this.CourseList;
}
})
},
//获取班级关联课程列表
getClassCourse() {
queryClassCourseList({
ClassId: this.setingObj.ClassId
}).then(res => {
if (res.Code == 1) {
this.dataList = res.Data;
}
})
},
saveCourse() { saveCourse() {
var saveMsg = {
courseMsg: this.dataList
};
setClassCourse(saveMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.closeCourseForm();
this.$emit("success");
}
});
}, },
//关闭弹窗 //关闭弹窗
closeCourseForm() { closeCourseForm() {
...@@ -100,13 +146,66 @@ ...@@ -100,13 +146,66 @@
//课程筛选 //课程筛选
filterCourseFn(val, update, abort) { filterCourseFn(val, update, abort) {
update(() => { update(() => {
// this.courseOptions = this.courseList.filter( this.courseOptions = this.CourseList.filter(
// v => v.CourseName.indexOf(val) > -1 v => v.CourseName.indexOf(val) > -1
// ); );
}); });
}, },
//添加关联课程
addCourse() { addCourse() {
if (this.selectCourse) {
let temp = this.CourseList.find(x => x.CourseId == this.selectCourse);
if (temp) {
this.dataList.push({
Id: 0,
ClassId: this.setingObj.ClassId,
CourseId: temp.CourseId,
CourseName: temp.CourseName,
SellPrice: temp.SellPrice,
ClassHours: temp.ClassHours,
});
}
this.selectCourse = "";
}
},
//删除班级课程
deleteClassCourse(item, index) {
var delMsg = {
Id: item.Id
};
this.$q.dialog({
title: '提示信息',
message: "是否要删除此关联课程?",
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
if (item.Id > 0) {
deleteClassCourse(delMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '删除成功!',
position: 'top'
})
this.dataList.splice(index, 1);
} else {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: res.Message,
position: 'top'
})
}
})
} else {
this.dataList.splice(index, 1);
}
}).onCancel(() => {});
} }
} }
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div class="text-muted" style="font-size:13px">{{showObj.SchoolName}}·{{showObj.PostName}}</div> <div class="text-muted" style="font-size:13px">{{showObj.SchoolName}}·{{showObj.PostName}}</div>
<div class="flex items-center text-muted"> <div class="flex items-center text-muted">
<inline-svg class="svg-icon svg-icon-primary q-mr-xs" src="icons/svg/Communication/Mail-notification.svg"></inline-svg> <inline-svg class="svg-icon svg-icon-primary q-mr-xs" src="icons/svg/Communication/Mail-notification.svg"></inline-svg>
<span>alex9012@vip.qq.com</span> <span>{{showObj.Email}}</span>
</div> </div>
<div class="q-mt-xs"> <div class="q-mt-xs">
<q-btn color="primary" flat @click="logout">退出登录</q-btn> <q-btn color="primary" flat @click="logout">退出登录</q-btn>
......
<style> <style>
.OtherCourseNum{ .OtherCourseNum {
display:inline-block; display: inline-block;
width:25px; width: 25px;
height:25px; height: 25px;
text-align: center; text-align: center;
line-height: 25px; line-height: 25px;
border:1px solid #2961FE; border: 1px solid #2961FE;
border-radius: 50%; border-radius: 50%;
cursor: pointer; cursor: pointer;
} }
.OCourseTable{
width:400px; .OCourseTable {
width: 400px;
text-align: center; text-align: center;
} }
.OCourseTable tr td{
height:40px; .OCourseTable tr td {
height: 40px;
} }
.OCourseTable tr th{
height:40px; .OCourseTable tr th {
height: 40px;
background-color: rgb(238, 238, 239); background-color: rgb(238, 238, 239);
} }
</style> </style>
<template> <template>
<div class="page-body"> <div class="page-body">
...@@ -48,8 +52,9 @@ ...@@ -48,8 +52,9 @@
</div> </div>
</div> </div>
<div class="page-content"> <div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table sticky-right-column-table" <q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat
separator="none" :data="data" :columns="columns" row-key="name"> class="sticky-column-table sticky-right-column-table" separator="none" :data="data" :columns="columns"
row-key="name">
<template v-slot:top="props"> <template v-slot:top="props">
<div class="col-2 q-table__title">班级信息</div> <div class="col-2 q-table__title">班级信息</div>
<q-space /> <q-space />
...@@ -67,23 +72,34 @@ ...@@ -67,23 +72,34 @@
</template> </template>
<template v-slot:body-cell-OtherCourseName="props"> <template v-slot:body-cell-OtherCourseName="props">
<q-td auto-width :props="props"> <q-td auto-width :props="props">
课程名称:<span class="OtherCourseNum"> <template v-if="props.row.OtherCourseList">
8 <template v-if="props.row.OtherCourseList.length==1">
<q-popup-proxy> {{props.row.OtherCourseList[0].CourseName}}{{props.row.OtherCourseList[0].ClassHours}}课时】
<q-banner> </template>
<table class="OCourseTable" style="border-collapse:collapse;"> <template v-if="props.row.OtherCourseList.length>1">
<tr> {{props.row.OtherCourseList[0].CourseName}}
<th>课程名称</th> <span class="OtherCourseNum">
<th>课时数</th> {{props.row.OtherCourseList.length}}
</tr> <q-popup-proxy>
<tr> <q-banner>
<td>日语N10</td> <table class="OCourseTable" style="border-collapse:collapse;">
<td>12</td> <tr>
</tr> <th>课程名称</th>
</table> <th>课时数</th>
</q-banner> </tr>
</q-popup-proxy> <tr v-for="(sItem,sIndex) in props.row.OtherCourseList">
</span> <td>{{sItem.CourseName}}</td>
<td>{{sItem.ClassHours}}</td>
</tr>
</table>
</q-banner>
</q-popup-proxy>
</span>
</template>
<template v-if="props.row.OtherCourseList.length==0">
</template>
</template>
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-TeacherName="props"> <template v-slot:body-cell-TeacherName="props">
...@@ -138,10 +154,8 @@ ...@@ -138,10 +154,8 @@
</template> </template>
<template v-slot:body-cell-optioned="props"> <template v-slot:body-cell-optioned="props">
<q-td :props="props"> <q-td :props="props">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑" <q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="EditCourse(props.row)" /> @click="EditCourse(props.row)" />
<q-btn-dropdown flat size="xs" color="dark" label="更多" style="margin-left:10px;"> <q-btn-dropdown flat size="xs" color="dark" label="更多" style="margin-left:10px;">
<q-list> <q-list>
<q-item clickable v-close-popup @click="gotoOrder(props.row)"> <q-item clickable v-close-popup @click="gotoOrder(props.row)">
...@@ -164,7 +178,7 @@ ...@@ -164,7 +178,7 @@
<q-item-label>恢复</q-item-label> <q-item-label>恢复</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup @click="getOtherCourse(props.row)"> <q-item clickable v-close-popup @click="showOtherCourse(props.row)">
<q-item-section> <q-item-section>
<q-item-label>关联其他课程</q-item-label> <q-item-label>关联其他课程</q-item-label>
</q-item-section> </q-item-section>
...@@ -176,9 +190,11 @@ ...@@ -176,9 +190,11 @@
</q-table> </q-table>
<class-form v-if="isShowClassForm" :save-obj="classObjOption" @close="closeClassSaveForm" @success="refreshPage"> <class-form v-if="isShowClassForm" :save-obj="classObjOption" @close="closeClassSaveForm" @success="refreshPage">
</class-form> </class-form>
<classinfo-form v-if="isShowClassInfo" :seting-obj="classObjOption" @close="closeClass" @success="refreshClass"> <classinfo-form v-if="isShowClassInfo" :seting-obj="classObjOption" @close="closeClassSaveForm"
@success="refreshPage">
</classinfo-form> </classinfo-form>
<othercourseForm v-if="IsShowOtherCourse" @close="closeOtherCourse" @success="refreshOtherCourse"> <othercourseForm v-if="IsShowOtherCourse" :seting-obj="classObjOption" @close="closeClassSaveForm"
@success="refreshPage">
</othercourseForm> </othercourseForm>
</div> </div>
</div> </div>
...@@ -271,7 +287,6 @@ ...@@ -271,7 +287,6 @@
], ],
data: [], data: [],
loading: false, loading: false,
isShowClassForm: false,
msg: { msg: {
pageIndex: 1, pageIndex: 1,
pageSize: 12, pageSize: 12,
...@@ -288,13 +303,14 @@ ...@@ -288,13 +303,14 @@
schoolList: [], schoolList: [],
pageCount: 0, pageCount: 0,
classObjOption: null, classObjOption: null,
isShowClassInfo: false, //是否显示课程信息
isShowEdit: false, isShowEdit: false,
statusMsg: { statusMsg: {
ClassId: 0, ClassId: 0,
ClassStatus: 0 ClassStatus: 0
}, },
IsShowOtherCourse:false, isShowClassForm: false, //是否显示新增修改弹窗
isShowClassInfo: false, //是否显示课程信息
IsShowOtherCourse: false, //是否显示其他课程
} }
}, },
created() { created() {
...@@ -454,7 +470,12 @@ ...@@ -454,7 +470,12 @@
}, },
//关闭弹窗 //关闭弹窗
closeClassSaveForm() { closeClassSaveForm() {
this.isShowClassForm = false //关闭新增修改弹窗
this.isShowClassForm = false;
//关闭班级信息弹窗
this.isShowClassInfo = false;
//关闭关联其他课程弹窗
this.IsShowOtherCourse = false;
}, },
GetFirst(val) { GetFirst(val) {
if (val) { if (val) {
...@@ -468,28 +489,11 @@ ...@@ -468,28 +489,11 @@
} }
return (Math.round(num / total * 100) / 100.00); return (Math.round(num / total * 100) / 100.00);
}, },
//关闭班级信息弹窗 //显示关联课程
closeClass() { showOtherCourse(item) {
this.isShowClassInfo = false this.IsShowOtherCourse = true;
this.classObjOption = item;
}, },
//刷新
refreshClass() {
},
getOtherCourse(){
this.IsShowOtherCourse=true;
},
//关闭关联其他课程弹窗
closeOtherCourse(){
},
//关联其他课程保存成功刷新
refreshOtherCourse(){
},
//点击班级名称 //点击班级名称
getClassInfo(obj) { getClassInfo(obj) {
this.classObjOption = null; this.classObjOption = null;
......
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