guhongwei 4 years ago
parent
commit
45d9a2084f

+ 6 - 0
src/router/index.js

@@ -106,6 +106,12 @@ const routes = [
     meta: { title: '用户管理', isleftarrow: true },
     component: () => import('../views/adminCenter/user/index.vue'),
   },
+  {
+    path: '/adminCenter/user/detail',
+    name: 'adminCenter_user_detail',
+    meta: { title: '审核/查看用户', isleftarrow: true },
+    component: () => import('../views/adminCenter/user/detail.vue'),
+  },
   // 登录
   {
     path: '/login',

+ 61 - 72
src/views/adminCenter/user/detail.vue

@@ -1,12 +1,12 @@
 <template>
-  <div id="index">
+  <div id="detail">
     <el-row>
       <el-col :span="24" class="style">
         <el-col :span="24" class="top">
           <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
         </el-col>
         <el-col :span="24" class="main">
-          <person :form="form" @onSubmit="onSubmit"></person>
+          <detailInfo :form="form" :role="userrole" @onSubmit="onSubmit"></detailInfo>
         </el-col>
       </el-col>
     </el-row>
@@ -14,100 +14,95 @@
 </template>
 
 <script>
+import detailInfo from './parts/detailInfo.vue';
 import NavBar from '@/layout/common/topInfo.vue';
-import person from '@/layout/adminuser/release.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: market } = createNamespacedHelpers('market');
-const { mapActions: expertsuser } = createNamespacedHelpers('expertsuser');
+const { mapActions: marketuser } = createNamespacedHelpers('marketuser');
+const { mapActions: exportuser } = createNamespacedHelpers('exportuser');
 export default {
-  name: 'index',
+  name: 'detail',
   props: {},
   components: {
     NavBar,
-    person, //个人信息维护
+    detailInfo,
   },
-  data: () => ({
-    // 头部标题
-    title: '',
-    // meta为true
-    isleftarrow: '',
-    // 返回
-    navShow: true,
-    // 个人信息
-    form: {},
-  }),
-  created() {
-    this.searchInfo();
+  data: function() {
+    return {
+      // 头部标题
+      title: '',
+      // meta为true
+      isleftarrow: '',
+      // 返回
+      navShow: true,
+      // 用户详情
+      form: {},
+      // 用户类别
+      userrole: '',
+    };
   },
-  computed: {
-    ...mapState(['user']),
-    id() {
-      return this.$route.query.id;
-    },
-    role() {
-      return this.$route.query.role;
-    },
+  async created() {
+    if (this.id) {
+      this.$set(this, `userrole`, this.role);
+      await this.search();
+    }
   },
   methods: {
-    ...market(['fetch', 'update', 'create']),
-    ...expertsuser({ expertsuserFetch: 'fetch', expertsuserUpdate: 'update', expertsuserUpgrade: 'upgrade', expertsuserCreate: 'create' }),
-    async searchInfo() {
-      if (this.role == '4' || this.role == '5' || this.role == '7') {
-        let res = await this.fetch(this.id);
-        if (res.errcode === 0) {
+    ...marketuser({ marketuserfetch: 'fetch', marketuserupdate: 'update' }),
+    ...exportuser({ exportuserfetch: 'fetch', exportuserupdate: 'update' }),
+    // 查询详情
+    async search() {
+      let role = this.role;
+      if (role == '4' || role == '5') {
+        let res = await this.marketuserfetch(this.id);
+        if (this.$checkRes(res)) {
           this.$set(this, `form`, res.data);
         }
-      } else if (this.role == '6') {
-        let res = await this.expertsuserFetch(this.id);
-        if (res.errcode === 0) {
+      } else {
+        let res = await this.exportuserfetch(this.id);
+        if (this.$checkRes(res)) {
           this.$set(this, `form`, res.data);
         }
       }
     },
+    // 审核提交
     async onSubmit({ data }) {
-      if (data.role == '4' || data.role == '5' || data.role == '7') {
-        let res;
-        let msg;
-        if (data.id) {
-          res = await this.update(data);
-          this.$message({
-            message: '个人信息修改成功',
-            type: 'success',
-          });
-        } else {
-          data.status = '0';
-          data.code = this.user.code;
-          res = await this.create(data);
-          this.$message({
-            message: '个人信息创建成功',
+      if (data.role == '4' || data.role == '5') {
+        let res = await this.marketuserupdate(data);
+        if (this.$checkRes(res)) {
+          this.$notify({
+            message: '审核成功',
             type: 'success',
           });
+          this.$router.push({ path: '/adminCenter/user/index' });
         }
-      } else if (data.role == '6') {
-        let res;
-        let msg;
-        if (data.id) {
-          res = await this.expertsuserUpdate(data);
-          this.$message({
-            message: '个人信息修改成功',
-            type: 'success',
-          });
-        } else {
-          data.code = this.user.code;
-          res = await this.expertsuserCreate(data);
-          this.$message({
-            message: '个人信息添加成功',
+      } else {
+        let res = await this.exportuserupdate(data);
+        if (this.$checkRes(res)) {
+          this.$notify({
+            message: '审核成功',
             type: 'success',
           });
+          this.$router.push({ path: '/adminCenter/user/index' });
         }
       }
-      this.$router.push({ path: './index' });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+    role() {
+      return this.$route.query.role;
     },
   },
   mounted() {
     this.title = this.$route.meta.title;
     this.isleftarrow = this.$route.meta.isleftarrow;
   },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
 };
 </script>
 
@@ -121,14 +116,8 @@ export default {
 .top {
   height: 46px;
   overflow: hidden;
-  position: relative;
-  z-index: 999;
 }
 .main {
   min-height: 570px;
 }
-.foot {
-  position: absolute;
-  bottom: 0;
-}
 </style>

+ 31 - 13
src/views/adminCenter/user/index.vue

@@ -6,17 +6,19 @@
           <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
         </el-col>
         <el-col :span="24" class="main">
-          <van-tabs v-model="active">
-            <van-tab title="待审核">
-              <userlist :list="oneList"></userlist>
-            </van-tab>
-            <van-tab title="审核通过">
-              <userlist></userlist>
-            </van-tab>
-            <van-tab title="审核拒绝">
-              <userlist></userlist>
-            </van-tab>
-          </van-tabs>
+          <el-col :span="24">
+            <van-tabs v-model="active">
+              <van-tab title="待审核">
+                <userlist :list="oneList" @shenhebtn="shenhebtn"></userlist>
+              </van-tab>
+              <van-tab title="审核通过">
+                <userlist :list="twoList" @shenhebtn="shenhebtn"></userlist>
+              </van-tab>
+              <van-tab title="审核拒绝">
+                <userlist :list="threeList" @shenhebtn="shenhebtn"></userlist>
+              </van-tab>
+            </van-tabs>
+          </el-col>
         </el-col>
       </el-col>
     </el-row>
@@ -44,6 +46,12 @@ export default {
     active: '1',
     // 待审核
     oneList: [],
+    // 审核通过
+    twoList: [],
+    // 审核拒绝
+    threeList: [],
+    // 搜索
+    value: '',
   }),
   async created() {
     await this.search();
@@ -51,15 +59,25 @@ export default {
   methods: {
     ...marketuser(['userquery']),
     async search({ ...info } = {}) {
-      console.log(this.user);
       let user = this.user;
       if (this.user.code == 'JLCJGLY') {
         const res = await this.userquery({ ...info });
-        console.log(res);
+        if (this.$checkRes(res)) {
+          let one = res.data.filter(i => i.status == '0' && i.isdel == '0');
+          if (one) this.$set(this, `oneList`, one);
+          let two = res.data.filter(i => i.status == '1' && i.isdel == '0');
+          if (two) this.$set(this, `twoList`, two);
+          let three = res.data.filter(i => i.status == '2' && i.isdel == '0');
+          if (three) this.$set(this, `threeList`, three);
+        }
       } else {
         console.log('机构');
       }
     },
+    // 审核用户。查看用户
+    shenhebtn(data) {
+      this.$router.push({ path: '/adminCenter/user/detail', query: { id: data.uid, role: data.role } });
+    },
   },
   computed: {
     ...mapState(['user']),

+ 167 - 0
src/views/adminCenter/user/parts/detailInfo.vue

@@ -0,0 +1,167 @@
+<template>
+  <div id="detailInfo">
+    <el-row>
+      <el-col :span="24">
+        <span v-if="role == '4'">
+          <van-form>
+            <van-field v-model="form.name" name="用户名" label="用户名" placeholder="用户名" readonly />
+            <van-field v-model="form.phone" name="手机号" label="手机号" placeholder="手机号" readonly />
+            <van-field v-model="form.code" name="机构代码" label="机构代码" readonly />
+            <van-field name="radio" label="用户类别">
+              <template #input>
+                <van-radio-group v-model="form.role" direction="horizontal" disabled>
+                  <van-radio name="4">个人</van-radio>
+                  <van-radio name="5">机构</van-radio>
+                  <van-radio name="6">专家</van-radio>
+                </van-radio-group>
+              </template>
+            </van-field>
+            <van-field v-model="form.email" name="电子邮箱" label="电子邮箱" placeholder="电子邮箱" readonly />
+            <van-field v-model="form.addr" name="联系地址" label="联系地址" placeholder="联系地址" readonly />
+            <van-field v-model="form.office_phone" name="办公电话" label="办公电话" placeholder="办公电话" readonly />
+            <van-field v-model="form.profession" name="所属行业" label="所属行业" placeholder="所属行业" readonly />
+            <van-field name="radio" label="用户状态">
+              <template #input>
+                <van-radio-group v-model="form.status" direction="horizontal">
+                  <van-radio name="0">已注册</van-radio>
+                  <van-radio name="1">通过</van-radio>
+                  <van-radio name="2">未通过</van-radio>
+                </van-radio-group>
+              </template>
+            </van-field>
+            <div style="margin: 16px;" v-if="form.status == '0'">
+              <van-button round block type="info" @click="onSubmit">
+                提交
+              </van-button>
+            </div>
+          </van-form>
+        </span>
+        <span v-else-if="role == '5'">
+          <van-form>
+            <van-field v-model="form.name" name="用户名" label="用户名" placeholder="用户名" readonly />
+            <van-field v-model="form.phone" name="手机号" label="手机号" placeholder="手机号" readonly />
+            <van-field v-model="form.code" name="机构代码" label="机构代码" readonly />
+            <van-field name="radio" label="用户类别">
+              <template #input>
+                <van-radio-group v-model="form.role" direction="horizontal" disabled>
+                  <van-radio name="4">个人</van-radio>
+                  <van-radio name="5">机构</van-radio>
+                  <van-radio name="6">专家</van-radio>
+                </van-radio-group>
+              </template>
+            </van-field>
+            <van-field v-model="form.email" name="电子邮箱" label="电子邮箱" placeholder="电子邮箱" readonly />
+            <van-field v-model="form.addr" name="联系地址" label="联系地址" placeholder="联系地址" readonly />
+            <van-field v-model="form.office_phone" name="办公电话" label="办公电话" placeholder="办公电话" readonly />
+            <van-field v-model="form.profession" name="所属行业" label="所属行业" placeholder="所属行业" readonly />
+            <van-field v-model="form.institution_code" name="信用代码" label="信用代码" placeholder="信用代码" readonly />
+            <van-field v-model="form.companytype" name="注册类型" label="注册类型" placeholder="注册类型" readonly />
+            <van-field v-model="form.companydate" name="注册时间" label="注册时间" placeholder="注册时间" readonly />
+            <van-field v-model="form.companycapital" name="注册资金" label="注册资金" placeholder="注册资金" readonly />
+            <van-field v-model="form.companyperson" name="企业法人" label="企业法人" placeholder="企业法人" readonly />
+            <van-field v-model="form.sndqyzsr" name="企业总收入" label="企业总收入" placeholder="企业总收入" readonly />
+            <van-field v-model="form.sndyffy" name="研发费用" label="研发费用" placeholder="研发费用" readonly />
+            <van-field v-model="form.companytotal" name="总人数" label="总人数" placeholder="总人数" readonly />
+            <van-field v-model="form.companybrief" rows="1" autosize label="企业简介" type="textarea" placeholder="企业简介" />
+            <van-field v-model="form.mainproduct" rows="1" autosize label="主要产品" type="textarea" placeholder="主要产品" />
+            <van-field v-model="form.qualifications" rows="1" autosize label="资质/荣誉" type="textarea" placeholder="资质/荣誉" />
+            <van-field name="radio" label="用户状态">
+              <template #input>
+                <van-radio-group v-model="form.status" direction="horizontal">
+                  <van-radio name="0">已注册</van-radio>
+                  <van-radio name="1">通过</van-radio>
+                  <van-radio name="2">未通过</van-radio>
+                </van-radio-group>
+              </template>
+            </van-field>
+            <div style="margin: 16px;" v-if="form.status == '0'">
+              <van-button round block type="info" @click="onSubmit">
+                提交
+              </van-button>
+            </div>
+          </van-form>
+        </span>
+        <span v-else-if="role == '6'">
+          <van-form>
+            <van-field v-model="form.name" name="用户名" label="用户名" placeholder="用户名" readonly />
+            <van-field v-model="form.phone" name="手机号" label="手机号" placeholder="手机号" readonly />
+            <van-field v-model="form.code" name="机构代码" label="机构代码" readonly />
+            <van-field name="radio" label="用户类别">
+              <template #input>
+                <van-radio-group v-model="form.role" direction="horizontal" disabled>
+                  <van-radio name="4">个人</van-radio>
+                  <van-radio name="5">机构</van-radio>
+                  <van-radio name="6">专家</van-radio>
+                </van-radio-group>
+              </template>
+            </van-field>
+            <van-field name="uploader" label="用户头像">
+              <template #input>
+                <van-image width="100" height="100" :src="form.expertimage" />
+              </template>
+            </van-field>
+            <van-field v-model="form.education" name="最高学历" label="最高学历" placeholder="最高学历" readonly />
+            <van-field v-model="form.school" name="毕业院校" label="毕业院校" placeholder="毕业院校" readonly />
+            <van-field v-model="form.birthDate" name="出生日期" label="出生日期" placeholder="出生日期" readonly />
+            <van-field v-model="form.qqwx" name="QQ/微信" label="QQ/微信" placeholder="电子邮箱" readonly />
+            <van-field v-model="form.email" name="电子邮箱" label="电子邮箱" placeholder="电子邮箱" readonly />
+            <van-field v-model="form.company" name="工作单位" label="工作单位" placeholder="工作单位" readonly />
+            <van-field v-model="form.zwzc" name="职务职称" label="职务职称" placeholder="职务职称" readonly />
+            <van-field v-model="form.expertise" name="擅长领域" label="擅长领域" placeholder="擅长领域" readonly />
+            <van-field v-model="form.workexperience" rows="1" autosize label="工作经历" type="textarea" placeholder="工作经历" />
+            <van-field v-model="form.scientific" rows="1" autosize label="科研综述" type="textarea" placeholder="科研综述" />
+            <van-field v-model="form.undertakingproject" rows="1" autosize label="承担项目" type="textarea" placeholder="承担项目" />
+            <van-field v-model="form.scienceaward" rows="1" autosize label="科技奖励" type="textarea" placeholder="科技奖励" />
+            <van-field v-model="form.social" rows="1" autosize label="社会任职" type="textarea" placeholder="社会任职" />
+            <van-field name="radio" label="用户状态">
+              <template #input>
+                <van-radio-group v-model="form.status" direction="horizontal">
+                  <van-radio name="0">已注册</van-radio>
+                  <van-radio name="1">通过</van-radio>
+                  <van-radio name="2">未通过</van-radio>
+                </van-radio-group>
+              </template>
+            </van-field>
+            <div style="margin: 16px;" v-if="form.status == '0'">
+              <van-button round block type="info" @click="onSubmit">
+                提交
+              </van-button>
+            </div>
+          </van-form>
+        </span>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'detailInfo',
+  props: {
+    form: { type: Object },
+    role: { type: String },
+  },
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {
+    onSubmit() {
+      this.$emit('onSubmit', { data: this.form });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 35 - 5
src/views/adminCenter/user/parts/userlist.vue

@@ -1,9 +1,14 @@
 <template>
   <div id="userlist">
     <el-row>
-      <el-col :span="24">
-        <el-col :span="24" v-for="(item, index) in list" :key="index">
-          <p>{{ item.name }}</p>
+      <el-col :span="24" class="userlist">
+        <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
+          <p class="textOver">{{ item.name }}</p>
+          <p class="textOver">联系电话:{{ item.phone }}</p>
+          <p class="textOver">用户类别:{{ item.role == '4' ? '个人' : item.role == '5' ? '机构用户' : '专家用户' }}</p>
+          <p>
+            <el-button type="primary" size="mini" @click="shenhebtn(item)">{{ item.status == '0' ? '审核用户' : '查看用户' }}</el-button>
+          </p>
         </el-col>
       </el-col>
     </el-row>
@@ -22,7 +27,11 @@ export default {
     return {};
   },
   created() {},
-  methods: {},
+  methods: {
+    shenhebtn(data) {
+      this.$emit('shenhebtn', data);
+    },
+  },
   computed: {
     ...mapState(['user']),
     pageTitle() {
@@ -35,4 +44,25 @@ export default {
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.userlist {
+  padding: 0 10px;
+  .list {
+    border-bottom: 1px dashed #ccc;
+    padding: 10px 0;
+    p {
+      font-size: 16px;
+      color: #666;
+      padding: 0 0 5px 0;
+    }
+    p:nth-child(1) {
+      font-size: 18px;
+      font-weight: bold;
+      color: #000;
+    }
+    p:nth-child(4) {
+      text-align: center;
+    }
+  }
+}
+</style>

+ 20 - 15
src/views/dockCenter/applyInfo/index.vue

@@ -27,7 +27,12 @@
                 <el-col :span="24" class="btn">
                   <el-button type="success" size="mini" @click="handlecheck(item)" v-if="item.status == '0'">同意参展</el-button>
                   <el-button type="danger" size="mini" @click="handleclose(item)" v-if="item.status == '0'">拒绝参展</el-button>
-                  <el-button type="primary" size="mini" v-if="item.status == '1'"  @click="$router.push({ path: '/dockCenter/applyInfo/productList', query: { dockid: dock_id,id:item.user_id } })">
+                  <el-button
+                    type="primary"
+                    size="mini"
+                    v-if="item.status == '1'"
+                    @click="$router.push({ path: '/dockCenter/applyInfo/productList', query: { dockid: dock_id, id: item.user_id } })"
+                  >
                     审核参展产品</el-button
                   >
                 </el-col>
@@ -97,15 +102,15 @@ export default {
           status: '1',
         },
       ],
-      dock_id:''
+      dock_id: '',
     };
   },
   created() {
-        this.searchInfo();
+    this.searchInfo();
   },
   methods: {
-    ...dock({ dockQuery: 'query', dockfetch: 'fetch',dockupdate:'update' }),
-        ...apply({ applyUpdate: 'update' }),
+    ...dock({ dockQuery: 'query', dockfetch: 'fetch', dockupdate: 'update' }),
+    ...apply({ applyUpdate: 'update' }),
     async searchInfo() {
       let res = await this.dockfetch(this.user.uid);
       if (this.$checkRes(res)) {
@@ -115,17 +120,17 @@ export default {
         this.$set(this, `dock_id`, res.data.id);
       }
     },
-     // 同意参展
+    // 同意参展
     async handlecheck(data) {
       data.status = '1';
       data.dock_id = this.dock_id;
       data.id = data._id;
       let res = await this.applyUpdate(data);
-           this.$notify({
-            message: '审核通过',
-            type: 'success',
-          });
-          this.searchInfo();
+      this.$notify({
+        message: '审核通过',
+        type: 'success',
+      });
+      this.searchInfo();
     },
     // 拒绝参展
     async handleclose(data) {
@@ -133,10 +138,10 @@ export default {
       data.dock_id = this.dock_id;
       data.id = data._id;
       let res = await this.applyUpdate(data);
-        this.$notify({
-            message: '审核拒绝',
-            type: 'success',
-          });
+      this.$notify({
+        message: '审核拒绝',
+        type: 'success',
+      });
     },
   },
   computed: { ...mapState(['user']) },