|
@@ -0,0 +1,122 @@
|
|
|
+<template>
|
|
|
+ <div id="index">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="main animate__animated animate__backInRight">
|
|
|
+ <el-col :span="24" class="one">
|
|
|
+ <data-table :fields="fields" :opera="opera" :data="list" @query="search" :total="total" @view="toView" @check="toCheck" @del="toDel">
|
|
|
+ <!-- <template slot="selfbtn">
|
|
|
+ <el-button type="primary" size="mini" @click="toAdd()">添加</el-button>
|
|
|
+ </template> -->
|
|
|
+ </data-table>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <e-dialog :dialog="dialog" @toClose="toClose">
|
|
|
+ <template v-slot:info>
|
|
|
+ <check-1 v-if="dialog.type == '1'" :form="form" @onSubmit="checkSubmit" @toReset="toClose"></check-1>
|
|
|
+ <info-1 v-else-if="dialog.type == '2'" :form="form"></info-1>
|
|
|
+ </template>
|
|
|
+ </e-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions } = createNamespacedHelpers('users');
|
|
|
+export default {
|
|
|
+ name: 'index',
|
|
|
+ props: {},
|
|
|
+ components: {
|
|
|
+ check1: () => import('./parts/check-1.vue'),
|
|
|
+ info1: () => import('./parts/info-1.vue'),
|
|
|
+ },
|
|
|
+ data: function () {
|
|
|
+ return {
|
|
|
+ list: [],
|
|
|
+ total: 0,
|
|
|
+ opera: [
|
|
|
+ { label: '信息', method: 'view' },
|
|
|
+ { label: '审核', method: 'check', display: (i) => i.status == '0' },
|
|
|
+ { label: '删除', method: 'del', confirm: true, type: 'danger' },
|
|
|
+ ],
|
|
|
+ fields: [
|
|
|
+ { label: '用户姓名', prop: 'name', filter: 'input' },
|
|
|
+ { label: '手机号', prop: 'phone', filter: 'input' },
|
|
|
+ { label: '身份证', prop: 'card', filter: 'input' },
|
|
|
+ { label: '电子邮箱', prop: 'email' },
|
|
|
+ { label: '联系地址', prop: 'addr' },
|
|
|
+ { label: '所在院系', prop: 'school' },
|
|
|
+ { label: '所学专业', prop: 'major' },
|
|
|
+ { label: '职务职称', prop: 'zwzc' },
|
|
|
+ { label: '办公电话', prop: 'office_phone' },
|
|
|
+ { label: '所属行业', prop: 'profession' },
|
|
|
+ {
|
|
|
+ label: '状态',
|
|
|
+ prop: 'status',
|
|
|
+ format: (i) => (i === '0' ? '待审中' : i === '1' ? '审核通过' : '审核拒绝'),
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ // 弹框
|
|
|
+ dialog: { title: '审核信息', show: false, type: '1' },
|
|
|
+ // 审核
|
|
|
+ form: {},
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ await this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
|
+ async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
+ let res = await this.query({ skip, limit, ...info });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 详细信息
|
|
|
+ async toView({ data }) {
|
|
|
+ let res = await this.fetch(data._id);
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `form`, res.data);
|
|
|
+ this.dialog = { title: '详细信息', show: true, type: '2' };
|
|
|
+ },
|
|
|
+ // 审核
|
|
|
+ async toCheck({ data }) {
|
|
|
+ let res = await this.fetch(data._id);
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `form`, res.data);
|
|
|
+ this.dialog = { title: '审核信息', show: true, type: '1' };
|
|
|
+ },
|
|
|
+ // 提交审核
|
|
|
+ async checkSubmit({ data }) {
|
|
|
+ let res = await this.update(data);
|
|
|
+ if (this.$checkRes(res, '审核信息成功', '审核信息失败')) this.toClose();
|
|
|
+ },
|
|
|
+ // 删除用户
|
|
|
+ async toDel({ data }) {
|
|
|
+ let res = await this.delete(data._id);
|
|
|
+ if (this.$checkRes(res, '删除信息成功', '删除信息失败')) this.search();
|
|
|
+ },
|
|
|
+ // 关闭
|
|
|
+ toClose() {
|
|
|
+ this.form = {};
|
|
|
+ this.dialog = { title: '审核信息', show: false, type: '1' };
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ },
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ test: {
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ handler(val) {},
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped></style>
|