Browse Source

fix:[模板管理]导出

lkf
15881625488@163.com 2 months ago
parent
commit
305d4c77ac
1 changed files with 21 additions and 7 deletions
  1. +21
    -7
      src/views/business/study/comp/tbbd/Xq.vue

+ 21
- 7
src/views/business/study/comp/tbbd/Xq.vue View File

@ -27,9 +27,9 @@
</el-button>
<div class="edit-content">
<div class="detail-content" style="width: 100%; height: 100%;">
<vue-html2pdf :show-layout="false" pdf-content-width="100%" :pdf-format="form.templatePdfSize"
:pdf-quality="2" :float-layout="false" pdf-orientation="landscape" :paginate-elements-by-height="794"
:enable-download="true" :preview-modal="true" ref="html2Pdf" @progress="onProgress">
<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="true"
:preview-modal="false" ref="html2Pdf" @progress="onProgress">
<section slot="pdf-content">
<div class="pdf-content">
<TemplateTable ref="templateTable" :sn="form.templateSn" :templateData="form" fillType="detail" />
@ -56,11 +56,11 @@
</tr>
</tbody>
</table>
<div class="content-title" style="margin-top: 10px;">
<div class="content-title" style="margin-top: 10px;" v-show="jcgjlxExport!=999">
<div class="line"></div>
<div class="subtitle"> {{ $t('page.business.study.studyFormFill.jcgj') }}</div>
</div>
<JcgjList ref="jcgjExportList" :readonly="true" />
<JcgjList ref="jcgjExportList" :readonly="true" v-show="jcgjlxExport!=999"/>
</div>
</div>
</section>
@ -200,7 +200,7 @@ export default {
showExport: false,
qmxxExportList: [],
jcgjExportList: [],
jcgjlxExport:0
}
},
computed: {
@ -213,6 +213,7 @@ export default {
methods: {
onProgress(progress) {
console.log(`生成进度: ${progress}%`)
this.removePageBreak()
if (progress == 100) {
this.showExport = false
this.$modal.closeLoading()
@ -220,8 +221,8 @@ export default {
},
exportExcel(jcgjlx) {
this.$modal.loading()
this.jcgjlxExport=jcgjlx
this.showExport = true
this.$modal.loading()
studyFormFill_jcgjqmxxList({ jcgjlx: jcgjlx, id: this.form.id }).then(response => {
this.jcgjExportList = response.data.jcgj
this.qmxxExportList = response.data.qmxx
@ -231,6 +232,12 @@ export default {
}, 200);
})
},
//
removePageBreak() {
document.querySelectorAll('.html2pdf__page-break').forEach(el => {
el.remove()
})
},
exportExcel_bak(jcgjlx) {
this.$modal.loading()
studyFormFill_exportDetail(_.merge({}, this.queryParamsJcgj, { jcgjlx: jcgjlx, lang: this.$store.getters.language.split("_")[0] })).then(response => {
@ -339,6 +346,9 @@ export default {
.pdf-content {
padding: 20px;
font-family: Arial, sans-serif;
page-break-inside: avoid !important;
break-inside: avoid !important;
page-break-after: avoid !important;
}
.pdf-content h1 {
@ -413,4 +423,8 @@ export default {
line-height: 35px;
text-align: center;
}
.html2pdf__page-break {
display: none !important;
}
</style>

Loading…
Cancel
Save