This commit is contained in:
lxd 2025-03-20 17:40:44 +08:00
commit cb1d23a5d6
9 changed files with 924 additions and 109 deletions

View File

@ -68,7 +68,7 @@
.report-item {
margin-bottom: 40px;
border: 1px solid #e0e0e0;
border: 1px solid #000;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
@ -79,14 +79,14 @@
}
.report-title {
background-color: #4a90e2;
color: white;
background-color: white;
color: black;
padding: 15px;
font-size: 18px;
/* 这里控制字体大小 */
font-weight: bold;
/* 这里控制字体粗细 */
border-bottom: 1px solid #e0e0e0;
border-bottom: 1px solid #000;
}
.report-content {
@ -295,9 +295,8 @@
.general-exam .exam-table td {
padding: 8px !important;
font-size: 18px !important;
line-height: 1.5;
height: 40px;
/* 降低单元格高度 */
line-height: 1.5;
height: 40px; /* 降低单元格高度 */
}
/* 一般检查的小结 */
@ -355,8 +354,8 @@
.report-title {
padding: 8px 10px;
font-size: 16px;
background-color: #4a90e2 !important;
color: white !important;
background-color: white !important;
color: black !important;
}
/* 内容区域 */
@ -560,6 +559,15 @@
text-align: center !important;
font-weight: bold !important;
}
.preface-paragraphs {
margin-bottom: 20px !important;
line-height: 1.8 !important; /* 打印时保持相同的行间距 */
}
.preface-paragraphs p {
margin-bottom: 15px !important; /* 打印时保持段落间距 */
}
}
/* 添加首页样式 */
@ -634,6 +642,7 @@
}
.preface-content .hospital-name {
margin-top: 60px;
margin-bottom: 20px;
font-weight: normal;
}
@ -737,7 +746,13 @@
}
.preface-paragraphs {
margin-bottom: 20px;
margin-bottom: 40px;
line-height: 2.5; /* 增加行间距 */
}
.preface-paragraphs p {
margin-bottom: 40px; /* 段落之间的间距 */
line-height: 2.5; /* 段落内的行间距 */
}
.preface-footer {
@ -745,6 +760,7 @@
}
.hospital-name {
margin-top: 60px;
font-weight: bold;
}
@ -839,7 +855,8 @@
</div>
<div class="repott_concent" style="top: -350px;">
<div style="display: flex; align-items: flex-start; justify-content: center; margin-bottom: 20px;">
<img src="/inspect/首页标签.png" alt="logo" style="width: 85px; height: 92px; ">
<img src="/首页标签.png" alt="logo"
style="width: 85px; height: 92px; ">
<div>
<div class="repott_concent_area">
<div class="repott_concent_title">健康</div>
@ -880,6 +897,9 @@
class="person_content">--</span>
</div>
</div>
<div style="text-align: center; margin-top: 80px;">
<span style="font-size: 18px;">兴和县卫生健康委员会</span>
</div>
</div>
<!-- 添加 first-page-number 类 -->
<div class="page-number first-page-number">第1页</div>
@ -899,15 +919,15 @@
<p class="preface-greeting">尊敬的<span class="underline"></span>先生/女士:</p>
<div class="preface-paragraphs">
<p>您好!欢迎参加国家基本公共卫生服务老年人健康体检项目。</p>
<p style="line-height: 2.5; margin-bottom: 40px;">您好!欢迎参加国家基本公共卫生服务老年人健康体检项目。</p>
<p>健康体检是在自我感觉健康的情况下,通过医学手段对身体各脏器的状态进行的检测。定期的健康体检可以帮助您及早发现健康状态下的危机,为您的健康保驾护航。</p>
<p style="line-height: 2.5; margin-bottom: 40px;">健康体检是在自我感觉健康的情况下,通过医学手段对身体各脏器的状态进行的检测。定期的健康体检可以帮助您及早发现健康状态下的危机,为您的健康保驾护航。</p>
<p>希望您仔细阅读并妥善保管这份体检报告,给予充分的重视。如有疑问请及时与我院进行联系。</p>
<p style="line-height: 2.5; margin-bottom: 40px;">希望您仔细阅读并妥善保管这份体检报告,给予充分的重视。如有疑问请及时与我院进行联系。</p>
<p>我们希望能够与您建立长期的联系,并为您建立健康档案,以便对您的健康状态进行长期的追踪,为您的健康提供长期的帮助和服务。</p>
<p style="line-height: 2.5; margin-bottom: 40px;">我们希望能够与您建立长期的联系,并为您建立健康档案,以便对您的健康状态进行长期的追踪,为您的健康提供长期的帮助和服务。</p>
<p>由于体检项目和检测手段所限,一次体检不能全部检出身体中的潜在隐患,一旦发现身体出现不适,请及时到医院进行就诊。</p>
<p style="line-height: 2.5; margin-bottom: 40px;">由于体检项目和检测手段所限,一次体检不能全部检出身体中的潜在隐患,一旦发现身体出现不适,请及时到医院进行就诊。</p>
</div>
<div class="preface-footer">

