| 
					
				 | 
			
			
				@@ -1,7 +1,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   <a-range-picker 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     style="width:100%" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    :ranges="ranges" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    :ranges="rangesVal" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     :value="date" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     :size="size" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     :disabledDate="disabledDate" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -27,18 +27,35 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     showTime: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       type: Boolean, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       default: true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    today: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      type: Boolean, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      default: true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   data () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       date: this.value, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       dateFormat: 'YYYY-MM-DD', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      selectPriceDate: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      ranges: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        '今天': [moment(), moment()], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        '近一个月': [moment().subtract(1, 'months'), moment()], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        '本月': [moment().startOf('month'), moment()], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        '上月': [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')] } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      selectPriceDate: '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  computed: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    rangesVal () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (this.today) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          '今天': [moment(), moment()], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          '近一个月': [moment().subtract(1, 'months'), moment()], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          '本月': [moment().startOf('month'), moment()], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          '上月': [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          '近一个月': [moment().subtract(1, 'months'), moment().subtract(1, 'days')], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          '本月': [moment().startOf('month'), moment().subtract(1, 'days')], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          '上月': [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   methods: { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -46,7 +63,7 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     disabledDate (current) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       //  最早可倒推选择两年数据,最晚为今天 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       const minYearVs = moment().subtract(2, 'years') //  两年前   负值 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      const maxYearVs = moment().endOf('day') //  今天,包含今天 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      const maxYearVs = this.today ? moment().endOf('day') : moment().subtract(1, 'days').endOf('day') //  今天,包含今天 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       //  限制最多只能查一年区间的数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       if (this.selectPriceDate) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         const oMinYearVs = moment(this.selectPriceDate, 'YYYY-MM-DD').subtract(1, 'years') //  当前选中开始日期前推一年 
			 |