Commit 0935644f authored by zhengke's avatar zhengke

修改

parent 14632dbb
<style>
</style>
<template>
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 500px;max-width:500px;">
<q-card-section>
<div class="text-h6">设置班级状态</div>
</q-card-section>
<div class="col row wrap q-mr-lg q-col-gutter-md" style="margin:20px 0;">
<div class="col-12">
<q-select filled option-value="Id" option-label="Name" class="q-pr-lg" v-model="statusMsg.ClassStatus"
:options="classStatusList" emit-value map-options label="班级状态" />
</div>
<div class="col-12" v-if="setingObj.Teacher_Id==0&&statusMsg.ClassStatus==2">
<q-select filled option-value="TId" option-label="TeacherName" class="q-pr-lg" v-model="statusMsg.Teacher_Id"
:options="TeacherList" emit-value map-options label="带班老师" />
</div>
</div>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeClassSaveForm" />
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveLoading"
@click="setClassStatus(statusMsg.ClassStatus)" />
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script>
import {
queryClassStatusList,
saveClassStatus, //修改班级状态
} from '../../api/course/class'
import {
getTeacherDropDownList
} from '../../api/school/index';
export default {
props: {
setingObj: {
type: Object,
default: null
}
},
data() {
return {
persistent: true,
saveLoading: false,
statusMsg: {
ClassId: 0,
ClassStatus: 0,
Teacher_Id: 0
},
classStatusList: [],
TeacherList: [],
}
},
created() {
},
watch: {
},
mounted() {
this.statusMsg.ClassId = this.setingObj.ClassId;
this.statusMsg.ClassStatus = this.setingObj.ClassStatus;
this.getClassStatus();
this.GetTeacherList();
},
methods: {
//获取班级状态列表
getClassStatus() {
queryClassStatusList({}).then(res => {
if (res.Code == 1) {
this.classStatusList = [];
let TempData = res.Data;
TempData.forEach(x => {
if (x.Id >= this.setingObj.ClassStatus) {
this.classStatusList.push(x)
}
})
}
}).catch(() => {})
},
//获取教师下拉
GetTeacherList() {
getTeacherDropDownList({}).then(res => {
if (res.Code == 1) {
this.TeacherList = res.Data;
this.TeacherList.unshift({
TId: 0,
TeacherName: "不限"
})
}
})
},
closeClassSaveForm() {
this.$emit('close');
this.persistent = false;
},
//更新班级状态
setClassStatus(ClassStatus) {
if (this.setingObj.Teacher_Id == 0 && ClassStatus == 2) {
if (this.statusMsg.Teacher_Id == 0) {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择老师`
})
return
}
}
this.saveLoading = true;
saveClassStatus(this.statusMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '设置成功!',
position: 'top'
})
this.$emit('success');
this.closeClassSaveForm();
} else {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: res.Message,
position: 'top'
})
}
this.saveLoading = false;
});
},
}
}
</script>
......@@ -187,31 +187,9 @@
<q-item-label>月度课耗</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup>
<q-item clickable v-close-popup @click.stop="getClassItem(props.row)">
<q-item-section>
<q-item-label>
<span @click.stop="getClassItem(props.row),getClassStatus(props.row.ClassStatus)">
<!-- {{props.row.ClassStatusStr}} -->
状态变更
<q-popup-proxy>
<q-banner v-if="isShowEdit">
<div class="calenderDialog">
<div style="margin:10px 0 15px 0;">设置班级状态</div>
<q-select filled option-value="Id" option-label="Name"
v-model="statusMsg.ClassStatus" :options="classStatusList" emit-value map-options label="班级状态" />
<q-select v-if="props.row.Teacher_Id==0&&statusMsg.ClassStatus==2" filled option-value="TId" option-label="TeacherName" style="margin-top:20px;"
v-model="statusMsg.Teacher_Id" :options="TeacherList" emit-value map-options label="带班老师" />
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" @click="isShowEdit=false"
style="font-weight:400 !important" />
<q-btn label="确认" color="accent q-px-md" style="font-weight:400 !important"
@click="setClassStatus(props.row.Teacher_Id,statusMsg.ClassStatus)" />
</q-card-actions>
</div>
</q-banner>
</q-popup-proxy>
</span>
</q-item-label>
<q-item-label>状态变更</q-item-label>
</q-item-section>
</q-item>
</q-list>
......@@ -227,6 +205,8 @@
<othercourseForm v-if="IsShowOtherCourse" :seting-obj="classObjOption" @close="closeClassSaveForm"
@success="refreshPage">
</othercourseForm>
<changestatusForm v-if="isShowStatusChange" :seting-obj="classObjOption" @close="closeClassSaveForm"
@success="refreshPage"></changestatusForm>
</div>
</div>
</template>
......@@ -234,7 +214,6 @@
import {
queryClassPage,
queryClassStatusList,
saveClassStatus, //修改班级状态
} from '../../api/course/class';
//获取校区列表
import {
......@@ -246,6 +225,7 @@
import classForm from '../../components/course/class-form';
import classinfoForm from '../../components/course/classinfo-form';
import othercourseForm from '../../components/course/othercourse-form';
import changestatusForm from '../../components/course/changestatus-form'
export default {
meta: {
title: "班级管理"
......@@ -253,7 +233,8 @@
components: {
classForm,
classinfoForm,
othercourseForm
othercourseForm,
changestatusForm
},
data() {
return {
......@@ -348,23 +329,18 @@
schoolList: [],
pageCount: 0,
classObjOption: null,
isShowEdit: false,
statusMsg: {
ClassId: 0,
ClassStatus: 0,
Teacher_Id:0
},
isShowClassForm: false, //是否显示新增修改弹窗
isShowClassInfo: false, //是否显示课程信息
IsShowOtherCourse: false, //是否显示其他课程
TeacherList:[]
TeacherList:[],
isShowStatusChange:false
}
},
created() {
if (this.$route.query && this.$route.query.ClassName) {
this.msg.ClassName = decodeURI(this.$route.query.ClassName)
}
// this.getClassStatus();
this.getClassStatus();
this.getSchool();
this.GetTeacherList();
},
......@@ -415,46 +391,13 @@
});
},
//当前点击的班级
getClassItem(item) {
this.isShowEdit = true;
var Obj = JSON.parse(JSON.stringify(item));
this.statusMsg.Teacher_Id = 0;
this.statusMsg.ClassStatus = Obj.ClassStatus;
this.statusMsg.ClassId = Obj.ClassId;
},
//更新班级状态
setClassStatus(Teacher_Id,ClassStatus) {
if(Teacher_Id==0&&ClassStatus==2){
if(this.statusMsg.Teacher_Id==0){
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择老师`
})
return
}
getClassItem(obj) {
if (obj) {
this.classObjOption = obj
} else {
this.classObjOption = null
}
saveClassStatus(this.statusMsg).then(res => {
this.isShowEdit = false;
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '设置成功!',
position: 'top'
})
this.getClassList();
} else {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: res.Message,
position: 'top'
})
}
});
this.isShowStatusChange = true;
},
gotoOrder(item) {
var tempStr = '/course/classorder?ClassId=' + item.ClassId;
......@@ -494,13 +437,7 @@
getClassStatus(status) {
queryClassStatusList({}).then(res => {
if (res.Code == 1) {
this.classStatusList=[];
let TempData = res.Data;
TempData.forEach(x=>{
if(x.Id>=status){
this.classStatusList.push(x)
}
})
this.classStatusList= res.Data;
}
}).catch(() => {})
},
......@@ -542,6 +479,7 @@
this.isShowClassInfo = false;
//关闭关联其他课程弹窗
this.IsShowOtherCourse = false;
this.isShowStatusChange = false;
},
GetFirst(val) {
if (val) {
......
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