perf: 表单打印展示样式

saber
ssc 4 years ago
parent 8000410bce
commit fae53717ce
  1. 43
      src/views/plugin/workflow/mixins/ex-form.js
  2. 2
      src/views/plugin/workflow/process/external/Leave/detail.vue
  3. 2
      src/views/plugin/workflow/process/external/template/detail.vue

@ -324,10 +324,45 @@ export default {
})
},
handlePrint() { // 打印
// const watermarkText = this.userInfo.user_name + " " + this.userInfo.dept_name
// Watermark.set({ watermark_txt: watermarkText }) // 添加水印
Print('#printBody')
Watermark.remove() // 删除水印
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
const option = this.deepClone(this.option)
this.option.detail = true
if (this.option.column) {
this.option.column.forEach(col => {
this.handleTemporaryPrintOption(col)
})
}
if (this.option.group) {
this.option.group.forEach(g => {
g.column.forEach(col => {
this.handleTemporaryPrintOption(col)
})
})
}
setTimeout(() => {
loading.close()
// const watermarkText = this.userInfo.user_name + " " + this.userInfo.dept_name
// Watermark.set({ watermark_txt: watermarkText }) // 添加水印
Print('#printBody')
this.option = option
Watermark.remove() // 删除水印
}, 500)
},
// 生成打印临时option
handleTemporaryPrintOption(obj) {
if (!obj.type) return
obj.span = 24
if (obj.type == 'dynamic') {
obj.children.type = 'form'
obj.children.column.forEach(col => {
this.handleTemporaryPrintOption(col)
})
}
},
// 关闭当前tag,并跳转
handleCloseTag(path) {

@ -19,7 +19,7 @@
<el-tab-pane label="申请信息"
name="first">
<el-card shadow="never">
<div ref="printBody"
<div id="printBody"
:class="process.status != 'todo' ? `wf-theme-${theme}`: ''">
<avue-form v-if="option && ((option.column && option.column.length > 0) || (option.group && option.group.length > 0))"
v-model="form"

@ -19,7 +19,7 @@
<el-tab-pane label="申请信息"
name="first">
<el-card shadow="never">
<div ref="printBody"
<div id="printBody"
:class="process.status != 'todo' ? `wf-theme-${theme}`: ''">
<!-- 自定义表单区域 -->

Loading…
Cancel
Save