|
@ -12,11 +12,11 @@ |
|
|
<!-- 日期选择 --> |
|
|
<!-- 日期选择 --> |
|
|
<el-date-picker size="mini" class="selectRoad" :clearable="false" v-model="dateTime" style="width: 140px" |
|
|
<el-date-picker size="mini" class="selectRoad" :clearable="false" v-model="dateTime" style="width: 140px" |
|
|
:picker-options="pickerOptions" :type="type == 2 |
|
|
:picker-options="pickerOptions" :type="type == 2 |
|
|
? 'date' |
|
|
? 'dates' |
|
|
: type == 1 |
|
|
: type == 1 |
|
|
? 'month' |
|
|
? 'months' |
|
|
: type == 0 |
|
|
: type == 0 |
|
|
? 'year' |
|
|
? 'years' |
|
|
: '' |
|
|
: '' |
|
|
" placeholder="请选择" /> |
|
|
" placeholder="请选择" /> |
|
|
|
|
|
|
|
@ -87,7 +87,7 @@ export default { |
|
|
} |
|
|
} |
|
|
], |
|
|
], |
|
|
quarter: "2", |
|
|
quarter: "2", |
|
|
dateTime: moment().format("YYYY-MM-DD HH:mm:ss"), |
|
|
dateTime: [moment().format("YYYY-MM-DD"),moment().format("YYYY-MM-DD")], |
|
|
dataList: [], |
|
|
dataList: [], |
|
|
year: "", |
|
|
year: "", |
|
|
|
|
|
|
|
@ -101,6 +101,16 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
created() { }, |
|
|
created() { }, |
|
|
|
|
|
|
|
|
|
|
|
watch: { |
|
|
|
|
|
dateTime:{ |
|
|
|
|
|
handler: function(n,o) { |
|
|
|
|
|
if(n.length>2){ |
|
|
|
|
|
n.shift(); |
|
|
|
|
|
this.dateTime = n; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
// 上传成功 |
|
|
// 上传成功 |
|
|
|
|
|
|
|
@ -134,19 +144,21 @@ export default { |
|
|
return filter; |
|
|
return filter; |
|
|
}, |
|
|
}, |
|
|
getStartTime(){ |
|
|
getStartTime(){ |
|
|
let startTime = ""; |
|
|
let thisTime = this.dateTime[0]; |
|
|
let endTime = ""; |
|
|
let lastTime = this.dateTime[1]; |
|
|
if (this.type == 2) { //日 |
|
|
if (this.type == 2) { //日 |
|
|
startTime = moment(this.dateTime).format("YYYY-MM-DD 00:00:00"); |
|
|
// startTime = moment(this.dateTime).format("YYYY-MM-DD 00:00:00"); |
|
|
endTime = moment(this.dateTime).format("YYYY-MM-DD 23:59:59"); |
|
|
// endTime = moment(this.dateTime).format("YYYY-MM-DD 23:59:59"); |
|
|
|
|
|
thisTime = moment(this.dateTime[0]).format("YYYY-MM-DD"); |
|
|
|
|
|
lastTime = moment(this.dateTime[1]).format("YYYY-MM-DD"); |
|
|
} else if (this.type == 1) { //月 |
|
|
} else if (this.type == 1) { //月 |
|
|
startTime = moment(this.dateTime).format("YYYY-MM-01 00:00:00"); |
|
|
thisTime = moment(this.dateTime[0]).format("YYYY-MM"); |
|
|
endTime = moment(this.dateTime).endOf('month').format("YYYY-MM-DD 23:59:59"); |
|
|
lastTime = moment(this.dateTime[1]).format("YYYY-MM"); |
|
|
} else if (this.type == 0) { //年 |
|
|
} else if (this.type == 0) { //年 |
|
|
startTime = moment(this.dateTime).format("YYYY-01-01 00:00:00"); |
|
|
thisTime = moment(this.dateTime[0]).format("YYYY"); |
|
|
endTime = moment(this.dateTime).format("YYYY-12-31 23:59:59"); |
|
|
lastTime = moment(this.dateTime[1]).format("YYYY"); |
|
|
} |
|
|
} |
|
|
return {type: this.type, startTime,endTime} |
|
|
return {type: this.type, thisTime,lastTime} |
|
|
}, |
|
|
}, |
|
|
onReset() { |
|
|
onReset() { |
|
|
this.selectId = 1; |
|
|
this.selectId = 1; |
|
|