wuhongyu 5 年之前
父节点
当前提交
9d683e357b

+ 4 - 1
src/components/supermaket/supermarketlistDetail.vue

@@ -59,7 +59,10 @@ export default {
   },
   data: () => ({}),
   created() {},
-  computed: {},
+  computed: {
+
+    
+  },
   methods: {
     clickList({ id }) {
       console.log(id);

+ 39 - 27
src/layout/supermarket/rightcont.vue

@@ -20,41 +20,37 @@
       <el-tabs type="border-card" @tab-click="handleClick(activeName)" v-model="activeName">
         <el-tab-pane name="1">
           <span slot="label">技术供求</span>
-          <el-col :span="12" class="jishuList" v-for="(item, index) in jishuList" :key="index">
-            <el-link :underline="false">
-              <el-col :span="24" class="title">
-                <span class="textOver">{{ item.name }}</span>
-              </el-col>
-              <el-col :span="15" class="type">
-                <span>技术类型:{{ item.product_type_name }}</span>
-              </el-col>
-              <el-col :span="9" class="date"
-                >日期:{{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}</el-col
-              >
-              <el-col :span="24" class="yen">价格:¥{{ item.price }}/{{ item.priceunit }}</el-col>
-            </el-link>
+          <el-col :span="12" class="jishuList" v-for="(item, index) in jishuList" :key="index" @click.native="detailjishu(item)">
+            <!-- <el-link :underline="false" > -->
+            <el-col :span="24" class="title">
+              <span class="textOver">{{ item.name }}</span>
+            </el-col>
+            <el-col :span="15" class="type">
+              <span>技术类型:{{ item.product_type_name }}</span>
+            </el-col>
+            <el-col :span="9" class="date">日期:{{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}</el-col>
+            <el-col :span="24" class="yen">价格:¥{{ item.price }}/{{ item.priceunit }}</el-col>
+            <!-- </el-link> -->
           </el-col>
         </el-tab-pane>
         <el-tab-pane name="2">
           <span slot="label">产品供求</span>
-          <el-col :span="6" class="chanpinList" v-for="(item, index) in chanpinList" :key="index">
-            <el-link :underline="false">
-              <el-col :span="24" class="images" v-for="(acc, index) in item.image" :key="index">
-                <el-image style="width:220px;height:160px;" :src="acc.url"></el-image>
-              </el-col>
-              <el-col :span="24" class="title">
-                <span class="textOver">{{ item.name }}</span>
-              </el-col>
-              <el-col :span="14" class="yen"> ¥{{ item.price }}/{{ item.priceunit }}</el-col>
-              <el-col :span="10" class="type">
-                {{ item.product_type_name }}
-              </el-col>
-            </el-link>
+          <el-col :span="6" class="chanpinList" v-for="(item, index) in chanpinList" :key="index" @click.native="detail(item)">
+            <el-col :span="24" class="images" v-for="(acc, index) in item.image" :key="index">
+              <el-image style="width:220px;height:160px;" :src="acc.url"></el-image>
+            </el-col>
+            <el-col :span="24" class="title">
+              <span class="textOver">{{ item.name }}</span>
+            </el-col>
+            <el-col :span="14" class="yen"> ¥{{ item.price }}/{{ item.priceunit }}</el-col>
+            <el-col :span="10" class="type">
+              {{ item.product_type_name }}
+            </el-col>
           </el-col>
         </el-tab-pane>
         <el-tab-pane name="3">
           <span slot="label">服务供求</span>
-          <el-col :span="24" class="serviceList" v-for="(item, index) in serviceList" :key="index">
+          <el-col :span="24" class="serviceList" v-for="(item, index) in serviceList" :key="index" @click.native="clickdetail(item)">
             <el-col :span="10" class="title">
               <span class="textOver">{{ item.name }}</span>
             </el-col>
@@ -116,6 +112,22 @@ export default {
         this.$router.push({ path: '/supermaket/supermarketlist', query: { totaltype: '2' } });
       }
     },
+    detailjishu(id) {
+      console.log('ads');
+      console.log(id.id);
+      let newid = id.id;
+      window.location.href = 'http://139.210.167.203/free-technological-management/supermaket/supermarketdetail?totaltype=0&&?&id=' + newid + '';
+    },
+    detail(id) {
+      console.log(id.id);
+      let newid = id.id;
+      window.location.href = ' http://139.210.167.203/free-technological-management/supermaket/supermarketdetail?totaltype=1&&?&id=' + newid + '';
+    },
+    clickdetail(id) {
+      console.log(id.id);
+      let newid = id.id;
+      window.location.href = 'http://139.210.167.203/free-technological-management/supermaket/supermarketdetail?totaltype=2&&?&id=' + newid + '';
+    },
   },
 };
 </script>

+ 7 - 0
src/router/index.js

@@ -166,6 +166,13 @@ const routes = [
     name: 'supermarketGroup',
     component: () => import('../views/supermaket/supermarketGroup.vue'),
   },
+  //xiangping
+  {
+    path: '/supermaket/supermarketdetail',
+    name: 'supermarketdetail',
+    component: () => import('../views/supermaket/supermarketdetail.vue'),
+  },
+
   // 科技超市-研发服务
   {
     path: '/supermaket/supermaketService',

+ 108 - 0
src/views/supermaket/supermarketdetail.vue

@@ -0,0 +1,108 @@
+<template>
+  <div id="policy">
+    <supermarketlist-detail
+      :info="info"
+      @handleCurrentChange="handleCurrentChange"
+      :contentList="contentList"
+      :total="total"
+      :columnName="columnName"
+      @fetch="fetchInfo"
+      :display="display"
+      :policyInfo="policyInfo"
+      @onSubmit="onSubmit"
+    ></supermarketlist-detail>
+  </div>
+</template>
+
+<script>
+import supermarketlistDetail from '@/components/supermaket/supermarketlistDetail.vue';
+import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
+import _ from 'loadsh';
+const { mapActions: mapSite } = createNamespacedHelpers('site');
+const { mapActions: mapEnterpriseproject } = createNamespacedHelpers('enterpriseproject');
+const { mapActions: transaction } = createNamespacedHelpers('transaction');
+const { mapActions: tranaudit } = createNamespacedHelpers('tranaudit');
+
+export default {
+  name: 'policy',
+  props: {},
+  components: {
+    supermarketlistDetail,
+  },
+  data: () => ({
+    info: {},
+    policyInfo: {},
+    display: 'detail',
+    columnName: '',
+    contentList: [],
+    total: 1,
+    skip: '',
+  }),
+  async created() {
+    this.searchSite();
+
+    this.searchinfos();
+  },
+  computed: {
+    id() {
+      return this.$route.query.id;
+    },
+    ...mapState(['user']),
+    totaltype() {
+      return this.$route.query.totaltype;
+    },
+  },
+  methods: {
+    ...mapSite(['showInfo']),
+    ...mapEnterpriseproject({ list: 'query', fetch: 'fetch' }),
+    ...transaction({ transactioncreate: 'create', transactionfetch: 'fetch' }),
+    ...transaction({ transactioncreate: 'create', transactionfetch: 'fetch' }),
+    ...tranaudit({ tranauditcreate: 'create' }),
+    // 查询站点信息
+    async searchSite() {
+      let res = await this.showInfo();
+      let object = JSON.parse(JSON.stringify(res.data));
+      if (object) {
+        this.$set(this, `info`, res.data);
+      } else {
+        this.$message.error(res.errmsg ? res.errmsg : 'error');
+      }
+    },
+    fetchInfo() {},
+    async searchinfos() {
+      console.log(this.id);
+
+      this.display = 'detail';
+      const res = await this.fetch(this.id);
+      this.$set(this, `policyInfo`, res.data);
+    },
+    async handleCurrentChange({ skip, limit, currentPage }) {
+      this.$set(this, `skip`, skip);
+      this.search();
+    },
+    async onSubmit() {
+      console.log(this.user.id);
+      let form = {};
+      form.userid = this.user.id;
+      form.username = '测试neme';
+      form.product_id = this.policyInfo.id;
+      form.product_name = this.policyInfo.name;
+      form.market_userid = this.policyInfo.userid;
+      form.market_username = this.policyInfo.contact_user;
+      form.status = '0';
+      console.log(form);
+      let res = await this.transactioncreate(form);
+      this.$checkRes(res, '发起交易成功', '交易失败');
+      let shenhe = {};
+      shenhe.result = '0';
+      shenhe.transaction_id = res.data.id;
+      shenhe.userid = this.policyInfo.userid;
+      shenhe.product_id = this.policyInfo.userid;
+      console.log(shenhe);
+      let ress = await this.tranauditcreate(shenhe);
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 1 - 0
src/views/supermaket/supermarketlist.vue

@@ -41,6 +41,7 @@ export default {
   async created() {
     this.searchSite();
     this.search();
+    this.searchinfos();
   },
   computed: {
     ...mapState(['user']),