|
|
|
@ -29,8 +29,26 @@ |
|
|
|
<div class="detail-content" style="width: 100%; height: 100%; padding: 0px 10px;"> |
|
|
|
<vue-html2pdf :show-layout="true" pdf-content-width="100%" :pdf-format="form.templatePdfSize" :pdf-quality="2" |
|
|
|
:float-layout="false" pdf-orientation="landscape" :paginate-elements-by-height="0" :enable-download="false" |
|
|
|
:preview-modal="false" :filename="form.bdmc" @beforeDownload="handleBeforeDownload" ref="html2Pdf" |
|
|
|
@progress="onProgress"> |
|
|
|
:preview-modal="false" :filename="form.bdmc" :html-to-pdf-options="{ |
|
|
|
margin: [10, 5, 10, 5], // 格式: [上, 右, 下, 左] (单位: mm) |
|
|
|
// 或者使用对象格式 |
|
|
|
// margin: { top: 20, right: 15, bottom: 20, left: 15 }, |
|
|
|
filename: 'document.pdf', |
|
|
|
image: { |
|
|
|
type: 'jpeg', |
|
|
|
quality: 2 |
|
|
|
}, |
|
|
|
enableLinks: false, |
|
|
|
html2canvas: { |
|
|
|
scale: 2, |
|
|
|
useCORS: true |
|
|
|
}, |
|
|
|
jsPDF: { |
|
|
|
unit: 'mm', // 单位: mm |
|
|
|
format: form.templatePdfSize, // 纸张大小 |
|
|
|
orientation: 'landscape' // 方向 |
|
|
|
} |
|
|
|
}" @beforeDownload="handleBeforeDownload" ref="html2Pdf" @progress="onProgress"> |
|
|
|
<section slot="pdf-content"> |
|
|
|
<div class="pdf-content"> |
|
|
|
<TemplateTable ref="templateTable" :sn="form.templateSn" :templateData="form" fillType="detail" /> |
|
|
|
@ -164,6 +182,8 @@ export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
watermarkText: '', |
|
|
|
appTitle: process.env.VUE_APP_TITLE, |
|
|
|
baseUrl: process.env.VUE_APP_FILE_DOMAIN, |
|
|
|
uploadFileUrl: process.env.VUE_APP_BASE_API + '/file/upload', // 上传文件服务器地址 |
|
|
|
opacity: 0.8, |
|
|
|
watermarkOpacity: 0.8, |
|
|
|
@ -316,30 +336,26 @@ export default { |
|
|
|
if (progress == 100) { |
|
|
|
this.showExport = false |
|
|
|
// this.$modal.closeLoading() |
|
|
|
} else { |
|
|
|
this.$modal.loading() |
|
|
|
} |
|
|
|
}, |
|
|
|
//导出 |
|
|
|
exportExcel(jcgjlx) { |
|
|
|
this.$modal.loading() |
|
|
|
debugger |
|
|
|
this.jcgjlxExport = jcgjlx |
|
|
|
this.showExport = true |
|
|
|
studyFormFill_jcgjqmxxList({ jcgjlx: jcgjlx, id: this.form.id }).then(response => { |
|
|
|
this.jcgjExportList = response.data.jcgj |
|
|
|
this.qmxxExportList = response.data.qmxx |
|
|
|
// this.updateWatermark() |
|
|
|
this.$refs.jcgjExportList.init(this.jcgjExportList) |
|
|
|
setTimeout(() => { |
|
|
|
this.$refs.html2Pdf.generatePdf({ |
|
|
|
margin: { |
|
|
|
top: 20, |
|
|
|
right: 15, |
|
|
|
bottom: 20, |
|
|
|
left: 15 |
|
|
|
}, |
|
|
|
}) |
|
|
|
}, 200); |
|
|
|
// this.showExport = true |
|
|
|
// studyFormFill_jcgjqmxxList({ jcgjlx: jcgjlx, id: this.form.id }).then(response => { |
|
|
|
// this.jcgjExportList = response.data.jcgj |
|
|
|
// this.qmxxExportList = response.data.qmxx |
|
|
|
// // this.updateWatermark() |
|
|
|
// this.$refs.jcgjExportList.init(this.jcgjExportList) |
|
|
|
setTimeout(() => { |
|
|
|
this.$refs.html2Pdf.generatePdf() |
|
|
|
this.saveSimpleLog({ jcmc: '填报表单详情导出', jcmcEn: 'Record Detail Export', name: this.form.bdmc + '(' + this.form.bdbh + ')', nameEn: this.form.bdmc + '(' + this.form.bdbh + ')' }) |
|
|
|
}) |
|
|
|
}, 200); |
|
|
|
// }) |
|
|
|
}, |
|
|
|
//获取文件blog |
|
|
|
async handleBeforeDownload({ html2pdf, options, pdfContent }) { |
|
|
|
@ -386,9 +402,12 @@ export default { |
|
|
|
{ |
|
|
|
url: data.data.url, |
|
|
|
studyFormFillId: this.form.id, |
|
|
|
jcgjlx: this.jcgjlxExport, |
|
|
|
version:this.appTitle, |
|
|
|
lang: this.$store.getters.language.split("_")[0] |
|
|
|
} |
|
|
|
).then(response => { |
|
|
|
window.open(process.env.VUE_APP_FILE_DOMAIN + response.msg) |
|
|
|
window.open(this.baseUrl + response.msg) |
|
|
|
}).finally(() => { |
|
|
|
this.$modal.closeLoading() |
|
|
|
}) |
|
|
|
@ -462,12 +481,10 @@ export default { |
|
|
|
this.queryParamsQmxx.formId = row.id |
|
|
|
studyFormFill_info({ id: row.id }).then(response => { |
|
|
|
this.form = response.data |
|
|
|
this.open = true |
|
|
|
this.getQmxxList() |
|
|
|
this.getJjcgjList() |
|
|
|
this.open = true |
|
|
|
this.saveSimpleLog({ jcmc: '填报详情', jcmcEn: 'Record Detail', name: this.form.bdmc + '(' + this.form.bdbh + ')', nameEn: this.form.bdmc + '(' + this.form.bdbh + ')' }) |
|
|
|
}).finally(() => { |
|
|
|
this.$modal.closeLoading() |
|
|
|
}) |
|
|
|
}, |
|
|
|
approve() { |
|
|
|
|