From 7dab665523f3a9354ba843cd5f808a7598a6df16 Mon Sep 17 00:00:00 2001 From: danshihao Date: Mon, 4 Mar 2024 17:52:16 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E5=BC=B9=E6=A1=86-=E5=BC=80=E7=A5=A8=E9=82=AE=E5=AF=84?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=A2=9E=E5=8A=A0=E6=9F=A5=E7=9C=8B=E5=8F=91?= =?UTF-8?q?=E7=A5=A8=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ProjectDetailModal.vue | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/components/ProjectDetailModal.vue b/src/components/ProjectDetailModal.vue index 763c9f7..89d6a78 100644 --- a/src/components/ProjectDetailModal.vue +++ b/src/components/ProjectDetailModal.vue @@ -319,6 +319,7 @@ class="j-table-force-nowrap" > + 查看发票 查看物流 @@ -339,6 +340,10 @@ import { queryCommonProjectById, getStanderMemberLastProofInfo, getCertificateLa import JEllipsis from '@comp/jero/JEllipsis' import PreviewFile from './jero/PreviewFile' import { ProjectTypeEnums } from '@/enums/commonEnums' +import Vue from 'vue' +import {ACCESS_TOKEN} from '@/store/mutation-types' +import {getFileInfo} from '@api/api' +const Base64 = require('js-base64').Base64 // import pick from 'lodash.pick' // import {getAction} from "@api/manage"; const columns = [ @@ -515,6 +520,31 @@ export default { } return `${ item.person }于${ item.time }开票,金额为:${ item.money }元,票号:${ item.piaoNo },项目:${ porjectItem }` }, + /** + * 查看发票 + */ + lookInvoice (record) { + if (!record.invoiceFileId) { + this.$message.warning('暂无发票') + return + } + // 多个文件取第一个 + const id = record.invoiceFileId.split(',')[0] + getFileInfo({ id }).then(res => { + if (res.success) { + // 预览文件 + this.handlePreview(res.result) + } + }) + }, + // 预览 + handlePreview(file) { + if (file && file.url) { + var fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}` + let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}` + window.open(url) + } + }, /* * 查看物流 * */