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 @@ ...@@ -187,31 +187,9 @@
<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> <q-item clickable v-close-popup @click.stop="getClassItem(props.row)">
<q-item-section> <q-item-section>
<q-item-label> <q-item-label>状态变更</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-section> </q-item-section>
</q-item> </q-item>
</q-list> </q-list>
...@@ -227,6 +205,8 @@ ...@@ -227,6 +205,8 @@
<othercourseForm v-if="IsShowOtherCourse" :seting-obj="classObjOption" @close="closeClassSaveForm" <othercourseForm v-if="IsShowOtherCourse" :seting-obj="classObjOption" @close="closeClassSaveForm"
@success="refreshPage"> @success="refreshPage">
</othercourseForm> </othercourseForm>
<changestatusForm v-if="isShowStatusChange" :seting-obj="classObjOption" @close="closeClassSaveForm"
@success="refreshPage"></changestatusForm>
</div> </div>
</div> </div>
</template> </template>
...@@ -234,7 +214,6 @@ ...@@ -234,7 +214,6 @@
import { import {
queryClassPage, queryClassPage,
queryClassStatusList, queryClassStatusList,
saveClassStatus, //修改班级状态
} from '../../api/course/class'; } from '../../api/course/class';
//获取校区列表 //获取校区列表
import { import {
...@@ -246,6 +225,7 @@ ...@@ -246,6 +225,7 @@
import classForm from '../../components/course/class-form'; import classForm from '../../components/course/class-form';
import classinfoForm from '../../components/course/classinfo-form'; import classinfoForm from '../../components/course/classinfo-form';
import othercourseForm from '../../components/course/othercourse-form'; import othercourseForm from '../../components/course/othercourse-form';
import changestatusForm from '../../components/course/changestatus-form'
export default { export default {
meta: { meta: {
title: "班级管理" title: "班级管理"
...@@ -253,7 +233,8 @@ ...@@ -253,7 +233,8 @@
components: { components: {
classForm, classForm,
classinfoForm, classinfoForm,
othercourseForm othercourseForm,
changestatusForm
}, },
data() { data() {
return { return {
...@@ -348,23 +329,18 @@ ...@@ -348,23 +329,18 @@
schoolList: [], schoolList: [],
pageCount: 0, pageCount: 0,
classObjOption: null, classObjOption: null,
isShowEdit: false,
statusMsg: {
ClassId: 0,
ClassStatus: 0,
Teacher_Id:0
},
isShowClassForm: false, //是否显示新增修改弹窗 isShowClassForm: false, //是否显示新增修改弹窗
isShowClassInfo: false, //是否显示课程信息 isShowClassInfo: false, //是否显示课程信息
IsShowOtherCourse: false, //是否显示其他课程 IsShowOtherCourse: false, //是否显示其他课程
TeacherList:[] TeacherList:[],
isShowStatusChange:false
} }
}, },
created() { created() {
if (this.$route.query && this.$route.query.ClassName) { if (this.$route.query && this.$route.query.ClassName) {
this.msg.ClassName = decodeURI(this.$route.query.ClassName) this.msg.ClassName = decodeURI(this.$route.query.ClassName)
} }
// this.getClassStatus(); this.getClassStatus();
this.getSchool(); this.getSchool();
this.GetTeacherList(); this.GetTeacherList();
}, },
...@@ -415,46 +391,13 @@ ...@@ -415,46 +391,13 @@
}); });
}, },
//当前点击的班级 //当前点击的班级
getClassItem(item) { getClassItem(obj) {
this.isShowEdit = true; if (obj) {
var Obj = JSON.parse(JSON.stringify(item)); this.classObjOption = obj
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
}
}
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 { } else {
this.$q.notify({ this.classObjOption = null
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: res.Message,
position: 'top'
})
} }
}); this.isShowStatusChange = true;
}, },
gotoOrder(item) { gotoOrder(item) {
var tempStr = '/course/classorder?ClassId=' + item.ClassId; var tempStr = '/course/classorder?ClassId=' + item.ClassId;
...@@ -494,13 +437,7 @@ ...@@ -494,13 +437,7 @@
getClassStatus(status) { getClassStatus(status) {
queryClassStatusList({}).then(res => { queryClassStatusList({}).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.classStatusList=[]; this.classStatusList= res.Data;
let TempData = res.Data;
TempData.forEach(x=>{
if(x.Id>=status){
this.classStatusList.push(x)
}
})
} }
}).catch(() => {}) }).catch(() => {})
}, },
...@@ -542,6 +479,7 @@ ...@@ -542,6 +479,7 @@
this.isShowClassInfo = false; this.isShowClassInfo = false;
//关闭关联其他课程弹窗 //关闭关联其他课程弹窗
this.IsShowOtherCourse = false; this.IsShowOtherCourse = false;
this.isShowStatusChange = false;
}, },
GetFirst(val) { GetFirst(val) {
if (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