diff --git a/src/api/file.ts b/src/api/file.ts index aa45edd..ba1d9ec 100644 --- a/src/api/file.ts +++ b/src/api/file.ts @@ -26,3 +26,10 @@ method: 'get', }) } +export function getPdfStream(fileName: string) { + return request({ + url: `/minio/file/download/stream?fileName=${fileName}`, + method: 'post', + responseType: 'blob', + }) +} diff --git a/src/api/file.ts b/src/api/file.ts index aa45edd..ba1d9ec 100644 --- a/src/api/file.ts +++ b/src/api/file.ts @@ -26,3 +26,10 @@ method: 'get', }) } +export function getPdfStream(fileName: string) { + return request({ + url: `/minio/file/download/stream?fileName=${fileName}`, + method: 'post', + responseType: 'blob', + }) +} diff --git a/src/views/resource/customer/contract/detail.vue b/src/views/resource/customer/contract/detail.vue index 6664d39..3687c36 100644 --- a/src/views/resource/customer/contract/detail.vue +++ b/src/views/resource/customer/contract/detail.vue @@ -8,6 +8,7 @@ import { getBase64, getObjectURL } from '@/utils/download' import { exportFile } from '@/utils/exportUtils' import { printPdf } from '@/utils/printUtils' +import { getPdfStream } from '@/api/file' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const printFileName = ref('') // 文件名 @@ -61,8 +62,8 @@ lock: true, text: '加载中...', background: 'rgba(255, 255, 255, 0.6)', - }) - getStream({ id: infoId.value, pdf: true }).then((res) => { + }); + ($route.query.contractExecutionFile ? getPdfStream($route.query.contractExecutionFile as string) : getStream({ id: infoId.value, pdf: true })).then((res) => { pdfStream.value = new Blob([res.data]) getBase64(res.data).then((res) => { pdfUrl.value = res as string @@ -132,7 +133,7 @@ 发送给委托方 - + 导出word @@ -161,4 +162,3 @@ } } - diff --git a/src/api/file.ts b/src/api/file.ts index aa45edd..ba1d9ec 100644 --- a/src/api/file.ts +++ b/src/api/file.ts @@ -26,3 +26,10 @@ method: 'get', }) } +export function getPdfStream(fileName: string) { + return request({ + url: `/minio/file/download/stream?fileName=${fileName}`, + method: 'post', + responseType: 'blob', + }) +} diff --git a/src/views/resource/customer/contract/detail.vue b/src/views/resource/customer/contract/detail.vue index 6664d39..3687c36 100644 --- a/src/views/resource/customer/contract/detail.vue +++ b/src/views/resource/customer/contract/detail.vue @@ -8,6 +8,7 @@ import { getBase64, getObjectURL } from '@/utils/download' import { exportFile } from '@/utils/exportUtils' import { printPdf } from '@/utils/printUtils' +import { getPdfStream } from '@/api/file' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const printFileName = ref('') // 文件名 @@ -61,8 +62,8 @@ lock: true, text: '加载中...', background: 'rgba(255, 255, 255, 0.6)', - }) - getStream({ id: infoId.value, pdf: true }).then((res) => { + }); + ($route.query.contractExecutionFile ? getPdfStream($route.query.contractExecutionFile as string) : getStream({ id: infoId.value, pdf: true })).then((res) => { pdfStream.value = new Blob([res.data]) getBase64(res.data).then((res) => { pdfUrl.value = res as string @@ -132,7 +133,7 @@ 发送给委托方 - + 导出word @@ -161,4 +162,3 @@ } } - diff --git a/src/views/resource/customer/contract/list.vue b/src/views/resource/customer/contract/list.vue index 2f9bbf6..b3cb72d 100644 --- a/src/views/resource/customer/contract/list.vue +++ b/src/views/resource/customer/contract/list.vue @@ -196,6 +196,7 @@ query: { approvalStatusName: '全部', // 审批状态名称 customerName: row.customerName, // 委托方名称 + contractExecutionFile: row.contractExecutionFile, }, }) } diff --git a/src/api/file.ts b/src/api/file.ts index aa45edd..ba1d9ec 100644 --- a/src/api/file.ts +++ b/src/api/file.ts @@ -26,3 +26,10 @@ method: 'get', }) } +export function getPdfStream(fileName: string) { + return request({ + url: `/minio/file/download/stream?fileName=${fileName}`, + method: 'post', + responseType: 'blob', + }) +} diff --git a/src/views/resource/customer/contract/detail.vue b/src/views/resource/customer/contract/detail.vue index 6664d39..3687c36 100644 --- a/src/views/resource/customer/contract/detail.vue +++ b/src/views/resource/customer/contract/detail.vue @@ -8,6 +8,7 @@ import { getBase64, getObjectURL } from '@/utils/download' import { exportFile } from '@/utils/exportUtils' import { printPdf } from '@/utils/printUtils' +import { getPdfStream } from '@/api/file' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const printFileName = ref('') // 文件名 @@ -61,8 +62,8 @@ lock: true, text: '加载中...', background: 'rgba(255, 255, 255, 0.6)', - }) - getStream({ id: infoId.value, pdf: true }).then((res) => { + }); + ($route.query.contractExecutionFile ? getPdfStream($route.query.contractExecutionFile as string) : getStream({ id: infoId.value, pdf: true })).then((res) => { pdfStream.value = new Blob([res.data]) getBase64(res.data).then((res) => { pdfUrl.value = res as string @@ -132,7 +133,7 @@ 发送给委托方 - + 导出word @@ -161,4 +162,3 @@ } } - diff --git a/src/views/resource/customer/contract/list.vue b/src/views/resource/customer/contract/list.vue index 2f9bbf6..b3cb72d 100644 --- a/src/views/resource/customer/contract/list.vue +++ b/src/views/resource/customer/contract/list.vue @@ -196,6 +196,7 @@ query: { approvalStatusName: '全部', // 审批状态名称 customerName: row.customerName, // 委托方名称 + contractExecutionFile: row.contractExecutionFile, }, }) } diff --git a/src/views/resource/customer/examine/approvedDetail.vue b/src/views/resource/customer/examine/approvedDetail.vue index 7ebb27e..995868c 100644 --- a/src/views/resource/customer/examine/approvedDetail.vue +++ b/src/views/resource/customer/examine/approvedDetail.vue @@ -6,7 +6,7 @@ import { printPdf } from '@/utils/printUtils' import { getBase64 } from '@/utils/download' import { getStream } from '@/api/resource/examine' - +import { getPdfStream } from '@/api/file' const infoId = ref('') // id const $route = useRoute() const $router = useRouter() @@ -50,8 +50,8 @@ lock: true, text: '加载中...', background: 'rgba(255, 255, 255, 0.6)', - }) - getStream({ id: infoId.value, pdf: true }).then((res) => { + }); + ($route.query.examineFormFile ? getPdfStream($route.query.examineFormFile as string) : getStream({ id: infoId.value, pdf: true })).then((res) => { pdfStream.value = new Blob([res.data]) getBase64(res.data).then((res) => { pdfUrl.value = res as string @@ -71,13 +71,13 @@