Переглянути джерело

Merge branch 'master' of http://git.cc-lotus.info/zkzx/zkzx_admin

guhongwei 2 роки тому
батько
коміт
3c39e5ccc9
2 змінених файлів з 17 додано та 15 видалено
  1. 7 13
      src/views/user/expert/detail.vue
  2. 10 2
      src/views/user/expert/index.vue

+ 7 - 13
src/views/user/expert/detail.vue

@@ -6,16 +6,10 @@
           <cSearch :is_back="true" @toBack="toBack"></cSearch>
         </el-col>
         <el-col :span="24" class="two">
-          <cForm :span="24" :fields="formFields" :form="form" :rules="rules" @save="onSubmit" :disabled="disabled">
-            <template #type>
-              <el-option v-for="(i, index) in typeList" :key="index" :label="i.label" :value="i.value"></el-option>
-            </template>
+          <cForm :span="12" :fields="formFields" :form="form" :rules="rules" @save="onSubmit" :disabled="disabled" :isSave="!disabled">
             <template #code>
               <el-option v-for="(i, index) in codeList" :key="index" :label="i.label" :value="i.value"></el-option>
             </template>
-            <template #password>
-              <el-input v-model="form.password" placeholder="请输入密码" :disabled="form._id ? true : false" show-password></el-input>
-            </template>
             <template #area>
               <el-option v-for="(i, index) in areaList" :key="index" :label="i.label" :value="i.value"></el-option>
             </template>
@@ -42,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();
@@ -56,16 +50,14 @@ let form: Ref<any> = ref({});
 let roleList: Ref<any> = ref([]);
 let statusList: Ref<any> = ref([]);
 let codeList: Ref<any> = ref([]);
-let typeList: Ref<any> = ref([{ label: '专家', value: '6' }]);
 let areaList: Ref<any> = ref([]);
 let personalList: Ref<any> = ref([]);
 let disabled: Ref<any> = ref(false);
 // 表单
 let formFields: Ref<any[]> = ref([
-  { label: '用户类型', model: 'type', type: 'select', options: { disabled: true } },
   { label: '邀请码', model: 'code', type: 'select' },
   { label: '账号', model: 'account' },
-  { label: '密码', model: 'password', custom: true },
+  { label: '密码', model: 'password', type: 'password' },
   { label: '名称', model: 'name' },
   { label: '手机号', model: 'phone' },
   { label: '电子邮箱', model: 'email' },
@@ -80,8 +72,8 @@ let formFields: Ref<any[]> = ref([
   { label: '最高学历', model: 'education' },
   { label: '所学专业', model: 'major' },
   { label: '单位名称', model: 'company' },
-  { label: '职务职称', model: 'zwzc' },
   { label: '头像图片', model: 'icon', custom: true },
+  { label: '职务职称', model: 'zwzc' },
   { label: '擅长领域', model: 'expertise' },
   { label: '工作经历', model: 'workexperience' },
   { label: '科研综述', model: 'scientific' },
@@ -105,6 +97,7 @@ onMounted(async () => {
 });
 const search = async () => {
   if (route.query.id) {
+    formFields.value = formFields.value.filter((i) => i.model != 'password');
     let res: IQueryResult = await expert.fetch(route.query.id);
     if (res.errcode == 0) form.value = res.data as {};
   } else form.value = { type: '6', status: '1' };
@@ -145,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;
 };

+ 10 - 2
src/views/user/expert/index.vue

@@ -62,14 +62,14 @@ 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') }
 ]);
 // 操作
 let opera: Ref<any[]> = ref([
   { label: '查看', method: 'view', type: 'success' },
   { label: '修改', method: 'edit' },
-  { label: '审核', method: 'exam', type: 'warning' },
+  { label: '审核', method: 'exam', type: 'warning', display: (i) => i.status != '1' },
   { label: '删除', method: 'del', confirm: true, type: 'danger' }
 ]);
 const dialog: Ref<{ type: string; show: boolean; title: string }> = ref({ type: '1', show: false, title: '信息管理' });
@@ -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>