View File

@ -1,50 +1,55 @@
import request from '@/config/axios'
// pacs抓取数据 VO
export interface PacsDataVO {
id: number // 主键
code: string // 体检编号
data: string // 数据
time: Date // 监测时间
equipmentManufacturerModel: string // 设备厂商型号
item: string // 项目
type: string // 类型
remark: string // 备注
delFlag: number // 是否删除(0-未删除1-已删除)
createId: string // 创建人
createTime: Date // 创建时间
personName: string // 检测者姓名
}
// pacs抓取数据 API
export const PacsDataApi = {
// 查询pacs抓取数据分页
getPacsDataPage: async (params: any) => {
return await request.get({ url: `/inspect/pacs-data/page`, params })
},
// 查询pacs抓取数据详情
getPacsData: async (id: number) => {
return await request.get({ url: `/inspect/pacs-data/get?id=` + id })
},
// 新增pacs抓取数据
createPacsData: async (data: PacsDataVO) => {
return await request.post({ url: `/inspect/pacs-data/create`, data })
},
// 修改pacs抓取数据
updatePacsData: async (data: PacsDataVO) => {
return await request.put({ url: `/inspect/pacs-data/update`, data })
},
// 删除pacs抓取数据
deletePacsData: async (id: number) => {
return await request.delete({ url: `/inspect/pacs-data/delete?id=` + id })
},
// 导出pacs抓取数据 Excel
exportPacsData: async (params) => {
return await request.download({ url: `/inspect/pacs-data/export-excel`, params })
},
}
import request from '@/config/axios'
// pacs抓取数据 VO
export interface PacsDataVO {
id: number // 主键
code: string // 体检编号
data: string // 数据
time: Date // 监测时间
equipmentManufacturerModel: string // 设备厂商型号
item: string // 项目
type: string // 类型
remark: string // 备注
delFlag: number // 是否删除(0-未删除1-已删除)
createId: string // 创建人
createTime: Date // 创建时间
personName: string // 检测者姓名
}
// pacs抓取数据 API
export const PacsDataApi = {
// 查询pacs抓取数据分页
getPacsDataPage: async (params: any) => {
return await request.get({ url: `/inspect/pacs-data/page`, params })
},
// 查询pacs抓取数据详情
getPacsData: async (id: number) => {
return await request.get({ url: `/inspect/pacs-data/get?id=` + id })
},
// 新增pacs抓取数据
createPacsData: async (data: PacsDataVO) => {
return await request.post({ url: `/inspect/pacs-data/create`, data })
},
// 修改pacs抓取数据
updatePacsData: async (data: PacsDataVO) => {
return await request.put({ url: `/inspect/pacs-data/update`, data })
},
// 删除pacs抓取数据
deletePacsData: async (id: number) => {
return await request.delete({ url: `/inspect/pacs-data/delete?id=` + id })
},
// 导出pacs抓取数据 Excel
exportPacsData: async (params) => {
return await request.download({ url: `/inspect/pacs-data/export-excel`, params })
},
// 获取pacs抓取数据详情
getPacsDataDetail: async (code: string) => {
return await request.get({ url: `/inspect/pacs-data/getList?code=` + code })
}
}

View File

