guhongwei há 4 anos atrás
pai
commit
10bbec12dc

+ 4 - 4
src/views/market/index.vue

@@ -23,7 +23,7 @@
                     class="achieveList"
                     v-for="(item, index) in achieveList"
                     :key="index"
-                    @click.native="$router.push({ path: '/market/marketlists', query: { type: '1', column_name: '技术成果', id: item.id } })"
+                    @click.native="$router.push({ path: '/market/marketlists', query: { type: '1', column_name: '技术成果', id: item._id } })"
                   >
                     <el-col :span="24" class="achieveImage">
                       <el-image v-if="item.image && item.image.length > 0" :src="item.image[0].url"></el-image>
@@ -59,7 +59,7 @@
                   class="technologyList"
                   v-for="(item, index) in technologyList"
                   :key="index"
-                  @click.native="$router.push({ path: '/market/marketlists', query: { type: '0', column_name: '科技需求', id: item.id } })"
+                  @click.native="$router.push({ path: '/market/marketlists', query: { type: '0', column_name: '科技需求', id: item._id } })"
                 >
                   <el-col :span="20" class="name textOver">
                     {{ item.name }}
@@ -97,7 +97,7 @@
                   class="businessList"
                   v-for="(item, index) in businessList"
                   :key="index"
-                  @click.native="$router.push({ path: '/market/marketlists', query: { type: '2', column_name: '商务信息', id: item.id } })"
+                  @click.native="$router.push({ path: '/market/marketlists', query: { type: '2', column_name: '商务信息', id: item._id } })"
                 >
                   <el-col :span="10" class="name textOver">
                     {{ item.name }}
@@ -130,7 +130,7 @@
                   class="expertList"
                   v-for="(item, index) in expertList"
                   :key="index"
-                  @click.native="$router.push({ path: '/market/marketlists', query: { type: '3', column_name: '专家服务', id: item.id } })"
+                  @click.native="$router.push({ path: '/market/marketlists', query: { type: '3', column_name: '专家服务', id: item._id } })"
                 >
                   <el-col :span="8" class="expertimage">
                     <el-image v-if="item.expertimage != ''" :src="item.expertimage"></el-image>

+ 5 - 1
src/views/market/list/achieve.vue

@@ -8,7 +8,7 @@
           </el-col>
           <el-col :span="12" class="search">
             <el-input placeholder="请输入名称" v-model="infoName" class="input-with-select">
-              <el-button slot="append" icon="el-icon-search"></el-button>
+              <el-button slot="append" icon="el-icon-search" @click="searchData()"></el-button>
             </el-input>
           </el-col>
         </el-col>
