|
@@ -23,11 +23,13 @@ import type { Ref } from 'vue';
|
|
|
import { ref, onMounted } from 'vue';
|
|
|
import { useRoute } from 'vue-router';
|
|
|
// 接口
|
|
|
+import { UserStore } from '@/stores/users/user';
|
|
|
import { ApplicationStore } from '@/stores/match/application';
|
|
|
import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
|
|
|
import type { IQueryResult } from '@/util/types.util';
|
|
|
const applicationAxios = ApplicationStore();
|
|
|
const dictAxios = DictDataStore();
|
|
|
+const userAxios = UserStore();
|
|
|
const route = useRoute();
|
|
|
// 加载中
|
|
|
const loading: Ref<any> = ref(false);
|
|
@@ -43,6 +45,8 @@ let fields: Ref<any[]> = ref([
|
|
|
]);
|
|
|
// 字典表
|
|
|
const genderList: Ref<any> = ref([]);
|
|
|
+const userList: Ref<any> = ref([]);
|
|
|
+
|
|
|
const memberfields: Ref<any> = ref([
|
|
|
{ label: '姓名', model: 'name' },
|
|
|
{ label: '性别', model: 'gender', format: (i: any) => getDict(i, 'gender') },
|
|
@@ -62,6 +66,20 @@ const search = async () => {
|
|
|
let res: IQueryResult = await applicationAxios.fetch(id);
|
|
|
if (res.errcode == '0') {
|
|
|
let info: any = res.data as {};
|
|
|
+ let memberList = [];
|
|
|
+ for (const val of info.user_id) {
|
|
|
+ for (const as of userList.value) {
|
|
|
+ if (val == as._id)
|
|
|
+ memberList.push({
|
|
|
+ _id: val,
|
|
|
+ name: as.name || '暂无',
|
|
|
+ age: as.age || '暂无',
|
|
|
+ phone: as.phone || '暂无',
|
|
|
+ gender: as.gender || '暂无'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ info.user_id = memberList;
|
|
|
form.value = info;
|
|
|
}
|
|
|
}
|
|
@@ -79,6 +97,9 @@ const searchOther = async () => {
|
|
|
// 性别
|
|
|
res = await dictAxios.query({ type: 'gender' });
|
|
|
if (res.errcode == '0') genderList.value = res.data;
|
|
|
+ // 管理员
|
|
|
+ res = await userAxios.query({ status: '1' });
|
|
|
+ if (res.errcode == '0') userList.value = res.data;
|
|
|
};
|
|
|
// 返回上一页
|
|
|
const toBack = () => {
|