@ -107,5 +107,9 @@ export const PatientApi = {
// 保存汇总结果
updatemedicalSn: async (data: PatientVO) => {
return await request.put({ url: `/inspect/patient/updatesummary`, data })
},
//获取中医体质辨识结果
getZytzInfo: async (medicalSn: string, cardId: string) => {
return await request.put({ url: `/inspect/patient/syncPatientZyInfo?medicalSn=` + medicalSn + `&cardId=` + cardId })
}
}

View File

@ -0,0 +1,45 @@
import request from '@/config/axios'
// 汇总模板 VO
export interface TemplateVO {
id: number // 主键id
type: string // 类型
status: string // 状态
content: string // 模板内容
orderNum: number // 排序
createId: string // 创建人
contentName: string // 模板名称
}
// 汇总模板 API
export const TemplateApi = {
// 查询汇总模板分页
getTemplatePage: async (params: any) => {
return await request.get({ url: `/inspect/template/page`, params })
},
// 查询汇总模板详情
getTemplate: async (id: number) => {
return await request.get({ url: `/inspect/template/get?id=` + id })
},
// 新增汇总模板
createTemplate: async (data: TemplateVO) => {
return await request.post({ url: `/inspect/template/create`, data })
},
// 修改汇总模板
updateTemplate: async (data: TemplateVO) => {
return await request.put({ url: `/inspect/template/update`, data })
},
// 删除汇总模板
deleteTemplate: async (id: number) => {
return await request.delete({ url: `/inspect/template/delete?id=` + id })
},
// 导出汇总模板 Excel
exportTemplate: async (params) => {
return await request.download({ url: `/inspect/template/export-excel`, params })
},
}

View File

