Commit e133b35d authored by zhengke's avatar zhengke

修改

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