From 99cef99cf0c4f750150a1b7ca50824b555dd2936 Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Wed, 6 Apr 2022 11:19:35 +0800 Subject: [PATCH] edit --- proxy.conf.js | 12 +------ .../services/freight-account.service.ts | 36 +++++++++++++------ 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/proxy.conf.js b/proxy.conf.js index fe30b24d..da23059d 100644 --- a/proxy.conf.js +++ b/proxy.conf.js @@ -20,17 +20,7 @@ module.exports = { // } '//api': { target: { - host: 'tms-api-dev.eascs.com', - protocol: 'https:', - port: 443 - }, - secure: false, - changeOrigin: true, - logLevel: 'debug' - }, - '//sascs': { - target: { - host: 'sascs-tj-tms-dev.obs.cn-south-1.myhuaweicloud.com', + host: 'tms-api-test.eascs.com', protocol: 'https:', port: 443 }, diff --git a/src/app/routes/financial-management/services/freight-account.service.ts b/src/app/routes/financial-management/services/freight-account.service.ts index 99477de7..ec4e72d8 100644 --- a/src/app/routes/financial-management/services/freight-account.service.ts +++ b/src/app/routes/financial-management/services/freight-account.service.ts @@ -59,14 +59,14 @@ export class FreightAccountService extends ShipperBaseService { // 拒绝提现 $api_disagree_refund = '/api/fcc/refundApplicationOBC/disagreeRefund'; - // 查询订单退款申请表 - $api_get_refund_record_page = '/api/fcc/billRefundApplication/list/page'; - // 同意退款 - $api_agree_refund_record= '/api/fcc/billRefundApplication/agreeRefund'; - // 不同意退款 - $api_disagree_refund_record = '/api/fcc/billRefundApplication/disagreeRefund'; - // 重新发起 - $api_rebulid_refund_record = '/api/fcc/billRefundApplication/rebulid'; + // 查询订单退款申请表 + $api_get_refund_record_page = '/api/fcc/billRefundApplication/list/page'; + // 同意退款 + $api_agree_refund_record = '/api/fcc/billRefundApplication/agreeRefund'; + // 不同意退款 + $api_disagree_refund_record = '/api/fcc/billRefundApplication/disagreeRefund'; + // 重新发起 + $api_rebulid_refund_record = '/api/fcc/billRefundApplication/rebulid'; // 查询充值信息表 $api_get_recharge_page = '/api/fcc/rechargeInfo/list/getPageByOperator'; @@ -122,6 +122,7 @@ export class FreightAccountService extends ShipperBaseService { // 下载银行回单请求 $api_download_receipt_apply = '/api/fcc/spd/callback/receiptApply'; + $api_download_receipt_apply_byte = '/api/fcc/spd/callback/receiptApplyByte'; // 查询预收款余额 $api_get_advance_collection_page = '/api/fcc/ficoYskBla/list/page'; @@ -137,12 +138,25 @@ export class FreightAccountService extends ShipperBaseService { } getReceiptUrl(url: string, params: any) { + const { bankType, snglFlgCd } = params; if (url) { - this.reviewPDF(url); + if (params?.bankType === '1') { + window.open(params?.receiptUrl); + } else if (params?.bankType === '2') { + this.exportFile({ bankType, receiptUrl: url, bankSerialNumber: snglFlgCd }, this.$api_download_receipt_apply_byte); + } } else { this.request(this.$api_download_receipt_apply, { ...params }).subscribe(res => { if (res?.receiptUrl) { - this.reviewPDF(res.receiptUrl); + if (bankType === '1') { + window.open(res?.receiptUrl); + } else if (bankType === '2') { + this.downloadFile(this.$api_download_receipt_apply_byte, { + bankType, + receiptUrl: res.receiptUrl, + bankSerialNumber: snglFlgCd + }); + } } else { this.msgSrv.warning(res.statusMsg || '获取回单失败'); } @@ -163,7 +177,7 @@ export class FreightAccountService extends ShipperBaseService { const a = document.createElement('a'); document.body.appendChild(a); a.href = objectUrl; - a.download = '回单.pdf'; + a.download = `回单.pdf`; if (isIE) { // 兼容IE11无法触发下载的问题 (navigator as any).msSaveBlob(url, a.download);