guhongwei 2 years ago
parent
commit
5a2e8ae265

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

@@ -48,5 +48,10 @@ export default [
     path: '/user/company/detail',
     meta: { title: '信息管理' },
     component: () => import('@/views/user/company/detail.vue')
+  },
+  {
+    path: '/user/company/info',
+    meta: { title: '详细信息' },
+    component: () => import('@/views/user/company/info.vue')
   }
 ];

+ 5 - 1
src/views/system/module/detail.vue

@@ -1,6 +1,6 @@
 <template>
   <el-row>
-    <el-col :span="24" class="main animate__animated animate__backInRight">
+    <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
       <el-col :span="24" class="one">
         <cSearch :is_back="true" @toBack="toBack"></cSearch>
       </el-col>
@@ -31,6 +31,8 @@ const dictAxios = DictDataStore();
 
 // 路由
 let route = useRoute();
+// 加载中
+const loading: Ref<any> = ref(false);
 // 表单
 const fields: Ref<any> = ref([
   { label: '模块名称', model: 'name' },
@@ -49,8 +51,10 @@ const is_useList: Ref<any> = ref([]);
 
 // 请求
 onMounted(async () => {
+  loading.value = true;
   await searchOther();
   await search();
+  loading.value = false;
 });
 const search = async () => {
   let id = route.query.id;

+ 5 - 2
src/views/system/module/index.vue

@@ -1,6 +1,6 @@
 <template>
   <el-row>
-    <el-col :span="24" class="main animate__animated animate__backInRight">
+    <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
       <el-col :span="24" class="one">
         <cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch">
           <template #is_use>
@@ -33,7 +33,8 @@ const moduleAxios = ModuleStore();
 const dictAxios = DictDataStore();
 
 const { proxy } = getCurrentInstance() as any;
-
+// 加载中
+const loading: Ref<any> = ref(false);
 // 分页数据
 const list: Ref<any> = ref([]);
 const total: Ref<any> = ref(0);
@@ -57,8 +58,10 @@ const is_useList: Ref<any> = ref([]);
 
 // 请求
 onMounted(async () => {
+  loading.value = true;
   await searchOther();
   await search({ skip, limit });
+  loading.value = false;
 });
 const search = async (e: { skip: number; limit: number }) => {
   const info = { skip: e.skip, limit: e.limit, ...searchInfo.value };

+ 5 - 2
src/views/system/module/menus.vue

@@ -1,7 +1,7 @@
 <template>
   <div id="menus">
     <el-row>
-      <el-col :span="24" class="main animate__animated animate__backInRight">
+      <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>
@@ -75,7 +75,8 @@ const dictAxios = DictDataStore();
 
 // 路由
 const route = useRoute();
-
+// 加载中
+const loading: Ref<any> = ref(false);
 // 模块id
 const module_id: Ref<any> = ref(['']);
 // 菜单列表
@@ -106,10 +107,12 @@ const iconList: Ref<any> = ref([]);
 const is_useList: Ref<any> = ref([]);
 // 请求
 onMounted(async () => {
+  loading.value = true;
   let id = route.query.id;
   if (id) module_id.value = id;
   await searchOther();
   await search();
+  loading.value = false;
 });
 const search = async () => {
   if (module_id.value) {

+ 5 - 1
src/views/system/role/detail.vue

@@ -1,6 +1,6 @@
 <template>
   <el-row>
-    <el-col :span="24" class="main animate__animated animate__backInRight">
+    <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
       <el-col :span="24" class="one">
         <cSearch :is_back="true" @toBack="toBack"></cSearch>
       </el-col>
@@ -44,6 +44,8 @@ const dictAxios = DictDataStore();
 
 // 路由
 let route = useRoute();
+// 加载中
+const loading: Ref<any> = ref(false);
 // 表单
 const fields: Ref<any> = ref([
   { label: '角色名称', model: 'name' },
@@ -67,8 +69,10 @@ const typeList: Ref<any> = ref([]);
 
 // 请求
 onMounted(async () => {
+  loading.value = true;
   await searchOther();
   await search();
+  loading.value = false;
 });
 const search = async () => {
   let id = route.query.id;

+ 5 - 2
src/views/system/role/index.vue

@@ -1,6 +1,6 @@
 <template>
   <el-row>
-    <el-col :span="24" class="main animate__animated animate__backInRight">
+    <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
       <el-col :span="24" class="one">
         <cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch"></cSearch>
       </el-col>
@@ -29,7 +29,8 @@ const roleAxios = RoleStore();
 const dictAxios = DictDataStore();
 
 const { proxy } = getCurrentInstance() as any;
-
+// 加载中
+const loading: Ref<any> = ref(false);
 // 分页数据
 const list: Ref<any> = ref([]);
 const total: Ref<any> = ref(0);
@@ -56,8 +57,10 @@ const menuList: Ref<any> = ref([]);
 
 // 请求
 onMounted(async () => {
+  loading.value = true;
   await searchOther();
   await search({ skip, limit });
+  loading.value = false;
 });
 const search = async (e: { skip: number; limit: number }) => {
   const info = { skip: e.skip, limit: e.limit, ...searchInfo.value };

+ 132 - 0
src/views/user/company/detail.vue

@@ -0,0 +1,132 @@
+<template>
+  <el-row>
+    <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
+      <el-col :span="24" class="one">
+        <cSearch :is_back="true" @toBack="toBack"></cSearch>
+      </el-col>
+      <el-col :span="24" class="two">
+        <cForm :fields="fields" :rules="rules" :form="form" labelWidth="auto" @save="toSave">
+          <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>
+</template>
+
+<script setup lang="ts">
+// 基础
+import type { Ref } from 'vue';
+import { onMounted, ref, reactive } from 'vue';
+import { useRoute } from 'vue-router';
+import type { FormRules } from 'element-plus';
+import { ElMessage } from 'element-plus';
+// 接口
+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();
+
+// 路由
+let route = useRoute();
+// 加载中
+const loading: Ref<any> = ref(false);
+// 表单
+const fields: Ref<any> = ref([
+  { label: '邀请码', model: 'code', type: 'select' },
+  { label: '账号', model: 'account' },
+  { label: '密码', model: 'password', type: 'password' },
+  { 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' },
+  { label: '状态', model: 'status', type: 'select' }
+]);
+const form: Ref<any> = ref({ type: '5', status: '1' });
+const rules = reactive<FormRules>({});
+// 字典表
+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;
+  let res: IQueryResult;
+  let info: any = { type: '5', status: '1' };
+  if (id) {
+    // 已有数据
+    fields.value = fields.value.filter((i) => i.model != 'password');
+    res = await companyAxios.fetch(id);
+    if (res.errcode == '0') {
+      info = res.data;
+    }
+  }
+  form.value = info;
+};
+// 提交保存
+const toSave = async (data) => {
+  let res: IQueryResult;
+  if (data._id) {
+    res = await companyAxios.update(data);
+  } else res = await companyAxios.create(data);
+  if (res.errcode == '0') {
+    ElMessage({ message: `信息维护成功`, type: 'success' });
+    toBack();
+  } else {
+    ElMessage({ message: `${res.errmsg}`, type: 'error' });
+  }
+};
+// 查询其他信息
+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>

+ 175 - 0
src/views/user/company/index.vue

@@ -0,0 +1,175 @@
+<template>
+  <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_search="true" :fields="fields" @search="toSearch">
+          <template #area>
+            <el-option v-for="i in areaList" :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>
+        </cSearch>
+      </el-col>
+      <el-col :span="24" class="two">
+        <cButton @toAdd="toAdd"></cButton>
+      </el-col>
+      <el-col :span="24" class="thr">
+        <cTable :fields="fields" :opera="opera" :list="list" :total="total" @query="search" @view="toView" @exam="toExam" @edit="toEdit" @del="toDel"></cTable>
+      </el-col>
+    </el-col>
+  </el-row>
+  <cDialog :dialog="dialog" @handleClose="toClose">
+    <template v-slot:info>
+      <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
+        <cForm :fields="infofields" :form="form" labelWidth="auto" @save="toSave">
+          <template #status>
+            <el-option v-for="i in statusList" :key="i.value" :label="i.label" :value="i.value"></el-option>
+          </template>
+        </cForm>
+      </el-col>
+    </template>
+  </cDialog>
+</template>
+
+<script setup lang="ts">
+// 基础
+import type { Ref } from 'vue';
+import { onMounted, ref, getCurrentInstance } from 'vue';
+import { ElMessage } from 'element-plus';
+import { useRouter } 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 { proxy } = getCurrentInstance() as any;
+// 路由
+const router = useRouter();
+// 加载中
+const loading: Ref<any> = ref(false);
+// 分页数据
+const list: Ref<any> = ref([]);
+const total: Ref<any> = ref(0);
+const skip = 0;
+const limit = proxy.$limit;
+const fields: Ref<any> = ref([
+  { label: '邀请码', model: 'code', isSearch: true },
+  { label: '账号', model: 'account', isSearch: true },
+  { label: '姓名', model: 'name', isSearch: true },
+  { label: '手机号', model: 'phone', isSearch: true },
+  { label: '电子邮箱', model: 'email' },
+  { label: '所属辖区', model: 'area', format: (i) => getDict(i, 'area'), isSearch: true, type: 'select' },
+  { label: '审核状态', model: 'status', format: (i) => getDict(i, 'status'), isSearch: true, type: 'select' }
+]);
+const opera: Ref<any> = ref([
+  { label: '查看', method: 'view' },
+  { label: '审核', method: 'exam', display: (i) => i.status == '0' },
+  { label: '修改', method: 'edit', type: 'warning' },
+  { label: '删除', method: 'del', confirm: true, type: 'danger' }
+]);
+// 查询
+const searchInfo: Ref<any> = ref({});
+// 字典表
+const statusList: Ref<any> = ref([]);
+const areaList: 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' }]);
+
+// 请求
+onMounted(async () => {
+  loading.value = true;
+  await searchOther();
+  await search({ skip, limit });
+  loading.value = false;
+});
+const search = async (e: { skip: number; limit: number }) => {
+  const info = { skip: e.skip, limit: e.limit, ...searchInfo.value };
+  const res: IQueryResult = await companyAxios.query(info);
+  if (res.errcode == '0') {
+    list.value = res.data;
+    total.value = res.total;
+  }
+};
+const toSearch = (e) => {
+  searchInfo.value = e;
+  search({ skip, limit });
+};
+const getDict = (e, model) => {
+  if (model == 'area') {
+    let data = areaList.value.find((i) => i.value == e);
+    if (data) return data.label;
+    else return '暂无';
+  } else if (model == 'status') {
+    let data = statusList.value.find((i) => i.value == e);
+    if (data) return data.label;
+    else return '暂无';
+  }
+};
+// 查看
+const toView = (e) => {
+  router.push({ path: '/user/company/info', query: { id: e._id } });
+};
+// 添加
+const toAdd = () => {
+  router.push({ path: '/user/company/detail' });
+};
+// 修改
+const toEdit = (e) => {
+  router.push({ path: '/user/company/detail', query: { id: e._id } });
+};
+// 删除
+const toDel = async (e) => {
+  let res: IQueryResult;
+  res = await companyAxios.del(e._id);
+  if (res.errcode == '0') {
+    ElMessage({ message: `删除信息成功`, type: 'success' });
+    search({ skip, limit });
+  } else {
+    ElMessage({ message: `${res.errmsg}`, type: 'error' });
+  }
+};
+// 审核
+const toExam = (e) => {
+  form.value = e;
+  dialog.value = { title: '审核管理', show: true, type: '1' };
+};
+// 提交保存
+const toSave = async (data) => {
+  let res: IQueryResult = await companyAxios.update(data);
+  if (res.errcode == '0') {
+    ElMessage({ message: `审核信息成功`, type: 'success' });
+    toClose();
+  } else {
+    ElMessage({ message: `${res.errmsg}`, type: 'error' });
+  }
+};
+// 关闭弹框
+const toClose = () => {
+  form.value = {};
+  dialog.value = { title: '审核管理', show: false, type: '1' };
+  search({ skip, limit });
+};
+// 查询其他信息
+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;
+};
+</script>
+<style scoped lang="scss">
+.main {
+  .two {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

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

@@ -0,0 +1,108 @@
+<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>