bug280 会诊管理-》门诊会诊申请管理-》【打印】不是打印某一条会诊记录的申请单

This commit is contained in:
2026-04-15 11:04:39 +08:00
parent e294952a60
commit 38b4ff5c92
2 changed files with 26 additions and 21 deletions

View File

@@ -377,6 +377,7 @@ import { Search, Refresh, Printer, Edit, View, Delete } from '@element-plus/icon
import { queryConsultationListPage, cancelConsultation, saveConsultation, getConsultationOpinions } from './api'
import { simplePrint, PRINT_TEMPLATE } from '@/utils/printUtils.js'
import { formatDate } from '@/utils/index.js'
import useUserStore from '@/store/modules/user'
const loading = ref(false)
const saving = ref(false)
@@ -548,15 +549,19 @@ const handleCurrentChange = (val) => {
}
const handlePrint = async (row) => {
const printRow = row || currentRow.value
const printRows = tableData.value
if (!printRow) {
ElMessage.warning('请先选择一条记录')
if (printRows.length === 0) {
ElMessage.warning('没有可打印的数据')
return
}
const userStore = useUserStore()
const hospitalName = userStore.tenantName || userStore.hospitalName || ''
try {
const printData = {
const printDataList = printRows.map(printRow => ({
hospitalName,
patientName: printRow.patientName || '',
gender: printRow.genderEnum === 1 ? '男' : '女',
age: printRow.age || '',
@@ -565,8 +570,8 @@ const handlePrint = async (row) => {
consultationReason: printRow.consultationPurpose || '',
applyTime: printRow.consultationRequestDate || '',
applyDoctor: printRow.requestingPhysician || ''
}
await simplePrint(PRINT_TEMPLATE.CONSULTATION, printData)
}))
await simplePrint(PRINT_TEMPLATE.CONSULTATION, printDataList)
} catch (error) {
console.error('会诊申请单打印失败:', error)
ElMessage.error('打印失败')