|
@@ -6,7 +6,7 @@
|
|
<cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch"> </cSearch>
|
|
<cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch"> </cSearch>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24" class="two">
|
|
<el-col :span="24" class="two">
|
|
- <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @view="toView" @exam="toExam"> </cTable>
|
|
|
|
|
|
+ <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @exam="toExam" @edit="toEdit" @del="toDel"> </cTable>
|
|
</el-col>
|
|
</el-col>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -31,11 +31,9 @@ import { onMounted, ref, getCurrentInstance } from 'vue';
|
|
import { ElMessage } from 'element-plus';
|
|
import { ElMessage } from 'element-plus';
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
// 接口
|
|
// 接口
|
|
-import { TeamStore } from '@/stores/team/team';
|
|
|
|
import { UserStore } from '@/stores/users/user';
|
|
import { UserStore } from '@/stores/users/user';
|
|
import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
|
|
import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
|
|
import type { IQueryResult } from '@/util/types.util';
|
|
import type { IQueryResult } from '@/util/types.util';
|
|
-const teamAxios = TeamStore();
|
|
|
|
const userAxios = UserStore();
|
|
const userAxios = UserStore();
|
|
const dictAxios = DictDataStore();
|
|
const dictAxios = DictDataStore();
|
|
const { proxy } = getCurrentInstance() as any;
|
|
const { proxy } = getCurrentInstance() as any;
|
|
@@ -48,18 +46,21 @@ let total: Ref<number> = ref(0);
|
|
let skip = 0;
|
|
let skip = 0;
|
|
let limit: number = proxy.$limit;
|
|
let limit: number = proxy.$limit;
|
|
let fields: Ref<any[]> = ref([
|
|
let fields: Ref<any[]> = ref([
|
|
- { label: '所属管理员', model: 'administrator', format: (i: any) => getDict(i, 'administrator') },
|
|
|
|
- { label: '团队名称', model: 'name', isSearch: true },
|
|
|
|
- { label: '单位地址', model: 'address' },
|
|
|
|
|
|
+ { label: '微信用户标识', model: 'openid' },
|
|
|
|
+ { label: '用户账号', model: 'account', isSearch: true },
|
|
|
|
+ { label: '姓名', model: 'name', isSearch: true },
|
|
|
|
+ { label: '性别', model: 'gender', format: (i: any) => getDict(i, 'gender') },
|
|
|
|
+ { label: '年龄', model: 'age' },
|
|
{ label: '手机号', model: 'phone', isSearch: true },
|
|
{ label: '手机号', model: 'phone', isSearch: true },
|
|
- { label: '团队人数', model: 'number' },
|
|
|
|
- { label: '成立时间', model: 'create_time' },
|
|
|
|
|
|
+ { label: '电子邮箱', model: 'email' },
|
|
|
|
+ { label: '工作单位', model: 'work' },
|
|
{ label: '状态', model: 'status', format: (i: any) => getDict(i, 'status') }
|
|
{ label: '状态', model: 'status', format: (i: any) => getDict(i, 'status') }
|
|
]);
|
|
]);
|
|
// 操作
|
|
// 操作
|
|
let opera: Ref<any[]> = ref([
|
|
let opera: Ref<any[]> = ref([
|
|
- { label: '查看', method: 'view', tpye: 'Info' },
|
|
|
|
- { label: '审核', method: 'exam', type: 'warning', display: (i) => i.status == '0' }
|
|
|
|
|
|
+ { label: '审核', method: 'exam', type: 'warning', display: (i) => i.status == '0' },
|
|
|
|
+ { label: '修改', method: 'edit' },
|
|
|
|
+ { label: '删除', method: 'del', confirm: true, type: 'danger' }
|
|
]);
|
|
]);
|
|
// 查询数据
|
|
// 查询数据
|
|
let searchForm: Ref<any> = ref({});
|
|
let searchForm: Ref<any> = ref({});
|
|
@@ -67,7 +68,6 @@ let searchForm: Ref<any> = ref({});
|
|
const genderList: Ref<any> = ref([]);
|
|
const genderList: Ref<any> = ref([]);
|
|
const typeList: Ref<any> = ref([]);
|
|
const typeList: Ref<any> = ref([]);
|
|
const statusList: Ref<any> = ref([]);
|
|
const statusList: Ref<any> = ref([]);
|
|
-const userList: Ref<any> = ref([]);
|
|
|
|
// 弹框
|
|
// 弹框
|
|
const dialog: Ref<any> = ref({ title: '审核管理', show: false, type: '1' });
|
|
const dialog: Ref<any> = ref({ title: '审核管理', show: false, type: '1' });
|
|
const form: Ref<any> = ref({ file: [] });
|
|
const form: Ref<any> = ref({ file: [] });
|
|
@@ -80,8 +80,8 @@ onMounted(async () => {
|
|
loading.value = false;
|
|
loading.value = false;
|
|
});
|
|
});
|
|
const search = async (e: { skip: number; limit: number }) => {
|
|
const search = async (e: { skip: number; limit: number }) => {
|
|
- const info = { skip: e.skip, limit: e.limit, ...searchForm.value, status: '0' };
|
|
|
|
- const res: IQueryResult = await teamAxios.query(info);
|
|
|
|
|
|
+ const info = { skip: e.skip, limit: e.limit, ...searchForm.value, type: '0' };
|
|
|
|
+ const res: IQueryResult = await userAxios.query(info);
|
|
if (res.errcode == '0') {
|
|
if (res.errcode == '0') {
|
|
list.value = res.data;
|
|
list.value = res.data;
|
|
total.value = res.total;
|
|
total.value = res.total;
|
|
@@ -92,9 +92,9 @@ const toSearch = (query) => {
|
|
search({ skip, limit });
|
|
search({ skip, limit });
|
|
};
|
|
};
|
|
const getDict = (e, model) => {
|
|
const getDict = (e, model) => {
|
|
- if (model == 'administrator') {
|
|
|
|
- let data: any = userList.value.find((i: any) => i._id == e);
|
|
|
|
- if (data) return data.name;
|
|
|
|
|
|
+ if (model == 'gender') {
|
|
|
|
+ let data: any = genderList.value.find((i: any) => i.value == e);
|
|
|
|
+ if (data) return data.label;
|
|
else return '暂无';
|
|
else return '暂无';
|
|
} else if (model == 'status') {
|
|
} else if (model == 'status') {
|
|
let data: any = statusList.value.find((i: any) => i.value == e);
|
|
let data: any = statusList.value.find((i: any) => i.value == e);
|
|
@@ -102,13 +102,9 @@ const getDict = (e, model) => {
|
|
else return '暂无';
|
|
else return '暂无';
|
|
}
|
|
}
|
|
};
|
|
};
|
|
-// 查看
|
|
|
|
-const toView = (data) => {
|
|
|
|
- router.push({ path: '/team/examine/detail', query: { id: data._id } });
|
|
|
|
-};
|
|
|
|
// 审核
|
|
// 审核
|
|
const toExam = async (data) => {
|
|
const toExam = async (data) => {
|
|
- let res: IQueryResult = await teamAxios.fetch(data._id);
|
|
|
|
|
|
+ let res: IQueryResult = await userAxios.fetch(data._id);
|
|
if (res.errcode == '0') {
|
|
if (res.errcode == '0') {
|
|
form.value = res.data;
|
|
form.value = res.data;
|
|
dialog.value = { title: '审核管理', show: true, type: '1' };
|
|
dialog.value = { title: '审核管理', show: true, type: '1' };
|
|
@@ -116,7 +112,7 @@ const toExam = async (data) => {
|
|
};
|
|
};
|
|
// 提交保存
|
|
// 提交保存
|
|
const toSave = async (data) => {
|
|
const toSave = async (data) => {
|
|
- let res: IQueryResult = await teamAxios.update(data);
|
|
|
|
|
|
+ let res: IQueryResult = await userAxios.update(data);
|
|
if (res.errcode == '0') {
|
|
if (res.errcode == '0') {
|
|
ElMessage({ message: '信息审核成功', type: 'success' });
|
|
ElMessage({ message: '信息审核成功', type: 'success' });
|
|
toClose();
|
|
toClose();
|
|
@@ -124,6 +120,19 @@ const toSave = async (data) => {
|
|
ElMessage({ message: `${res.errmsg}`, type: 'error' });
|
|
ElMessage({ message: `${res.errmsg}`, type: 'error' });
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
+// 修改
|
|
|
|
+const toEdit = (data) => {
|
|
|
|
+ router.push({ path: '/users/match/detail', query: { id: data._id } });
|
|
|
|
+};
|
|
|
|
+// 删除
|
|
|
|
+const toDel = async (data: any) => {
|
|
|
|
+ let res: IQueryResult = await userAxios.del(data._id);
|
|
|
|
+ if (res.errcode == 0) {
|
|
|
|
+ ElMessage({ type: `success`, message: `刪除信息成功` });
|
|
|
|
+ search({ skip, limit });
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
// 关闭弹框
|
|
// 关闭弹框
|
|
const toClose = () => {
|
|
const toClose = () => {
|
|
form.value = {};
|
|
form.value = {};
|
|
@@ -143,9 +152,6 @@ const searchOther = async () => {
|
|
// 状态
|
|
// 状态
|
|
res = await dictAxios.query({ type: 'status' });
|
|
res = await dictAxios.query({ type: 'status' });
|
|
if (res.errcode == '0') statusList.value = res.data;
|
|
if (res.errcode == '0') statusList.value = res.data;
|
|
- // 管理员
|
|
|
|
- res = await userAxios.query({ status: '1' });
|
|
|
|
- if (res.errcode == '0') userList.value = res.data;
|
|
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|