Files
his/openhis-ui-vue3/src/components/Auto/printBills/wristBill.vue
zhangfei 9c3e603b94 Fix Bug #443: 手术计费:点击签发耗材时异常报错
当手术计费弹窗中点击"签发"耗材时,因耗材的locationId(发放库房)为空导致后端异常。
在DoctorStationAdviceAppServiceImpl.handDevice方法中,当locationId为null时,使用登录用户的科室ID作为默认值,
与NurseBillingAppService中的处理方式保持一致。
2026-05-08 09:14:18 +08:00

116 lines
3.5 KiB
Vue
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="printWrist">
<div id="div1" class="printView_content">
<div style="margin: 1px;font-size: 12px">
<span>姓名: </span>
<span>{{ printData.patientName }}</span>
<span style="position: absolute; left: 110px">病历号:</span>
<span style="position: absolute; left: 155px">{{ printData.hisId }}</span>
<span style="position: absolute; left: 250px">入院时间:</span>
<span style="position: absolute; left: 305px">{{ printData.checkInWardTime? printData.checkInWardTime.substr(0,16):'' }}</span>
</div>
<div style="margin: 1px;font-size: 12px">
<span>性别: </span>
<span>{{ printData.gender? printData.gender.display:'' }}</span>
<span style="position: absolute; left: 110px">科室:</span>
<span style="position: absolute; left: 140px">{{ printData.dept }}</span>
</div>
<div style="margin-top: 2px;font-size: 12px">
<span>床号: </span>
<span>{{ printData.bedName }}</span>
<span style="position: absolute; left: 110px">分级:</span>
<span style="position: absolute; left: 140px">{{ printData.triageLevel }}</span>
</div>
</div>
<div id="qrcode" ref="refQr" style="padding-top: 1px" />
</div>
</template>
<script>
import QRCode from 'qrcodejs2'
// 迁移到 hiprint
import { simplePrint, PRINT_TEMPLATE } from '@/utils/printUtils.js'
export default {
name: 'WristPrint',
data() {
return {
printData: {
patientName: '',
deptName: '',
triageLevel: '',
triageTime: '',
hisId: '11111',
lastId: ''
}
}
},
mounted() {
},
updated() {
this.initBarCode()
},
methods: {
initBarCode() {
this.$nextTick(() => {
if (this.lastId !== this.printData.hisId) {
new QRCode('qrcode', {
text: this.printData.hisId,
width: 40,
height: 40,
colorDark: '#000000',
colorLight: '#ffffff',
correctLevel: QRCode.CorrectLevel.H
})
}
this.lastId = this.printData.hisId
})
},
clear() {
document.getElementById('qrcode').innerHTML = ''
},
/**
* 使用 hiprint 执行打印
* @param {boolean} preview 是否预览hiprint暂不支持预览参数保留兼容性
* @param {string} printerName 打印机名称
*/
async execPrint(preview, printerName) {
try {
// 构建打印数据
const printData = {
patientName: this.printData.patientName,
hisId: this.printData.hisId,
gender: this.printData.gender ? this.printData.gender.display : '',
dept: this.printData.dept,
bedName: this.printData.bedName,
triageLevel: this.printData.triageLevel,
checkInWardTime: this.printData.checkInWardTime
}
// 使用 hiprint 打印
await simplePrint(PRINT_TEMPLATE.WRIST_BAND, printData, printerName)
} catch (error) {
console.error('腕带打印失败:', error)
if (this.openMesBox) {
this.openMesBox('6', '打印失败: ' + (error.message || '未知错误'))
}
}
}
}
}
</script>
<style scoped lang="less">
.printWrist {
display: grid;
width: 460px;
grid-template-columns: 330px 40px;
height: 45px;
.printView_content{
display: grid;
padding-top: 1px;
padding-left: 60px;
grid-template-rows: repeat(3,14px);
}
}
</style>