|
@@ -6,12 +6,7 @@
|
|
|
<NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="main">
|
|
|
- <!-- <el-col :span="24" class="leaveBtn">
|
|
|
- <punchBtn :show="show" :form="form" :dates="dates" @openClick="openClick" @onSubmit="onSubmit"></punchBtn>
|
|
|
- </el-col> -->
|
|
|
- <el-col :span="24" class="leaveList">
|
|
|
- <checkList :checkWorkList="checkWorkList" :anames="anames"></checkList>
|
|
|
- </el-col>
|
|
|
+ <checkList :list="list"></checkList>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -21,7 +16,6 @@
|
|
|
<script>
|
|
|
import NavBar from '@/layout/common/topInfo.vue';
|
|
|
import checkList from '@/layout/user/checkList.vue';
|
|
|
-// import punchBtn from '@/layout/user/punchBtn.vue';
|
|
|
import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
|
|
|
const { mapActions: mapAttendance } = createNamespacedHelpers('attendance');
|
|
|
const { mapActions: mapClass } = createNamespacedHelpers('classes');
|
|
@@ -31,26 +25,16 @@ export default {
|
|
|
components: {
|
|
|
NavBar, //头部导航
|
|
|
checkList, //考勤列表
|
|
|
- // punchBtn, //考勤打卡
|
|
|
},
|
|
|
data: () => ({
|
|
|
- show: false,
|
|
|
- form: {
|
|
|
- attend: [],
|
|
|
- },
|
|
|
- dates: {},
|
|
|
- anames: '',
|
|
|
- checkWorkList: {
|
|
|
- attend: [],
|
|
|
- },
|
|
|
title: '',
|
|
|
isleftarrow: '',
|
|
|
transitionName: 'fade',
|
|
|
navShow: true,
|
|
|
+ list: [],
|
|
|
}),
|
|
|
created() {
|
|
|
this.search();
|
|
|
- this.getDate();
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
@@ -72,48 +56,7 @@ export default {
|
|
|
async search() {
|
|
|
let studentid = this.user.userid;
|
|
|
const res = await this.query({ studentid });
|
|
|
-
|
|
|
- this.$set(this, `checkWorkList`, res.data);
|
|
|
- this.$set(this, `anames`, this.user.name);
|
|
|
- },
|
|
|
- // 考勤详情显示
|
|
|
- async openClick() {
|
|
|
- this.show = true;
|
|
|
- const classInfo = await this.classinfo(this.user.classid);
|
|
|
- this.$set(this.form, `topTitle`, classInfo.data.name);
|
|
|
- },
|
|
|
- // 考勤提交
|
|
|
- async onSubmit(form) {
|
|
|
- this.form.termid = this.user.termid;
|
|
|
- this.form.batchid = this.user.batchid;
|
|
|
- this.form.classid = this.user.classid;
|
|
|
- this.form.studentid = this.user.userid;
|
|
|
- let data = this.form;
|
|
|
- let res = await this.create(data);
|
|
|
- this.show = false;
|
|
|
- this.search();
|
|
|
- },
|
|
|
- // 获得时间
|
|
|
- getDate() {
|
|
|
- this.timer = setInterval(() => {
|
|
|
- var adate = new Date();
|
|
|
- let year = adate.getFullYear();
|
|
|
- let mouth = adate.getMonth() + 1;
|
|
|
- let day = adate.getDate();
|
|
|
- let newsdate = year + '年' + mouth + '月' + day + '日';
|
|
|
- this.value = adate.getHours() + ':' + adate.getMinutes() + adate.getSeconds();
|
|
|
- let str = adate.getHours() > 9 ? adate.getHours() : '0' + adate.getHours();
|
|
|
- let tt = adate.getMinutes() > 9 ? adate.getMinutes() : '0' + adate.getMinutes();
|
|
|
- let ss = adate.getSeconds() > 9 ? adate.getSeconds() : '0' + adate.getSeconds();
|
|
|
- let tim = str + ':' + tt + ':' + ss;
|
|
|
- let time = tim;
|
|
|
- let date = newsdate;
|
|
|
- let attend = [{ time, date }];
|
|
|
- for (const val of attend) {
|
|
|
- this.$set(this, `dates`, val);
|
|
|
- }
|
|
|
- this.$set(this.form, `attend`, attend);
|
|
|
- }, 1000);
|
|
|
+ this.$set(this, `list`, res.data[0].attend);
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -133,11 +76,4 @@ export default {
|
|
|
.main {
|
|
|
min-height: 570px;
|
|
|
}
|
|
|
-.main .leaveBtn {
|
|
|
- text-align: center;
|
|
|
- padding: 15px 0;
|
|
|
-}
|
|
|
-.leaveList {
|
|
|
- padding: 15px 0 0 0;
|
|
|
-}
|
|
|
</style>
|