Unify advance/reimburse browsing under workbench view menus with existing detail routes. Co-authored-by: Cursor <cursoragent@cursor.com>
76 lines
2.9 KiB
JavaScript
76 lines
2.9 KiB
JavaScript
import { bxRequest, bxUploadFile } from '@/utils/bxRequest'
|
|
|
|
export const advanceApi = {
|
|
list: (params) => bxRequest({ url: '/advances/', method: 'GET', params }),
|
|
my: (params) => bxRequest({ url: '/advances/my', method: 'GET', params }),
|
|
getById: (id) => bxRequest({ url: `/advances/${id}`, method: 'GET' }),
|
|
getApprovals: (id) => bxRequest({ url: `/advances/${id}/approvals`, method: 'GET' }),
|
|
getApprovalHistory: (id) => bxRequest({ url: `/advances/${id}/approval-history`, method: 'GET' }),
|
|
create: (data) => bxRequest({ url: '/advances/', method: 'POST', data }),
|
|
update: (id, data) => bxRequest({ url: `/advances/${id}`, method: 'PUT', data }),
|
|
submit: (id) => bxRequest({ url: `/advances/${id}/submit`, method: 'POST' }),
|
|
delete: (id) => bxRequest({ url: `/advances/${id}`, method: 'DELETE' })
|
|
}
|
|
|
|
export const reimburseApi = {
|
|
generateTitle: (params) =>
|
|
bxRequest({ url: '/reimburses/generate-title', method: 'GET', params }),
|
|
list: (params) => bxRequest({ url: '/reimburses/', method: 'GET', params }),
|
|
my: (params) => bxRequest({ url: '/reimburses/my', method: 'GET', params }),
|
|
getById: (id) => bxRequest({ url: `/reimburses/${id}`, method: 'GET' }),
|
|
getApprovals: (id) => bxRequest({ url: `/reimburses/${id}/approvals`, method: 'GET' }),
|
|
getApprovalHistory: (id) =>
|
|
bxRequest({ url: `/reimburses/${id}/approval-history`, method: 'GET' }),
|
|
create: (data) => bxRequest({ url: '/reimburses/', method: 'POST', data }),
|
|
update: (id, data) => bxRequest({ url: `/reimburses/${id}`, method: 'PUT', data }),
|
|
submit: (id, data) =>
|
|
bxRequest({ url: `/reimburses/${id}/submit`, method: 'POST', data }),
|
|
delete: (id) => bxRequest({ url: `/reimburses/${id}`, method: 'DELETE' })
|
|
}
|
|
|
|
export const expenseItemApi = {
|
|
tree: () => bxRequest({ url: '/expense-items/tree', method: 'GET' })
|
|
}
|
|
|
|
export const invoiceWalletApi = {
|
|
mineSummary: (params) =>
|
|
bxRequest({ url: '/invoice-wallets/mine/summary', method: 'GET', params })
|
|
}
|
|
|
|
export const invoiceApi = {
|
|
list: (params) => bxRequest({ url: '/invoices', method: 'GET', params })
|
|
}
|
|
|
|
/** 附件:申请页图片上传所需最小集合 */
|
|
export const attachmentApi = {
|
|
upload: (filePath, bizType = '', bizId = 0) =>
|
|
bxUploadFile(filePath, { bizType, bizId }),
|
|
listByBiz: (bizType, bizId) =>
|
|
bxRequest({
|
|
url: '/attachments/list',
|
|
method: 'GET',
|
|
params: { biz_type: bizType, biz_id: bizId }
|
|
}),
|
|
preview: (id) => bxRequest({ url: `/attachments/preview/${id}`, method: 'GET' }),
|
|
delete: (id) => bxRequest({ url: `/attachments/${id}`, method: 'DELETE' }),
|
|
bindBiz: (ids, bizType, bizId) =>
|
|
bxRequest({
|
|
url: '/attachments/bind-biz',
|
|
method: 'PUT',
|
|
params: {
|
|
ids: (ids || []).join(','),
|
|
biz_type: bizType,
|
|
biz_id: bizId
|
|
}
|
|
})
|
|
}
|
|
|
|
export default {
|
|
advanceApi,
|
|
reimburseApi,
|
|
expenseItemApi,
|
|
invoiceWalletApi,
|
|
invoiceApi,
|
|
attachmentApi
|
|
}
|