fix(common): 统一异常处理并迁移打印功能到hiprint
- 替换所有System.out.println和printStackTrace为slf4j日志记录 - 在BeanUtils、AuditFieldUtil、DateUtils、ServletUtils等工具类中添加Logger实例 - 在Flowable相关控制器和服务中统一错误日志记录格式 - 在代码生成器中添加日志记录功能 - 将前端打印组件从Lodop迁移到hiprint打印方案 - 更新体温单打印功能使用hiprint预览打印 - 移除调试用的console.log语句 - 修复打印模板中线条元素类型定义
This commit is contained in:
@@ -60,7 +60,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {getLodop} from '../../../plugins/print/LodopFuncs'
|
||||
// 迁移到 hiprint
|
||||
import { simplePrint, PRINT_TEMPLATE } from '@/utils/printUtils.js'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
export default {
|
||||
@@ -76,18 +77,38 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
printTest() {
|
||||
const LODOP = getLodop()
|
||||
LODOP.PRINT_INIT('')
|
||||
LODOP.ADD_PRINT_TABLE(100, 35, 700, 900, document.getElementById('div2').innerHTML)
|
||||
LODOP.ADD_PRINT_HTM(20, 40, '100%', 100, document.getElementById('div1').innerHTML)
|
||||
LODOP.SET_PRINT_PAGESIZE(0, '148mm', '210mm', '') // 设置横向打印
|
||||
// LODOP.SET_SHOW_MODE('LANDSCAPE_DEFROTATED', 1);// 横向时的正向显示
|
||||
LODOP.PREVIEW() // 打印预览
|
||||
// LODOP.PRINT(); // 直接打印
|
||||
/**
|
||||
* 使用 hiprint 执行打印
|
||||
*/
|
||||
async printTest() {
|
||||
try {
|
||||
// 构建打印数据
|
||||
const recordData = (this.printData.recordData || []).map(item => ({
|
||||
moTime: item.moTime ? item.moTime.substring(0, 16) : '',
|
||||
orderName: item.orderName || '',
|
||||
flag: item.flag || '',
|
||||
doseOnceUnit: (item.doseOnce || '') + (item.doseUnit || ''),
|
||||
freqName: item.freqName || '',
|
||||
usageName: item.usageName || ''
|
||||
}))
|
||||
|
||||
const printData = {
|
||||
hospitalName: this.userStore.hospitalName,
|
||||
encounterLocationName: this.printData.patientInfo ? this.printData.patientInfo.encounterLocationName : '',
|
||||
name: this.printData.patientInfo ? this.printData.patientInfo.name : '',
|
||||
sexName: this.printData.patientInfo ? this.printData.patientInfo.sexName : '',
|
||||
patientAge: this.printData.patientInfo ? this.printData.patientInfo.patientAge : '',
|
||||
hisNo: this.printData.patientInfo ? this.printData.patientInfo.hisNo : '',
|
||||
deptName: this.printData.patientInfo ? this.printData.patientInfo.deptName : '',
|
||||
recordData: recordData
|
||||
}
|
||||
// 使用 hiprint 打印(复用医嘱执行单模板)
|
||||
await simplePrint(PRINT_TEMPLATE.EXE_ORDER_SHEET, printData)
|
||||
} catch (error) {
|
||||
console.error('输液执行单打印失败:', error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user