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 @@