zs 1 vuosi sitten
vanhempi
commit
e18ae90cce

+ 21 - 0
src/views/match/enroll/detail.vue

@@ -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 = () => {

+ 2 - 11
src/views/match/enroll/index.vue

@@ -6,7 +6,7 @@
           <cSearch :is_title="false" :is_back="true" @toBack="toBack"></cSearch>
         </el-col>
         <el-col :span="24" class="two">
-          <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @exam="toExam" @view="toView" @del="toDel"> </cTable>
+          <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @exam="toExam" @view="toView"> </cTable>
         </el-col>
       </el-col>
     </el-row>
@@ -57,8 +57,7 @@ let fields: Ref<any[]> = ref([
 // 操作
 let opera: Ref<any[]> = ref([
   { label: '审核', method: 'exam', type: 'warning', display: (i) => i.status == '0' },
-  { label: '查看', method: 'view' },
-  { label: '删除', method: 'del', confirm: true, type: 'danger' }
+  { label: '查看', method: 'view' }
 ]);
 // 字典表
 const statusList: Ref<any> = ref([]);
@@ -111,14 +110,6 @@ const toExam = async (data) => {
 const toView = (data) => {
   router.push({ path: '/match/enroll/detail', query: { id: data._id } });
 };
-// 删除
-const toDel = async (data: any) => {
-  let res: IQueryResult = await applicationAxios.del(data._id);
-  if (res.errcode == 0) {
-    ElMessage({ type: `success`, message: `刪除信息成功` });
-    search({ skip, limit });
-  }
-};
 // 关闭弹框
 const toClose = () => {
   form.value = {};

+ 0 - 1
src/views/team/examine/detail.vue

@@ -33,7 +33,6 @@ import { TeamStore } from '@/stores/team/team';
 import { UserStore } from '@/stores/users/user';
 import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
 import type { IQueryResult } from '@/util/types.util';
-import { forOwnRight } from 'lodash';
 const teamAxios = TeamStore();
 const userAxios = UserStore();
 const dictAxios = DictDataStore();