guhongwei 3 years ago
parent
commit
36ccd9d3bd

+ 12 - 2
src/views/service/patent/market/index.vue

@@ -3,10 +3,10 @@
     <admin-frame @search="search" :limit="limit" :total="total" topType="2" @back="back" :rightArrow="false" :useNav="false">
       <template v-slot:info>
         <van-tabs v-model="active" @change="change">
-          <van-tab title="授权专利" name="1">
+          <van-tab :title="`授权专利【${oneTotal}】`" name="1">
             <list-1 :list="oneList" @detail="detail"></list-1>
           </van-tab>
-          <van-tab title="专利转让" name="2">
+          <van-tab :title="`专利转让【${twoTotal}】`" name="2">
             <list-2 :list="twoList" @detail="twoDetail"></list-2>
           </van-tab>
         </van-tabs>
@@ -39,10 +39,13 @@ export default {
       oneList: [],
       // 专利转让
       twoList: [],
+      oneTotal: 0,
+      twoTotal: 0,
     };
   },
   async created() {
     await this.search();
+    await this.searchTotal();
   },
   methods: {
     ...patent(['query']),
@@ -62,6 +65,13 @@ export default {
         }
       }
     },
+    // 查询总数
+    async searchTotal({ skip = 0, limit = this.limit, ...info } = {}) {
+      let res = await this.query({ skip, limit, ...info });
+      if (this.$checkRes(res)) this.$set(this, `oneTotal`, res.total);
+      res = await this.transQuery({ skip, limit, ...info });
+      if (this.$checkRes(res)) this.$set(this, `twoTotal`, res.total);
+    },
     // 专利详情
     detail(data) {
       this.$router.push({ path: '/service/patent/market/detail', query: { id: data._id } });

+ 26 - 2
src/views/service/patent/mech/patent/information/index.vue

@@ -3,10 +3,13 @@
     <admin-frame @search="search" :limit="limit" :total="total" topType="2" @back="back" :rightArrow="false" :useNav="false">
       <template v-slot:info>
         <van-tabs v-model="active" @change="change" color="#409eff">
-          <van-tab title="已授权" name="有效">
+          <van-tab :title="`已授权【${oneTotal}】`" name="有效">
             <list-1 :list="list" @detail="detail"></list-1>
           </van-tab>
-          <van-tab title="已受理" name="审中">
+          <van-tab :title="`已受理【${twoTotal}】`" name="审中">
+            <list-1 :list="list" @detail="detail"></list-1>
+          </van-tab>
+          <van-tab :title="`已失效专利【${thrTotal}】`" name="失效">
             <list-1 :list="list" @detail="detail"></list-1>
           </van-tab>
         </van-tabs>
@@ -33,10 +36,14 @@ export default {
       list: [],
       limit: 10,
       total: 0,
+      oneTotal: 0,
+      twoTotal: 0,
+      thrTotal: 0,
     };
   },
   async created() {
     await this.search({ term: '有效' });
+    await this.searchTotal();
   },
   methods: {
     ...patentinfo(['queryByOrg']),
@@ -57,8 +64,25 @@ export default {
           this.$set(this, `list`, res.data);
           this.$set(this, `total`, res.total);
         }
+      } else if (this.active == '失效') {
+        info.term = this.active;
+        info.code = this.user.code;
+        let res = await this.queryByOrg({ skip, limit, ...info });
+        if (this.$checkRes(res)) {
+          this.$set(this, `list`, res.data);
+          this.$set(this, `total`, res.total);
+        }
       }
     },
+    // 查询总数
+    async searchTotal({ skip = 0, limit = this.limit, ...info } = {}) {
+      let res = await this.queryByOrg({ skip, limit, term: '有效', code: this.user.code, ...info });
+      if (this.$checkRes(res)) this.$set(this, `oneTotal`, res.total);
+      res = await this.queryByOrg({ skip, limit, term: '审中', code: this.user.code, ...info });
+      if (this.$checkRes(res)) this.$set(this, `twoTotal`, res.total);
+      res = await this.queryByOrg({ skip, limit, term: '失效', code: this.user.code, ...info });
+      if (this.$checkRes(res)) this.$set(this, `thrTotal`, res.total);
+    },
     // 详情
     detail(data) {
       this.$router.push({ path: '/service/patent/mech/patent/information/detail', query: { id: data.id } });

+ 26 - 2
src/views/service/patent/user/patent/information/index.vue

@@ -3,10 +3,13 @@
     <admin-frame @search="search" :limit="limit" :total="total" topType="2" @back="back" :rightArrow="false" :useNav="false">
       <template v-slot:info>
         <van-tabs v-model="active" @change="change" color="#409eff">
-          <van-tab title="已授权" name="有效">
+          <van-tab :title="`已授权【${oneTotal}】`" name="有效">
             <list-1 :list="list" @detail="detail"></list-1>
           </van-tab>
-          <van-tab title="已受理" name="审中">
+          <van-tab :title="`已受理【${twoTotal}】`" name="审中">
+            <list-1 :list="list" @detail="detail"></list-1>
+          </van-tab>
+          <van-tab :title="`已失效专利【${thrTotal}】`" name="失效">
             <list-1 :list="list" @detail="detail"></list-1>
           </van-tab>
         </van-tabs>
@@ -33,10 +36,14 @@ export default {
       list: [],
       limit: 10,
       total: 0,
+      oneTotal: 0,
+      twoTotal: 0,
+      thrTotal: 0,
     };
   },
   async created() {
     await this.search({ term: '有效' });
+    await this.searchTotal();
   },
   methods: {
     ...patentinfo(['query']),
@@ -57,8 +64,25 @@ export default {
           this.$set(this, `list`, res.data);
           this.$set(this, `total`, res.total);
         }
+      } else if (this.active == '失效') {
+        info.term = this.active;
+        info.user_id = this.user._id;
+        let res = await this.query({ skip, limit, ...info });
+        if (this.$checkRes(res)) {
+          this.$set(this, `list`, res.data);
+          this.$set(this, `total`, res.total);
+        }
       }
     },
+    // 查询总数
+    async searchTotal({ skip = 0, limit = this.limit, ...info } = {}) {
+      let res = await this.query({ skip, limit, term: '有效', user_id: this.user.id, ...info });
+      if (this.$checkRes(res)) this.$set(this, `oneTotal`, res.total);
+      res = await this.query({ skip, limit, term: '审中', user_id: this.user.id, ...info });
+      if (this.$checkRes(res)) this.$set(this, `twoTotal`, res.total);
+      res = await this.query({ skip, limit, term: '失效', user_id: this.user.id, ...info });
+      if (this.$checkRes(res)) this.$set(this, `thrTotal`, res.total);
+    },
     // 详情
     detail(data) {
       this.$router.push({ path: '/service/patent/user/patent/information/detail', query: { id: data.id } });