From d9c6150ae1ecc9f34b02dd4825763d5ac1977884 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wei=5F=E4=BD=B3?= Date: Mon, 24 Nov 2025 14:10:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=A1=E8=AE=A1=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8F=90=E4=BA=A4=E4=B8=8E=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E8=8C=83=E5=9B=B4=E7=AD=9B=E9=80=89=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96=E5=8F=91=E7=A5=A8=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=87=AD=E8=AF=81=E5=B1=95=E7=A4=BA=E5=8F=8A=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transaction/invoice/InvoiceModal.vue | 6 +- web/src/views/transaction/invoice/index.vue | 58 +++++------------- web/src/views/valuation/audit/index.vue | 61 +++++++++++++------ 3 files changed, 62 insertions(+), 63 deletions(-) diff --git a/web/src/views/transaction/invoice/InvoiceModal.vue b/web/src/views/transaction/invoice/InvoiceModal.vue index 74474b0..9fcd91e 100644 --- a/web/src/views/transaction/invoice/InvoiceModal.vue +++ b/web/src/views/transaction/invoice/InvoiceModal.vue @@ -92,11 +92,11 @@ const handleUploadFinish = ({ file, event }) => { try { const res = JSON.parse(event.target.response) // 只要返回了 url 字段,就认为上传成功 - if (res.url) { + if (res.code === 200 && res.data?.url) { // 显式查找 fileList 中的文件对象进行更新,确保响应式 const targetFile = fileList.value.find(f => f.id === file.id) || file - targetFile.url = res.url - targetFile.name = res.filename || targetFile.name + targetFile.url = res.data.url + targetFile.name = res.data.filename || targetFile.name targetFile.status = 'finished' // 手动标记为完成 // 更新 formData.attachments diff --git a/web/src/views/transaction/invoice/index.vue b/web/src/views/transaction/invoice/index.vue index bd0bdf4..28ac8e1 100644 --- a/web/src/views/transaction/invoice/index.vue +++ b/web/src/views/transaction/invoice/index.vue @@ -70,12 +70,9 @@ const renderInvoiceType = (type) => { const columns = [ { title: 'ID', - key: 'receiptId', + key: 'id', width: 80, align: 'center', - render(row) { - return row.receipt?.id || '-' - }, }, { title: '提交时间', @@ -88,38 +85,25 @@ const columns = [ }, { title: '付款凭证', - key: 'receipt', + key: 'receipts', width: 140, align: 'center', render(row) { - const list = Array.isArray(row.receipt) ? row.receipt : row.receipt ? [row.receipt] : [] - const urls = list - .map((item) => (typeof item === 'string' ? item : item?.url)) - .filter(Boolean) + const list = Array.isArray(row.receipts) ? row.receipts : [] + const urls = list.map((item) => item?.url).filter(Boolean) + if (!urls.length) return '-' return h( 'div', - { style: 'display:flex; gap:6px; justify-content:center;' }, + { style: 'display:flex; gap:6px; justify-content:center; align-items: center;' }, urls.slice(0, 3).map((url, idx) => - h( - 'a', - { - href: url, - target: '_blank', - rel: 'noopener noreferrer', - key: `${url}-${idx}`, - style: 'display:inline-block', - }, - { - default: () => - h('img', { - src: url, - style: - 'width:46px;height:46px;object-fit:cover;border-radius:4px;border:1px solid #e5e6eb;', - alt: '付款凭证', - }), - } - ) + h('img', { + src: url, + style: + 'width:40px;height:40px;object-fit:cover;border-radius:4px;border:1px solid #e5e6eb;cursor:pointer;', + alt: '付款凭证', + onClick: () => window.open(url, '_blank'), + }) ) ) }, @@ -230,22 +214,11 @@ const columns = [ ] // 开票按钮:未开票可编辑,其余只读 -async function handleInvoice(row) { +function handleInvoice(row) { const editable = row.status === 'pending' invoiceModalMode.value = editable ? 'send' : 'view' + currentInvoice.value = row invoiceModalVisible.value = true - await fetchDetail(row) -} - -async function fetchDetail(row) { - try { - const id = row?.receipt?.id || row.id - const { data } = await api.getInvoiceById({ id }) - currentInvoice.value = data || row - } catch (error) { - currentInvoice.value = row - $message.error(error?.message || '获取详情失败') - } } // 确认发送邮件 @@ -253,6 +226,7 @@ async function fetchDetail(row) { async function handleInvoiceConfirm(formData) { try { const payload = { + receipt_id: formData.id, email: formData.email, subject: formData.email, // 用户要求 subject 传 email body: formData.content, // 映射 content -> body diff --git a/web/src/views/valuation/audit/index.vue b/web/src/views/valuation/audit/index.vue index d798736..0fb1751 100644 --- a/web/src/views/valuation/audit/index.vue +++ b/web/src/views/valuation/audit/index.vue @@ -1,5 +1,6 @@