bug280 会诊管理-》门诊会诊申请管理-》【打印】不是打印某一条会诊记录的申请单 打印表格数据
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user