|
|
@@ -61,6 +61,7 @@
|
|
|
placeholder="请选择"
|
|
|
value-format="YYYY-MM-DD"
|
|
|
style="width: 100%"
|
|
|
+ :disabled-date="disabledBeforeToday"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
|
|
|
@@ -598,6 +599,14 @@ const selectedProvinceName = ref("");
|
|
|
const selectedCityName = ref("");
|
|
|
const selectedDistrictName = ref("");
|
|
|
|
|
|
+// 禁用「当天之前」的日期(核心方法)
|
|
|
+const disabledBeforeToday = (date) => {
|
|
|
+ // 初始化今天的日期(重置时分秒为0,避免时间戳干扰)
|
|
|
+ const today = new Date();
|
|
|
+ today.setHours(0, 0, 0, 0);
|
|
|
+ // 核心判断:日期 < 今天 → 禁用;今天及以后 → 可用
|
|
|
+ return date < today;
|
|
|
+};
|
|
|
// 表单验证规则
|
|
|
const rules = reactive({
|
|
|
requirementTitle: [{ required: true, message: "请输入需求标题", trigger: "blur" }],
|