fix(common): 统一异常处理并迁移打印功能到hiprint
- 替换所有System.out.println和printStackTrace为slf4j日志记录 - 在BeanUtils、AuditFieldUtil、DateUtils、ServletUtils等工具类中添加Logger实例 - 在Flowable相关控制器和服务中统一错误日志记录格式 - 在代码生成器中添加日志记录功能 - 将前端打印组件从Lodop迁移到hiprint打印方案 - 更新体温单打印功能使用hiprint预览打印 - 移除调试用的console.log语句 - 修复打印模板中线条元素类型定义
This commit is contained in:
@@ -501,6 +501,8 @@ import {
|
||||
getInspectionItemList
|
||||
} from '../api'
|
||||
import useUserStore from '@/store/modules/user.js'
|
||||
// 迁移到 hiprint
|
||||
import { simplePrint, PRINT_TEMPLATE, previewPrint } from '@/utils/printUtils.js'
|
||||
import {storeToRefs} from 'pinia'
|
||||
|
||||
// Props
|
||||
@@ -1366,8 +1368,6 @@ function handleSelectionChange(selection) {
|
||||
|
||||
// 打印申请单
|
||||
function handlePrint(row) {
|
||||
// console.log('打印申请单:', row)
|
||||
|
||||
// 切换到申请单TAB
|
||||
leftActiveTab.value = 'application'
|
||||
|
||||
@@ -1376,64 +1376,14 @@ function handlePrint(row) {
|
||||
|
||||
// 等待DOM更新后执行打印
|
||||
setTimeout(() => {
|
||||
// 添加打印样式
|
||||
const printStyle = document.createElement('style')
|
||||
printStyle.innerHTML = `
|
||||
@media print {
|
||||
body * {
|
||||
visibility: hidden;
|
||||
}
|
||||
.application-form,
|
||||
.application-form * {
|
||||
visibility: visible;
|
||||
}
|
||||
.application-form {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
}
|
||||
.el-tabs__header {
|
||||
display: none;
|
||||
}
|
||||
.el-tabs__content {
|
||||
padding: 0;
|
||||
}
|
||||
.section-header,
|
||||
.pagination-container,
|
||||
.inspection-selector,
|
||||
.selected-items-area,
|
||||
.actions {
|
||||
display: none !important;
|
||||
}
|
||||
.application-form .el-input__inner,
|
||||
.application-form .el-select .el-input__inner,
|
||||
.application-form .el-textarea__inner {
|
||||
border: 1px solid #ddd !important;
|
||||
background: white !important;
|
||||
}
|
||||
.application-form .el-checkbox__input.is-checked .el-checkbox__inner {
|
||||
background-color: #409eff;
|
||||
border-color: #409eff;
|
||||
}
|
||||
}
|
||||
`
|
||||
document.head.appendChild(printStyle)
|
||||
|
||||
// 执行打印
|
||||
window.print()
|
||||
|
||||
// 移除打印样式
|
||||
setTimeout(() => {
|
||||
document.head.removeChild(printStyle)
|
||||
}, 1000)
|
||||
|
||||
ElMessage.success('正在准备打印...')
|
||||
// 使用 hiprint 的 previewPrint 方法
|
||||
const printDom = document.querySelector('.application-form')
|
||||
if (printDom) {
|
||||
previewPrint(printDom)
|
||||
ElMessage.success('正在准备打印...')
|
||||
} else {
|
||||
ElMessage.warning('未找到打印内容')
|
||||
}
|
||||
}, 100)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user