From 7b2fd9e157ed0901f4dbe0d869b1630889143e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E5=BC=BA=E5=BC=BA?= <787203167> Date: Wed, 6 Mar 2024 11:31:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E6=9D=A1=E6=AC=BE=E5=AF=B9?= =?UTF-8?q?=E6=AF=94=20=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comparisonTermsView.vue | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/jero-web/src/views/documentTool/documentComparison/comparisonTermsView.vue b/jero-web/src/views/documentTool/documentComparison/comparisonTermsView.vue index 99d1245..4a0f692 100644 --- a/jero-web/src/views/documentTool/documentComparison/comparisonTermsView.vue +++ b/jero-web/src/views/documentTool/documentComparison/comparisonTermsView.vue @@ -36,6 +36,7 @@ import InternalDetailPage from '../../../components/InternalDetailPage.vue' import JTable from '../../../components/jero/JTable.vue' import { JeroListMixin } from '../../../mixins/JeroListMixin.js' import viewDifferenceModal from './modules/viewDifferenceModal' +import { downFile } from '../../../api/manage' export default { name: 'comparisonTermsView', mixins: [JeroListMixin], @@ -125,6 +126,44 @@ export default { }, handleExportXls () { + const fileName = '条款比对信息' + const fileSuffix = '.xlsx' + const param = {} + param.standHisId = this.standHisId + param.exportName = fileName + fileSuffix + // 加一个大的提示 + const modalLoading = this.$info({ + title: this.$t('tips'), + content: {this.$t('exportTip')} + , + keyboard: false + }) + // 把知道了这个按钮去掉 + this.$nextTick(() => { + document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display:none' + }) + downFile('/compare/sarItemsCompareHis/exportSarItemsCompareHisXls', param).then((data) => { + if (!data) { + this.$message.warning(this.$t('fileDownloadFail')) + return + } + if (typeof window.navigator.msSaveBlob !== 'undefined') { + window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + fileSuffix) + } else { + const url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' })) + const link = document.createElement('a') + link.style.display = 'none' + link.href = url + link.setAttribute('download', fileName + fileSuffix) + document.body.appendChild(link) + link.click() + document.body.removeChild(link) // 下载完成移除元素 + window.URL.revokeObjectURL(url) // 释放掉blob对象 + } + }).finally(() => { + // 销毁这个提示 + modalLoading.destroy() + }) } } }