|
@@ -51,42 +51,28 @@ export default {
|
|
console.log(this.textname);
|
|
console.log(this.textname);
|
|
},
|
|
},
|
|
oneSearch() {
|
|
oneSearch() {
|
|
- const limitMonth = 3;
|
|
|
|
- const create_date = '2015-12-24';
|
|
|
|
- // 当前年份
|
|
|
|
- const now_year = moment(new Date()).format('YYYY');
|
|
|
|
- // 专利日期
|
|
|
|
- const patent_month = moment(create_date).format('MM-DD');
|
|
|
|
- // 专利到期日期
|
|
|
|
- const end = now_year + '-' + patent_month;
|
|
|
|
- // 专利到期前一天
|
|
|
|
- const endbeforeone = moment(end).subtract(1, 'd').format('YYYY-MM-DD');
|
|
|
|
- // 专利到期日期减去三个月
|
|
|
|
- const start = moment(end).subtract(limitMonth, 'months').format('YYYY-MM-DD');
|
|
|
|
|
|
+ const create_date = '2015-1-22';
|
|
|
|
+ // 专利到期时间
|
|
|
|
+ const expire_date = moment(new Date()).format('YYYY') + '-' + moment(create_date).format('MM-DD');
|
|
|
|
+ // 专利到期时间延后一个月
|
|
|
|
+ const end = moment(expire_date).add(1, 'months').format('YYYY-MM-DD');
|
|
|
|
+ // 专利到期前三个月
|
|
|
|
+ const start = moment(end).subtract(3, 'months').format('YYYY-MM-DD');
|
|
|
|
+ // 专利到期前两个月
|
|
|
|
+ const start_two = moment(end).subtract(2, 'months').format('YYYY-MM-DD');
|
|
|
|
+ // 专利到期前一个月
|
|
|
|
+ const start_thr = moment(end).subtract(1, 'months').format('YYYY-MM-DD');
|
|
|
|
+ // 判断是否是三个月的区间
|
|
const r = moment().isBetween(start, end, null, '[]');
|
|
const r = moment().isBetween(start, end, null, '[]');
|
|
- console.log(r);
|
|
|
|
- // // 专利月日减去三个月
|
|
|
|
- // const start = moment(end).subtract(limitMonth, 'months').format('MM-DD');
|
|
|
|
- // // 专利月日减去一天
|
|
|
|
- // const endbeforeone = moment(end).subtract(1, 'd').format('MM-DD');
|
|
|
|
- // // 取得当前月份
|
|
|
|
- // const month_now = moment(new Date()).format('MM-DD');
|
|
|
|
- // const r = moment('02-01').isBetween(start, end, null, '[]');
|
|
|
|
- // console.log(r);
|
|
|
|
- // // // 取得当前年份
|
|
|
|
- //
|
|
|
|
- // // // 当前年份+一年
|
|
|
|
- // const afterYear = moment(nowYear).add(1, 'year').format('YYYY');
|
|
|
|
- // // // 开始时间(先组合日期,减去三个月)
|
|
|
|
- // const nowDate = nowYear + '-' + month;
|
|
|
|
- // const start = moment(nowDate).subtract(limitMonth, 'months').format('YYYY-MM-DD');
|
|
|
|
- // console.log(start + '----------5');
|
|
|
|
- // // 结束时间
|
|
|
|
- // const end = nowYear + '-' + month;
|
|
|
|
- // console.log(end + '----------6');
|
|
|
|
- // const endbeforeone = moment(end).subtract(1, 'd').format('YYYY-MM-DD');
|
|
|
|
- // const r = moment().isBetween(start, end, null, '[]');
|
|
|
|
- // console.log(r);
|
|
|
|
|
|
+ if (r) {
|
|
|
|
+ // 三个月内的第一天||两个月内的第一天||一个月内的第一天
|
|
|
|
+ const toDay = moment('2022-01-22').format('YYYY-MM-DD');
|
|
|
|
+ if (toDay === start || toDay === start_two || toDay === start_thr) {
|
|
|
|
+ console.log('1');
|
|
|
|
+ }
|
|
|
|
+ const early_num = toDay === start ? 1 : toDay === start_two ? 2 : toDay === start_thr ? 3 : 1;
|
|
|
|
+ console.log(early_num);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// async twoSearch() {
|
|
// async twoSearch() {
|
|
// let res = await this.personalQuery({ code: 'XQGQ' });
|
|
// let res = await this.personalQuery({ code: 'XQGQ' });
|