guhongwei 5 سال پیش
والد
کامیت
800a960617
1فایلهای تغییر یافته به همراه17 افزوده شده و 10 حذف شده
  1. 17 10
      src/views/dynamic/dealDetail.vue

+ 17 - 10
src/views/dynamic/dealDetail.vue

@@ -63,6 +63,7 @@
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: transaction } = createNamespacedHelpers('transaction');
 const { mapActions: product } = createNamespacedHelpers('enterpriseproject');
+const { mapActions: expertsuser } = createNamespacedHelpers('expertsuser');
 export default {
   name: 'dealDetail',
   props: {},
@@ -83,6 +84,7 @@ export default {
   methods: {
     ...transaction(['fetch']),
     ...product({ list: 'newquery', newfetch: 'newfetch' }),
+    ...expertsuser({ expertsuserFetch: 'fetch' }),
     async search() {
       let res = await this.fetch(this.id);
       res.data.status = parseInt(res.data.status);
@@ -90,16 +92,21 @@ export default {
       this.$set(this, `dealDetails`, res.data);
     },
     async onclick() {
-      let product_id = this.dealDetails.product_id;
-      const res = await this.newfetch(product_id);
-      console.log(res.errcode);
-      // if (res.data.totaltype == '0') {
-      //   this.$router.push({ path: '/market/marketlists', query: { totaltype: 0, id: this.dealDetails.product_id, column_name: '技术供求', display: 2 } });
-      // } else if (res.data.totaltype == '1') {
-      //   this.$router.push({ path: '/market/marketlists', query: { totaltype: 1, id: this.dealDetails.product_id, column_name: '科技产品', display: 2 } });
-      // } else if (res.data.totaltype == '2') {
-      //   this.$router.push({ path: '/market/marketlists', query: { totaltype: 2, id: this.dealDetails.product_id, display: 2, column_name: '科技产品' } });
-      // }
+      if (this.dealDetails.type == '0') {
+        let product_id = this.dealDetails.product_id;
+        const res = await this.newfetch(product_id);
+        if (res.data.totaltype == '0') {
+          this.$router.push({ path: '/market/marketlists', query: { totaltype: 0, id: product_id, column_name: '技术供求', display: 2 } });
+        } else if (res.data.totaltype == '1') {
+          this.$router.push({ path: '/market/marketlists', query: { totaltype: 1, id: product_id, column_name: '科技产品', display: 2 } });
+        } else if (res.data.totaltype == '2') {
+          this.$router.push({ path: '/market/marketlists', query: { totaltype: 2, id: product_id, column_name: '科技产品', display: 2 } });
+        }
+      } else {
+        let export_id = this.dealDetails.product_id;
+        const res = await this.expertsuserFetch(export_id);
+        this.$router.push({ path: '/market/marketlists', query: { id: export_id, column_name: '专家供求', display: 3 } });
+      }
     },
   },
   filters: {