server.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { creatRequest } from '../../utils/request.js';
  2. const requestList = {
  3. // 一键查核
  4. oneKeyCheck: {
  5. method: 'POST',
  6. url: 'checkTask/saveBatchCheckTaskDetail'
  7. },
  8. // 列表一键不适用
  9. oneKeyNotApplicable: {
  10. method: 'POST',
  11. url: 'checkTask/notApplicable'
  12. },
  13. // 当situationType=2时,获取访查对象列表
  14. getInvestigationUsers: {
  15. method: 'GET',
  16. url: 'checkTask/getInvestigationUsers'
  17. },
  18. getPointConditions:{ //获取筛选条件
  19. method: 'GET',
  20. url: 'plan/getPointConditions'
  21. },
  22. getZichaduchaCheckItems:{ //获取自查督查查核要点
  23. method: 'GET',
  24. url: 'inspector/checkItemList'
  25. },
  26. oneKeyCheckZichaducha:{ //一键查核自查督查
  27. method: 'post',
  28. url: 'inspector/saveBatchItem'
  29. }
  30. };
  31. export const commServer = (key, data) => {
  32. let obj = requestList[key];
  33. if(key=='oneKeyNotApplicable'){
  34. return creatRequest({
  35. ...obj,
  36. url:`checkTask/notApplicable?checkDetailId=${data.id}&type=${data.type}`
  37. });
  38. }
  39. if(key=='oneKeyCheckZichaducha'){
  40. return creatRequest({
  41. ...obj,
  42. url:`inspector/saveBatchItem?functionId=${data}`
  43. });
  44. }
  45. return creatRequest(obj, data);
  46. }