From 38b4ff5c924074fb4e258800c9f93741d510e5ab Mon Sep 17 00:00:00 2001 From: xiaoming <13564692840@163.com> Date: Wed, 15 Apr 2026 11:04:39 +0800 Subject: [PATCH] =?UTF-8?q?bug280=20=E4=BC=9A=E8=AF=8A=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E3=80=8B=E9=97=A8=E8=AF=8A=E4=BC=9A=E8=AF=8A=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E3=80=8B=E3=80=90=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E3=80=91=E4=B8=8D=E6=98=AF=E6=89=93=E5=8D=B0=E6=9F=90=E4=B8=80?= =?UTF-8?q?=E6=9D=A1=E4=BC=9A=E8=AF=8A=E8=AE=B0=E5=BD=95=E7=9A=84=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/Print/Consultation.json | 30 +++++++++---------- .../consultationapplication/index.vue | 17 +++++++---- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/openhis-ui-vue3/src/components/Print/Consultation.json b/openhis-ui-vue3/src/components/Print/Consultation.json index 89a934d1..9c7a9516 100644 --- a/openhis-ui-vue3/src/components/Print/Consultation.json +++ b/openhis-ui-vue3/src/components/Print/Consultation.json @@ -1,27 +1,27 @@ { "panels": [ { - "height": 210, + "height": 297, "index": 1, "name": "会诊申请单", - "paperFooter": 595.5, + "paperFooter": 780, "paperHeader": 0, - "paperList": {"height": 210, "type": "A4", "width": 210}, + "paperList": {"height": 297, "type": "A4", "width": 210}, "paperNumberDisabled": true, "paperType": "A4", "printElements": [ - {"options": {"fontSize": 14, "fontWeight": "bold", "height": 15, "left": 0, "textAlign": "center", "title": "会诊申请单", "top": 5, "width": 180}, "printElementType": {"title": "文本", "type": "text"}}, - {"options": {"field": "hospitalName", "fontSize": 10, "height": 10, "left": 0, "textAlign": "center", "title": "医院名称", "top": 22, "width": 180}, "printElementType": {"title": "文本", "type": "text"}}, - {"options": {"field": "patientName", "fontSize": 10, "height": 10, "left": 5, "title": "姓名:", "top": 40, "width": 60, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}}, - {"options": {"field": "gender", "fontSize": 10, "height": 10, "left": 70, "title": "性别:", "top": 40, "width": 30, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}}, - {"options": {"field": "age", "fontSize": 10, "height": 10, "left": 105, "title": "年龄:", "top": 40, "width": 40, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}}, - {"options": {"field": "deptName", "fontSize": 10, "height": 10, "left": 150, "title": "科室:", "top": 40, "width": 30, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}}, - {"options": {"field": "diagnosis", "fontSize": 10, "height": 20, "left": 5, "title": "初步诊断:", "top": 55, "width": 170, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}}, - {"options": {"field": "consultationReason", "fontSize": 10, "height": 40, "left": 5, "title": "会诊目的:", "top": 80, "width": 170, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}}, - {"options": {"field": "applyTime", "fontSize": 10, "height": 10, "left": 5, "title": "申请时间:", "top": 130, "width": 80, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}}, - {"options": {"field": "applyDoctor", "fontSize": 10, "height": 10, "left": 100, "title": "申请医生:", "top": 130, "width": 75, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}} + {"options": {"fontSize": 18, "fontWeight": "bold", "height": 20, "left": 0, "textAlign": "center", "title": "会诊申请单", "top": 10, "width": 210}, "printElementType": {"title": "文本", "type": "text"}}, + {"options": {"field": "hospitalName", "fontSize": 12, "height": 15, "left": 0, "textAlign": "center", "title": "医院名称", "top": 35, "width": 210}, "printElementType": {"title": "文本", "type": "text"}}, + {"options": {"field": "patientName", "fontSize": 12, "height": 15, "left": 10, "title": "姓名:", "top": 60, "width": 80, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}}, + {"options": {"field": "gender", "fontSize": 12, "height": 15, "left": 300, "title": "性别:", "top": 60, "width": 100, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}}, + {"options": {"field": "age", "fontSize": 12, "height": 15, "left": 150, "title": "年龄:", "top": 60, "width": 100, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}}, + {"options": {"field": "deptName", "fontSize": 12, "height": 15, "left": 10, "title": "科室:", "top": 80, "width": 190, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}}, + {"options": {"field": "diagnosis", "fontSize": 12, "height": 25, "left": 10, "title": "初步诊断:", "top": 100, "width": 400, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}}, + {"options": {"field": "consultationReason", "fontSize": 12, "height": 50, "left": 10, "title": "会诊目的:", "top": 130, "width": 190, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}}, + {"options": {"field": "applyTime", "fontSize": 12, "height": 15, "left": 10, "title": "申请时间:", "top": 190, "width": 300, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}}, + {"options": {"field": "applyDoctor", "fontSize": 12, "height": 15, "left": 400, "title": "申请医生:", "top": 190, "width": 300, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}} ], - "width": 180 + "width": 210 } ] -} +} \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/consultationmanagement/consultationapplication/index.vue b/openhis-ui-vue3/src/views/consultationmanagement/consultationapplication/index.vue index d915b961..09e1c8cf 100644 --- a/openhis-ui-vue3/src/views/consultationmanagement/consultationapplication/index.vue +++ b/openhis-ui-vue3/src/views/consultationmanagement/consultationapplication/index.vue @@ -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('打印失败')