|
@@ -9,7 +9,7 @@
|
|
|
<el-col :span="24" class="main">
|
|
|
<el-col :span="24" class="leaveBtn">
|
|
|
<!-- <van-button round type="info" icon="smile" @click="onClickRight()">考勤打卡</van-button> -->
|
|
|
- <punchBtn :show="show" :form="form" @openClick="openClick" @onSubmit="onSubmit"></punchBtn>
|
|
|
+ <punchBtn :show="show" :form="form" :dates="dates" @openClick="openClick" @onSubmit="onSubmit"></punchBtn>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="leaveList">
|
|
|
<checkList :checkWorkList="checkWorkList"></checkList>
|
|
@@ -62,6 +62,7 @@ export default {
|
|
|
form: {
|
|
|
attend: [],
|
|
|
},
|
|
|
+ dates: {},
|
|
|
title: '',
|
|
|
isleftarrow: '',
|
|
|
transitionName: 'fade',
|
|
@@ -70,6 +71,7 @@ export default {
|
|
|
created() {
|
|
|
this.searchInfo();
|
|
|
this.getDate();
|
|
|
+ // this.search();
|
|
|
},
|
|
|
computed: {},
|
|
|
mounted() {
|
|
@@ -83,7 +85,12 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapAttendance(['fetch', 'create']),
|
|
|
+ ...mapAttendance(['fetch', 'create', 'query']),
|
|
|
+ // async search() {
|
|
|
+ // const res = await this.query();
|
|
|
+ // console.log(res);
|
|
|
+ // this.$set(this, `checkWorkList`, res.data);
|
|
|
+ // },
|
|
|
searchInfo() {
|
|
|
let site = JSON.parse(sessionStorage.getItem('site'));
|
|
|
this.$set(this.form, `batchid`, site.batchid);
|
|
@@ -93,10 +100,15 @@ export default {
|
|
|
this.show = true;
|
|
|
},
|
|
|
async onSubmit(form) {
|
|
|
+ let site = JSON.parse(sessionStorage.getItem('site'));
|
|
|
+ console.log(site);
|
|
|
this.form.termid = '123456';
|
|
|
+ this.form.batchid = site.batchid;
|
|
|
+ this.form.ckassid = site.ckassid;
|
|
|
+ this.form.studentid = site.studentid;
|
|
|
let data = this.form;
|
|
|
- console.log(this.form.attend);
|
|
|
- // let res = await this.create(data);
|
|
|
+ console.log(this.form.batchid);
|
|
|
+ let res = await this.create(data);
|
|
|
this.show = false;
|
|
|
},
|
|
|
getDate() {
|
|
@@ -104,15 +116,20 @@ export default {
|
|
|
var adate = new Date();
|
|
|
let year = adate.getFullYear();
|
|
|
let mouth = adate.getMonth() + 1;
|
|
|
- let date = adate.getDate();
|
|
|
- let newsdate = year + '-' + mouth + '-' + date;
|
|
|
+ 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;
|
|
|
- this.$set(this.form.attend, `time`, tim);
|
|
|
- this.$set(this.form.attend, `date`, newsdate);
|
|
|
+ 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);
|
|
|
},
|
|
|
},
|