|
@@ -24,7 +24,7 @@
|
|
|
import NavBar from '@/layout/common/topInfo.vue';
|
|
|
import checkList from '@/layout/user/checkList.vue';
|
|
|
import punchBtn from '@/layout/user/punchBtn.vue';
|
|
|
-import { createNamespacedHelpers, mapGetters } from 'vuex';
|
|
|
+import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
|
|
|
const { mapActions: mapAttendance } = createNamespacedHelpers('attendance');
|
|
|
export default {
|
|
|
name: 'checkWork',
|
|
@@ -37,26 +37,26 @@ export default {
|
|
|
data: () => ({
|
|
|
info: {},
|
|
|
checkWorkList: [
|
|
|
- {
|
|
|
- studentid: '流域',
|
|
|
- attend: [
|
|
|
- {
|
|
|
- date: '2020-02-25',
|
|
|
- time: '80:30',
|
|
|
- status: '0',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2020-02-25',
|
|
|
- time: '80:30',
|
|
|
- status: '1',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2020-02-25',
|
|
|
- time: '80:30',
|
|
|
- status: '2',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // studentid: '流域',
|
|
|
+ // attend: [
|
|
|
+ // {
|
|
|
+ // date: '2020-02-25',
|
|
|
+ // time: '80:30',
|
|
|
+ // status: '0',
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // date: '2020-02-25',
|
|
|
+ // time: '80:30',
|
|
|
+ // status: '1',
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // date: '2020-02-25',
|
|
|
+ // time: '80:30',
|
|
|
+ // status: '2',
|
|
|
+ // },
|
|
|
+ // ],
|
|
|
+ // },
|
|
|
],
|
|
|
show: false,
|
|
|
form: {
|
|
@@ -71,9 +71,11 @@ export default {
|
|
|
created() {
|
|
|
this.searchInfo();
|
|
|
this.getDate();
|
|
|
- // this.search();
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
},
|
|
|
- computed: {},
|
|
|
mounted() {
|
|
|
this.title = this.$route.meta.title;
|
|
|
this.isleftarrow = this.$route.meta.isleftarrow;
|
|
@@ -86,11 +88,11 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapAttendance(['fetch', 'create', 'query']),
|
|
|
- // async search() {
|
|
|
- // const res = await this.query();
|
|
|
- // console.log(res);
|
|
|
- // this.$set(this, `checkWorkList`, res.data);
|
|
|
- // },
|
|
|
+ async search() {
|
|
|
+ const res = await this.fetch();
|
|
|
+ console.log(res);
|
|
|
+ this.$set(this, `checkWorkList`, res.data);
|
|
|
+ },
|
|
|
searchInfo() {
|
|
|
let site = JSON.parse(sessionStorage.getItem('site'));
|
|
|
this.$set(this.form, `batchid`, site.batchid);
|
|
@@ -100,15 +102,16 @@ 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;
|
|
|
+ console.log(this.user);
|
|
|
+ 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;
|
|
|
console.log(this.form.batchid);
|
|
|
let res = await this.create(data);
|
|
|
+ console.log(res);
|
|
|
+
|
|
|
this.show = false;
|
|
|
},
|
|
|
getDate() {
|