From b218fc234597c5bb478945585d23ad78f0e993a5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=88=98=E6=B3=89=E4=BD=B3?= <1107186916@qq.com>
Date: Fri, 6 Nov 2026 17:39:34 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BB=98=E6=AC=BE=E8=AE=B0=E5=BD=95?=
=?UTF-8?q?=E4=BB=98=E6=AC=BE=E5=87=AD=E8=AF=81=E6=9F=A5=E7=9C=8B=E4=B8=8B?=
=?UTF-8?q?=E8=BD=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/payment/paymentApplication.js | 9 +++
.../payment/payment-application-form.vue | 71 ++++++++++++++-----
2 files changed, 61 insertions(+), 19 deletions(-)
diff --git a/src/api/payment/paymentApplication.js b/src/api/payment/paymentApplication.js
index 4a64416..a3fde86 100644
--- a/src/api/payment/paymentApplication.js
+++ b/src/api/payment/paymentApplication.js
@@ -34,6 +34,15 @@ export const syncKingdeeBatch = ids =>
// 回写任务按 paymentNo 分批远程查询 A103-2/A103-4,同样可能超过全局超时
export const syncKingdeeResult = () =>
request({ url: `${baseUrl}/sync-kingdee-result`, method: 'post', timeout: APPROVE_TIMEOUT });
+// 付款记录付款凭证下载(后端代理 A801-2 流式回源),耗时较普通接口长,放宽到 120s
+export const downloadRecordVoucher = recordId =>
+ request({
+ url: `${baseUrl}/record/download-voucher`,
+ method: 'get',
+ params: { recordId },
+ responseType: 'blob',
+ timeout: 120000,
+ });
export const paymentTypeOptions = [
{ label: '项目预付', value: 'project_advance' },
diff --git a/src/views/payment/payment-application-form.vue b/src/views/payment/payment-application-form.vue
index f93c25f..4de8874 100644
--- a/src/views/payment/payment-application-form.vue
+++ b/src/views/payment/payment-application-form.vue
@@ -354,11 +354,23 @@
>
+ min-width="160" />查看下载
-
@@ -736,8 +748,10 @@ import { formatContractOptionLabel } from '@/utils/contract';
import { downloadFileByUrl } from '@/utils/util';
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
import {
+ downloadKingdeeFile,
downloadKingdeeInvoiceFile,
isKingdeePathAttachment,
+ viewKingdeeFile,
viewKingdeeInvoiceFile,
} from '@/utils/kingdee-attachment';
import PdfPreview from '@/components/pdf-preview/main.vue';
@@ -1907,17 +1921,23 @@ export default {
this.attachmentFileName(this.invoiceAttachment(row)) || `${row.invoiceNo || '发票'}.pdf`
);
},
+ /** 金蝶附件查看/下载互斥闸门(A801-2 拉流较慢,进行中忽略重复点击,结束自动释放) */
+ async withKingdeeAttachmentBusy(action) {
+ if (this.kingdeeAttachmentBusy) return;
+ this.kingdeeAttachmentBusy = true;
+ try {
+ await action();
+ } finally {
+ this.kingdeeAttachmentBusy = false;
+ }
+ },
async viewInvoiceAttachment(row) {
const attachment = this.invoiceAttachment(row);
// 金蝶侧附件(path 型)经后端代理 A801-2 预览,OSS 直链维持本地预览组件
if (isKingdeePathAttachment(attachment)) {
- if (this.kingdeeAttachmentBusy) return;
- this.kingdeeAttachmentBusy = true;
- try {
- await viewKingdeeInvoiceFile(row.invoiceNo, this.invoiceAttachmentName(row));
- } finally {
- this.kingdeeAttachmentBusy = false;
- }
+ await this.withKingdeeAttachmentBusy(() =>
+ viewKingdeeInvoiceFile(row.invoiceNo, this.invoiceAttachmentName(row))
+ );
return;
}
if (!this.attachmentFileUrl(attachment)) {
@@ -1933,13 +1953,9 @@ export default {
const attachment = this.invoiceAttachment(row);
// 金蝶侧附件(path 型)经后端代理 A801-2 下载,OSS 直链维持前端直连下载
if (isKingdeePathAttachment(attachment)) {
- if (this.kingdeeAttachmentBusy) return;
- this.kingdeeAttachmentBusy = true;
- try {
- await downloadKingdeeInvoiceFile(row.invoiceNo, this.invoiceAttachmentName(row));
- } finally {
- this.kingdeeAttachmentBusy = false;
- }
+ await this.withKingdeeAttachmentBusy(() =>
+ downloadKingdeeInvoiceFile(row.invoiceNo, this.invoiceAttachmentName(row))
+ );
return;
}
const url = this.attachmentFileUrl(attachment);
@@ -1949,6 +1965,23 @@ export default {
}
downloadFileByUrl(url, this.invoiceAttachmentName(row));
},
+ /** 付款记录付款凭证(金蝶电子回单,A801-2 代理):查看=新窗口预览,下载=保存文件 */
+ viewRecordVoucher(row) {
+ return this.withKingdeeAttachmentBusy(() =>
+ viewKingdeeFile(
+ () => api.downloadRecordVoucher(row.id),
+ `${row.paymentNo || '付款记录'}-付款凭证.pdf`
+ )
+ );
+ },
+ downloadRecordVoucher(row) {
+ return this.withKingdeeAttachmentBusy(() =>
+ downloadKingdeeFile(
+ () => api.downloadRecordVoucher(row.id),
+ `${row.paymentNo || '付款记录'}-付款凭证.pdf`
+ )
+ );
+ },
attachmentFileName(file) {
return String(file?.originalName || file?.name || file?.fileName || '').trim();
},