8 天以前 77fdbcc67ba81d2394b02ab4247eb741d220fbcc
src/views/personnelManagement/dimission/components/formDia.vue
@@ -102,6 +102,7 @@
                    v-model="form.leaveDate"
                    type="date"
                    :disabled="operationType === 'edit'"
                    :disabled-date="disabledFutureDate"
                    placeholder="请选择离职日期"
                    value-format="YYYY-MM-DD"
                    format="YYYY-MM-DD"
@@ -180,6 +181,19 @@
const dialogFormVisible = ref(false);
const operationType = ref('')
const getTodayDate = () => {
  const now = new Date();
  const year = now.getFullYear();
  const month = `${now.getMonth() + 1}`.padStart(2, '0');
  const day = `${now.getDate()}`.padStart(2, '0');
  return `${year}-${month}-${day}`;
};
const disabledFutureDate = (time) => {
  const todayEnd = new Date();
  todayEnd.setHours(23, 59, 59, 999);
  return time.getTime() > todayEnd.getTime();
};
const data = reactive({
  form: {
    staffOnJobId: undefined,
@@ -220,6 +234,7 @@
      }
    ]
  } else {
    form.value.leaveDate = getTodayDate()
    getList()
  }
}
@@ -329,4 +344,4 @@
  color: #303133;
  font-size: 14px;
}
</style>
</style>