//时间控件最大三天
timeUpdatethree(val){
let sTime=new Date(val[0]).getTime();
let eTime=new Date(val[1]).getTime();
let reduceDate=(eTime-sTime)/1000/60/60/24;
if(reduceDate>3){
return true;
}
},
//时间选择结束之后
timedataBtn(val) {
let timeUpdate=this.timeUpdatethree
if(val!=null){
if(timeUpdate(val)){
this.$message.error(‘查询天数不能大于3天’);
}else{
this.$message.success(‘查询成功’);
}
}
}
<div>
<el-date-picker v-model=”timevalue” align=”center” size=”small” type=”datetimerange” value-format=”timestamp” style=”margin-top:10px;” :editable=’false’ :clearable=”false” range-separator=”至” start-placeholder=”开始日期” :picker-options=”pickerOptions” :default-time=”[’00:00:00′, ’23:59:59′]” end-placeholder=”结束日期”>
</el-date-picker>
</div>
<el-button type=”primary” @click=”timedataBtn(timevalue)”>查询</el-button>