98 lines
2.3 KiB
JavaScript
98 lines
2.3 KiB
JavaScript
import request from '@/utils/request'
|
|
|
|
// OA 日程管理(日历待办)
|
|
// 响应拦截器只返回 {code, data, msg} 包装,调用方需自行取 res.data
|
|
|
|
export function getScheduleList(params) {
|
|
return request({
|
|
url: '/backend/oa/schedule/list',
|
|
method: 'get',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function getScheduleStats() {
|
|
return request({
|
|
url: '/backend/oa/schedule/stats',
|
|
method: 'get'
|
|
})
|
|
}
|
|
|
|
export function createSchedule(data) {
|
|
return request({
|
|
url: '/backend/oa/schedule/create',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function updateSchedule(id, data) {
|
|
return request({
|
|
url: `/backend/oa/schedule/update/${id}`,
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function deleteSchedule(id) {
|
|
return request({
|
|
url: `/backend/oa/schedule/delete/${id}`,
|
|
method: 'delete'
|
|
})
|
|
}
|
|
|
|
export function finishSchedule(id) {
|
|
return request({
|
|
url: `/backend/oa/schedule/finish/${id}`,
|
|
method: 'post'
|
|
})
|
|
}
|
|
|
|
// 顺延单条日程到下一天(target_date 为空时后端默认取当前日程日期 +1 天)
|
|
export function carrySchedule(id, data) {
|
|
return request({
|
|
url: `/backend/oa/schedule/carry/${id}`,
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
// 更新日程的相关图片:images 为 [{id, url, name}],由后端序列化存储
|
|
export function updateScheduleImages(id, images) {
|
|
return request({
|
|
url: `/backend/oa/schedule/images/${id}`,
|
|
method: 'post',
|
|
data: { images }
|
|
})
|
|
}
|
|
|
|
// 仅更新日程的备注内容(创建 / 修改 / 完成后均可),不会影响其他字段或已绑定提醒
|
|
export function updateScheduleContent(id, content) {
|
|
return request({
|
|
url: `/backend/oa/schedule/content/${id}`,
|
|
method: 'post',
|
|
data: { content }
|
|
})
|
|
}
|
|
|
|
// 批量顺延指定日期的全部未完成日程
|
|
export function carryPendingSchedules(data) {
|
|
return request({
|
|
url: '/backend/oa/schedule/carry-pending',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
// 中国法定节假日/调休日
|
|
// 返回 { list: [{date, name, type, year, wage}], builtin_years: [..] }
|
|
// type: 0 调休上班(周末补班,显示「班」);1 法定放假(显示「休」)
|
|
// 传 start_date + end_date 查区间(日历按 42 格查询),或传 year 查整年。
|
|
export function getScheduleHolidays(params) {
|
|
return request({
|
|
url: '/backend/oa/holiday',
|
|
method: 'get',
|
|
params
|
|
})
|
|
}
|