guhongwei 5 年 前
コミット
c6d7f9359b

+ 3 - 3
src/views/dockCenter/applyInfo/index.vue

@@ -25,9 +25,9 @@
                   用户状态:<span>{{ item.status == '0' ? '待审核' : item.status == '1' ? '通过' : item.status == '2' ? '拒绝' : '未识别' }}</span>
                 </el-col>
                 <el-col :span="24" class="btn">
-                  <el-button type="success" size="mini" @click="handlecheck(item)">同意参展</el-button>
-                  <el-button type="danger" size="mini" @click="handleclose(item)">拒绝参展</el-button>
-                  <el-button type="primary" size="mini" v-if="item.status == '1'"  @click="$router.push({ path: '/dockCenter/applyInfo/productList', query: { id: item.id } })">
+                  <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
                   >
                 </el-col>

+ 49 - 49
src/views/dockCenter/applyInfo/productList.vue

@@ -50,8 +50,8 @@
               <span>{{ item.dockStatus == '0' ? '待审核' : item.dockStatus == '1' ? '通过' : item.dockStatus == '2' ? '拒绝' : '未识别' }}</span>
             </el-col>
             <el-col :span="24" class="btn">
-              <el-button type="success" size="mini">同意参展</el-button>
-              <el-button type="danger" size="mini">拒绝参展</el-button>
+              <el-button type="success" size="mini" @click="checkProduct(item)">同意参展</el-button>
+              <el-button type="danger" size="mini" @click="closeProduct(item)">拒绝参展</el-button>
             </el-col>
           </el-col>
         </el-col>
@@ -63,6 +63,7 @@
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
 import NavBar from '@/layout/common/topInfo.vue';
+const { mapActions: dock } = createNamespacedHelpers('dock');
 export default {
   name: 'productList',
   props: {},
@@ -75,55 +76,54 @@ export default {
       isleftarrow: '',
       // 返回
       navShow: true,
-      list: [
-        {
-          name: '测试测hi策划书',
-          totaltype: '1',
-          field: '1',
-          coopermode: '1',
-          dockStatus: '0',
-        },
-        {
-          name: '测试测hi策划书',
-          totaltype: '1',
-          field: '1',
-          coopermode: '1',
-          dockStatus: '0',
-        },
-        {
-          name: '测试测hi策划书',
-          totaltype: '1',
-          field: '1',
-          coopermode: '1',
-          dockStatus: '0',
-        },
-        {
-          name: '测试测hi策划书',
-          totaltype: '1',
-          field: '1',
-          coopermode: '1',
-          dockStatus: '0',
-        },
-        {
-          name: '测试测hi策划书',
-          totaltype: '1',
-          field: '1',
-          coopermode: '1',
-          dockStatus: '0',
-        },
-        {
-          name: '测试测hi策划书测试测hi策划书测试测hi策划书测试测hi策划书测试测hi策划书测试测hi策划书测试测hi策划书',
-          totaltype: '1',
-          field: '1',
-          coopermode: '1',
-          dockStatus: '0',
-        },
-      ],
+      list: [],
     };
   },
-  created() {},
-  methods: {},
-  computed: { ...mapState(['user']) },
+  created() {
+    this.searchInfo();
+  },
+  methods: {
+    ...dock({ dockQuery: 'query', dockfetch: 'fetch',dockupdate:'update',updateGood:'updateGood' }),
+    async searchInfo() {
+      let res = await this.dockfetch(this.user.uid);
+      if (this.$checkRes(res)) {
+      var arr = res.data.apply.filter(item => item.user_id ===this.id);
+      this.$set(this, `list`, arr[0].goodsList);
+      }
+    },
+     // 产品审核
+    // 产品审核同意参展
+    async checkProduct(data) {
+      data.dockStatus = '1';
+      data.id = this.dockid;
+      let res = await this.updateGood(data);
+       this.$notify({
+          message: '审核成功',
+          type: 'success',
+        });
+     this.$router.push({ path: '/dockCenter/applyInfo/index' });
+    },
+    // 产品审核拒绝参展
+    async closeProduct(data) {
+      data.dockStatus = '2';
+      data.id = this.dockid;
+      let res = await this.updateGood(data);
+      this.$notify({
+          message: '审核成功',
+          type: 'success',
+        });
+     this.$router.push({ path: '/dockCenter/applyInfo/index' });
+    },
+  },
+  computed: {
+     ...mapState(['user']),
+     dockid(){
+       return this.$route.query.dockid;
+     },
+     id(){
+       return this.$route.query.id;
+     },
+      },
   mounted() {
     this.title = this.$route.meta.title;
     this.isleftarrow = this.$route.meta.isleftarrow;