@ -0,0 +1,172 @@
<template>
<el-drawer
v-model="visible"
title="诊断模板"
direction="rtl"
size="30%"
:destroy-on-close="false"
:before-close="handleClose"
>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="模板名称" prop="contentName">
<el-input
v-model="queryParams.contentName"
placeholder="请输入模板名称"
clearable
@keyup.enter="handleQuery"
class="!w-160px"
/>
</el-form-item>
<el-form-item label="模板类型" prop="type" class="w-200px">
<el-select v-model="queryParams.type" placeholder="请选择模板类型" clearable>
<el-option label="一般检查" value="一般检查" />
<el-option label="超声" value="超声" />
<el-option label="心电图" value="心电图" />
<el-option label="血常规" value="血常规" />
<el-option label="尿常规" value="尿常规" />
<el-option label="生化" value="生化" />
<el-option label="通用" value="通用" />
<el-option label="汇总" value="汇总" />
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table
v-loading="loading"
:data="list"
:stripe="true"
:show-overflow-tooltip="true"
:header-cell-style="{ background: 'rgb(235, 241, 250)', height: '56px', color: '#333333' }"
:row-style="{ height: '56px' }"
@row-click="handleRowClick"
>
<el-table-column label="主键" align="center" prop="id" v-if="false" />
<el-table-column label="模板名称" align="center" prop="contentName" />
<el-table-column label="模板内容" align="center" prop="content" />
<el-table-column label="模板类型" align="center" prop="type" />
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
</el-drawer>
</template>
<script setup lang="ts">
import { ref, computed, watch, nextTick } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { TemplateApi, TemplateVO } from '@/api/inspect/inspecttemplate'
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<TemplateVO[]>([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
id: undefined,
type: undefined,
status: undefined,
content: undefined,
orderNum: undefined,
contentName: undefined
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
const Type = ref()
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
queryParams.type = Type.value
const data = await TemplateApi.getTemplatePage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
Type.value = queryParams.type
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
// propsemits
const props = defineProps({
modelValue: {
type: Boolean,
default: false
},
templateType: {
type: String,
required: true
}
})
const emit = defineEmits(['update:modelValue', 'select-template'])
//
const visible = computed({
get: () => props.modelValue,
set: (val) => emit('update:modelValue', val)
})
//
watch(visible, (newVal) => {
if (newVal) {
Type.value = props.templateType
getList()
}
})
//
const handleClose = (done) => {
done()
}
//
const handleRowClick = (template) => {
ElMessageBox.confirm('确认要使用该模板吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
emit('select-template', template.content)
visible.value = false //
ElMessage.success('模板应用成功')
})
.catch(() => {
//
})
}
</script>

View File

@ -255,7 +255,14 @@
<!-- 修改体检小结部分 -->
<div v-if="['ultrasound', 'ecg'].includes(currentTab)" class="findings-diagnosis-container">
<div class="findings-section">
<div class="section-title">检查所见</div>
<div class="section-title">
<span class="title-text">
检查所见
<el-button type="text" @click="openTemplateDrawer('finding')" :disabled="isReadOnly">
诊断模板
</el-button>
</span>
</div>
<textarea
v-model="conclusionData[currentTab].finding"
placeholder="请输入检查所见"
@ -265,7 +272,14 @@
</div>
<div class="diagnosis-section">
<div class="section-title">检查结果</div>
<div class="section-title">
<span class="title-text">
检查结果
<el-button type="text" @click="openTemplateDrawer('diagnosis')" :disabled="isReadOnly">
诊断模板
</el-button>
</span>
</div>
<textarea
v-model="conclusionData[currentTab].diagnosis"
placeholder="请输入检查结果"
@ -277,7 +291,14 @@
<!-- 其他类型使用单栏小结但不包括汇总标签 -->
<div v-else-if="currentTab !== 'summary'" class="summary-section">
<div class="section-title">体检小结</div>
<div class="section-title">
<span class="title-text">
体检小结
<el-button type="text" @click="openTemplateDrawer('summary')" :disabled="isReadOnly">
诊断模板
</el-button>
</span>
</div>
<textarea
v-model="currentSummary"
placeholder="输入多个以分号隔开"
@ -329,6 +350,12 @@
</div>
</div>
</div>
<!-- 添加模板抽屉组件 -->
<template-drawer
v-model="drawerVisible"
:template-type="currentTemplateType"
@select-template="insertTemplate"
/>
</template>
<script setup>
@ -343,6 +370,7 @@ import All from './All.vue' // 导入All组件用于超声、心电图等
import { PacsDataApi } from '@/api/inspect/inspectpacsdata' // PacsDataApi
import { getStrDictOptions } from '@/utils/dict'//
import Summary from './summary.vue' // Summary
import TemplateDrawer from './Drawer-Template.vue'
const dialogTitle = ref('体检报告')
@ -578,9 +606,6 @@ const loadPatientData = async (patient) => {
})
try {
// ID
const userProfile = await getUserProfile()
user.value = userProfile
//
const patientData = await PatientApi.getPatient(patient.id)
@ -653,6 +678,118 @@ const loadPatientData = async (patient) => {
examItems.value = groupedItems
conclusionData.value = conclusions
}
// PACS
const pacsTypes = {
blood: 'cbc',
urine: 'rt',
biochemical: 'bt'
}
// PACS
const pacsRequests = Object.entries(pacsTypes).map(async ([tabKey, pacsType]) => {
try {
const res = await PacsDataApi.getPacsDataDetail(patient.medicalSn)
if (res && res.length > 0) {
// item
const combinedItems = res.map(r => r.item).join('')
return { tabKey, data: combinedItems }
}
return null
} catch (error) {
console.error(`获取${pacsType}数据失败:`, error)
return null
}
})
const pacsResults = await Promise.all(pacsRequests)
// PACS
pacsResults.forEach(result => {
if (!result) return
const { tabKey, data } = result
const tabData = conclusionData.value[tabKey]
if (tabData) {
// summary
tabData.summary = data || ''
//
if (tabKey === 'blood' && examItems.value.blood) {
examItems.value.blood.forEach(item => {
if (item.name === '血常规') {
item.value = data || ''
item.itemStatus = '1'
}
})
}
// 尿
if (tabKey === 'urine' && examItems.value.urine) {
examItems.value.urine.forEach(item => {
if (item.name === '尿常规') {
item.value = data || ''
item.itemStatus = '1'
}
})
}
if (tabKey === 'biochemical' && examItems.value.biochemical) {
examItems.value.biochemical.forEach(item => {
if (item.name === '生化') {
item.value = data || ''
item.itemStatus = '1'
}
})
}
}
})
// PACS
const pacsRes = await PacsDataApi.getPacsDataDetail(patient.medicalSn)
// type
if (pacsRes && pacsRes.length > 0) {
//
const typeMap = {
cbc: { items: [], tabKey: 'blood', name: '血常规' },
rt: { items: [], tabKey: 'urine', name: '尿常规' },
bt: { items: [], tabKey: 'biochemical', name: '生化' }
}
//
pacsRes.forEach(item => {
switch(item.type.toLowerCase()) {
case 'cbc':
typeMap.cbc.items.push(item.item)
break
case 'rt':
typeMap.rt.items.push(item.item)
break
case 'bt':
typeMap.bt.items.push(item.item)
break
}
})
//
Object.values(typeMap).forEach(({ items, tabKey, name }) => {
if (items.length > 0) {
const combined = items.join('')
//
conclusionData.value[tabKey].summary = combined
//
if (examItems.value[tabKey]) {
examItems.value[tabKey].forEach(examItem => {
if (examItem.name === name) {
examItem.value = combined
examItem.itemStatus = '1'
}
})
}
}
})
}
} catch (error) {
console.error('加载患者数据失败:', error)
ElMessage.error('加载患者数据失败')
@ -1170,6 +1307,8 @@ const handleSync = async () => {
})
)
}
//
await PatientApi.getZytzInfo(medicalSn, currentSelectedPatient.cardId)
//
if (syncPromises.length === 0) {
@ -1202,7 +1341,7 @@ const handleSync = async () => {
//
await loadPatientData(currentSelectedPatient)
loading.close()
ElMessage.success(`同步成功`)
} catch (error) {
@ -1915,6 +2054,75 @@ const currentSummary = computed({
}
});
//
const drawerVisible = ref(false)
const currentTemplateType = ref('')
//
const openTemplateDrawer = (type) => {
if (isReadOnly.value) {
ElMessage.warning('已检查患者不可修改内容')
return
}
//
let templateType
switch (currentTab.value) {
case 'general':
templateType = '一般检查'
break
case 'ultrasound':
templateType = '超声'
break
case 'ecg':
templateType = '心电图'
break
case 'blood':
templateType = '血常规'
break
case 'urine':
templateType = '尿常规'
break
case 'biochemical':
templateType = '生化'
break
case 'summary':
templateType = '汇总'
break
default:
templateType = '通用'
}
currentTemplateType.value = templateType
drawerVisible.value = true
}
//
const insertTemplate = (templateContent) => {
if (isReadOnly.value) return
switch(currentTab.value) {
case 'ultrasound':
conclusionData.value.ultrasound.finding += templateContent
break
case 'ecg':
conclusionData.value.ecg.finding += templateContent
break
case 'blood':
case 'urine':
case 'biochemical':
case 'general':
conclusionData.value[currentTab.value].summary += templateContent
break
case 'summary':
summaryRef.value?.insertTemplate(templateContent)
break
}
drawerVisible.value = false
}
</script>
<style scoped>
@ -2929,4 +3137,44 @@ cursor: not-allowed;
white-space: nowrap;
display: block;
}
.section-title {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
}
.section-title .el-button {
padding: 0;
font-size: 14px;
}
.section-title {
margin-bottom: 10px;
}
.title-text {
display: flex;
align-items: center;
gap: 8px; /* 调整文字和按钮之间的间距 */
font-weight: bold;
}
.title-text .el-button {
padding: 0;
height: auto;
font-size: 14px;
margin-left: 8px;
font-weight: normal;
color: #409EFF;
}
.title-text .el-button:hover {
color: #66b1ff;
}
.title-text .el-button[disabled] {
color: #C0C4CC;
}
</style>

