在 Web 与移动 OA 表单收款账户选择器中,对可见账户增加行尾编辑/删除图标; 复用现有新增表单做编辑,删除二次确认后软删并从已选移除。 Co-authored-by: Cursor <cursoragent@cursor.com>
186 lines
5.1 KiB
JavaScript
186 lines
5.1 KiB
JavaScript
import { get, post, put, request } from '../utils/http.js'
|
|
|
|
export function fetchUserList(params) {
|
|
return get('/web/admin/users', params)
|
|
}
|
|
|
|
/** 轻量用户下拉(label/value),评论 @ 预缓存用 */
|
|
export function fetchUserOptions(params) {
|
|
return get('/web/admin/users/options', params)
|
|
}
|
|
|
|
export function fetchDeptTree(params) {
|
|
return get('/web/admin/depts', params)
|
|
}
|
|
|
|
export function fetchPostList(params) {
|
|
return get('/web/admin/posts', params)
|
|
}
|
|
|
|
export function fetchReceiveAccountOptions() {
|
|
return get('/web/admin/oa-approval/receive-accounts/options')
|
|
}
|
|
|
|
export function fetchCreateReceiveAccount(data) {
|
|
return post('/web/admin/oa-approval/receive-accounts', data)
|
|
}
|
|
|
|
export function fetchUpdateReceiveAccount(id, data) {
|
|
return put(`/web/admin/oa-approval/receive-accounts/${id}`, data)
|
|
}
|
|
|
|
export function fetchDeleteReceiveAccount(id) {
|
|
return request({
|
|
url: `/web/admin/oa-approval/receive-accounts/${id}`,
|
|
method: 'DELETE'
|
|
})
|
|
}
|
|
|
|
export function fetchRelatedCandidates(params) {
|
|
return get('/web/admin/oa-approval/related-candidates', params)
|
|
}
|
|
|
|
export function fetchRelatedSummaries(ids, mode = 'view') {
|
|
return get('/web/admin/oa-approval/related-summaries', {
|
|
ids: (ids || []).filter(Boolean).join(','),
|
|
mode
|
|
})
|
|
}
|
|
|
|
export function uploadAttachment(file) {
|
|
const fd = new FormData()
|
|
fd.append('file', file)
|
|
fd.append('folder', 'oa-approval')
|
|
return request({
|
|
url: '/web/admin/attachment/upload',
|
|
method: 'POST',
|
|
data: fd
|
|
})
|
|
}
|
|
|
|
/** 获取带 Content-Disposition 的下载地址(保留原始文件名) */
|
|
export function fetchAttachmentDownloadUrl({ fileUrl, fileName } = {}) {
|
|
return post('/web/admin/attachment/download-url', {
|
|
fileUrl,
|
|
fileName: fileName || undefined
|
|
})
|
|
}
|
|
|
|
// —— 发起审批运行时(对齐 web-admin oaApproval.ts)——
|
|
|
|
export function fetchOaGroupList() {
|
|
return get('/web/admin/oa-approval/groups')
|
|
}
|
|
|
|
export function fetchOaTemplates() {
|
|
return get('/web/admin/oa-approval/templates')
|
|
}
|
|
|
|
export function fetchOaTemplateDetail(appId) {
|
|
return get(`/web/admin/oa-approval/templates/${encodeURIComponent(appId)}`)
|
|
}
|
|
|
|
export function fetchOaFlowPreview(appId, { formData, initiatorSelectByNode } = {}) {
|
|
return post(`/web/admin/oa-approval/templates/${encodeURIComponent(appId)}/flow-preview`, {
|
|
formData: formData || {},
|
|
initiatorSelectByNode: initiatorSelectByNode || undefined
|
|
})
|
|
}
|
|
|
|
export function fetchCreateOaInstanceDraft(data) {
|
|
return post('/web/admin/oa-approval/drafts', data)
|
|
}
|
|
|
|
export function fetchUpdateOaInstanceDraft(id, data) {
|
|
return put(`/web/admin/oa-approval/drafts/${encodeURIComponent(id)}`, data)
|
|
}
|
|
|
|
export function fetchOaInstanceDraftDetail(id) {
|
|
return get(`/web/admin/oa-approval/drafts/${encodeURIComponent(id)}`)
|
|
}
|
|
|
|
export function fetchSubmitOaInstanceDraft(id, data) {
|
|
return post(`/web/admin/oa-approval/drafts/${encodeURIComponent(id)}/submit`, data)
|
|
}
|
|
|
|
export function fetchStartOaInstance(data) {
|
|
return post('/web/admin/oa-approval/instances', data)
|
|
}
|
|
|
|
export function fetchCurrentUser() {
|
|
return get('/web/auth/current-user')
|
|
}
|
|
|
|
export function fetchCnHolidayRange(start, end) {
|
|
return get('/cn-holiday/range', { start, end })
|
|
}
|
|
|
|
// —— 详情 / 办理动作(对齐 web-admin oaApproval.ts)——
|
|
|
|
export function fetchOaInstanceDetail(id) {
|
|
return get(`/web/admin/oa-approval/instances/${encodeURIComponent(id)}`)
|
|
}
|
|
|
|
export function fetchOaInstanceHistory(params) {
|
|
return get('/web/admin/oa-approval/instances/history', params)
|
|
}
|
|
|
|
export function fetchApproveOaTask(taskId, comment) {
|
|
return post(`/web/admin/oa-approval/tasks/${encodeURIComponent(taskId)}/approve`, {
|
|
comment
|
|
})
|
|
}
|
|
|
|
export function fetchRejectOaTask(taskId, comment) {
|
|
return post(`/web/admin/oa-approval/tasks/${encodeURIComponent(taskId)}/reject`, {
|
|
comment
|
|
})
|
|
}
|
|
|
|
export function fetchReturnOaTask(taskId, comment) {
|
|
return post(`/web/admin/oa-approval/tasks/${encodeURIComponent(taskId)}/return`, {
|
|
comment
|
|
})
|
|
}
|
|
|
|
export function fetchAddSignOaTask(taskId, data) {
|
|
return post(`/web/admin/oa-approval/tasks/${encodeURIComponent(taskId)}/add-sign`, data)
|
|
}
|
|
|
|
export function fetchTransferOaTask(taskId, data) {
|
|
return post(`/web/admin/oa-approval/tasks/${encodeURIComponent(taskId)}/transfer`, data)
|
|
}
|
|
|
|
export function fetchWithdrawOaInstance(instanceId) {
|
|
return post(
|
|
`/web/admin/oa-approval/instances/${encodeURIComponent(instanceId)}/withdraw`,
|
|
{}
|
|
)
|
|
}
|
|
|
|
export function fetchOaFormAttachments(instanceId) {
|
|
return get(
|
|
`/web/admin/oa-approval/instances/${encodeURIComponent(instanceId)}/form-attachments`
|
|
)
|
|
}
|
|
|
|
export function fetchCreateOaComment(instanceId, data) {
|
|
return post(
|
|
`/web/admin/oa-approval/instances/${encodeURIComponent(instanceId)}/comments`,
|
|
data
|
|
)
|
|
}
|
|
|
|
export function fetchRevokeOaComment(instanceId, commentId) {
|
|
return post(
|
|
`/web/admin/oa-approval/instances/${encodeURIComponent(instanceId)}/comments/${encodeURIComponent(commentId)}/revoke`,
|
|
{}
|
|
)
|
|
}
|
|
|
|
export function fetchMarkOaCcTaskRead(taskId) {
|
|
return post(`/web/admin/oa-approval/tasks/${encodeURIComponent(taskId)}/read`, {})
|
|
}
|
|
|
|
export { post, put }
|