|
@@ -0,0 +1,198 @@
|
|
|
+<template>
|
|
|
+ <div id="mechUser">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-tabs v-model="active" type="card">
|
|
|
+ <el-tab-pane label="待审核" name="first">
|
|
|
+ <data-table
|
|
|
+ :fields="fields"
|
|
|
+ :opera="opera"
|
|
|
+ :data="oneList"
|
|
|
+ :total="oneTotal"
|
|
|
+ @query="search"
|
|
|
+ @change="toChange"
|
|
|
+ @edit="toEdit"
|
|
|
+ @delete="toDelete"
|
|
|
+ ></data-table>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="审核通过" name="second">
|
|
|
+ <data-table
|
|
|
+ :fields="fields"
|
|
|
+ :opera="opera"
|
|
|
+ :data="twoList"
|
|
|
+ :total="twoTotal"
|
|
|
+ @query="search"
|
|
|
+ @change="toChange"
|
|
|
+ @edit="toEdit"
|
|
|
+ @delete="toDelete"
|
|
|
+ ></data-table>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="审核失败" name="third">
|
|
|
+ <data-table
|
|
|
+ :fields="fields"
|
|
|
+ :opera="opera"
|
|
|
+ :data="thrList"
|
|
|
+ :total="thrTotal"
|
|
|
+ @query="search"
|
|
|
+ @change="toChange"
|
|
|
+ @edit="toEdit"
|
|
|
+ @delete="toDelete"
|
|
|
+ ></data-table>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-dialog title="更换管理员" width="40%" :visible.sync="dialog" @closed="handleClose" :destroy-on-close="true">
|
|
|
+ <data-form :data="form" :fields="formfields" :rules="{}" @save="toSave">
|
|
|
+ <template #options="{ item }">
|
|
|
+ <template v-if="item.model === 'code'">
|
|
|
+ <el-option v-for="(i, index) in codeList" :key="index" :label="i.user_name" :value="i.code"></el-option>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </data-form>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import dataTable from '@common/src/components/frame/filter-page-table.vue';
|
|
|
+import dataForm from '@common/src/components/frame/form.vue';
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: organization } = createNamespacedHelpers('organization');
|
|
|
+const { mapActions: inviteCode } = createNamespacedHelpers('inviteCode');
|
|
|
+export default {
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
+ name: 'mechUser',
|
|
|
+ props: {},
|
|
|
+ components: {
|
|
|
+ dataTable,
|
|
|
+ dataForm,
|
|
|
+ },
|
|
|
+ data: function () {
|
|
|
+ return {
|
|
|
+ active: 'first',
|
|
|
+ opera: [
|
|
|
+ // {
|
|
|
+ // label: '更换管理员',
|
|
|
+ // method: 'change',
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ label: '审核&查看',
|
|
|
+ method: 'edit',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '删除',
|
|
|
+ method: 'delete',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ fields: [
|
|
|
+ { label: '机构代码或邀请码', prop: 'code' },
|
|
|
+ { label: '用户名', prop: 'name' },
|
|
|
+ { label: '用户ID', prop: 'phone' },
|
|
|
+ { label: '社会统一信用代码', prop: 'institution_code' },
|
|
|
+ { label: '电子邮箱', prop: 'email' },
|
|
|
+ { label: '所属辖区', prop: 'juris' },
|
|
|
+ {
|
|
|
+ label: '状态',
|
|
|
+ prop: 'status',
|
|
|
+ format: (item) => {
|
|
|
+ return item === '0' ? '审核中' : item === '1' ? '审核通过' : '审核拒绝';
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ // 待审核
|
|
|
+ oneList: [],
|
|
|
+ oneTotal: 0,
|
|
|
+ // 审核通过
|
|
|
+ twoList: [],
|
|
|
+ twoTotal: 0,
|
|
|
+ // 审核失败
|
|
|
+ thrList: [],
|
|
|
+ thrTotal: 0,
|
|
|
+ // 更换管理员
|
|
|
+ dialog: false,
|
|
|
+ codeList: [],
|
|
|
+ formfields: [
|
|
|
+ { label: '姓名', model: 'name', options: { readonly: true } },
|
|
|
+ { label: '所属机构', model: 'code', type: 'select' },
|
|
|
+ ],
|
|
|
+ form: {},
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ await this.searchOther();
|
|
|
+ await this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...inviteCode({ codeQuery: 'query' }),
|
|
|
+ ...organization(['query', 'delete', 'update']),
|
|
|
+ // 查询列表
|
|
|
+ async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
+ let user = this.user;
|
|
|
+ if (user.role != '0') info.code = user.code;
|
|
|
+ let one = await this.query({ skip, limit, status: '0', ...info });
|
|
|
+ let two = await this.query({ skip, limit, status: '1', ...info });
|
|
|
+ let thr = await this.query({ skip, limit, status: '2', ...info });
|
|
|
+ if (this.$checkRes(one) || this.$checkRes(two) || this.$checkRes(thr)) {
|
|
|
+ this.$set(this, `oneList`, one.data);
|
|
|
+ this.$set(this, `oneTotal`, one.total);
|
|
|
+ this.$set(this, `twoList`, two.data);
|
|
|
+ this.$set(this, `twoTotal`, two.total);
|
|
|
+ this.$set(this, `thrList`, thr.data);
|
|
|
+ this.$set(this, `thrTotal`, thr.total);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 修改
|
|
|
+ toEdit({ data }) {
|
|
|
+ this.$router.push({ path: '/jg/users/detail', query: { id: data.id, type: '5' } });
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ async toDelete({ data }) {
|
|
|
+ let res = await this.delete(data.id);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({
|
|
|
+ message: '信息修改成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ this.search();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 更换管理员
|
|
|
+ toChange({ data }) {
|
|
|
+ this.$set(this, `form`, data);
|
|
|
+ this.dialog = true;
|
|
|
+ },
|
|
|
+ async toSave({ data }) {
|
|
|
+ let res = await this.update(data);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({
|
|
|
+ message: '更换管理员成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ this.handleClose();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 取消更换
|
|
|
+ handleClose() {
|
|
|
+ this.form = {};
|
|
|
+ this.dialog = false;
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ // 查询机构代码
|
|
|
+ async searchOther() {
|
|
|
+ let res = await this.codeQuery();
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `codeList`, res.data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ },
|
|
|
+ watch: {},
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped></style>
|