|
@@ -0,0 +1,87 @@
|
|
|
+<template>
|
|
|
+ <div id="index">
|
|
|
+ <list-frame :title="mainTitle" @query="search" :total="total" :needFilter="false">
|
|
|
+ <data-table :fields="fields" :data="list" :opera="opera"></data-table>
|
|
|
+ </list-frame>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import listFrame from '@frame/layout/admin/list-frame';
|
|
|
+import dataTable from '@frame/components/data-table';
|
|
|
+import { createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions } = createNamespacedHelpers('leave');
|
|
|
+const { mapActions: mapstudent } = createNamespacedHelpers('student');
|
|
|
+export default {
|
|
|
+ metaInfo: { title: '请假和退出管理' },
|
|
|
+ name: 'index',
|
|
|
+ props: {},
|
|
|
+ components: {
|
|
|
+ listFrame,
|
|
|
+ dataTable,
|
|
|
+ },
|
|
|
+ data: () => ({
|
|
|
+ opera: [],
|
|
|
+ fields: [
|
|
|
+ { label: '学生名称', prop: 'stuName' },
|
|
|
+ { label: '开始时间', prop: 'starttime' },
|
|
|
+ { label: '结束时间', prop: 'endtime' },
|
|
|
+ { label: '请假理由', prop: 'reason' },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: '状态',
|
|
|
+ prop: 'status',
|
|
|
+ format: item => {
|
|
|
+ return item === '0' ? '审核中' : item === '1' ? '通过' : '未通过';
|
|
|
+ },
|
|
|
+ },
|
|
|
+ { label: '拒绝原因', prop: 'refcause' },
|
|
|
+ {
|
|
|
+ label: '类型',
|
|
|
+ prop: 'type',
|
|
|
+ format: item => {
|
|
|
+ return item === '0' ? '请假' : '退出';
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ list: [],
|
|
|
+ total: 0,
|
|
|
+ }),
|
|
|
+ created() {
|
|
|
+ this.search();
|
|
|
+ this.searchinfo();
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ mainTitle() {
|
|
|
+ let meta = this.$route.meta;
|
|
|
+ let main = meta.title || '';
|
|
|
+ let sub = meta.sub || '';
|
|
|
+ return `${main}${sub}`;
|
|
|
+ },
|
|
|
+ keyWord() {
|
|
|
+ let meta = this.$route.meta;
|
|
|
+ let main = meta.title || '';
|
|
|
+ return main;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...mapActions(['query', 'delete']),
|
|
|
+ ...mapstudent({ lists: 'fetch' }),
|
|
|
+ async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
+ const res = await this.query({ skip, limit, ...info });
|
|
|
+ for (const val of res.data) {
|
|
|
+ const stuName = await this.lists(val.studentid);
|
|
|
+ console.log(stuName);
|
|
|
+ val.stuName = stuName.data.name;
|
|
|
+ }
|
|
|
+ console.log(res.data);
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
+ },
|
|
|
+
|
|
|
+ async searchinfo() {},
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped></style>
|