bug280 会诊管理-》门诊会诊申请管理-》【打印】不是打印某一条会诊记录的申请单 打印表格数据
This commit is contained in:
@@ -1,27 +1,185 @@
|
|||||||
{
|
{
|
||||||
"panels": [
|
"panels": [
|
||||||
{
|
{
|
||||||
"height": 297,
|
|
||||||
"index": 1,
|
"index": 1,
|
||||||
"name": "会诊申请单",
|
"name": "会诊申请列表",
|
||||||
"paperFooter": 780,
|
"paperType": "自定义",
|
||||||
|
"height": 210,
|
||||||
|
"width": 297,
|
||||||
|
"paperList": {
|
||||||
|
"type": "自定义",
|
||||||
|
"width": 297,
|
||||||
|
"height": 210
|
||||||
|
},
|
||||||
"paperHeader": 0,
|
"paperHeader": 0,
|
||||||
"paperList": {"height": 297, "type": "A4", "width": 210},
|
"paperFooter": 794,
|
||||||
"paperNumberDisabled": true,
|
"paperNumberDisabled": true,
|
||||||
"paperType": "A4",
|
"paperNumberContinue": true,
|
||||||
"printElements": [
|
"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": {
|
||||||
{"options": {"field": "patientName", "fontSize": 12, "height": 15, "left": 10, "title": "姓名:", "top": 60, "width": 80, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}},
|
"left": 0,
|
||||||
{"options": {"field": "gender", "fontSize": 12, "height": 15, "left": 300, "title": "性别:", "top": 60, "width": 100, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}},
|
"top": 8,
|
||||||
{"options": {"field": "age", "fontSize": 12, "height": 15, "left": 150, "title": "年龄:", "top": 60, "width": 100, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}},
|
"height": 24,
|
||||||
{"options": {"field": "deptName", "fontSize": 12, "height": 15, "left": 10, "title": "科室:", "top": 80, "width": 190, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}},
|
"width": 820,
|
||||||
{"options": {"field": "diagnosis", "fontSize": 12, "height": 25, "left": 10, "title": "初步诊断:", "top": 100, "width": 400, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}},
|
"title": "会诊申请列表",
|
||||||
{"options": {"field": "consultationReason", "fontSize": 12, "height": 50, "left": 10, "title": "会诊目的:", "top": 130, "width": 190, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}},
|
"fontSize": 18,
|
||||||
{"options": {"field": "applyTime", "fontSize": 12, "height": 15, "left": 10, "title": "申请时间:", "top": 190, "width": 300, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}},
|
"fontWeight": "bold",
|
||||||
{"options": {"field": "applyDoctor", "fontSize": 12, "height": 15, "left": 400, "title": "申请医生:", "top": 190, "width": 300, "hideTitle": false}, "printElementType": {"title": "文本", "type": "text"}}
|
"textAlign": "center"
|
||||||
],
|
},
|
||||||
"width": 210
|
"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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -377,7 +377,6 @@ import { Search, Refresh, Printer, Edit, View, Delete } from '@element-plus/icon
|
|||||||
import { queryConsultationListPage, cancelConsultation, saveConsultation, getConsultationOpinions } from './api'
|
import { queryConsultationListPage, cancelConsultation, saveConsultation, getConsultationOpinions } from './api'
|
||||||
import { simplePrint, PRINT_TEMPLATE } from '@/utils/printUtils.js'
|
import { simplePrint, PRINT_TEMPLATE } from '@/utils/printUtils.js'
|
||||||
import { formatDate } from '@/utils/index.js'
|
import { formatDate } from '@/utils/index.js'
|
||||||
import useUserStore from '@/store/modules/user'
|
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const saving = ref(false)
|
const saving = ref(false)
|
||||||
@@ -549,33 +548,33 @@ const handleCurrentChange = (val) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handlePrint = async (row) => {
|
const handlePrint = async (row) => {
|
||||||
// 如果传入了具体行数据,则只打印该行;否则打印所有数据
|
const printRows = row && row.consultationId ? [row] : tableData.value
|
||||||
const printRows = row ? [row] : tableData.value;
|
|
||||||
|
|
||||||
if (printRows.length === 0) {
|
if (printRows.length === 0) {
|
||||||
ElMessage.warning('没有可打印的数据');
|
ElMessage.warning('没有可打印的数据')
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const userStore = useUserStore();
|
|
||||||
const hospitalName = userStore.tenantName || userStore.hospitalName || '';
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const printDataList = printRows.map(printRow => ({
|
const consultationRows = printRows.map(printRow => ({
|
||||||
hospitalName,
|
consultationId: printRow.consultationId || '',
|
||||||
|
urgent: printRow.consultationUrgency === '2' ? '√' : '',
|
||||||
patientName: printRow.patientName || '',
|
patientName: printRow.patientName || '',
|
||||||
gender: printRow.genderEnum === 1 ? '男' : '女',
|
consultationDate: formatDate(printRow.consultationDate),
|
||||||
age: printRow.age || '',
|
department: printRow.department || '',
|
||||||
deptName: printRow.department || '',
|
invitedObject: printRow.invitedObject || '',
|
||||||
diagnosis: printRow.provisionalDiagnosis || '',
|
consultationRequestDate: formatDate(printRow.consultationRequestDate),
|
||||||
consultationReason: printRow.consultationPurpose || '',
|
requestingPhysician: printRow.requestingPhysician || '',
|
||||||
applyTime: printRow.consultationRequestDate || '',
|
submitted: printRow.consultationStatus >= STATUS.SUBMITTED ? '√' : '',
|
||||||
applyDoctor: printRow.requestingPhysician || ''
|
ended: printRow.consultationStatus === STATUS.ENDED ? '√' : ''
|
||||||
}));
|
}))
|
||||||
await simplePrint(PRINT_TEMPLATE.CONSULTATION, printDataList);
|
await simplePrint(PRINT_TEMPLATE.CONSULTATION, { consultationRows }, undefined, {
|
||||||
|
title: '会诊申请列表',
|
||||||
|
width: 297,
|
||||||
|
height: 210
|
||||||
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('会诊申请单打印失败:', error);
|
console.error('会诊申请单打印失败:', error)
|
||||||
ElMessage.error('打印失败');
|
ElMessage.error('打印失败')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -840,4 +839,3 @@ onMounted(() => {
|
|||||||
color: #909399;
|
color: #909399;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user