bug280 会诊管理-》门诊会诊申请管理-》【打印】不是打印某一条会诊记录的申请单
This commit is contained in:
@@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -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('打印失败')
|
||||
|
||||
Reference in New Issue
Block a user