guhongwei 4 năm trước cách đây
mục cha
commit
048022fae3

+ 6 - 0
src/router/index.js

@@ -130,6 +130,12 @@ const routes = [
     meta: { title: '审核管理', isleftarrow: true },
     component: () => import('../views/adminCenter/enterpriseProduct/index.vue'),
   },
+  {
+    path: '/adminCenter/enterpriseProduct/detail',
+    name: 'adminCenter_enterpriseProduct',
+    meta: { title: '产品信息管理', isleftarrow: true },
+    component: () => import('../views/adminCenter/enterpriseProduct/detail.vue'),
+  },
   // 登录
   {
     path: '/login',

+ 14 - 0
src/store/market/product.js

@@ -5,6 +5,7 @@ Vue.use(Vuex);
 const api = {
   newsInfo: `/api/market/product`,
   indexqueryinfo: `/api/market/product/indexquery`,
+  exportexcelInfo: `/api/market/product/exportexcel`,
 };
 const state = () => ({});
 const mutations = {};
@@ -28,6 +29,15 @@ const actions = {
     });
     return res;
   },
+  // 管理员查询注册用户所发布的产品
+  async comquery({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.newsInfo}/allquery`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
   async newquery({ commit }, { skip = 0, limit, ...info } = {}) {
     const res = await this.$axios.$get(`${api.newsInfo}/newquery`, {
       skip,
@@ -44,6 +54,10 @@ const actions = {
     });
     return res;
   },
+  async exportexcel({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.exportexcelInfo}`, payload);
+    return res;
+  },
   async create({ commit }, payload) {
     const res = await this.$axios.$post(`${api.newsInfo}`, payload);
     return res;

+ 205 - 0
src/views/adminCenter/enterpriseProduct/detail.vue

@@ -0,0 +1,205 @@
+<template>
+  <div id="index">
+    <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">
+          <span v-if="form.type == '0'">
+            <van-form>
+              <van-field v-model="form.name" name="名称" label="名称" placeholder="名称" readonly />
+              <van-field v-model="form.contacts" name="联系人" label="联系人" placeholder="联系人" readonly />
+              <van-field v-model="form.phone" name="联系电话" label="联系电话" placeholder="联系电话" readonly />
+              <van-field v-model="form.qqwx" name="QQ/微信" label="QQ/微信" placeholder="QQ/微信" readonly />
+              <van-field v-model="form.email" name="电子邮箱" label="电子邮箱" placeholder="电子邮箱" readonly />
+              <van-field v-model="form.field" name="所属领域" label="所属领域" placeholder="所属领域" readonly />
+              <van-field v-model="form.cooperation" name="合作方式" label="合作方式" placeholder="合作方式" readonly />
+              <van-field v-model="form.company" name="企业名称" label="企业名称" placeholder="企业名称" readonly />
+              <van-field v-model="form.companybrief" rows="1" autosize label="企业简介" type="textarea" placeholder="企业简介" readonly />
+              <van-field v-model="form.companyweb" name="企业网站" label="企业网站" placeholder="企业网站" readonly />
+              <van-field v-model="form.condition" name="合作条件及要求" label="合作条件及要求" placeholder="合作条件及要求" readonly />
+              <!-- <van-field v-model="form.image" name="产品图片" label="产品图片" placeholder="产品图片" readonly /> -->
+              <van-field v-model="form.budget" name="投资预算" label="投资预算" placeholder="投资预算" readonly />
+              <van-field v-model="form.companytype" name="投资预算" label="投资预算" placeholder="投资预算" readonly />
+              <van-field v-model="form.zzjgdm" 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.zjzyfrs" name="研发人数" label="研发人数" placeholder="研发人数" readonly />
+              <van-field v-model="form.degreeurgency" name="需求紧急程度" label="需求紧急程度" placeholder="需求紧急程度" readonly />
+              <van-field v-model="form.requirementdesc" rows="1" autosize label="技术难题" type="textarea" placeholder="技术难题" readonly />
+              <van-field v-model="form.expect" rows="1" autosize label="预期目标" type="textarea" placeholder="预期目标" readonly />
+              <van-field v-model="form.present" rows="1" autosize label="需求现状" type="textarea" placeholder="需求现状" readonly />
+              <van-field v-model="form.mainproduct" rows="1" autosize label="主要产品" type="textarea" placeholder="主要产品" readonly />
+              <van-field v-model="form.qualifications" rows="1" autosize label="资质/荣誉" type="textarea" placeholder="资质/荣誉" readonly />
+              <van-field name="radio" label="状态" v-if="form.status == '0'">
+                <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-if="form.type == '1'">
+            <van-form>
+              <van-field v-model="form.name" name="名称" label="名称" placeholder="名称" readonly />
+              <van-field v-model="form.contacts" name="联系人" label="联系人" placeholder="联系人" readonly />
+              <van-field v-model="form.phone" name="联系电话" label="联系电话" placeholder="联系电话" readonly />
+              <van-field v-model="form.qqwx" name="QQ/微信" label="QQ/微信" placeholder="QQ/微信" readonly />
+              <van-field v-model="form.email" name="电子邮箱" label="电子邮箱" placeholder="电子邮箱" readonly />
+              <van-field v-model="form.field" name="所属领域" label="所属领域" placeholder="所属领域" readonly />
+              <van-field v-model="form.cooperation" name="合作方式" label="合作方式" placeholder="合作方式" readonly />
+              <van-field v-model="form.company" name="企业名称" label="企业名称" placeholder="企业名称" readonly />
+              <van-field v-model="form.companybrief" rows="1" autosize label="企业简介" type="textarea" placeholder="企业简介" readonly />
+              <van-field v-model="form.companyweb" name="企业网站" label="企业网站" placeholder="企业网站" readonly />
+              <van-field v-model="form.condition" name="合作条件及要求" label="合作条件及要求" placeholder="合作条件及要求" readonly />
+              <van-field v-model="form.achievestatus" name="成果状态" label="成果状态" placeholder="成果状态" readonly />
+              <van-field v-model="form.achieveown" name="成果权属" label="成果权属" placeholder="成果权属" readonly />
+              <van-field v-model="form.degreeurgency" name="成果来源" label="成果来源" placeholder="成果来源" readonly />
+              <van-field v-model="form.roadshow" name="项目路演" label="项目路演" placeholder="项目路演" readonly />
+              <van-field v-model="form.intentionprice" name="意向价格" label="意向价格" placeholder="意向价格" readonly />
+              <van-field v-model="form.achievebrief" rows="1" autosize label="成果简介" type="textarea" placeholder="成果简介" readonly />
+              <van-field v-model="form.maxRows" rows="1" autosize label="技术特点" type="textarea" placeholder="技术特点" readonly />
+              <van-field v-model="form.team" rows="1" autosize label="技术团队" type="textarea" placeholder="技术团队" readonly />
+              <van-field v-model="form.expectations" rows="1" autosize label="商业预期" type="textarea" placeholder="商业预期" readonly />
+              <van-field name="radio" label="状态" v-if="form.status == '0'">
+                <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-if="form.type == '2'">
+            <van-form>
+              <van-field v-model="form.name" name="名称" label="名称" placeholder="名称" readonly />
+              <van-field v-model="form.contacts" name="联系人" label="联系人" placeholder="联系人" readonly />
+              <van-field v-model="form.phone" name="联系电话" label="联系电话" placeholder="联系电话" readonly />
+              <van-field v-model="form.qqwx" name="QQ/微信" label="QQ/微信" placeholder="QQ/微信" readonly />
+              <van-field v-model="form.email" name="电子邮箱" label="电子邮箱" placeholder="电子邮箱" readonly />
+              <van-field v-model="form.messattribute" name="信息属性" label="信息属性" placeholder="信息属性" readonly />
+              <van-field v-model="form.demand" name="需求程度" label="需求程度" placeholder="需求程度" readonly />
+              <van-field v-model="form.informationdesc" rows="1" autosize label="信息描述" type="textarea" placeholder="信息描述" readonly />
+              <van-field v-model="form.coreelements" rows="1" autosize label="核心要素" type="textarea" placeholder="核心要素" readonly />
+              <van-field v-model="form.priceinfo" rows="1" autosize label="价格信息" type="textarea" placeholder="价格信息" readonly />
+              <van-field v-model="form.businessexpect" rows="1" autosize label="商业预期" type="textarea" placeholder="商业预期" readonly />
+              <van-field name="radio" label="状态" v-if="form.status == '0'">
+                <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-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import NavBar from '@/layout/common/topInfo.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: product } = createNamespacedHelpers('product');
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    NavBar,
+  },
+  data: function() {
+    return {
+      // 头部标题
+      title: '',
+      // meta为true
+      isleftarrow: '',
+      // 返回
+      navShow: true,
+      form: {},
+    };
+  },
+  async created() {
+    if (this.id) {
+      await this.search();
+    }
+  },
+  methods: {
+    ...product(['query', 'comquery', 'delete', 'fetch', 'update']),
+    async search() {
+      let res = await this.fetch(this.id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `form`, res.data);
+      }
+    },
+    // 提交
+    async onSubmit() {
+      let data = this.form;
+      const res = await this.update(data);
+      if (this.$checkRes(res)) {
+        this.$notify({
+          message: '审核成功',
+          type: 'success',
+        });
+        this.$router.push({ path: '/adminCenter/enterpriseProduct/index' });
+      }
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  mounted() {
+    this.title = this.$route.meta.title;
+    this.isleftarrow = this.$route.meta.isleftarrow;
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.style {
+  width: 100%;
+  min-height: 667px;
+  position: relative;
+  background-color: #f9fafc;
+}
+.top {
+  height: 46px;
+  overflow: hidden;
+}
+.main {
+  min-height: 570px;
+}
+</style>

+ 49 - 5
src/views/adminCenter/enterpriseProduct/index.vue

@@ -8,13 +8,13 @@
         <el-col :span="24" class="main">
           <van-tabs v-model="active">
             <van-tab title="待审核">
-              <list></list>
+              <list :list="oneList" status="0" @query="search" @check="check" @deleteBtn="deleteBtn"></list>
             </van-tab>
             <van-tab title="审核成功">
-              <list></list>
+              <list :list="twoList" status="1" @query="search" @check="check" @deleteBtn="deleteBtn"></list>
             </van-tab>
             <van-tab title="审核拒绝">
-              <list></list>
+              <list :list="threeList" status="2" @query="search" @check="check" @deleteBtn="deleteBtn"></list>
             </van-tab>
           </van-tabs>
         </el-col>
@@ -27,6 +27,7 @@
 import list from './parts/list.vue';
 import NavBar from '@/layout/common/topInfo.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: product } = createNamespacedHelpers('product');
 export default {
   name: 'index',
   props: {},
@@ -43,10 +44,53 @@ export default {
       // 返回
       navShow: true,
       active: '1',
+      // 待审核
+      oneList: [],
+      // 审核成功
+      twoList: [],
+      // 审核拒绝
+      threeList: [],
     };
   },
-  created() {},
-  methods: {},
+  async created() {
+    await this.search({ status: '0' });
+    await this.search({ status: '1' });
+    await this.search({ status: '2' });
+  },
+  methods: {
+    ...product(['query', 'comquery', 'delete', 'fetch', 'update']),
+    async search({ skip = 0, status, ...info } = {}) {
+      let code = this.user.code;
+      let pid = this.user.uid;
+      let res = await this.comquery({ status, code, pid, ...info });
+      if (res.errcode === 0) {
+        if (status == '0') {
+          this.$set(this, `oneList`, res.data);
+        } else if (status == '1') {
+          this.$set(this, `twoList`, res.data);
+        } else if (status == '2') {
+          this.$set(this, `threeList`, res.data);
+        }
+      }
+    },
+    // 审核/查看
+    check(data) {
+      this.$router.push({ path: '/adminCenter/enterpriseProduct/detail', query: { id: data.id } });
+    },
+    // 删除
+    async deleteBtn(data) {
+      const res = await this.delete(data.id);
+      if (this.$checkRes(res)) {
+        this.$notify({
+          message: '删除成功',
+          type: 'success',
+        });
+        this.search({ status: '0' });
+        this.search({ status: '1' });
+        this.search({ status: '2' });
+      }
+    },
+  },
   computed: {
     ...mapState(['user']),
   },

+ 55 - 4
src/views/adminCenter/enterpriseProduct/parts/list.vue

@@ -1,6 +1,20 @@
 <template>
   <div id="list">
-    <p>list</p>
+    <el-row>
+      <el-col :span="24" class="product">
+        <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
+          <p class="textOver">{{ item.name }}</p>
+          <p>
+            <span>产品类型:{{ item.type == '0' ? '技术' : item.type == '1' ? '产品' : '商务' }}</span>
+            <span>产品状态:{{ item.status == '0' ? '待审核' : item.status == '1' ? '审核通过' : '审核拒绝' }}</span>
+          </p>
+          <p>
+            <el-button type="primary" size="mini" @click="check(item)">{{ item.status == '0' ? '审核' : '查看' }}</el-button>
+            <el-button type="danger" size="mini" @click="deleteBtn(item)">删除</el-button>
+          </p>
+        </el-col>
+      </el-col>
+    </el-row>
   </div>
 </template>
 
@@ -8,13 +22,24 @@
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'list',
-  props: {},
+  props: {
+    list: { type: Array },
+  },
   components: {},
   data: function() {
     return {};
   },
   created() {},
-  methods: {},
+  methods: {
+    // 审核/查看
+    check(data) {
+      this.$emit('check', data);
+    },
+    // 删除
+    deleteBtn(data) {
+      this.$emit('deleteBtn', data);
+    },
+  },
   computed: {
     ...mapState(['user']),
     pageTitle() {
@@ -27,4 +52,30 @@ export default {
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.product {
+  padding: 0 10px;
+  .list {
+    padding: 10px 0;
+    border-bottom: 1px dashed #ccc;
+    p {
+      font-size: 16px;
+      color: #000;
+      padding: 0 0 10px 0;
+    }
+    p:nth-child(1) {
+      font-size: 18px;
+      font-weight: bold;
+    }
+    p:nth-child(2) {
+      span {
+        display: inline-block;
+        width: 50%;
+      }
+    }
+    p:nth-child(3) {
+      text-align: center;
+    }
+  }
+}
+</style>