1
yyb
90 分钟以前 c63958466b4eaef3c9314c41020a3337bdb928f5
src/views/personnelManagement/dimission/components/formDia.vue
@@ -101,6 +101,8 @@
                <el-date-picker
                    v-model="form.leaveDate"
                    type="date"
                    :disabled="operationType === 'edit'"
                    :disabled-date="disabledFutureDate"
                    placeholder="请选择离职日期"
                    value-format="YYYY-MM-DD"
                    format="YYYY-MM-DD"
@@ -179,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,
@@ -219,6 +234,7 @@
      }
    ]
  } else {
    form.value.leaveDate = getTodayDate()
    getList()
  }
}
@@ -328,4 +344,4 @@
  color: #303133;
  font-size: 14px;
}
</style>
</style>