guhongwei 4 anos atrás
pai
commit
c296608c68

+ 4 - 0
src/store/market/transaction.js

@@ -13,6 +13,10 @@ const actions = {
     const res = await this.$axios.$get(`${api.transactionInfo}`, { skip, limit, ...info });
     return res;
   },
+  async productquery({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.transactionInfo}/findTransactionList`, payload);
+    return res;
+  },
   async create({ commit }, payload) {
     const res = await this.$axios.$post(`${api.transactionInfo}`, payload);
     return res;

+ 44 - 73
src/views/dynamic/dealDetail.vue

@@ -7,51 +7,29 @@
             <el-image :src="topUrl"></el-image>
           </el-col>
           <el-col :span="24" class="two">
-            <el-col :span="24" class="top">
-              <span></span>
-            </el-col>
             <el-col :span="24" class="info">
               <el-col :span="1" class="infoTop">
                 <p>项目详情</p>
                 <p><span></span></p>
               </el-col>
               <el-col :span="22" class="infoMess">
-                <el-col :span="6" class="infoMessStep">
-                  <el-steps direction="vertical" :active="dealDetails.status">
-                    <el-step title="正在洽谈"></el-step>
-                    <el-step title="达成意向"></el-step>
-                    <el-step title="交易成功"></el-step>
-                  </el-steps>
-                </el-col>
-                <el-col :span="18" class="infoMessInfo">
-                  <!-- <el-image :src="infoUrl"></el-image> -->
-                  <el-col :span="24" class="message">
-                    <el-col :span="12" class="content">
-                      <p>项目名称</p>
-                      <p>服务名称:{{ dealDetails.product_name }}</p>
-                      <p>发布时间:{{ dealDetails.meta | getDate }}</p>
-                      <p>服务说明:{{ dealDetails.description }}</p>
-                    </el-col>
-                    <el-col :span="12" class="image">
-                      <el-col :span="24" class="user"> 购买人:{{ dealDetails.username }} </el-col>
-                      <el-col :span="24" class="images" v-if="dealDetails.pic">
-                        <el-image style="width:100%;height:380px;" :src="dealDetails.pic"></el-image>
-                      </el-col>
-                    </el-col>
-                    <el-col :span="24" class="btn">
-                      <el-button @click.native="onclick()">我要对接</el-button>
-                    </el-col>
-                  </el-col>
-                </el-col>
+                <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
+                  <el-tab-pane label="正在洽谈" name="first">
+                    <zzqt :zzqtList="zzqtList" :total="zzqtTotal"></zzqt>
+                  </el-tab-pane>
+                  <el-tab-pane label="达成意向" name="second">
+                    <dcyx :dcyxList="dcyxList" :total="dxyxTotal"></dcyx>
+                  </el-tab-pane>
+                  <el-tab-pane label="交易完成" name="third">
+                    <jywc :jywcList="jywcList" :total="jywcTotal"></jywc>
+                  </el-tab-pane>
+                </el-tabs>
               </el-col>
               <el-col :span="1" class="infoDown">
                 <p><span></span></p>
                 <p>项目详情</p>
               </el-col>
             </el-col>
-            <el-col :span="24" class="top down">
-              <span></span>
-            </el-col>
           </el-col>
         </el-col>
       </div>
@@ -60,63 +38,56 @@
 </template>
 
 <script>
+import zzqt from './parts/zzqt.vue';
+import dcyx from './parts/dcyx.vue';
+import jywc from './parts/jywc.vue';
 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: {},
-  components: {},
+  components: {
+    zzqt,
+    dcyx,
+    jywc,
+  },
   data: () => ({
     topUrl: require('@/assets/dynamic6.png'),
     infoUrl: require('@/assets/dynamic7.png'),
-    dealDetails: {},
+    activeName: 'first',
+    zzqtList: [],
+    zzqtTotal: 0,
+    dcyxList: [],
+    dxyxTotal: 0,
+    jywcList: [],
+    jywcTotal: 0,
   }),
   created() {
     this.search();
   },
-  computed: {
-    id() {
-      return this.$route.query.id;
-    },
-  },
   methods: {
-    ...transaction(['fetch']),
-    ...product({ list: 'newquery', newfetch: 'newfetch' }),
-    ...expertsuser({ expertsuserFetch: 'fetch' }),
+    ...transaction(['productquery']),
     async search() {
-      let res = await this.fetch(this.id);
-      res.data.status = parseInt(res.data.status);
-      res.data.status = res.data.status + 1;
-      this.$set(this, `dealDetails`, res.data);
-    },
-    async onclick() {
-      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 } });
+      let res = await this.productquery({ product_id: this.id });
+      if (this.$checkRes(res)) {
+        var zzqt = res.data.filter(item => item.status === '0');
+        var dcyx = res.data.filter(item => item.status === '1');
+        var jywc = res.data.filter(item => item.status === '2');
+        this.$set(this, `zzqtList`, zzqt);
+        this.$set(this, `zzqtTotal`, zzqt.length);
+        this.$set(this, `dcyxList`, dcyx);
+        this.$set(this, `dxyxTotal`, dcyx.length);
+        this.$set(this, `jywcList`, jywc);
+        this.$set(this, `jywcTotal`, jywc.length);
       }
     },
+    handleClick(tab, event) {
+      console.log(tab, event);
+    },
   },
-  filters: {
-    getDate(meta) {
-      let createdAt = _.get(meta, `createdAt`);
-      let date = new Date(createdAt)
-        .toLocaleDateString()
-        .replace('/', '-')
-        .replace('/', '-');
-      return date;
+  computed: {
+    id() {
+      return this.$route.query.id;
     },
   },
 };

+ 79 - 0
src/views/dynamic/parts/dcyx.vue

@@ -0,0 +1,79 @@
+<template>
+  <div id="dcyx">
+    <el-row>
+      <el-col :span="24">
+        <el-table :data="list" border style="width: 100%">
+          <el-table-column prop="product_name" label="产品名称" align="center"> </el-table-column>
+          <el-table-column prop="username" label="营销人" align="center"> </el-table-column>
+          <el-table-column prop="market_username" label="购买人" align="center"> </el-table-column>
+        </el-table>
+        <el-col :span="24" class="page">
+          <el-pagination
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            layout="total, prev, pager, next, jumper"
+            :total="total"
+            :page-size="pageSize"
+          >
+          </el-pagination>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import _ from 'lodash';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'dcyx',
+  props: {
+    dcyxList: null,
+    total: null,
+  },
+  components: {},
+  data: function() {
+    return {
+      currentPage: 1,
+      pageSize: 10,
+      origin: [],
+      list: [],
+    };
+  },
+  created() {},
+  methods: {
+    search(page = 1) {
+      this.$set(this, `list`, this.origin[page - 1]);
+    },
+    handleCurrentChange(currentPage) {
+      this.search(currentPage);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    dcyxList: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
+        this.search();
+      },
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.page {
+  text-align: center;
+  padding: 10px 0;
+}
+</style>

+ 46 - 15
src/views/dynamic/parts/down-pie.vue

@@ -7,13 +7,37 @@
         </el-col>
         <el-col :span="13" class="rightData">
           <el-table :data="tableData" border style="width: 100%">
-            <el-table-column prop="product_name" label="服务名称" align="center"> </el-table-column>
-            <el-table-column prop="market_username" label="营销机构" align="center"> </el-table-column>
+            <el-table-column prop="name" label="产品名称" align="center"> </el-table-column>
+            <el-table-column prop="product_type_name" label="类型" align="center"> </el-table-column>
+            <el-table-column label="产品类型" align="center">
+              <template slot-scope="scoped">
+                {{ scoped.row.totaltype === '0' ? '技术' : scoped.row.totaltype === '1' ? '产品' : scoped.row.totaltype === '2' ? '服务' : '暂无' }}
+              </template>
+            </el-table-column>
+            <el-table-column label="所属领域" align="center">
+              <template slot-scope="scoped">
+                {{
+                  scoped.row.field == '0'
+                    ? '先进制造'
+                    : scoped.row.field == '1'
+                    ? '新材料'
+                    : scoped.row.field == '2'
+                    ? '光电子'
+                    : scoped.row.field == '3'
+                    ? '信息技术'
+                    : scoped.row.field == '4'
+                    ? '文化和科技融合'
+                    : '暂无'
+                }}
+              </template>
+            </el-table-column>
             <el-table-column label="操作" width="100" align="center" fixed="right">
               <template slot-scope="scoped">
-                <el-button @click="$router.push({ path: '/dynamic/dealDetail', query: { id: scoped.row.id } })" type="text" size="small">
-                  <i class="el-icon-view"></i>
-                </el-button>
+                <el-tooltip class="item" effect="dark" content="交易情况" placement="bottom">
+                  <el-button type="text" size="mini" @click="$router.push({ path: '/dynamic/dealDetail', query: { id: scoped.row.id } })"
+                    ><i class="el-icon-view"></i
+                  ></el-button>
+                </el-tooltip>
               </template>
             </el-table-column>
           </el-table>
@@ -27,6 +51,7 @@
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions } = createNamespacedHelpers('transaction');
 const { mapActions: personalRoom } = createNamespacedHelpers('personalroom');
+const { mapActions: enterpriseproject } = createNamespacedHelpers('enterpriseproject');
 import echarts from 'echarts/lib/echarts';
 import 'echarts/lib/chart/pie';
 import 'echarts/lib/chart/pie';
@@ -49,17 +74,18 @@ export default {
   },
   created() {
     this.init();
+    this.searchInfo();
   },
   methods: {
     ...mapActions(['query']),
     ...personalRoom(['countRoom']),
+    ...enterpriseproject(['newquery']),
     async init() {
       let res = await this.query();
       let rooms = await this.countRoom();
       if (this.$checkRes(res)) {
         let arr = res.data.filter(f => f.status != '3');
         let newArr = _.chunk(arr, 6);
-        this.$set(this, `tableData`, newArr[0]);
         let s3 = res.data.filter(f => f.status == '0'); //正在洽谈
         let s1 = res.data.filter(f => f.status == '1'); //达成意向
         let s2 = res.data.filter(f => f.status == '2'); //对接完成
@@ -102,17 +128,22 @@ export default {
           },
         };
         this.myChart.setOption(option);
-        this.myChart.on('click', params => {
-          if (params.dataIndex === 0) {
-            this.$set(this, `tableData`, s3);
-          } else if (params.dataIndex === 1) {
-            this.$set(this, `tableData`, s1);
-          } else {
-            this.$set(this, `tableData`, s2);
-          }
-        });
+        // this.myChart.on('click', params => {
+        //   if (params.dataIndex === 0) {
+        //     this.$set(this, `tableData`, s3);
+        //   } else if (params.dataIndex === 1) {
+        //     this.$set(this, `tableData`, s1);
+        //   } else {
+        //     this.$set(this, `tableData`, s2);
+        //   }
+        // });
       }
     },
+    async searchInfo() {
+      let res = await this.newquery({ status: 1 });
+      console.log(res);
+      this.$set(this, `tableData`, res.data);
+    },
   },
   computed: {
     ...mapState(['user']),

+ 79 - 0
src/views/dynamic/parts/jywc.vue

@@ -0,0 +1,79 @@
+<template>
+  <div id="jywc">
+    <el-row>
+      <el-col :span="24">
+        <el-table :data="list" border style="width: 100%">
+          <el-table-column prop="product_name" label="产品名称" align="center"> </el-table-column>
+          <el-table-column prop="username" label="营销人" align="center"> </el-table-column>
+          <el-table-column prop="market_username" label="购买人" align="center"> </el-table-column>
+        </el-table>
+        <el-col :span="24" class="page">
+          <el-pagination
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            layout="total, prev, pager, next, jumper"
+            :total="total"
+            :page-size="pageSize"
+          >
+          </el-pagination>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import _ from 'lodash';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'jywc',
+  props: {
+    jywcList: null,
+    total: null,
+  },
+  components: {},
+  data: function() {
+    return {
+      currentPage: 1,
+      pageSize: 10,
+      origin: [],
+      list: [],
+    };
+  },
+  created() {},
+  methods: {
+    search(page = 1) {
+      this.$set(this, `list`, this.origin[page - 1]);
+    },
+    handleCurrentChange(currentPage) {
+      this.search(currentPage);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    jywcList: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
+        this.search();
+      },
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.page {
+  text-align: center;
+  padding: 10px 0;
+}
+</style>

+ 1 - 1
src/views/dynamic/parts/userTwo.vue

@@ -96,7 +96,7 @@ export default {
       // 专家
       let exportNum = await this.expertsuserQurty();
       // 发布需求
-      let productNum = await this.marketproductQuery();
+      let productNum = await this.marketproductQuery({ status: 1 });
       let listData = { num1: s2.length, num2: s1.length, num3: exportNum.data.length, num4: productNum.data.length };
       this.$set(this, `detail`, listData);
       //交易

+ 79 - 0
src/views/dynamic/parts/zzqt.vue

@@ -0,0 +1,79 @@
+<template>
+  <div id="zzqt">
+    <el-row>
+      <el-col :span="24">
+        <el-table :data="list" border style="width: 100%">
+          <el-table-column prop="product_name" label="产品名称" align="center"> </el-table-column>
+          <el-table-column prop="username" label="营销人" align="center"> </el-table-column>
+          <el-table-column prop="market_username" label="购买人" align="center"> </el-table-column>
+        </el-table>
+        <el-col :span="24" class="page">
+          <el-pagination
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            layout="total, prev, pager, next, jumper"
+            :total="total"
+            :page-size="pageSize"
+          >
+          </el-pagination>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import _ from 'lodash';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'zzqt',
+  props: {
+    zzqtList: null,
+    total: null,
+  },
+  components: {},
+  data: function() {
+    return {
+      currentPage: 1,
+      pageSize: 10,
+      origin: [],
+      list: [],
+    };
+  },
+  created() {},
+  methods: {
+    search(page = 1) {
+      this.$set(this, `list`, this.origin[page - 1]);
+    },
+    handleCurrentChange(currentPage) {
+      this.search(currentPage);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    zzqtList: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
+        this.search();
+      },
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.page {
+  text-align: center;
+  padding: 10px 0;
+}
+</style>