123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <template>
- <div id="index">
- <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="`已授权【${oneTotal}】`" name="有效">
- <list-1 :list="list" @detail="detail"></list-1>
- </van-tab>
- <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>
- </template>
- </admin-frame>
- </div>
- </template>
- <script>
- import list1 from '../../../../../company/parts/list_2.vue';
- import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
- import { mapState, createNamespacedHelpers } from 'vuex';
- const { mapActions: patentinfo } = createNamespacedHelpers('patentinfo');
- const moment = require('moment');
- export default {
- name: 'index',
- props: {},
- components: {
- adminFrame,
- list1,
- },
- data: function () {
- return {
- active: '有效',
- list: [],
- limit: 10,
- total: 0,
- oneTotal: 0,
- twoTotal: 0,
- thrTotal: 0,
- };
- },
- async created() {
- await this.search({ term: '有效' });
- await this.searchTotal();
- },
- methods: {
- ...patentinfo(['query']),
- async search({ skip = 0, limit = this.limit, ...info } = {}) {
- 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);
- }
- } 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);
- }
- } 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)) {
- let onDate = moment(new Date()).format('YYYY-MM-DD');
- let data = res.data.filter((i) => i.lose_data <= onDate);
- console.log(data);
- // 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 } });
- },
- // 选择类型
- change(name) {
- this.$set(this, `active`, name);
- this.search({ term: name });
- },
- // 返回
- back() {
- this.$router.push({ path: '/service/patent/index' });
- },
- },
- computed: {
- ...mapState(['user']),
- },
- metaInfo() {
- return { title: this.$route.meta.title };
- },
- watch: {
- test: {
- deep: true,
- immediate: true,
- handler(val) {},
- },
- },
- };
- </script>
- <style lang="less" scoped></style>
|