<el-form-item label="开放时间" prop="placeOpen">
<el-date-picker
v-model="defForm.placeOpen"
type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间" style="width: 200px"
:picker-options="pickerOptionsStart"
:disabled="isAble">
</el-date-picker>
</el-form-item>
<el-form-item label="关闭时间" prop="placeClose">
<el-date-picker
v-model="defForm.placeClose"
type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间" style="width: 200px"
:picker-options="pickerOptionsEnd"
:disabled="isAble">
</el-date-picker>
</el-form-item>
data(){
return{
defForm:{
placeOpen:'',
placeClose:''
},
pickerOptionsStart: {
disabledDate: time => {
let endDateVal = this.defForm.placeClose;
if (endDateVal) {
return time.getTime() > new Date(endDateVal).getTime();
}
}
},
pickerOptionsEnd: {
disabledDate: time => {
let beginDateVal = this.defForm.placeOpen;
if (beginDateVal) {
return (time.getTime()<new Date(beginDateVal).getTime()+1*24*60*60*1000
);
}
}
},
}
}