|
@@ -5,8 +5,21 @@
|
|
|
<!-- <el-col :span="24" class="add" style="text-align:right;padding: 10px 20px;">
|
|
|
<el-button size="mini" type="primary" @click="toAdd" icon="el-icon-plus">添加{{ theme }}</el-button>
|
|
|
</el-col> -->
|
|
|
- <el-col :span="24" class="main">
|
|
|
+ <!-- <el-col :span="24" class="main">
|
|
|
<data-table :fields="fields" :opera="opera" @edit="toEdit" :data="list" :total="total" @delete="toDelete" @query="search"></data-table>
|
|
|
+ </el-col> -->
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <el-tabs v-model="activeName" type="card">
|
|
|
+ <el-tab-pane label="待审核" name="first">
|
|
|
+ <one :oneList="oneList" :total="onetotal" @handleDelete="handleDelete" @handleEdit="handleEdit1"></one>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="审核成功" name="second">
|
|
|
+ <two :oneList="twoList" :total="twototal" @handleDelete="handleDelete" @handleEdit="handleEdit1"></two>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="审核失败" name="third">
|
|
|
+ <three :oneList="threeList" :total="threetotal" @handleDelete="handleDelete" @handleEdit="handleEdit1"></three>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
</el-col>
|
|
|
<el-dialog :title="theme" width="60%" :visible.sync="dialog" @closed="handleClose" :destroy-on-close="true">
|
|
|
<el-form ref="form" :model="form" label-width="100px">
|
|
@@ -196,6 +209,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import one from './parts/one.vue';
|
|
|
+import two from './parts/two.vue';
|
|
|
+import three from './parts/three.vue';
|
|
|
import upload from '@/components/uploadone.vue';
|
|
|
import dataTable from '@/components/data-table.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
@@ -205,36 +221,25 @@ export default {
|
|
|
name: 'index',
|
|
|
props: {},
|
|
|
components: {
|
|
|
- dataTable,
|
|
|
+ // dataTable,
|
|
|
upload,
|
|
|
+ one,
|
|
|
+ two,
|
|
|
+ three,
|
|
|
},
|
|
|
data: function() {
|
|
|
return {
|
|
|
theme: '用戶',
|
|
|
- opera: [
|
|
|
- {
|
|
|
- label: '审核',
|
|
|
- icon: 'el-icon-edit',
|
|
|
- method: 'edit',
|
|
|
- },
|
|
|
- {
|
|
|
- label: '删除',
|
|
|
- icon: 'el-icon-delete',
|
|
|
- method: 'delete',
|
|
|
- confirm: true,
|
|
|
- },
|
|
|
- ],
|
|
|
- fields: [
|
|
|
- { label: '姓名', prop: 'name', filter: 'input' },
|
|
|
- { label: '电话', prop: 'phone', filter: 'input' },
|
|
|
- { label: '用戶类型', prop: 'role', format: i => (i == '4' ? '个人用户' : i == '5' ? '企业用户' : i == '6' ? '专家' : '临时用户') },
|
|
|
- { label: '状态', prop: 'status', format: i => (i == '0' ? '待审核' : i == '1' ? '审核成功' : i == '2' ? '审核不成功' : '待认证') },
|
|
|
- ],
|
|
|
- list: [],
|
|
|
- total: 0,
|
|
|
+ activeName: 'first',
|
|
|
dialog: false,
|
|
|
form: {},
|
|
|
editData: {},
|
|
|
+ oneList: [],
|
|
|
+ onetotal: 0,
|
|
|
+ twoList: [],
|
|
|
+ twototal: 0,
|
|
|
+ threeList: [],
|
|
|
+ threetotal: 0,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -245,16 +250,42 @@ export default {
|
|
|
...expertsuser({ exportuserFetch: 'fetch', exportuserCreate: 'create', exportuserUpdate: 'update' }),
|
|
|
async search({ skip = 0, limit = 10, pid = '', ...info } = {}) {
|
|
|
if (this.user.code == 'JLCJGLY') {
|
|
|
- const res = await this.userquery({ skip, limit, ...info });
|
|
|
+ const res = await this.userquery({ skip, ...info });
|
|
|
if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `list`, res.data);
|
|
|
- this.$set(this, `total`, res.total);
|
|
|
+ let one = res.data.filter(i => i.status == '0');
|
|
|
+ if (one) {
|
|
|
+ this.$set(this, `oneList`, one);
|
|
|
+ this.$set(this, `onetotal`, one.length);
|
|
|
+ }
|
|
|
+ let two = res.data.filter(i => i.status == '1');
|
|
|
+ if (two) {
|
|
|
+ this.$set(this, `twototal`, two.length);
|
|
|
+ this.$set(this, `twoList`, two);
|
|
|
+ }
|
|
|
+ let three = res.data.filter(i => i.status == '2');
|
|
|
+ if (three) {
|
|
|
+ this.$set(this, `threeList`, three);
|
|
|
+ this.$set(this, `threetotal`, three.length);
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
const res = await this.userquery({ skip, limit, pid, code: this.user.code, ...info });
|
|
|
if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `list`, res.data);
|
|
|
- this.$set(this, `total`, res.total);
|
|
|
+ let one = res.data.filter(i => i.status == '0');
|
|
|
+ if (one) {
|
|
|
+ this.$set(this, `oneList`, one);
|
|
|
+ this.$set(this, `onetotal`, one.length);
|
|
|
+ }
|
|
|
+ let two = res.data.filter(i => i.status == '1');
|
|
|
+ if (two) {
|
|
|
+ this.$set(this, `twototal`, two.length);
|
|
|
+ this.$set(this, `twoList`, two);
|
|
|
+ }
|
|
|
+ let three = res.data.filter(i => i.status == '2');
|
|
|
+ if (three) {
|
|
|
+ this.$set(this, `threeList`, three);
|
|
|
+ this.$set(this, `threetotal`, three.length);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -262,7 +293,7 @@ export default {
|
|
|
toAdd() {
|
|
|
console.log('添加');
|
|
|
},
|
|
|
- // 修改
|
|
|
+ // 修改handleEdit
|
|
|
async toEdit({ data }) {
|
|
|
if (data.role == '6') {
|
|
|
const res = await this.exportuserFetch(data.uid);
|
|
@@ -280,9 +311,10 @@ export default {
|
|
|
},
|
|
|
// 提交
|
|
|
async handleSave() {
|
|
|
+ // console.log(this.form);
|
|
|
let data = this.form;
|
|
|
if (data.role == '4' || data.role == '5') {
|
|
|
- data.id = this.editData.uid;
|
|
|
+ data.id = data.uid;
|
|
|
let res = await this.update(data);
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$message({
|
|
@@ -292,7 +324,7 @@ export default {
|
|
|
this.handleClose();
|
|
|
}
|
|
|
} else if (data.role == '6') {
|
|
|
- data.id = this.editData.uid;
|
|
|
+ data.id = data.uid;
|
|
|
let res = await this.exportuserUpdate(data);
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$message({
|
|
@@ -318,6 +350,30 @@ export default {
|
|
|
data == '2' ? (val = '0') : (val = '1');
|
|
|
this.$set(this.form, `is_qy`, val);
|
|
|
},
|
|
|
+ // 审核
|
|
|
+ handleEdit1(data) {
|
|
|
+ // console.log(data);
|
|
|
+ this.$set(this, `form`, data);
|
|
|
+ this.dialog = true;
|
|
|
+ },
|
|
|
+ async handleDelete(id) {
|
|
|
+ this.$confirm('您确定要删除此信息吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ const res = await this.delete(id);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({
|
|
|
+ message: '删除信息成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ this.search();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|