common.ts 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. import { GenericApi, DwLayout, FileApi, Basicinfo, Mattress } from "@/api/interface/index";
  2. import { PORT1, PORT_DL } from "@/api/config/servicePort";
  3. import http from "@/api";
  4. /**
  5. * @name 获取 通用接口:查询
  6. * @param params 请求参数
  7. * @param dwname 布局名称
  8. */
  9. export const CommonDynamicSelect = (params: GenericApi.ReqCommonDynamicSelect, dwname?: string) => {
  10. return http.postCommonDynamic<GenericApi.ResCommonDynamicSelect>(PORT1 + `/CommonDynamicSelect`, params, dwname);
  11. };
  12. /**
  13. * @name 数据交互 通用调用uo
  14. */
  15. export const CommonBill = (params: GenericApi.CommonClass) => {
  16. return http.postCommonBill<GenericApi.ResCommonBill>(PORT1 + `/CommonBill`, params);
  17. };
  18. /**
  19. * @name 获取 用户布局习惯
  20. */
  21. export const GetDwLyoutApi = (params: DwLayout.ReqGetDwLayout) => {
  22. return http.post<DwLayout.ResGetDwLayout>(PORT1 + `/GetSysUserFileString`, params);
  23. };
  24. /**
  25. * @name 提交 用户布局习惯
  26. */
  27. export const SetDwLyoutApi = (params: DwLayout.ReqSetDwLayout) => {
  28. return http.post(PORT1 + `/SetSysUserFileString`, params);
  29. };
  30. /**
  31. * @name 获取 文件分类
  32. */
  33. export const GetFileClass = (params: FileApi.ReqFileClass) => {
  34. return http.post<FileApi.ResFileClass>(PORT1 + `/GetFileClass`, params);
  35. };
  36. /**
  37. * @name 获取 附件数据
  38. */
  39. export const GetFjFile = (params: FileApi.ReqFileData) => {
  40. return http.post<FileApi.ResFileData>(PORT1 + `/GetFjFile`, params);
  41. };
  42. /**
  43. * @name 获取 md5转换附件
  44. */
  45. export const GetCacheFile = (params: FileApi.ReqCacheFile) => {
  46. return http.post<FileApi.ResCacheFile>(PORT1 + `/GetCacheFile`, params);
  47. };
  48. /**
  49. * @name 下载 md5转换附件
  50. */
  51. export const DownloadCacheFile = (params: FileApi.ReqCacheFile) => {
  52. return http.get<FileApi.ResCacheFile>(PORT_DL + `/GetCacheFile`, params, { responseType: "blob" });
  53. };
  54. /**
  55. * @name 上传 附件
  56. */
  57. export const UploadFile = (params: FileApi.ReqUploadFile) => {
  58. return http.post(PORT1 + `/UploadL1File`, params);
  59. };
  60. export const GetFormulaCompute = (params: GenericApi.ReqFormulaCompute) => {
  61. return http.post<GenericApi.ResFormulaCompute>(PORT1 + `/GetFormulaCompute`, params);
  62. };
  63. export const GetERPMtrldefList = (params?: GenericApi.ReqGetERPMtrldefList) => {
  64. return http.post<GenericApi.ResGetERPMtrldefList>(PORT1 + `/GetERPMtrldefList`, params);
  65. };
  66. export const GetERPConfigureList = (params?: GenericApi.ReqGetERPConfigureList) => {
  67. return http.post<GenericApi.ResGetERPConfigureList>(PORT1 + `/GetERPConfigureList`, params);
  68. };
  69. export const GetERPWrkGrpList = (params?: GenericApi.ReqGetERPWrkGrpList) => {
  70. return http.post<GenericApi.ResGetERPWrkGrpList>(PORT1 + `/GetERPWrkGrpList`, params);
  71. };
  72. export const GetERPWrkGrpList2 = () => {
  73. let newParams: any = {};
  74. newParams.dsname = "_Mapper_wrkgrpcode2";
  75. newParams.queryparams = {};
  76. newParams.pageindex = 0;
  77. newParams.pagesize = 0;
  78. return CommonDynamicSelect(newParams);
  79. };
  80. export const GetERPMtrlTypeList = () => {
  81. return http.post<Basicinfo.ResGetMtrlTypeList>(PORT1 + `/GetERPMtrlTypeList`);
  82. };
  83. /**
  84. * @description 生成L1物料
  85. * @param params
  86. * @returns
  87. */
  88. export const CreatMtrlPf = (params?: Mattress.ReqRefreshMattressInterface) => {
  89. return http.post<Mattress.ResSaveMattressBcp>(PORT1 + `/CreatMtrldef`, params);
  90. };
  91. /**
  92. * @description 生成L1清单
  93. * @param params
  94. * @returns
  95. */
  96. export const CreatPrdPf = (params?: Mattress.ReqRefreshMattressInterface) => {
  97. return http.post(PORT1 + `/CreatPrdPf`, params);
  98. };
  99. /**
  100. * @description 删除L1清单
  101. * @param params
  102. * @returns
  103. */
  104. export const DelMtrlPf = (params?: Mattress.ReqRefreshMattressInterface) => {
  105. return http.post(PORT1 + `/DelMtrlPf`, params);
  106. };