Browse Source

fix:[模板管理]导出

lkf
15881625488@163.com 2 months ago
parent
commit
7352d7a2cc
3 changed files with 73 additions and 35 deletions
  1. +7
    -0
      src/api/business/study/studyFormFill.js
  2. +6
    -2
      src/views/business/comps/common/JcgjList.vue
  3. +60
    -33
      src/views/business/study/comp/tbbd/Xq.vue

+ 7
- 0
src/api/business/study/studyFormFill.js View File

@ -24,6 +24,13 @@ export function studyFormFill_exportDetail(query) {
params: query
})
}
export function studyFormFill_jcgjqmxxList(query) {
return request({
url: '/system/business/studyFormFill/jcgjqmxxList',
method: 'get',
params: query
})
}
//签名信息
export function studyFormFill_qmxx(query) {

+ 6
- 2
src/views/business/comps/common/JcgjList.vue View File

@ -1,11 +1,11 @@
<template>
<div class="jcgjList">
<div class="jcgjList-keywords">
<div class="jcgjList-keywords" v-if="!readonly">
<el-input v-model="queryParams.jcmc" clearable :placeholder="$t('form.placeholderInput')" @keyup.enter.native="handleQuery">
<el-button slot="append" icon="el-icon-search" @click="handleQuery"></el-button>
</el-input>
</div>
<div class="jcgjList-jcgjlx">
<div class="jcgjList-jcgjlx" v-if="!readonly">
<el-radio-group v-model="queryParams.jcgjlx" @change="handleQuery">
<el-radio-button :label="-1">{{ $t('page.business.study.study.qb') }}</el-radio-button>
<el-radio-button :label="1" v-if="showLc">{{ $t('page.business.study.study.lc') }}</el-radio-button>
@ -81,6 +81,10 @@ export default {
type:Boolean,
default:false
},
readonly: {
type:Boolean,
default:false
},
},
data() {
return {

+ 60
- 33
src/views/business/study/comp/tbbd/Xq.vue View File

@ -25,7 +25,7 @@
</el-button>
<el-button type="primary" @click="exportExcel(999)">{{ $t('page.business.study.studyFormFill.dcbhsjgj') }}
</el-button>
<div class="edit-content ">
<div class="edit-content">
<div class="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"
@ -33,40 +33,57 @@
<section slot="pdf-content">
<div class="pdf-content">
<TemplateTable ref="templateTable" :sn="form.templateSn" :templateData="form" fillType="detail" />
<div class="content-title">
<div class="line"></div>
<div class="subtitle"> {{ $t('page.business.study.studyFormFill.qmxx') }}</div>
</div>
<template v-if="!showExport">
<div class="pal">
<el-table :data="qmxxList" v-loading="loadingQmxx">
<el-table-column :label="$t('page.business.study.studyFormFill.qmr')" align="center" prop="qmrMc"
width="150px" />
<el-table-column :label="$t('page.business.study.studyFormFill.qmyy')" align="center"
:prop="$i18n.locale === 'zh_CN' ? 'qmyy' : 'qmyyEn'" width="150px" />
<el-table-column :label="$t('page.business.study.studyFormFill.qmsj')" align="center"
prop="createTime" width="150px" />
<el-table-column :label="$t('page.business.study.studyFormFill.bzyy')" align="center"
prop="remark" :show-overflow-tooltip="true" />
</el-table>
<div v-if="showExport">
<div class="content-title">
<div class="line"></div>
<div class="subtitle"> {{ $t('page.business.study.studyFormFill.qmxx') }}</div>
</div>
<div class="pal" v-if="showExport">
<pagination v-show="totalQmxx > 0" :total="totalQmxx" :page.sync="queryParamsQmxx.pageNum"
:limit.sync="queryParamsQmxx.pageSize" @pagination="getQmxxList" />
<el-table :data="qmxxExportList" >
<el-table-column :label="$t('page.business.study.studyFormFill.qmr')" align="center" prop="qmrMc" />
<el-table-column :label="$t('page.business.study.studyFormFill.qmyy')" align="center" :prop="$i18n.locale === 'zh_CN' ? 'qmyy' : 'qmyyEn'" />
<el-table-column :label="$t('page.business.study.studyFormFill.qmsj')" align="center" prop="createTime" />
<el-table-column :label="$t('page.business.study.studyFormFill.bzyy')" align="center" prop="remark" />
</el-table>
<div class="content-title">
<div class="line"></div>
<div class="subtitle"> {{ $t('page.business.study.studyFormFill.jcgj') }}</div>
</div>
</template>
<div class="content-title">
<div class="line"></div>
<div class="subtitle"> {{ $t('page.business.study.studyFormFill.jcgj') }}</div>
<JcgjList ref="jcgjExportList" :readonly="true" />
</div>
<template v-if="!showExport">
<JcgjList ref="jcgjList" @handleQuery="getJjcgjList" :showXg="true" />
<pagination v-show="jcgjTotal > 0" small layout="prev, pager, next" :total="jcgjTotal"
@pagination="getJjcgjList" />
</template>
</div>
</section>
</vue-html2pdf>
<div style="padding: 0px 20px 0px 30px;margin-left: 10px;" v-if="!showExport">
<template>
<div class="content-title">
<div class="line"></div>
<div class="subtitle"> {{ $t('page.business.study.studyFormFill.qmxx') }}</div>
</div>
<div class="pal">
<el-table :data="qmxxList" v-loading="loadingQmxx" style="width: 100%;">
<el-table-column :label="$t('page.business.study.studyFormFill.qmr')" align="center" prop="qmrMc" />
<el-table-column :label="$t('page.business.study.studyFormFill.qmyy')" align="center"
:prop="$i18n.locale === 'zh_CN' ? 'qmyy' : 'qmyyEn'" />
<el-table-column :label="$t('page.business.study.studyFormFill.qmsj')" align="center"
prop="createTime" />
<el-table-column :label="$t('page.business.study.studyFormFill.bzyy')" align="center" prop="remark" />
</el-table>
</div>
<div class="pal" v-if="showExport">
<pagination v-show="totalQmxx > 0" :total="totalQmxx" :page.sync="queryParamsQmxx.pageNum"
:limit.sync="queryParamsQmxx.pageSize" @pagination="getQmxxList" />
</div>
</template>
<div class="content-title">
<div class="line"></div>
<div class="subtitle"> {{ $t('page.business.study.studyFormFill.jcgj') }}</div>
</div>
<template>
<JcgjList ref="jcgjList" @handleQuery="getJjcgjList" :showXg="true" />
<pagination v-show="jcgjTotal > 0" small layout="prev, pager, next" :total="jcgjTotal"
@pagination="getJjcgjList" />
</template>
</div>
</div>
</div>
</div>
@ -120,7 +137,7 @@
</template>
<script>
import { studyFormFill_tb, studyFormFill_info, studyFormFill_jcgj, studyFormFill_qmxx, studyFormFill_exportDetail } from "@/api/business/study/studyFormFill"
import { studyFormFill_jcgjqmxxList, studyFormFill_tb, studyFormFill_info, studyFormFill_jcgj, studyFormFill_qmxx, studyFormFill_exportDetail } from "@/api/business/study/studyFormFill"
import { mapGetters } from 'vuex'
import JcgjList from "@/views/business/comps/common/JcgjList";
import TemplateTable from '@/views/business/comps/template/TemplateTable';
@ -176,6 +193,9 @@ export default {
pageSize: 9999,
},
showExport: false,
qmxxExportList: [],
jcgjExportList: [],
}
},
computed: {
@ -189,15 +209,22 @@ export default {
onProgress(progress) {
console.log(`生成进度: ${progress}%`)
if (progress == 100) {
this.showExport = false
this.$modal.closeLoading()
}
},
exportExcel(jcgjlx) {
this.$modal.loading()
this.showExport = true
setTimeout(() => {
this.$refs.html2Pdf.generatePdf()
}, 200);
this.$modal.loading()
studyFormFill_jcgjqmxxList({ jcgjlx: jcgjlx, id: this.form.id }).then(response => {
this.jcgjExportList = response.data.jcgj
this.qmxxExportList = response.data.qmxx
this.$refs.jcgjExportList.init(this.jcgjExportList)
setTimeout(() => {
this.$refs.html2Pdf.generatePdf()
}, 200);
})
},
exportExcel_bak(jcgjlx) {
this.$modal.loading()

Loading…
Cancel
Save