86 lines
1.9 KiB
JavaScript
86 lines
1.9 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
|
|
})
|
|
}
|