12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- import request from '../../service/request'; // 查询订单状态
- function payDetail(data) {
- return request.post('/miniProRequest.pay.payDetail', data);
- }
- /**
- * 获取医保缴费字段
- * @param {object} obj
- */
- function getYbParams(obj) {
- if (!obj || !obj.insUploadFeeResp) return {};
- const list = obj.insUploadFeeResp.split(":");
- const params = {};
- // 总额:feeSumamt
- // 医保支付:fundPay
- // 个人支付:psnAcctPay
- // 现金支付:ownPayAmt
- list.map((i, index) => {
- if (i.includes("feeSumamt")) {
- let innerList = i.split(",");
- let value = "";
- if (innerList[0].includes("feeSumamt")) {
- value = innerList[1];
- } else {
- value = list[index + 1].split(",")[0];
- }
- params.feeSumamt = value
- .replaceAll('"', "")
- .replaceAll("}", "")
- .replaceAll("{", "")
- .replaceAll("\\", "");
- }
- if (i.includes("fundPay")) {
- let innerList = i.split(",");
- let value = "";
- if (innerList[0].includes("fundPay")) {
- value = innerList[1];
- } else {
- value = list[index + 1].split(",")[0];
- }
- params.fundPay = value
- .replaceAll('"', "")
- .replaceAll("}", "")
- .replaceAll("{", "")
- .replaceAll("\\", "");
- }
- if (i.includes("ownPayAmt")) {
- let innerList = i.split(",");
- let value = "";
- if (innerList[0].includes("ownPayAmt")) {
- value = innerList[1];
- } else {
- value = list[index + 1].split(",")[0];
- }
- params.ownPayAmt = value
- .replaceAll('"', "")
- .replaceAll("}", "")
- .replaceAll("{", "")
- .replaceAll("\\", "");
- }
- if (i.includes("psnAcctPay")) {
- let innerList = i.split(",");
- let value = "";
- if (innerList[0].includes("psnAcctPay")) {
- value = innerList[1];
- } else {
- value = list[index + 1].split(",")[0];
- }
- params.psnAcctPay = value
- .replaceAll('"', "")
- .replaceAll("}", "")
- .replaceAll("{", "")
- .replaceAll("\\", "");
- }
- });
- return params;
- }
- function generateRandomFourDigitNumber() {
- return Math.floor(Math.random() * (9999 - 1000 + 1)) + 1000;
- }
- export default {
- payDetail,
- getYbParams,
- generateRandomFourDigitNumber
- };
|