add
This commit is contained in:
parent
e522e5b8a5
commit
6e5f681b48
@ -21,6 +21,7 @@
|
|||||||
import { apiOaScheduleLists, apiOaScheduleDetail } from '@/api/oa_schedule'
|
import { apiOaScheduleLists, apiOaScheduleDetail } from '@/api/oa_schedule'
|
||||||
import EditPopup from '../oa_schedule/edit.vue'
|
import EditPopup from '../oa_schedule/edit.vue'
|
||||||
import DeatilPopup from '../oa_schedule/detail.vue'
|
import DeatilPopup from '../oa_schedule/detail.vue'
|
||||||
|
import { timeFormat } from '@/utils/util'
|
||||||
|
|
||||||
const now = ref(new Date())
|
const now = ref(new Date())
|
||||||
const formData = ref([])
|
const formData = ref([])
|
||||||
@ -29,16 +30,6 @@ const showEdit = ref(false)
|
|||||||
const detailRef = ref(null)
|
const detailRef = ref(null)
|
||||||
const showDetail = ref(false)
|
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) {
|
function getDatesBetween(startDate, endDate) {
|
||||||
const dates = [];
|
const dates = [];
|
||||||
let currentDate = new Date(startDate);
|
let currentDate = new Date(startDate);
|
||||||
@ -47,7 +38,7 @@ function getDatesBetween(startDate, endDate) {
|
|||||||
currentDate.setDate(currentDate.getDate() + 1);
|
currentDate.setDate(currentDate.getDate() + 1);
|
||||||
}
|
}
|
||||||
let list = dates.map(item => {
|
let list = dates.map(item => {
|
||||||
return timeToDay(item)
|
return timeFormat(item, 'yyyy-mm-dd');
|
||||||
})
|
})
|
||||||
return list
|
return list
|
||||||
}
|
}
|
||||||
@ -62,7 +53,6 @@ const calcLaberTime = (time) => {
|
|||||||
return sum
|
return sum
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 编辑
|
// 编辑
|
||||||
const handleEdit = async (data) => {
|
const handleEdit = async (data) => {
|
||||||
data.id ? showDetail.value = true : showEdit.value = true
|
data.id ? showDetail.value = true : showEdit.value = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user