Browse Source

专家用户

YY 2 years ago
parent
commit
c654eda09f
2 changed files with 12 additions and 3 deletions
  1. 3 2
      src/views/user/expert/detail.vue
  2. 9 1
      src/views/user/expert/index.vue

+ 3 - 2
src/views/user/expert/detail.vue

@@ -36,8 +36,8 @@ import { ref, reactive, onMounted } from 'vue';
 import { ElMessage } from 'element-plus';
 import { useRoute } from 'vue-router';
 import { DictDataStore } from '@common/src/stores/system/dictData'; // 字典表
-import { RoleStore } from '@common/src/stores/system/role'; // 角色
-import { ExpertStore } from '@common/src/stores/admins/expert'; // 角色
+import { RoleStore } from '@common/src/stores/system/role'; // 个人
+import { ExpertStore } from '@common/src/stores/admins/expert'; // 专家
 import { PersonalStore } from '@common/src/stores/admins/personal';
 import type { IQueryResult } from '@/util/types.util';
 const expert = ExpertStore();
@@ -138,6 +138,7 @@ const searchOther = async () => {
   // 状态
   res = await dictData.query({ type: 'common_status' });
   if (res.errcode == 0) statusList.value = res.data;
+  // 个人
   res = await personal.query();
   if (res.errcode == 0) personalList.value = res.data;
 };

+ 9 - 1
src/views/user/expert/index.vue

@@ -62,7 +62,7 @@ let fields: Ref<any[]> = ref([
   { label: '账号', model: 'account', isSearch: true },
   { label: '姓名', model: 'name', isSearch: true },
   { label: '手机号', model: 'phone', isSearch: true },
-  { label: '所属辖区', model: 'area' },
+  { label: '所属辖区', model: 'area', format: (i) => getDict(i, 'area') },
   { label: '状态', model: 'status', format: (i) => getDict(i, 'status') }
 ]);
 // 操作
@@ -79,6 +79,7 @@ let formFields: Ref<any[]> = ref([{ label: '状态', model: 'status', type: 'sel
 // 查询数据
 let searchForm: Ref<any> = ref({});
 let statusList: Ref<any> = ref([]);
+let areaList: Ref<any> = ref([]);
 onMounted(async () => {
   loading.value = true;
   await searchOther();
@@ -105,6 +106,10 @@ const getDict = (e, model) => {
     let data: any = statusList.value.find((i: any) => i.value == e);
     if (data) return data.label;
     else return '暂无';
+  } else if (model == 'area') {
+    let data: any = areaList.value.find((i: any) => i.value == e);
+    if (data) return data.label;
+    else return '暂无';
   }
 };
 // 新增
@@ -155,6 +160,9 @@ const searchOther = async () => {
   // 状态
   res = await dictData.query({ type: 'common_status' });
   if (res.errcode == 0) statusList.value = res.data;
+  // 状态
+  res = await dictData.query({ type: 'jl_area' });
+  if (res.errcode == 0) areaList.value = res.data;
 };
 </script>
 <style lang="scss" scoped>