guhongwei 5 years ago
parent
commit
845af3eeab

+ 1 - 0
src/layout/enterpriseProduct/detailForm.vue

@@ -213,6 +213,7 @@ export default {
     // 草稿
     draftBtn() {
       this.$emit('draftBtn', { data: this.form });
+      console.log(this.form);
     },
     // 信息发布
     submitBtn(formName) {

+ 1 - 7
src/layout/enterpriseProduct/enterpriseProduct.vue

@@ -53,13 +53,7 @@
               <el-table-column prop="state" label="状态" align="center">
                 <template v-slot="scoped">
                   {{
-                    `${scoped.row.status}` === `0`
-                      ? '审核中'
-                      : `${scoped.row.status}` === `1`
-                      ? '审核通过'
-                      : `${scoped.row.status}` === `2`
-                      ? '审核拒绝'
-                      : '草稿'
+                    `${scoped.row.status}` == `0` ? '审核中' : `${scoped.row.status}` == `1` ? '审核通过' : `${scoped.row.status}` == `2` ? '审核拒绝' : '草稿'
                   }}
                 </template>
               </el-table-column>

+ 8 - 1
src/store/market.js

@@ -2,7 +2,9 @@ import Vue from 'vue';
 import Vuex from 'vuex';
 import _ from 'lodash';
 Vue.use(Vuex);
-const api = { newsInfo: `/api/market/product` };
+const api = {
+  newsInfo: `/api/market/product`,
+};
 const state = () => ({});
 const mutations = {};
 const actions = {
@@ -10,6 +12,11 @@ const actions = {
     const res = await this.$axios.$get(`${api.newsInfo}`, { skip, limit, ...info });
     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, limit, ...info });
     return res;

+ 9 - 9
src/views/enterpriseProduct/index.vue

@@ -46,7 +46,7 @@ export default {
     ...mapState(['user']),
   },
   methods: {
-    ...product(['query', 'delete', 'fetch', 'update']),
+    ...product(['query', 'comquery', 'delete', 'fetch', 'update']),
     async submit() {
       this.search(this.forms.status);
     },
@@ -54,16 +54,16 @@ export default {
       if (this.forms.status) {
         status = this.forms.status;
         skip = this.skip;
-        let userid = this.user.uid;
-        const res = await this.query({ skip, limit, status, userid, ...info });
-        this.$set(this, `recruitInfo`, res.data);
-        this.$set(this, `total`, res.total);
+        let code = this.user.code;
+        const arr = await this.comquery({ status, code, ...info });
+        this.$set(this, `recruitInfo`, arr.res);
+        this.$set(this, `total`, arr.res.length);
       } else {
         skip = this.skip;
-        let userid = this.user.uid;
-        const res = await this.query({ skip, limit, status: 3, userid, ...info });
-        this.$set(this, `recruitInfo`, res.data);
-        this.$set(this, `total`, res.total);
+        let code = this.user.code;
+        const arr = await this.comquery({ status: 3, code, ...info });
+        this.$set(this, `recruitInfo`, arr.res);
+        this.$set(this, `total`, arr.res.length);
       }
     },
     // 删除