View File

@ -3,15 +3,7 @@
<div class="summary-header">
<div class="title-with-button">
<h3>体检汇总</h3>
<!-- <el-button
type="success"
circle
size="small"
@click="loadPatientItems"
class="refresh-button"
>
<el-icon><Refresh /></el-icon>
</el-button> -->
<el-button type="text" @click="openTemplateDrawer" style="margin-left: 15px;">诊断模板</el-button>
</div>
</div>
@ -26,6 +18,12 @@
></textarea>
</div>
</div>
<!-- 添加诊断模板抽屉组件 -->
<template-drawer
v-model="drawerVisible"
@select-template="insertTemplate"
/>
</div>
</template>
@ -35,6 +33,7 @@ import { PatientitemsApi } from '@/api/inspect/inspectpatientitems'
import { PatientApi } from '@/api/inspect/inspectpatient'
import { ElLoading, ElMessage } from 'element-plus'
import { Refresh } from '@element-plus/icons-vue'
import TemplateDrawer from '@/views/Department-entry/Drawer-Template.vue'
const props = defineProps({
patient: {
@ -75,7 +74,6 @@ const checkPatientStatus = () => {
if (props.patient?.status) {
//
isReadOnly.value = String(props.patient.status) === '1'
console.log('患者状态:', props.patient.status, '只读模式:', isReadOnly.value)
}
}
@ -132,7 +130,6 @@ const formatSummaryData = () => {
// DOM
const getDataFromDOM = () => {
console.log('尝试从DOM中获取数据...')
try {
const parentDoc = window.parent ? window.parent.document : document
@ -160,7 +157,6 @@ const getDataFromDOM = () => {
for (const selector of selectorList) {
const element = parentDoc.querySelector(selector)
if (element) {
console.log(`找到元素 ${selector}:`, element)
return element.value || ''
}
}
@ -177,28 +173,15 @@ const getDataFromDOM = () => {
const urineSummary = getElementValue(selectors.urine)
const biochemicalSummary = getElementValue(selectors.biochemical)
console.log('从DOM获取的数据:')
console.log('一般检查小结:', generalSummary)
console.log('超声检查所见:', ultrasoundFinding)
console.log('超声检查结果:', ultrasoundDiagnosis)
console.log('心电图检查所见:', ecgFinding)
console.log('心电图检查结果:', ecgDiagnosis)
console.log('血常规小结:', bloodSummary)
console.log('尿常规小结:', urineSummary)
console.log('生化小结:', biochemicalSummary)
//
if (!generalSummary) {
console.log('尝试从体检小结文本框获取数据...')
const generalTextarea =
parentDoc.querySelector('#体检小结') ||
parentDoc.querySelector('.体检小结') ||
parentDoc.querySelector('[placeholder*="体检小结"]')
if (generalTextarea) {
console.log('找到体检小结文本框:', generalTextarea)
const generalText = generalTextarea.value || ''
console.log('体检小结内容:', generalText)
//
return {
@ -242,17 +225,14 @@ const loadPatientItems = async () => {
background: 'rgba(255, 255, 255, 0.7)'
})
console.log('当前患者信息:', props.patient)
//
checkPatientStatus()
// 使propsconclusionData
if (props.conclusionData) {
console.log('从props获取conclusionData:', props.conclusionData)
summaryData.value = props.conclusionData
} else if (window.parent?.conclusionData) {
console.log('父窗口conclusionData:', window.parent.conclusionData)
const parentData = window.parent.conclusionData
//
@ -271,20 +251,17 @@ const loadPatientItems = async () => {
biochemical: { summary: parentData.biochemical?.summary || '' }
}
console.log('从父窗口获取的汇总数据:', summaryData.value)
} else {
console.warn('父窗口中没有找到conclusionData尝试从全局变量获取')
//
if (window.conclusionData) {
console.log('从全局变量获取conclusionData:', window.conclusionData)
summaryData.value = window.conclusionData
} else {
console.warn('全局变量中没有找到conclusionData尝试从props获取')
// props
if (props.reportData && props.reportData.conclusionData) {
console.log('从props.reportData中获取数据:', props.reportData.conclusionData)
summaryData.value = props.reportData.conclusionData
} else {
// DOM
@ -301,7 +278,6 @@ const loadPatientItems = async () => {
//
const formattedText = formatSummaryData()
console.log('格式化后的文本:', formattedText)
editableSummary.value = formattedText
loading.close()
} catch (error) {
@ -336,7 +312,6 @@ const saveSummary = async () => {
summaryResult: editableSummary.value
}
console.log('保存汇总数据:', saveData)
// API
const response = await PatientApi.updatemedicalSn(saveData)
@ -371,8 +346,6 @@ const queryPatientData = async () => {
try {
const response = await PatientApi.getByMedicalSn(props.patient.medicalSn)
if (response && response.code === 200 && response.data) {
console.log('查询到的患者数据:', response.data)
//
if (response.data.summaryResult) {
editableSummary.value = response.data.summaryResult
@ -381,7 +354,6 @@ const queryPatientData = async () => {
//
if (response.data.status) {
isReadOnly.value = response.data.status === 2
console.log('更新后的患者状态:', response.data.status, '只读模式:', isReadOnly.value)
}
}
} catch (error) {
@ -407,6 +379,29 @@ watch(() => props.patient, (newVal) => {
}
}, { deep: true, immediate: true })
//
const drawerVisible = ref(false)
//
const openTemplateDrawer = () => {
if (isReadOnly.value) {
ElMessage.warning('已检查患者不可修改汇总内容')
return
}
drawerVisible.value = true
}
//
const insertTemplate = (templateContent) => {
if (isReadOnly.value) return
//
editableSummary.value += templateContent
//
drawerVisible.value = false
}
//
defineExpose({ saveSummary })
</script>

View File

@ -0,0 +1,130 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="模板名称" prop="contentName">
<el-input v-model="formData.contentName" placeholder="请输入模板名称" />
</el-form-item>
<el-form-item label="模板类型" prop="type">
<el-select v-model="formData.type" placeholder="请选择模板类型">
<el-option label="一般检查" value="一般检查" />
<el-option label="超声" value="超声" />
<el-option label="心电图" value="心电图" />
<el-option label="血常规" value="血常规" />
<el-option label="尿常规" value="尿常规" />
<el-option label="生化" value="生化" />
<el-option label="通用" value="通用" />
<el-option label="汇总" value="汇总" />
</el-select>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="formData.status">
<el-radio-button label="启用" value="1" />
<el-radio-button label="禁用" value="0" />
</el-radio-group>
</el-form-item>
<el-form-item label="模板内容" prop="content">
<el-input
v-model="formData.content"
type="textarea"
:rows="10"
resize="none"
placeholder="请输入模板内容"
/>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { TemplateApi, TemplateVO } from '@/api/inspect/inspecttemplate'
/** 汇总模板 表单 */
defineOptions({ name: 'TemplateForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
type: undefined,
status: undefined,
content: undefined,
orderNum: undefined,
createId: undefined,
contentName: undefined,
})
const formRules = reactive({
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await TemplateApi.getTemplate(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
const data = formData.value as unknown as TemplateVO
if (formType.value === 'create') {
await TemplateApi.createTemplate(data)
message.success(t('common.createSuccess'))
} else {
await TemplateApi.updateTemplate(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
type: undefined,
status: undefined,
content: undefined,
orderNum: undefined,
createId: undefined,
contentName: undefined,
}
formRef.value?.resetFields()
}
</script>

View File

@ -0,0 +1,196 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="请选择状态"
clearable
class="!w-240px"
>
<el-option label="启用" value="1" />
<el-option label="禁用" value="0" />
</el-select>
</el-form-item>
<el-form-item label="模板名称" prop="contentName">
<el-input
v-model="queryParams.contentName"
placeholder="请输入模板名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
plain
@click="openForm('create')"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table
v-loading="loading"
:data="list"
:stripe="true"
:show-overflow-tooltip="true"
:header-cell-style="{ background: 'rgb(235, 241, 250)', height: '56px',color:'#333333' }"
:row-style="{ height: '56px' }"
>
<el-table-column label="主键" align="center" prop="id" v-if="false" />
<el-table-column label="模板名称" align="center" prop="contentName" />
<el-table-column label="模板内容" align="center" prop="content" />
<el-table-column label="状态" align="center" prop="status">
<template #default="scope">
<el-tag :type="scope.row.status === '1' ? 'success' : 'danger'">
{{ scope.row.status === '1' ? '启用' : '禁用' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="模板类型" align="center" prop="type" />
<el-table-column label="操作" align="center" min-width="120px">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<TemplateForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { TemplateApi, TemplateVO } from '@/api/inspect/inspecttemplate'
import TemplateForm from './TemplateForm.vue'
/** 汇总模板 列表 */
defineOptions({ name: 'InspectTemplate' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<TemplateVO[]>([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
id: undefined,
type: undefined,
status: undefined,
content: undefined,
orderNum: undefined,
contentName: undefined,
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await TemplateApi.getTemplatePage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await TemplateApi.deleteTemplate(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await TemplateApi.exportTemplate(queryParams)
download.excel(data, '汇总模板.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>