Commit 32f66037 authored by 黄奎's avatar 黄奎

页面修改

parent 333c48aa
......@@ -71,6 +71,20 @@ export function queryCoursePage(data) {
})
}
/**
* 获取课程下拉列表
* @param {JSON对象} data
*/
export function queryCourseDropdownList(data)
{
return request({
url: '/Course/GetCourseList',
method: 'post',
data
})
}
/**
* 获取课程详情
* @param {JSON参数} data
......
......@@ -5,11 +5,11 @@ import request from '../../utils/request'
*
*/
export function getSchoolPage(data) {
return request({
url: '/user/GetSchoolPageList',
method: 'post',
data
})
return request({
url: '/user/GetSchoolPageList',
method: 'post',
data
})
}
/**
......@@ -17,11 +17,11 @@ export function getSchoolPage(data) {
*
*/
export function getSchoolDropdown(data) {
return request({
url: '/user/GetSchoolList',
method: 'post',
data
})
return request({
url: '/user/GetSchoolList',
method: 'post',
data
})
}
/**
......@@ -29,43 +29,54 @@ export function getSchoolDropdown(data) {
*
*/
export function saveSchool(data) {
return request({
url: '/user/SetSchool',
method: 'post',
data
})
return request({
url: '/user/SetSchool',
method: 'post',
data
})
}
/**
* 获取教师分页数据
*/
export function getTeacherPage(data) {
return request({
url: '/user/GetTeacherPageList',
method: 'post',
data
})
return request({
url: '/user/GetTeacherPageList',
method: 'post',
data
})
}
/**
* 获取讲师列表
*/
export function getTeacherDropDownList(data) {
return request({
url: '/user/GetTeacherList',
method: 'post',
data
})
}
/**
* 保存教师信息
*/
export function saveTeacher(data) {
return request({
url: '/user/SetTeacher',
method: 'post',
data
})
return request({
url: '/user/SetTeacher',
method: 'post',
data
})
}
/**
* 教师审核
*/
export function auditTeacher(data) {
return request({
url: '/user/AuditTeacher',
method: 'post',
data
})
return request({
url: '/user/AuditTeacher',
method: 'post',
data
})
}
/**
......@@ -73,44 +84,56 @@ export function auditTeacher(data) {
* @param {TId} data
*/
export function deleteTeacher(data) {
return request({
url: '/user/RemoveTeacher',
method: 'post',
data
})
return request({
url: '/user/RemoveTeacher',
method: 'post',
data
})
}
/**
* 获取助教分页数据
*/
export function getAssistPage(data) {
return request({
url: '/user/GetAssistPageList',
method: 'post',
data
})
return request({
url: '/user/GetAssistPageList',
method: 'post',
data
})
}
/**
* 获取助教下拉列表
* @param {JSON对象} data
*/
export function getAssistDropDownList(data) {
return request({
url: '/user/GetAssistList',
method: 'post',
data
})
}
/**
* 保存教师信息
*/
export function saveAssist(data) {
return request({
url: '/user/SetAssist',
method: 'post',
data
})
return request({
url: '/user/SetAssist',
method: 'post',
data
})
}
/**
* 教师审核
*/
export function auditAssist(data) {
return request({
url: '/user/AuditAssist',
method: 'post',
data
})
return request({
url: '/user/AuditAssist',
method: 'post',
data
})
}
/**
......@@ -118,9 +141,138 @@ export function auditAssist(data) {
* @param {AId} data
*/
export function deleteAssist(data) {
return request({
url: '/user/RemoveAssist',
method: 'post',
data
})
}
\ No newline at end of file
return request({
url: '/user/RemoveAssist',
method: 'post',
data
})
}
/**
* 获取班级分页列表
* @param {JSON数据} data
*/
export function getClassPage(data) {
return request({
url: '/Class/GetClassPageList',
method: 'post',
data
})
}
/**
* 获取班级列表【下拉使用】
* @param {JSON数据} data
*/
export function getClassDropDownList(data) {
return request({
url: '/Class/GetClassList',
method: 'post',
data
})
}
/**
* 新增修改班级
* @param {JSON数据} data
*/
export function saveClass(data) {
return request({
url: '/Class/SetClass',
method: 'post',
data
})
}
/**
* 新增修改班级
* @param {JSON数据} data
*/
export function getClassInfo(data) {
return request({
url: '/Class/GetClass',
method: 'post',
data
})
}
/**
* 删除班级
* @param {JSON数据} data
*/
export function deleteClass(data) {
return request({
url: '/Class/RemoveClass',
method: 'post',
data
})
}
/**
* 获取学员分页列表
* @param {JSON数据} data
*/
export function getStudentPage(data) {
return request({
url: '/User/GetStudentPageList',
method: 'post',
data
})
}
/**
* 获取学员下拉类表
*/
export function getStudentDorpDownList(data) {
return request({
url: '/User/GetStudentList',
method: 'post',
data
})
}
/**
* 添加修改学员
*/
export function saveStudent(data) {
return request({
url: '/User/SetStudent',
method: 'post',
data
})
}
/**
* 获取学员信息
*/
export function getStudentInfo(data) {
return request({
url: '/User/GetStudent',
method: 'post',
data
})
}
/**
* 删除学员信息
*/
export function deleteStudent(data) {
return request({
url: '/User/RemoveStudent',
method: 'post',
data
})
}
/**
* 更新学生禁用或启用
*/
export function UpdateStudentIsDisable(data) {
return request({
url: '/User/UpdateStudentIsDisable',
method: 'post',
data
})
}
<template>
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 800px;max-width:900px;">
<q-card-section>
<div class="text-h6">{{objOption.ClassId==0?'新增班级信息':'修改班级信息'}}</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="text-caption q-mb-md q-px-xs text-grey-6">基本资料</div>
<div class="row wrap">
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.ClassName" ref="ClassName"
class="col-6 q-pr-lg q-pb-lg" label="班级名称" :rules="[val => !!val || '请填写班级名称']" />
<q-select filled stack-label option-value="CourseId" option-label="CourseName" v-model="objOption.CouseId"
ref="CouseId" :options="courseList" label="所属课程" :dense="false" class="col-6 q-pb-lg" emit-value map-options
:rules="[val => !!val || '请选择所属课程']" />
<q-select filled stack-label option-value="TId" option-label="TeacherName" v-model="objOption.Teacher_Id"
ref="Teacher_Id" :options="teacherList" label="讲师" :dense="false" class="col-6 q-pr-lg q-pb-lg" emit-value
map-options :rules="[val => !!val || '请选择讲师']" />
<q-select filled stack-label option-value="AId" option-label="AssistName" v-model="objOption.Assist_Id"
ref="Assist_Id" :options="assistList" label="助教" :dense="false" class="col-6 q-pb-lg" emit-value map-options
:rules="[val => !!val || '请选择助教']" />
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" color="dark" style="font-weight:400 !important" @click="closeSaveForm" />
<q-btn label="立即提交" color="accent" class="q-px-md" style="font-weight:400 !important" :loading="saveLoading"
@click="saveClassInfo" />
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script>
import {
getTeacherDropDownList,
getAssistDropDownList,
saveClass,
getClassInfo
} from '../../../api/school/index'
import {
queryCourseDropdownList
} from '../../../api/course/index'
export default {
props: {
saveObj: {
type: Object,
default: null
}
},
data() {
return {
persistent: true,
objOption: {
ClassId: 0, //班级编号
ClassName: '', //班级名称
CouseId: 0, //所属课程
Teacher_Id: 0, //讲师编号
Assist_Id: 0, //助教编号
},
optionTitle: "",
courseList: [],
teacherList: [],
assistList: [],
saveLoading: false,
}
},
created() {
this.getCourseDropdown();
this.getTeacherDropdown();
this.getAssistantDropdown();
},
mounted() {
this.initObj()
},
methods: {
initObj() {
if (this.saveObj) {
this.optionTitle = "修改班级信息"
if (this.saveObj.ClassId > 0) {
getClassInfo({
ClassId: this.saveObj.ClassId
}).then(res => {
this.objOption.ClassId = res.Data.ClassId;
this.objOption.ClassName = res.Data.ClassName;
this.objOption.CouseId = res.Data.CouseId;
this.objOption.Teacher_Id = res.Data.Teacher_Id;
this.objOption.Assist_Id = res.Data.Assist_Id;
this.$forceUpdate();
})
}
} else {
this.optionTitle = "新增班级"
this.objOption.ClassId = 0;
this.objOption.ClassName = "";
this.objOption.CouseId = 0;
this.objOption.Teacher_Id = 0;
this.objOption.Assist_Id = 0;
}
},
//获取课程下拉列表
getCourseDropdown() {
queryCourseDropdownList({}).then(res => {
if (res.Code == 1) {
this.courseList = res.Data;
}
});
},
//获取讲师下拉列表
getTeacherDropdown() {
getTeacherDropDownList({}).then(res => {
if (res.Code == 1) {
this.teacherList = res.Data;
}
})
},
//获取助教下拉列表
getAssistantDropdown() {
getAssistDropDownList({}).then(res => {
if (res.Code == 1) {
this.assistList = res.Data;
}
});
},
closeSaveForm() {
this.$emit('close')
this.persistent = false
},
saveClassInfo() {
this.saveLoading = true
saveClass(this.objOption).then(res => {
this.saveLoading = false
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
this.closeSaveForm()
}).catch(() => {
this.saveLoading = false
})
},
},
}
</script>
This diff is collapsed.
This diff is collapsed.
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