service.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import request from '../../service/request'; // 查询订单状态
  2. function payDetail(data) {
  3. return request.post('/miniProRequest.pay.payDetail', data);
  4. }
  5. /**
  6. * 获取医保缴费字段
  7. * @param {object} obj
  8. */
  9. function getYbParams(obj) {
  10. if (!obj) return {};
  11. const list = obj.insUploadFeeResp.split(":");
  12. const params = {};
  13. // 总额:feeSumamt
  14. // 医保支付:fundPay
  15. // 个人支付:ownPayAmt
  16. list.map((i, index) => {
  17. if (i.includes("feeSumamt")) {
  18. let innerList = i.split(",");
  19. let value = "";
  20. if (innerList[0].includes("feeSumamt")) {
  21. value = innerList[1];
  22. } else {
  23. value = list[index + 1].split(",")[0];
  24. }
  25. params.feeSumamt = value
  26. .replaceAll('"', "")
  27. .replaceAll("}", "")
  28. .replaceAll("{", "")
  29. .replaceAll("\\", "");
  30. }
  31. if (i.includes("fundPay")) {
  32. let innerList = i.split(",");
  33. let value = "";
  34. if (innerList[0].includes("fundPay")) {
  35. value = innerList[1];
  36. } else {
  37. value = list[index + 1].split(",")[0];
  38. }
  39. params.fundPay = value
  40. .replaceAll('"', "")
  41. .replaceAll("}", "")
  42. .replaceAll("{", "")
  43. .replaceAll("\\", "");
  44. }
  45. if (i.includes("ownPayAmt")) {
  46. let innerList = i.split(",");
  47. let value = "";
  48. if (innerList[0].includes("ownPayAmt")) {
  49. value = innerList[1];
  50. } else {
  51. value = list[index + 1].split(",")[0];
  52. }
  53. params.ownPayAmt = value
  54. .replaceAll('"', "")
  55. .replaceAll("}", "")
  56. .replaceAll("{", "")
  57. .replaceAll("\\", "");
  58. }
  59. });
  60. return params;
  61. }
  62. export default {
  63. payDetail,
  64. getYbParams
  65. };