index.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import request from '@/utils/request';
  2. /* 费用申请 */
  3. // 列表
  4. export async function invoiceApplyPageListAPI(data) {
  5. let par = new URLSearchParams(data);
  6. const res = await request.get(`/eom/fininvoiceapply/page?` + par, {});
  7. if (res.data.code == 0) {
  8. return res.data.data;
  9. }
  10. return Promise.reject(new Error(res.data.message));
  11. }
  12. // 新增
  13. export async function invoiceApplySaveAPI(data) {
  14. const res = await request.post(`/eom/fininvoiceapply/save`, data);
  15. if (res.data.code == 0) {
  16. return res.data.data;
  17. }
  18. return Promise.reject(new Error(res.data.message));
  19. }
  20. // 新版新增
  21. export async function invoiceApplyCreateAPI(data) {
  22. const res = await request.post(`/eom/fininvoiceapply/create`, data);
  23. if (res.data.code == 0) {
  24. return res.data.data;
  25. }
  26. return Promise.reject(new Error(res.data.message));
  27. }
  28. // 编辑
  29. export async function invoiceApplyUpdateAPI(data) {
  30. const res = await request.put(`/eom/fininvoiceapply/update`, data);
  31. if (res.data.code == 0) {
  32. return res.data.data;
  33. }
  34. return Promise.reject(new Error(res.data.message));
  35. }
  36. // 新版编辑
  37. export async function invoiceApplyUpdateV2API(data) {
  38. const res = await request.put(`/eom/fininvoiceapply/v2/update`, data);
  39. if (res.data.code == 0) {
  40. return res.data.data;
  41. }
  42. return Promise.reject(new Error(res.data.message));
  43. }
  44. // 信息
  45. export async function invoiceApplyInfoAPI(id) {
  46. const res = await request.get(`/eom/fininvoiceapply/getById/${id}`);
  47. if (res.data.code == 0) {
  48. return res.data.data;
  49. }
  50. return Promise.reject(new Error(res.data.message));
  51. }
  52. // 新版信息
  53. export async function invoiceApplyInfoV2API(id) {
  54. const res = await request.get(`/eom/fininvoiceapply/detail/${id}`);
  55. if (res.data.code == 0) {
  56. return res.data.data;
  57. }
  58. return Promise.reject(new Error(res.data.message));
  59. }
  60. // 删除
  61. export async function invoiceApplyRemoveAPI(data) {
  62. const res = await request.delete('/eom/fininvoiceapply/delete', {data});
  63. if (res.data.code == 0) {
  64. return res.data;
  65. }
  66. return Promise.reject(new Error(res.data.message));
  67. }
  68. // 提交-开启流程
  69. export async function invoiceApplySubmit(data) {
  70. const res = await request.post('/bpm/finInvoiceApply/submit', data);
  71. if (res.data.code == 0) {
  72. return res.data;
  73. }
  74. return Promise.reject(new Error(res.data.message));
  75. }