Browse Source

fix:[模板管理]导出

lkf
15881625488@163.com 1 month ago
parent
commit
421d9c20c1
5 changed files with 56 additions and 29 deletions
  1. +1
    -1
      .env.development
  2. +1
    -1
      .env.production
  3. +1
    -0
      public/index.html
  4. +13
    -4
      src/layout/components/AppMain.vue
  5. +40
    -23
      src/views/business/study/comp/tbbd/Xq.vue

+ 1
- 1
.env.development View File

@ -1,5 +1,5 @@
# 页面标题 # 页面标题
VUE_APP_TITLE = 华西海圻管理系统
VUE_APP_TITLE = 华西海圻ELN V1.0
# 开发环境配置 # 开发环境配置
ENV = 'development' ENV = 'development'

+ 1
- 1
.env.production View File

@ -1,5 +1,5 @@
# 页面标题 # 页面标题
VUE_APP_TITLE = 华西海圻管理系统
VUE_APP_TITLE = 华西海圻ELN V1.0
# 生产环境配置 # 生产环境配置
ENV = 'production' ENV = 'production'

+ 1
- 0
public/index.html View File

@ -15,6 +15,7 @@
height: 100%; height: 100%;
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
overflow: hidden;
} }
.chromeframe { .chromeframe {
margin: 0.2em 0; margin: 0.2em 0;

+ 13
- 4
src/layout/components/AppMain.vue View File

@ -47,17 +47,21 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.app-main { .app-main {
/* 50= navbar 50 */ /* 50= navbar 50 */
min-height: calc(100vh - 84px);
// min-height: calc(100vh - 84px);
min-height: 100vh;
width: 100%; width: 100%;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
padding-bottom: 84px;
background: #f3f3f3; background: #f3f3f3;
} }
.fixed-header + .app-main { .fixed-header + .app-main {
overflow-y: auto; overflow-y: auto;
scrollbar-gutter: auto; scrollbar-gutter: auto;
height: calc(100vh - 84px);
padding-bottom: 84px;
// height: calc(100vh - 84px);
height:100vh;
min-height: 0px; min-height: 0px;
} }
@ -66,18 +70,23 @@ export default {
} }
.fixed-header + .app-main { .fixed-header + .app-main {
padding-bottom: 84px;
margin-top: 50px; margin-top: 50px;
} }
.hasTagsView { .hasTagsView {
.app-main { .app-main {
/* 84 = navbar + tags-view = 50 + 34 */ /* 84 = navbar + tags-view = 50 + 34 */
min-height: calc(100vh - 84px);
// min-height: calc(100vh - 84px);
padding-bottom: 84px;
min-height: 100vh;
} }
.fixed-header + .app-main { .fixed-header + .app-main {
margin-top: 84px; margin-top: 84px;
height: calc(100vh -84px);
//min-height: calc(100vh - 84px);
padding-bottom: 84px;
height: 100vh;
min-height: 0px; min-height: 0px;
} }
} }

+ 40
- 23
src/views/business/study/comp/tbbd/Xq.vue View File

@ -29,8 +29,26 @@
<div class="detail-content" style="width: 100%; height: 100%; padding: 0px 10px;"> <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" <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" :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"> <section slot="pdf-content">
<div class="pdf-content"> <div class="pdf-content">
<TemplateTable ref="templateTable" :sn="form.templateSn" :templateData="form" fillType="detail" /> <TemplateTable ref="templateTable" :sn="form.templateSn" :templateData="form" fillType="detail" />
@ -164,6 +182,8 @@ export default {
data() { data() {
return { return {
watermarkText: '', watermarkText: '',
appTitle: process.env.VUE_APP_TITLE,
baseUrl: process.env.VUE_APP_FILE_DOMAIN,
uploadFileUrl: process.env.VUE_APP_BASE_API + '/file/upload', // uploadFileUrl: process.env.VUE_APP_BASE_API + '/file/upload', //
opacity: 0.8, opacity: 0.8,
watermarkOpacity: 0.8, watermarkOpacity: 0.8,
@ -316,30 +336,26 @@ export default {
if (progress == 100) { if (progress == 100) {
this.showExport = false this.showExport = false
// this.$modal.closeLoading() // this.$modal.closeLoading()
} else {
this.$modal.loading()
} }
}, },
// //
exportExcel(jcgjlx) { exportExcel(jcgjlx) {
this.$modal.loading() this.$modal.loading()
debugger
this.jcgjlxExport = jcgjlx 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 + ')' }) this.saveSimpleLog({ jcmc: '填报表单详情导出', jcmcEn: 'Record Detail Export', name: this.form.bdmc + '(' + this.form.bdbh + ')', nameEn: this.form.bdmc + '(' + this.form.bdbh + ')' })
})
}, 200);
// })
}, },
//blog //blog
async handleBeforeDownload({ html2pdf, options, pdfContent }) { async handleBeforeDownload({ html2pdf, options, pdfContent }) {
@ -386,9 +402,12 @@ export default {
{ {
url: data.data.url, url: data.data.url,
studyFormFillId: this.form.id, studyFormFillId: this.form.id,
jcgjlx: this.jcgjlxExport,
version:this.appTitle,
lang: this.$store.getters.language.split("_")[0]
} }
).then(response => { ).then(response => {
window.open(process.env.VUE_APP_FILE_DOMAIN + response.msg)
window.open(this.baseUrl + response.msg)
}).finally(() => { }).finally(() => {
this.$modal.closeLoading() this.$modal.closeLoading()
}) })
@ -462,12 +481,10 @@ export default {
this.queryParamsQmxx.formId = row.id this.queryParamsQmxx.formId = row.id
studyFormFill_info({ id: row.id }).then(response => { studyFormFill_info({ id: row.id }).then(response => {
this.form = response.data this.form = response.data
this.open = true
this.getQmxxList() this.getQmxxList()
this.getJjcgjList() 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 + ')' }) 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() { approve() {

Loading…
Cancel
Save