service.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * @Author: your name
  3. * @Date: 2021-07-26 08:54:08
  4. * @LastEditTime: 2021-08-12 18:24:15
  5. * @LastEditors: Please set LastEditors
  6. * @Description: In User Settings Edit
  7. * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
  8. */
  9. import { request } from 'umi';
  10. //获取收入成本数据设置列表
  11. export async function getIncomeCostDataImport(params, options) {
  12. return request('/api/costAccount/costincomefile/list', {
  13. method: 'GET',
  14. params:{...params},
  15. ...(options || {}),
  16. });
  17. }
  18. //获取导入错误详情列表
  19. export async function getIncomeCostDataImportErrList(params, options) {
  20. return request('/api/costAccount/costincomefile/getErrorList', {
  21. method: 'GET',
  22. params:{...params},
  23. ...(options || {}),
  24. });
  25. }
  26. //导入收入数据
  27. export async function addIncomeCostDataImport(body, options) {
  28. const {formData} = body;
  29. const type = formData.get('fileType');
  30. const urlMap = [
  31. '/api/costAccount/excel/importShareParamGroup',//成本分摊
  32. '/api/costAccount/excel/importDataByFileType',//收入
  33. '/api/costAccount/excel/importCostingGroup',//成本
  34. ];
  35. // console.log({type},Number(type)-1);
  36. return request(urlMap[Number(type)-1], {
  37. method: 'POST',
  38. data:formData,
  39. ...(options || {}),
  40. });
  41. }
  42. //addIncomeCostDataImport
  43. //撤销导入
  44. export async function cancelIncomeCostDataImport(body, options) {
  45. const {id} = body;
  46. return request('/api/costAccount/costincomefile/deleteImport', {
  47. method: 'POST',
  48. params:{id},
  49. ...(options || {}),
  50. });
  51. }