guhongwei před 2 roky
rodič
revize
3322f7cf41

+ 0 - 5
src/router/module/account.ts

@@ -49,11 +49,6 @@ export default [
     meta: { title: '信息管理' },
     component: () => import('@/views/user/company/detail.vue')
   },
-  {
-    path: '/user/company/info',
-    meta: { title: '详细信息' },
-    component: () => import('@/views/user/company/info.vue')
-  },
   {
     path: '/user/expert',
     meta: { title: '专家用户' },

+ 17 - 3
src/views/user/company/index.vue

@@ -26,6 +26,11 @@
           <template #status>
             <el-option v-for="i in statusList" :key="i.value" :label="i.label" :value="i.value"></el-option>
           </template>
+          <template #role>
+            <el-select v-model="form.role" multiple placeholder="请选择角色" style="width: 100%">
+              <el-option v-for="i in roleList" :key="i._id" :label="`${i.name}(${i.code})`" :value="i._id"> </el-option>
+            </el-select>
+          </template>
         </cForm>
       </el-col>
     </template>
@@ -41,9 +46,11 @@ import { useRouter } from 'vue-router';
 // 接口
 import { CompanyStore } from '@common/src/stores/admins/company';
 import { DictDataStore } from '@common/src/stores/system/dictData';
+import { RoleStore } from '@common/src/stores/system/role'; // 角色
 import type { IQueryResult } from '@/util/types.util';
 const companyAxios = CompanyStore();
 const dictAxios = DictDataStore();
+const roleAxios = RoleStore();
 
 const { proxy } = getCurrentInstance() as any;
 // 路由
@@ -66,7 +73,7 @@ const fields: Ref<any> = ref([
 ]);
 const opera: Ref<any> = ref([
   { label: '查看', method: 'view' },
-  { label: '审核', method: 'exam', display: (i) => i.status == '0' },
+  { label: '审核/角色', method: 'exam' },
   { label: '修改', method: 'edit', type: 'warning' },
   { label: '删除', method: 'del', confirm: true, type: 'danger' }
 ]);
@@ -75,11 +82,15 @@ const searchInfo: Ref<any> = ref({});
 // 字典表
 const statusList: Ref<any> = ref([]);
 const areaList: Ref<any> = ref([]);
+const roleList: Ref<any> = ref([]);
 
 // 弹框
 const dialog: Ref<any> = ref({ title: '审核管理', show: false, type: '1' });
 const form: Ref<any> = ref({});
-const infofields: Ref<any> = ref([{ label: '审核状态', model: 'status', type: 'select' }]);
+const infofields: Ref<any> = ref([
+  { label: '审核状态', model: 'status', type: 'select' },
+  { label: '角色', model: 'role', custom: true }
+]);
 
 // 请求
 onMounted(async () => {
@@ -113,7 +124,7 @@ const getDict = (e, model) => {
 };
 // 查看
 const toView = (e) => {
-  router.push({ path: '/user/company/info', query: { id: e._id } });
+  router.push({ path: '/user/company/detail', query: { id: e._id, isdisabled: `${true}` } });
 };
 // 添加
 const toAdd = () => {
@@ -164,6 +175,9 @@ const searchOther = async () => {
   // 辖区
   res = await dictAxios.query({ type: 'jl_area' });
   if (res.errcode == '0') areaList.value = res.data;
+  // 角色
+  res = await roleAxios.query({ account_type: '5', is_use: '0' });
+  if (res.errcode == 0) roleList.value = res.data;
 };
 </script>
 <style scoped lang="scss">

+ 0 - 108
src/views/user/company/info.vue

@@ -1,108 +0,0 @@
-<template>
-  <div id="info">
-    <el-row>
-      <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
-        <el-col :span="24" class="one">
-          <cSearch :is_title="false" :is_back="true" @toBack="toBack"></cSearch>
-        </el-col>
-        <el-col :span="24" class="two">
-          <cForm :fields="fields" :form="form" :disabled="true" labelWidth="auto" :isSave="false">
-            <template #code>
-              <el-option v-for="i in codeList" :key="i.value" :label="i.label" :value="i.value"></el-option>
-            </template>
-            <template #status>
-              <el-option v-for="i in statusList" :key="i.value" :label="i.label" :value="i.value"></el-option>
-            </template>
-            <template #area>
-              <el-option v-for="i in areaList" :key="i.value" :label="i.label" :value="i.value"></el-option>
-            </template>
-          </cForm>
-        </el-col>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script setup lang="ts">
-// 基础
-import type { Ref } from 'vue';
-import { onMounted, ref } from 'vue';
-import { useRoute } from 'vue-router';
-// 接口
-import { CompanyStore } from '@common/src/stores/admins/company';
-import { DictDataStore } from '@common/src/stores/system/dictData';
-import type { IQueryResult } from '@/util/types.util';
-const companyAxios = CompanyStore();
-const dictAxios = DictDataStore();
-
-// 路由
-const route = useRoute();
-// 加载中
-const loading: Ref<any> = ref(false);
-const form: Ref<any> = ref({});
-const fields: Ref<any> = ref([
-  { label: '邀请码', model: 'code', type: 'select' },
-  { label: '账号', model: 'account' },
-  { label: '姓名', model: 'name' },
-  { label: '手机号', model: 'phone' },
-  { label: '电子邮箱', model: 'email' },
-  { label: '联系地址', model: 'address' },
-  { label: '办公电话', model: 'work_phone' },
-  { label: '所属行业', model: 'industry' },
-  { label: '所属辖区', model: 'area', type: 'select' },
-  { label: '机构代码', model: 'institution_code' },
-  { label: '注册类型', model: 'companytype' },
-  { label: '注册时间', model: 'companydate', type: 'date' },
-  { label: '注册资金', model: 'companycapital' },
-  { label: '企业法人', model: 'companyperson' },
-  { label: '上年度企业总收入', model: 'sndqyzsr' },
-  { label: '上年度研发费用', model: 'sndyffy' },
-  { label: '企业总人数', model: 'companytotal' },
-  { label: '专&兼职研发人数', model: 'zjzyfrs' },
-  { label: '企业简介', model: 'companybrief', type: 'textarea' },
-  { label: '主要产品', model: 'mainproduct', type: 'textarea' },
-  { label: '企业资质&荣誉', model: 'qualifications', type: 'textarea' }
-]);
-// 字典表
-const statusList: Ref<any> = ref([]);
-const areaList: Ref<any> = ref([]);
-const codeList: Ref<any> = ref([]);
-// 请求
-onMounted(async () => {
-  loading.value = true;
-  await searchOther();
-  await search();
-  loading.value = false;
-});
-const search = async () => {
-  let id = route.query.id;
-  if (id) {
-    let res: IQueryResult = await companyAxios.fetch(id);
-    if (res.errcode == '0') {
-      form.value = res.data;
-    }
-  }
-};
-// 查询其他信息
-const searchOther = async () => {
-  let res: IQueryResult;
-  // 状态
-  res = await dictAxios.query({ type: 'common_status' });
-  if (res.errcode == '0') statusList.value = res.data;
-  // 辖区
-  res = await dictAxios.query({ type: 'jl_area' });
-  if (res.errcode == '0') areaList.value = res.data;
-  // 邀请码
-  res = await dictAxios.query({ type: 'account_code' });
-  if (res.errcode == '0') {
-    let list = res.data as any;
-    list = list.filter((i) => i.value != 'CJGLY');
-    codeList.value = list;
-  }
-};
-// 返回上一页
-const toBack = () => {
-  window.history.go(-1);
-};
-</script>
-<style scoped lang="scss"></style>

+ 17 - 3
src/views/user/expert/index.vue

@@ -27,6 +27,11 @@
           <template #status>
             <el-option v-for="(i, index) in statusList" :key="index" :label="i.label" :value="i.value"></el-option>
           </template>
+          <template #role>
+            <el-select v-model="form.role" multiple placeholder="请选择角色" style="width: 100%">
+              <el-option v-for="i in roleList" :key="i._id" :label="`${i.name}(${i.code})`" :value="i._id"> </el-option>
+            </el-select>
+          </template>
         </cForm>
       </template>
     </cDialog>
@@ -42,9 +47,11 @@ import { ElMessage } from 'element-plus';
 // 接口
 import { ExpertStore } from '@common/src/stores/admins/expert';
 import { DictDataStore } from '@common/src/stores/system/dictData'; // 字典表
+import { RoleStore } from '@common/src/stores/system/role'; // 角色
 import type { IQueryResult } from '@/util/types.util';
 const expert = ExpertStore();
 const dictData = DictDataStore();
+const roleAxios = RoleStore();
 
 const { proxy } = getCurrentInstance() as any;
 
@@ -71,19 +78,23 @@ let fields: Ref<any[]> = ref([
 // 操作
 let opera: Ref<any[]> = ref([
   { label: '查看', method: 'view', type: 'success' },
+  { label: '审核/角色', method: 'exam' },
   { label: '修改', method: 'edit' },
-  { 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: '信息管理' });
-let form: Ref<{}> = ref({});
+let form: Ref<any> = ref({});
 // 表单
-let formFields: Ref<any[]> = ref([{ label: '状态', model: 'status', type: 'select' }]);
+let formFields: Ref<any[]> = ref([
+  { label: '状态', model: 'status', type: 'select' },
+  { label: '角色', model: 'role', custom: true }
+]);
 // 查询数据
 let searchForm: Ref<any> = ref({});
 // 字典表
 let statusList: Ref<any> = ref([]);
 let areaList: Ref<any> = ref([]);
+const roleList: Ref<any> = ref([]);
 onMounted(async () => {
   loading.value = true;
   await searchOther();
@@ -167,6 +178,9 @@ const searchOther = async () => {
   // 状态
   res = await dictData.query({ type: 'jl_area' });
   if (res.errcode == 0) areaList.value = res.data;
+  // 角色
+  res = await roleAxios.query({ account_type: '6', is_use: '0' });
+  if (res.errcode == 0) roleList.value = res.data;
 };
 </script>
 <style lang="scss" scoped>

+ 17 - 3
src/views/user/personal/index.vue

@@ -28,6 +28,11 @@
             <template #status>
               <el-option v-for="(i, index) in statusList" :key="index" :label="i.label" :value="i.value"></el-option>
             </template>
+            <template #role>
+              <el-select v-model="form.role" multiple placeholder="请选择角色" style="width: 100%">
+                <el-option v-for="i in roleList" :key="i._id" :label="`${i.name}(${i.code})`" :value="i._id"> </el-option>
+              </el-select>
+            </template>
           </cForm>
         </el-col>
       </template>
@@ -43,9 +48,11 @@ import { useRouter } from 'vue-router';
 
 import { PersonalStore } from '@common/src/stores/admins/personal';
 import { DictDataStore } from '@common/src/stores/system/dictData'; // 字典表
+import { RoleStore } from '@common/src/stores/system/role'; // 角色
 import type { IQueryResult } from '@/util/types.util';
 const personal = PersonalStore();
 const dictData = DictDataStore();
+const roleAxios = RoleStore();
 
 const { proxy } = getCurrentInstance() as any;
 
@@ -71,20 +78,24 @@ let fields: Ref<any[]> = ref([
 // 操作
 let opera: Ref<any[]> = ref([
   { label: '查看', method: 'view', type: 'success' },
-  { label: '审核', method: 'exam', display: (i) => i.status == '0' },
+  { label: '审核/角色', method: 'exam' },
   { label: '修改', method: 'edit', type: 'warning' },
   { label: '删除', method: 'del', confirm: true, type: 'danger' }
 ]);
 // 弹框
 const dialog: Ref<any> = ref({ type: '1', show: false, title: '信息管理' });
-let form: Ref<{}> = ref({});
-let formFields: Ref<any[]> = ref([{ label: '状态', model: 'status', type: 'select' }]);
+let form: Ref<any> = ref({});
+let formFields: Ref<any[]> = ref([
+  { label: '状态', model: 'status', type: 'select' },
+  { label: '角色', model: 'role', custom: true }
+]);
 
 // 查询数据
 let searchForm: Ref<any> = ref({});
 // 字典表
 let statusList: Ref<any> = ref([]);
 const areaList: Ref<any> = ref([]);
+const roleList: Ref<any> = ref([]);
 
 onMounted(async () => {
   loading.value = true;
@@ -171,6 +182,9 @@ const searchOther = async () => {
   // 辖区
   res = await dictData.query({ type: 'jl_area' });
   if (res.errcode == '0') areaList.value = res.data;
+  // 角色
+  res = await roleAxios.query({ account_type: '4', is_use: '0' });
+  if (res.errcode == 0) roleList.value = res.data;
 };
 </script>
 <style lang="scss" scoped>