|
@@ -3,12 +3,10 @@
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="24" class="style">
|
|
<el-col :span="24" class="style">
|
|
<el-col :span="24" class="top">
|
|
<el-col :span="24" class="top">
|
|
- <!-- <topInfo></topInfo> -->
|
|
|
|
<NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
|
|
<NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24" class="main">
|
|
<el-col :span="24" class="main">
|
|
<el-col :span="24" class="leaveBtn">
|
|
<el-col :span="24" class="leaveBtn">
|
|
- <!-- <van-button round type="info" icon="smile" @click="onClickRight()">考勤打卡</van-button> -->
|
|
|
|
<punchBtn :show="show" :form="form" :dates="dates" @openClick="openClick" @onSubmit="onSubmit"></punchBtn>
|
|
<punchBtn :show="show" :form="form" :dates="dates" @openClick="openClick" @onSubmit="onSubmit"></punchBtn>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24" class="leaveList">
|
|
<el-col :span="24" class="leaveList">
|
|
@@ -26,6 +24,7 @@ import checkList from '@/layout/user/checkList.vue';
|
|
import punchBtn from '@/layout/user/punchBtn.vue';
|
|
import punchBtn from '@/layout/user/punchBtn.vue';
|
|
import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
|
|
import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
|
|
const { mapActions: mapAttendance } = createNamespacedHelpers('attendance');
|
|
const { mapActions: mapAttendance } = createNamespacedHelpers('attendance');
|
|
|
|
+const { mapActions: mapClass } = createNamespacedHelpers('classes');
|
|
export default {
|
|
export default {
|
|
name: 'checkWork',
|
|
name: 'checkWork',
|
|
props: {},
|
|
props: {},
|
|
@@ -35,26 +34,23 @@ export default {
|
|
punchBtn, //考勤打卡
|
|
punchBtn, //考勤打卡
|
|
},
|
|
},
|
|
data: () => ({
|
|
data: () => ({
|
|
- info: {},
|
|
|
|
- anames: '',
|
|
|
|
- checkWorkList: {
|
|
|
|
- attend: [],
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
show: false,
|
|
show: false,
|
|
form: {
|
|
form: {
|
|
attend: [],
|
|
attend: [],
|
|
},
|
|
},
|
|
dates: {},
|
|
dates: {},
|
|
|
|
+ anames: '',
|
|
|
|
+ checkWorkList: {
|
|
|
|
+ attend: [],
|
|
|
|
+ },
|
|
title: '',
|
|
title: '',
|
|
isleftarrow: '',
|
|
isleftarrow: '',
|
|
transitionName: 'fade',
|
|
transitionName: 'fade',
|
|
navShow: true,
|
|
navShow: true,
|
|
}),
|
|
}),
|
|
created() {
|
|
created() {
|
|
- this.searchInfo();
|
|
|
|
- this.getDate();
|
|
|
|
this.search();
|
|
this.search();
|
|
|
|
+ this.getDate();
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapState(['user']),
|
|
...mapState(['user']),
|
|
@@ -71,25 +67,22 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapAttendance(['fetch', 'create', 'query']),
|
|
...mapAttendance(['fetch', 'create', 'query']),
|
|
|
|
+ ...mapClass({ classinfo: 'fetch', classlist: 'query' }),
|
|
|
|
+ // 查询考勤列表
|
|
async search() {
|
|
async search() {
|
|
let studentid = this.user.userid;
|
|
let studentid = this.user.userid;
|
|
- console.log(studentid);
|
|
|
|
const res = await this.query();
|
|
const res = await this.query();
|
|
- console.log(res.data);
|
|
|
|
- console.log(res.data[0]);
|
|
|
|
-
|
|
|
|
this.$set(this, `checkWorkList`, res.data);
|
|
this.$set(this, `checkWorkList`, res.data);
|
|
- },
|
|
|
|
- searchInfo() {
|
|
|
|
- this.$set(this.form, `batchid`, this.user.batchid);
|
|
|
|
- this.$set(this.form, `classid`, this.user.classid);
|
|
|
|
this.$set(this, `anames`, this.user.name);
|
|
this.$set(this, `anames`, this.user.name);
|
|
},
|
|
},
|
|
- openClick() {
|
|
|
|
|
|
+ // 考勤详情显示
|
|
|
|
+ async openClick() {
|
|
this.show = true;
|
|
this.show = true;
|
|
|
|
+ const classInfo = await this.classinfo(this.user.classid);
|
|
|
|
+ this.$set(this.form, `topTitle`, classInfo.data.name);
|
|
},
|
|
},
|
|
|
|
+ // 考勤提交
|
|
async onSubmit(form) {
|
|
async onSubmit(form) {
|
|
- console.log(this.user);
|
|
|
|
this.form.termid = this.user.termid;
|
|
this.form.termid = this.user.termid;
|
|
this.form.batchid = this.user.batchid;
|
|
this.form.batchid = this.user.batchid;
|
|
this.form.classid = this.user.classid;
|
|
this.form.classid = this.user.classid;
|
|
@@ -98,6 +91,7 @@ export default {
|
|
let res = await this.create(data);
|
|
let res = await this.create(data);
|
|
this.show = false;
|
|
this.show = false;
|
|
},
|
|
},
|
|
|
|
+ // 获得时间
|
|
getDate() {
|
|
getDate() {
|
|
this.timer = setInterval(() => {
|
|
this.timer = setInterval(() => {
|
|
var adate = new Date();
|
|
var adate = new Date();
|