|
@@ -2,6 +2,26 @@
|
|
|
<div id="home">
|
|
|
<el-card v-if="!loading" shadow="hover">
|
|
|
<el-col :span="24" class="main">
|
|
|
+ <el-row class="one_1">
|
|
|
+ <el-col :span="24" class="one_title">
|
|
|
+ <span>待办事项</span>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="info">
|
|
|
+ <el-row class="info_1">
|
|
|
+ <el-col :span="6" class="list" @click.native="toView">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="20" class="l">
|
|
|
+ <el-col :span="24" class="name">学生请假或退出</el-col>
|
|
|
+ <el-col :span="24" class="num"><span class="dw">未处理</span>{{ leaveNum || 0 }}<span class="dw">个</span></el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4" class="r">
|
|
|
+ <i class="el-icon-s-check"></i>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
<el-col :span="24" class="title">
|
|
|
班主任全年安排
|
|
|
</el-col>
|
|
@@ -32,6 +52,7 @@ import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions: classes } = createNamespacedHelpers('classes');
|
|
|
const { mapActions: trainplan } = createNamespacedHelpers('trainplan');
|
|
|
const { mapActions: director } = createNamespacedHelpers('director');
|
|
|
+const { mapActions: leave } = createNamespacedHelpers('leave');
|
|
|
export default {
|
|
|
name: 'home',
|
|
|
props: {},
|
|
@@ -40,18 +61,21 @@ export default {
|
|
|
return {
|
|
|
loading: true,
|
|
|
list: [],
|
|
|
+ leaveNum: 0,
|
|
|
// 班主任
|
|
|
dirList: [],
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
|
await this.getOtherList();
|
|
|
+ await this.getleave();
|
|
|
this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
...classes(['query']),
|
|
|
...director({ getDirList: 'query' }),
|
|
|
...trainplan({ trainplanFetch: 'fetch', trainplanUpdate: 'update', updateclass: 'updateclass', updatereteacher: 'updatereteacher' }),
|
|
|
+ ...leave({ lQuery: 'query' }),
|
|
|
async search() {
|
|
|
let planid = _.get(this.defaultOption, 'planid');
|
|
|
const res = await this.trainplanFetch(planid);
|
|
@@ -59,7 +83,7 @@ export default {
|
|
|
if (res.errcode == 0) {
|
|
|
let data = res.data.termnum;
|
|
|
//按期排序
|
|
|
- data = data.map(i => {
|
|
|
+ data = data.map((i) => {
|
|
|
i.term = i.term * 1;
|
|
|
return i;
|
|
|
});
|
|
@@ -75,13 +99,13 @@ export default {
|
|
|
name: classes.name,
|
|
|
headteacherid: classes.headteacherid,
|
|
|
};
|
|
|
- let headteacherData = this.dirList.find(i => i.id == classes.headteacherid);
|
|
|
+ let headteacherData = this.dirList.find((i) => i.id == classes.headteacherid);
|
|
|
if (headteacherData) dirData.headteacher = headteacherData.name;
|
|
|
newData.push(dirData);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- let dirClass = newData.filter(i => i.headteacherid == this.user.userid);
|
|
|
+ let dirClass = newData.filter((i) => i.headteacherid == this.user.userid);
|
|
|
if (dirClass) this.$set(this, `list`, dirClass);
|
|
|
}
|
|
|
this.loading = false;
|
|
@@ -95,6 +119,19 @@ export default {
|
|
|
let res = await this.getDirList();
|
|
|
if (this.$checkRes(res)) this.$set(this, `dirList`, res.data);
|
|
|
},
|
|
|
+ // 查询请假人数未处理多少
|
|
|
+ async getleave() {
|
|
|
+ let classid = _.get(this.defaultOption, 'classid');
|
|
|
+ let termid = _.get(this.defaultOption, 'termid');
|
|
|
+ if (classid && termid) {
|
|
|
+ let res = await this.lQuery({ status: 0, termid, classid, skip: 0, limit: 1 });
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `leaveNum`, res.total);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 查看
|
|
|
+ toView() {
|
|
|
+ this.$router.push({ path: '/train/plan/leave' });
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user', 'defaultOption']),
|
|
@@ -116,5 +153,67 @@ export default {
|
|
|
font-size: 20px;
|
|
|
padding: 15px 0;
|
|
|
}
|
|
|
+ .one_1 {
|
|
|
+ margin: 0 0 20px 0;
|
|
|
+ .one_title {
|
|
|
+ margin: 0 0 20px 0;
|
|
|
+ span {
|
|
|
+ background-color: #439eff;
|
|
|
+ color: #ffffff;
|
|
|
+ padding: 5px 10px;
|
|
|
+ border-radius: 5px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .info {
|
|
|
+ .info_1 {
|
|
|
+ .list {
|
|
|
+ max-width: 23%;
|
|
|
+ margin: 0 10px;
|
|
|
+ border-radius: 5px;
|
|
|
+ padding: 15px 10px;
|
|
|
+ background: linear-gradient(to bottom, #439eff 90%, #f1f1f1);
|
|
|
+ .l {
|
|
|
+ .name {
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #ffffff;
|
|
|
+ margin: 0 0 10px 0;
|
|
|
+ }
|
|
|
+ .num {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ color: #ffffff;
|
|
|
+ font-size: 22px;
|
|
|
+ font-weight: bold;
|
|
|
+ .dw {
|
|
|
+ padding: 0 5px;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #f1f1f1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .r {
|
|
|
+ text-align: center;
|
|
|
+ padding: 5px 0;
|
|
|
+ font-size: 40px;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .list:nth-child(2) {
|
|
|
+ background: linear-gradient(to bottom, #ffa500 90%, #f1f1f1);
|
|
|
+ }
|
|
|
+ .list:nth-child(3) {
|
|
|
+ background: linear-gradient(to bottom, #00ff7f 90%, #f1f1f1);
|
|
|
+ }
|
|
|
+ .list:nth-child(4) {
|
|
|
+ background: linear-gradient(to bottom, #ff0000 90%, #f1f1f1);
|
|
|
+ }
|
|
|
+ .list:hover {
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|