From 1b64f7c1fd143d9c8247d64c4006d2fa15b6babd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wei=5F=E4=BD=B3?= Date: Thu, 27 Nov 2025 15:20:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=E6=9F=A5=E7=9C=8B=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E5=9B=9E=E6=98=BE=E5=8F=91=E7=A5=A8=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E5=8F=8A=E9=99=84=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transaction/invoice/InvoiceModal.vue | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/web/src/views/transaction/invoice/InvoiceModal.vue b/web/src/views/transaction/invoice/InvoiceModal.vue index ce01ab2..3c68709 100644 --- a/web/src/views/transaction/invoice/InvoiceModal.vue +++ b/web/src/views/transaction/invoice/InvoiceModal.vue @@ -40,12 +40,34 @@ watch( () => props.visible, (val) => { if (val) { - formData.value = { - email: props.invoiceData?.email || '', - content: '', - attachments: [], + // 如果是查看模式且有 extra 数据,则回显 extra 中的内容 + const extra = props.invoiceData?.extra + if (props.mode === 'view' && extra) { + formData.value = { + email: extra.email || props.invoiceData?.email || '', + content: extra.body || '', + attachments: extra.file_urls || [], + } + // 回显附件列表 + if (extra.file_urls && Array.isArray(extra.file_urls)) { + fileList.value = extra.file_urls.map((url, index) => ({ + id: `file-${index}`, + name: url.split('/').pop() || `附件${index + 1}`, + url: url, + status: 'finished', + })) + } else { + fileList.value = [] + } + } else { + // 开票模式,使用默认邮箱 + formData.value = { + email: props.invoiceData?.email || '', + content: '', + attachments: [], + } + fileList.value = [] } - fileList.value = [] } } )