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) {