From 42d9fb7ac2dffa9f8c52fa9c4c71d255fd6df856 Mon Sep 17 00:00:00 2001 From: xiaoming <13564692840@163.com> Date: Wed, 6 May 2026 13:52:21 +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=20=E6=89=93=E5=8D=B0=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/Print/Consultation.json | 194 ++++++++++++++++-- .../consultationapplication/index.vue | 44 ++-- 2 files changed, 197 insertions(+), 41 deletions(-) diff --git a/openhis-ui-vue3/src/components/Print/Consultation.json b/openhis-ui-vue3/src/components/Print/Consultation.json index 9c7a9516..eecf4a49 100644 --- a/openhis-ui-vue3/src/components/Print/Consultation.json +++ b/openhis-ui-vue3/src/components/Print/Consultation.json @@ -1,27 +1,185 @@ { "panels": [ { - "height": 297, "index": 1, - "name": "会诊申请单", - "paperFooter": 780, + "name": "会诊申请列表", + "paperType": "自定义", + "height": 210, + "width": 297, + "paperList": { + "type": "自定义", + "width": 297, + "height": 210 + }, "paperHeader": 0, - "paperList": {"height": 297, "type": "A4", "width": 210}, + "paperFooter": 794, "paperNumberDisabled": true, - "paperType": "A4", + "paperNumberContinue": true, "printElements": [ - {"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": 210 + { + "options": { + "left": 0, + "top": 8, + "height": 24, + "width": 820, + "title": "会诊申请列表", + "fontSize": 18, + "fontWeight": "bold", + "textAlign": "center" + }, + "printElementType": { + "title": "文本", + "type": "text" + } + }, + { + "options": { + "left": 10, + "top": 40, + "height": 720, + "width": 820, + "title": "会诊申请列表", + "field": "consultationRows", + "fontSize": 9, + "tableHeaderFontSize": 9, + "tableHeaderRowHeight": 9, + "tableHeaderRepeat": "every", + "tableHeaderBackground": "#f5f7fa", + "tableHeaderCellBorder": "border", + "tableBodyCellBorder": "border", + "tableBodyRowBorder": "border", + "coordinateSync": false, + "widthHeightSync": false, + "columns": [ + [ + { + "title": "ID", + "field": "consultationId", + "columnId": "consultationId", + "width": 125, + "checked": true, + "fixed": false, + "rowspan": 1, + "colspan": 1 + }, + { + "title": "急", + "field": "urgent", + "columnId": "urgent", + "width": 35, + "align": "center", + "halign": "center", + "checked": true, + "fixed": false, + "rowspan": 1, + "colspan": 1 + }, + { + "title": "病人姓名", + "field": "patientName", + "columnId": "patientName", + "width": 75, + "checked": true, + "fixed": false, + "rowspan": 1, + "colspan": 1 + }, + { + "title": "会诊时间", + "field": "consultationDate", + "columnId": "consultationDate", + "width": 115, + "checked": true, + "fixed": false, + "rowspan": 1, + "colspan": 1 + }, + { + "title": "申请科室", + "field": "department", + "columnId": "department", + "width": 90, + "checked": true, + "fixed": false, + "rowspan": 1, + "colspan": 1 + }, + { + "title": "邀请对象", + "field": "invitedObject", + "columnId": "invitedObject", + "width": 135, + "checked": true, + "fixed": false, + "rowspan": 1, + "colspan": 1 + }, + { + "title": "申请时间", + "field": "consultationRequestDate", + "columnId": "consultationRequestDate", + "width": 115, + "checked": true, + "fixed": false, + "rowspan": 1, + "colspan": 1 + }, + { + "title": "申请医师", + "field": "requestingPhysician", + "columnId": "requestingPhysician", + "width": 80, + "checked": true, + "fixed": false, + "rowspan": 1, + "colspan": 1 + }, + { + "title": "提交", + "field": "submitted", + "columnId": "submitted", + "width": 25, + "align": "center", + "halign": "center", + "checked": true, + "fixed": false, + "rowspan": 1, + "colspan": 1 + }, + { + "title": "结束", + "field": "ended", + "columnId": "ended", + "width": 25, + "align": "center", + "halign": "center", + "checked": true, + "fixed": false, + "rowspan": 1, + "colspan": 1 + } + ] + ] + }, + "printElementType": { + "title": "表格", + "type": "table", + "editable": true, + "columnDisplayEditable": true, + "columnDisplayIndexEditable": true, + "columnTitleEditable": true, + "columnResizable": true, + "columnAlignEditable": true, + "isEnableEditField": true, + "isEnableContextMenu": true, + "isEnableInsertRow": true, + "isEnableDeleteRow": true, + "isEnableInsertColumn": true, + "isEnableDeleteColumn": true, + "isEnableMergeCell": true + } + } + ] } ] -} \ 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 43b73914..77137538 100644 --- a/openhis-ui-vue3/src/views/consultationmanagement/consultationapplication/index.vue +++ b/openhis-ui-vue3/src/views/consultationmanagement/consultationapplication/index.vue @@ -377,7 +377,6 @@ 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) @@ -549,33 +548,33 @@ const handleCurrentChange = (val) => { } const handlePrint = async (row) => { - // 如果传入了具体行数据,则只打印该行;否则打印所有数据 - const printRows = row ? [row] : tableData.value; - + const printRows = row && row.consultationId ? [row] : tableData.value if (printRows.length === 0) { - ElMessage.warning('没有可打印的数据'); - return; + ElMessage.warning('没有可打印的数据') + return } - const userStore = useUserStore(); - const hospitalName = userStore.tenantName || userStore.hospitalName || ''; - try { - const printDataList = printRows.map(printRow => ({ - hospitalName, + const consultationRows = printRows.map(printRow => ({ + consultationId: printRow.consultationId || '', + urgent: printRow.consultationUrgency === '2' ? '√' : '', patientName: printRow.patientName || '', - gender: printRow.genderEnum === 1 ? '男' : '女', - age: printRow.age || '', - deptName: printRow.department || '', - diagnosis: printRow.provisionalDiagnosis || '', - consultationReason: printRow.consultationPurpose || '', - applyTime: printRow.consultationRequestDate || '', - applyDoctor: printRow.requestingPhysician || '' - })); - await simplePrint(PRINT_TEMPLATE.CONSULTATION, printDataList); + consultationDate: formatDate(printRow.consultationDate), + department: printRow.department || '', + invitedObject: printRow.invitedObject || '', + consultationRequestDate: formatDate(printRow.consultationRequestDate), + requestingPhysician: printRow.requestingPhysician || '', + submitted: printRow.consultationStatus >= STATUS.SUBMITTED ? '√' : '', + ended: printRow.consultationStatus === STATUS.ENDED ? '√' : '' + })) + await simplePrint(PRINT_TEMPLATE.CONSULTATION, { consultationRows }, undefined, { + title: '会诊申请列表', + width: 297, + height: 210 + }) } catch (error) { - console.error('会诊申请单打印失败:', error); - ElMessage.error('打印失败'); + console.error('会诊申请单打印失败:', error) + ElMessage.error('打印失败') } } @@ -840,4 +839,3 @@ onMounted(() => { color: #909399; } -