This commit is contained in:
zmj 2024-05-24 14:26:11 +08:00
parent e522e5b8a5
commit 6e5f681b48

View File

@ -21,6 +21,7 @@
import { apiOaScheduleLists, apiOaScheduleDetail } from '@/api/oa_schedule'
import EditPopup from '../oa_schedule/edit.vue'
import DeatilPopup from '../oa_schedule/detail.vue'
import { timeFormat } from '@/utils/util'
const now = ref(new Date())
const formData = ref([])
@ -29,16 +30,6 @@ const showEdit = ref(false)
const detailRef = ref(null)
const showDetail = ref(false)
function timeToDay(time) {
const dateTime = new Date(time);
const year = dateTime.getFullYear();
const month = dateTime.getMonth() + 1;
const day = dateTime.getDate();
const dateOnlyString = `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`;
return dateOnlyString;
}
function getDatesBetween(startDate, endDate) {
const dates = [];
let currentDate = new Date(startDate);
@ -47,7 +38,7 @@ function getDatesBetween(startDate, endDate) {
currentDate.setDate(currentDate.getDate() + 1);
}
let list = dates.map(item => {
return timeToDay(item)
return timeFormat(item, 'yyyy-mm-dd');
})
return list
}
@ -62,7 +53,6 @@ const calcLaberTime = (time) => {
return sum
}
//
const handleEdit = async (data) => {
data.id ? showDetail.value = true : showEdit.value = true