<el-row>
<el-col>
<el-form-item label="规则开始时间" prop="begindate">
<el-date-picker
v-model="form1.begindate"
type="date"
placeholder="请选择规则开始时间"
style="width: 400px"
size="small"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions0"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="规则结束时间" prop="enddate">
<el-date-picker
v-model="form1.enddate"
type="date"
placeholder="请选择规则结束时间"
style="width: 400px"
size="small"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions1"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
return {
pickerOptions0: {
disabledDate(time) {
if (that.form1.enddate) {
return (
time.getTime() > new Date(that.form1.enddate).getTime() ||
time.getTime() < Date.now() - 8.64e7
);
} else {
return time.getTime() < Date.now() - 8.64e7;
}
},
},
pickerOptions1: {
disabledDate(time) {
if (that.form1.begindate) {
return (
time.getTime() < new Date(that.form1.begindate).getTime() - 8.64e7
);
} else {
return time.getTime() < Date.now() - 8.64e7;
}
},
},
}