Commit e133b35d authored by zhengke's avatar zhengke

修改

parent 655172cb
......@@ -427,26 +427,11 @@
</div>
</template>
<script>
import {
GetClassPlanStatistical
} from '../../api/system/index';
export default {
props: {
StartTime: {
type: String,
default: null,
},
EndTime: {
type: String,
default: null,
},
TeacherId: {
type: Number,
default: null,
},
ClassRoomId: {
type: Number,
default: null,
dataList: {
type: Object,
default: null
},
},
data() {
......@@ -457,7 +442,6 @@
TeacherId: 0,
ClassRoomId: 0
},
dataList: []
};
},
created() {
......@@ -466,34 +450,6 @@
mounted() {
},
methods: {
// 获取校区教室导航列表
getPlanList(StartTime, EndTime, TeacherId, ClassRoomId) {
if (StartTime) {
this.msg.StartTime = StartTime;
}
if (StartTime == null) {
this.msg.StartTime = '';
}
if (EndTime) {
this.msg.EndTime = EndTime;
}
if (EndTime == null) {
this.msg.EndTime = '';
}
if (TeacherId >= 0) {
this.msg.TeacherId = JSON.parse(TeacherId);
}
if (ClassRoomId >= 0) {
this.msg.ClassRoomId = JSON.parse(ClassRoomId);
}
GetClassPlanStatistical(this.msg).then(res => {
if (res.Code == 1) {
this.dataList = res.Data;
}
}).catch(() => {
})
},
//获取进度条
getProgress(num, total) {
if (num == 0 || total == 0) {
......
......@@ -2,31 +2,31 @@
<div class="page-body MainPlan">
<div class="col row wrap q-col-gutter-md">
<div class="col-2">
<el-select v-model="TeacherId" style="width:100%;" placeholder="教师团队" size="small"
@change="changeClassMate()">
<el-select v-model="msg.TeacherId" style="width:100%;" placeholder="教师团队" size="small"
@change="getPlanList()">
<el-option v-for="item in TeacherList" :key="item.TeacherName" :label="item.TeacherName" :value="item.TId">
</el-option>
</el-select>
</div>
<div class="col-2">
<el-select v-model="ClassRoomId" style="width:100%;" placeholder="教室" size="small"
@change="changeClassMate()">
<el-select v-model="msg.ClassRoomId" style="width:100%;" placeholder="教室" size="small"
@change="getPlanList()">
<el-option v-for="item in ClassRoomList" :key="item.RoomName" :label="item.RoomName" :value="item.RoomId">
</el-option>
</el-select>
</div>
<div class="col-2">
<el-date-picker v-model="StartTime" type="date" value-format="yyyy-MM-dd" placeholder="开始日期" size="small"
style="width:100%;" @change="changeClassMate()" clear-icon="iconfont icon-guanbi">
<el-date-picker v-model="msg.StartTime" type="date" value-format="yyyy-MM-dd" placeholder="开始日期" size="small"
style="width:100%;" @change="getPlanList()" clear-icon="iconfont icon-guanbi">
</el-date-picker>
</div>
<div class="col-2">
<el-date-picker v-model="EndTime" type="date" value-format="yyyy-MM-dd" placeholder="结束日期" size="small"
style="width:100%;" @change="changeClassMate()" clear-icon="iconfont icon-guanbi">
<el-date-picker v-model="msg.EndTime" type="date" value-format="yyyy-MM-dd" placeholder="结束日期" size="small"
style="width:100%;" @change="getPlanList()" clear-icon="iconfont icon-guanbi">
</el-date-picker>
</div>
</div>
<classmateForm ref="classmate"></classmateForm>
<classmateForm :dataList="dataList"></classmateForm>
</div>
</template>
......@@ -35,6 +35,9 @@
getTeacherDropDownList,
queryClassRoomList
} from '../../api/school/index'
import {
GetClassPlanStatistical
} from '../../api/system/index';
import classmateForm from '../../components/course/classmate-form';
export default {
meta: {
......@@ -51,8 +54,14 @@
EndTime: '',
TeacherId: 0,
ClassRoomId: 0,
dataList: [],
activeNames: [1]
dataList: {},
activeNames: [1],
msg:{
StartTime: "",
EndTime: '',
TeacherId: 0,
ClassRoomId: 0
}
};
},
created() {
......@@ -60,35 +69,18 @@
this.getClassRoomList();
},
mounted() {
let myDate = new Date();
let nowDate =
myDate.getFullYear() +
"-" +
parseInt(myDate.getMonth() + 1) +
"-" +
myDate.getDate();
if (this.$route.query.StartTime) {
this.StartTime = this.$route.query.StartTime
}else {
this.StartTime = nowDate;
}
if (this.$route.query.EndTime) {
this.EndTime = this.$route.query.EndTime
}else{
this.EndTime = this.addMoth(nowDate, 1);
}
if (this.$route.query.TeacherId) {
this.TeacherId = JSON.parse(this.$route.query.TeacherId);
}
if (this.$route.query.ClassRoomId) {
this.ClassRoomId = JSON.parse(this.$route.query.ClassRoomId);
}
this.$refs.classmate.getPlanList(this.StartTime,this.EndTime,this.TeacherId,this.ClassRoomId);
this.getPlanList();
},
methods: {
//调用子组件方法
changeClassMate(){
this.$refs.classmate.getPlanList(this.StartTime,this.EndTime,this.TeacherId,this.ClassRoomId);
// 获取校区教室导航列表
getPlanList() {
GetClassPlanStatistical(this.msg).then(res => {
if (res.Code == 1) {
this.dataList = res.Data;
}
}).catch(() => {
})
},
//获取教师下拉
GetTeacherList() {
......@@ -115,17 +107,6 @@
this.ClassRoomList.unshift(obj);
}
})
},
addMoth(d, m) {
let ds = d.split("-"),
_d = ds[2] - 0;
let nextM = new Date(ds[0], ds[1] - 1 + m + 1, 0);
let max = nextM.getDate();
d = new Date(ds[0], ds[1] - 1 + m, _d > max ? max : _d);
return d
.toLocaleDateString()
.match(/\d+/g)
.join("-");
}
}
};
......
<style>
.myClassMate .planTabDiv{
height:calc(100vh - 290px);
max-height:calc(100vh - 290px);
}
.myClassMate .planTabDiv {
height: calc(100vh - 290px);
max-height: calc(100vh - 290px);
}
</style>
<template>
<div class="page-body MainPlan myClassMate">
<classmateForm ref="classmate"></classmateForm>
<classmateForm :dataList="dataList"></classmateForm>
</div>
</template>
<script>
import {
GetClassPlanStatistical
} from '../../api/system/index';
import classmateForm from '../../components/course/classmate-form';
export default {
meta: {
......@@ -20,20 +24,56 @@
},
data() {
return {
msg: {
StartTime: "",
EndTime: '',
TeacherId: 0,
ClassRoomId: 0
},
dataList: {}
}
},
created() {
},
mounted() {
let userinfo = this.getLocalStorage();
let AccountId = userinfo.AccountId;
this.$refs.classmate.getPlanList(null,null,AccountId,0);
let userinfo = this.getLocalStorage();
let AccountId = userinfo.AccountId;
let myDate = new Date();
let nowDate =
myDate.getFullYear() +
"-" +
parseInt(myDate.getMonth() + 1) +
"-" +
myDate.getDate();
this.msg.StartTime = nowDate;
this.msg.EndTime = this.addMoth(nowDate, 1);
this.msg.TeacherId = AccountId;
this.getPlanList();
},
methods: {
},
// 获取校区教室导航列表
getPlanList() {
GetClassPlanStatistical(this.msg).then(res => {
if (res.Code == 1) {
this.dataList = res.Data;
}
}).catch(() => {
})
},
addMoth(d, m) {
let ds = d.split("-"),
_d = ds[2] - 0;
let nextM = new Date(ds[0], ds[1] - 1 + m + 1, 0);
let max = nextM.getDate();
d = new Date(ds[0], ds[1] - 1 + m, _d > max ? max : _d);
return d
.toLocaleDateString()
.match(/\d+/g)
.join("-");
}
}
}
</script>
......
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