From e990b0eb6859c298172a48e7425369b4cade6bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wei=5F=E4=BD=B3?= Date: Wed, 26 Nov 2025 16:10:38 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E5=8F=91?= =?UTF-8?q?=E7=A5=A8=E5=92=8C=E4=BC=B0=E5=80=BC=E5=AE=A1=E6=A0=B8=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E2=80=9C=E5=B7=B2=E6=8B=92=E7=BB=9D=E2=80=9D=E5=92=8C?= =?UTF-8?q?=E2=80=9C=E5=B7=B2=E9=80=9A=E8=BF=87=E2=80=9D=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/transaction/invoice/index.vue | 2 -- web/src/views/valuation/audit/constants.js | 4 --- web/src/views/valuation/audit/index.vue | 2 +- .../components/ValuationHistory.vue | 31 ++++++++++++------- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/web/src/views/transaction/invoice/index.vue b/web/src/views/transaction/invoice/index.vue index 2ecdb73..af2da5d 100644 --- a/web/src/views/transaction/invoice/index.vue +++ b/web/src/views/transaction/invoice/index.vue @@ -38,7 +38,6 @@ const handleDateRangeChange = (val) => { const statusOptions = [ { label: '未开票', value: 'pending' }, { label: '已开票', value: 'invoiced' }, - { label: '已拒绝', value: 'rejected' }, { label: '已退款', value: 'refunded' }, ] @@ -51,7 +50,6 @@ const renderStatus = (status) => { const statusMap = { pending: { type: 'warning', text: '未开票' }, invoiced: { type: 'success', text: '已开票' }, - rejected: { type: 'error', text: '已拒绝' }, refunded: { type: 'info', text: '已退款' }, } const config = statusMap[status] || { type: 'default', text: '-' } diff --git a/web/src/views/valuation/audit/constants.js b/web/src/views/valuation/audit/constants.js index f55aa27..59a5747 100644 --- a/web/src/views/valuation/audit/constants.js +++ b/web/src/views/valuation/audit/constants.js @@ -1,15 +1,11 @@ export const STATUS_OPTIONS = [ { label: '全部', value: '' }, { label: '待审核', value: 'pending' }, - { label: '已通过', value: 'approved' }, - { label: '已拒绝', value: 'rejected' }, { label: '已完成', value: 'success' }, ] export const STATUS_MAP = { pending: { type: 'warning', text: '待审核' }, - approved: { type: 'success', text: '已通过' }, - rejected: { type: 'error', text: '已拒绝' }, success: { type: 'success', text: '已完成' }, } diff --git a/web/src/views/valuation/audit/index.vue b/web/src/views/valuation/audit/index.vue index 8a4daa3..a0372ee 100644 --- a/web/src/views/valuation/audit/index.vue +++ b/web/src/views/valuation/audit/index.vue @@ -154,7 +154,7 @@ const columns = [ } ) } - if (['approved', 'rejected', 'success'].includes(row.status)) { + if (row.status === 'success') { return h( NButton, { diff --git a/web1/src/views/user-center/components/ValuationHistory.vue b/web1/src/views/user-center/components/ValuationHistory.vue index d2e8713..75e15b6 100644 --- a/web1/src/views/user-center/components/ValuationHistory.vue +++ b/web1/src/views/user-center/components/ValuationHistory.vue @@ -41,22 +41,31 @@ const router = useRouter() const loading = ref(false) const tableData = ref([...props.assetList]) -function handleDownloadReport(item) { - // window.$message?.info('下载报告功能开发中') - if (item.certificate_download_urls && item.certificate_download_urls[0]) { - window.open(item.certificate_download_urls[0], '_blank') +function getDownloadLink(urls) { + if (Array.isArray(urls) && urls.length > 0) { + return urls[0] + } + if (typeof urls === 'string' && urls) { + return urls + } + return null +} + +function handleDownloadAction(item, urlKey, errorMessage) { + const downloadLink = getDownloadLink(item[urlKey]) + if (downloadLink) { + window.open(downloadLink, '_blank') } else { - window.$message?.error('报告下载链接不存在') + window.$message?.error(errorMessage) } } +function handleDownloadReport(item) { + handleDownloadAction(item, 'certificate_download_urls', '报告下载链接不存在') +} + function handleDownloadCertificate(item) { - // window.$message?.info('下载证书功能开发中') - if (item.report_download_urls && item.report_download_urls[0]) { - window.open(item.report_download_urls[0], '_blank') - } else { - window.$message?.error('证书下载链接不存在') - } + handleDownloadAction(item, 'report_download_urls', '证书下载链接不存在') } function formatDate(dateStr) {