@@ -67,6 +67,10 @@ export default {
     clickDetail(id) {
       this.$emit('clickDetail', { column_name: '技术成果', id: id });
     },
+    // 查询
+    searchData() {
+      this.$emit('searchData', { name: this.infoName, columnName: '技术成果' });
+    },
   },
   watch: {
     achieveList: {

+ 5 - 1
src/views/market/list/business.vue

@@ -8,7 +8,7 @@
           </el-col>
           <el-col :span="12" class="search">
             <el-input placeholder="请输入名称" v-model="infoName" class="input-with-select">
-              <el-button slot="append" icon="el-icon-search"></el-button>
+              <el-button slot="append" icon="el-icon-search" @click="searchData()"></el-button>
             </el-input>
           </el-col>
         </el-col>
@@ -67,6 +67,10 @@ export default {
     clickDetail(id) {
       this.$emit('clickDetail', { column_name: '商务信息', id: id });
     },
+    // 查询
+    searchData() {
+      this.$emit('searchData', { name: this.infoName, columnName: '商务信息' });
+    },
   },
   watch: {
     businessList: {

+ 5 - 1
src/views/market/list/expert.vue

@@ -8,7 +8,7 @@
           </el-col>
           <el-col :span="12" class="search">
             <el-input placeholder="请输入名称" v-model="infoName" class="input-with-select">
-              <el-button slot="append" icon="el-icon-search"></el-button>
+              <el-button slot="append" icon="el-icon-search" @click="searchData()"></el-button>
             </el-input>
           </el-col>
         </el-col>
@@ -70,6 +70,10 @@ export default {
     clickDetail(id) {
       this.$emit('clickDetail', { column_name: '专家服务', id: id });
     },
+    // 查询
+    searchData() {
+      this.$emit('searchData', { name: this.infoName, columnName: '专家服务' });
+    },
   },
   watch: {
     expertList: {

+ 5 - 1
src/views/market/list/technology.vue

@@ -8,7 +8,7 @@
           </el-col>
           <el-col :span="12" class="search">
             <el-input placeholder="请输入名称" v-model="infoName" class="input-with-select">
-              <el-button slot="append" icon="el-icon-search"></el-button>
+              <el-button slot="append" icon="el-icon-search" @click="searchData()"></el-button>
             </el-input>
           </el-col>
         </el-col>
@@ -67,6 +67,10 @@ export default {
     clickDetail(id) {
       this.$emit('clickDetail', { column_name: '科技需求', id: id });
     },
+    // 查询
+    searchData() {
+      this.$emit('searchData', { name: this.infoName, columnName: '科技需求' });
+    },
   },
   watch: {
     technologyList: {

+ 38 - 16
src/views/market/marketlists.vue

@@ -14,16 +14,34 @@
             <span v-if="display == 'list'">
               <el-col :span="24" class="listDown">
                 <span v-if="column_name == '科技需求'">
-                  <technology :technologyList="technologyList" :column_name="column_name" :total="technologyTotal" @clickDetail="clickDetail"></technology>
+                  <technology
+                    :technologyList="technologyList"
+                    :column_name="column_name"
+                    :total="technologyTotal"
+                    @clickDetail="clickDetail"
+                    @searchData="searchData"
+                  ></technology>
                 </span>
                 <span v-else-if="column_name == '技术成果'">
-                  <achieve :achieveList="achieveList" :column_name="column_name" :total="achieveTotal" @clickDetail="clickDetail"></achieve>
+                  <achieve
+                    :achieveList="achieveList"
+                    :column_name="column_name"
+                    :total="achieveTotal"
+                    @clickDetail="clickDetail"
+                    @searchData="searchData"
+                  ></achieve>
                 </span>
                 <span v-else-if="column_name == '商务信息'">
-                  <business :businessList="businessList" :column_name="column_name" :total="businessTotal" @clickDetail="clickDetail"></business>
+                  <business
+                    :businessList="businessList"
+                    :column_name="column_name"
+                    :total="businessTotal"
+                    @clickDetail="clickDetail"
+                    @searchData="searchData"
+                  ></business>
                 </span>
                 <span v-else-if="column_name == '专家服务'">
-                  <expert :expertList="expertList" :column_name="column_name" :total="expertTotal" @clickDetail="clickDetail"></expert>
+                  <expert :expertList="expertList" :column_name="column_name" :total="expertTotal" @clickDetail="clickDetail" @searchData="searchData"></expert>
                 </span>
               </el-col>
             </span>
@@ -162,29 +180,30 @@ export default {
       }
     },
     // 选择菜单
-    changeMenu(name, index) {
+    changeMenu(columnName, index) {
       this.display = 'list';
-      this.column_name = name;
+      this.column_name = columnName;
       this.menuIndex = index;
       this.menuColor = 'rgb(254, 149, 14)';
-      this.searchInfo({ name });
+      this.searchInfo({ columnName });
     },
     // 查看列表
-    async searchInfo({ skip = 0, limit = 10, name, ...info } = {}) {
-      if (name == '科技需求') {
-        let res = await this.productList({ skip, type: '0', status: '1', ...info });
+    async searchInfo({ skip = 0, limit = 10, columnName, name, ...info } = {}) {
+      console.log(columnName, name);
+      if (columnName == '科技需求') {
+        let res = await this.productList({ skip, type: '0', status: '1', name, ...info });
         if (this.$checkRes(res)) this.$set(this, `technologyList`, res.data);
         this.$set(this, `technologyTotal`, res.total);
-      } else if (name == '技术成果') {
-        let res = await this.productList({ skip, type: '1', status: '1', ...info });
+      } else if (columnName == '技术成果') {
+        let res = await this.productList({ skip, type: '1', status: '1', name, ...info });
         if (this.$checkRes(res)) this.$set(this, `achieveList`, res.data);
         this.$set(this, `achieveTotal`, res.total);
-      } else if (name == '商务信息') {
-        let res = await this.productList({ skip, type: '2', status: '1', ...info });
+      } else if (columnName == '商务信息') {
+        let res = await this.productList({ skip, type: '2', status: '1', name, ...info });
         if (this.$checkRes(res)) this.$set(this, `businessList`, res.data);
         this.$set(this, `businessTotal`, res.total);
-      } else if (name == '专家服务') {
-        let res = await this.expertsuserList({ skip, ...info });
+      } else if (columnName == '专家服务') {
+        let res = await this.expertsuserList({ skip, name, ...info });
         if (this.$checkRes(res)) this.$set(this, `expertList`, res.data);
         this.$set(this, `expertTotal`, res.total);
       }
@@ -259,6 +278,9 @@ export default {
         this.$checkRes(res, '购买申请成功', res.errmsg || '购买申请失败');
       }
     },
+    searchData({ name, columnName }) {
+      this.searchInfo({ columnName, name });
+    },
   },
   computed: {
     ...mapState(['user']),