Merge branch 'main' of http://114.55.171.231:3000/lxd/inspect-front
This commit is contained in:
commit
cb1d23a5d6
@ -68,7 +68,7 @@
|
|||||||
|
|
||||||
.report-item {
|
.report-item {
|
||||||
margin-bottom: 40px;
|
margin-bottom: 40px;
|
||||||
border: 1px solid #e0e0e0;
|
border: 1px solid #000;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
@ -79,14 +79,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.report-title {
|
.report-title {
|
||||||
background-color: #4a90e2;
|
background-color: white;
|
||||||
color: white;
|
color: black;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
/* 这里控制字体大小 */
|
/* 这里控制字体大小 */
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
/* 这里控制字体粗细 */
|
/* 这里控制字体粗细 */
|
||||||
border-bottom: 1px solid #e0e0e0;
|
border-bottom: 1px solid #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.report-content {
|
.report-content {
|
||||||
@ -296,8 +296,7 @@
|
|||||||
padding: 8px !important;
|
padding: 8px !important;
|
||||||
font-size: 18px !important;
|
font-size: 18px !important;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
height: 40px;
|
height: 40px; /* 降低单元格高度 */
|
||||||
/* 降低单元格高度 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 一般检查的小结 */
|
/* 一般检查的小结 */
|
||||||
@ -355,8 +354,8 @@
|
|||||||
.report-title {
|
.report-title {
|
||||||
padding: 8px 10px;
|
padding: 8px 10px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
background-color: #4a90e2 !important;
|
background-color: white !important;
|
||||||
color: white !important;
|
color: black !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 内容区域 */
|
/* 内容区域 */
|
||||||
@ -560,6 +559,15 @@
|
|||||||
text-align: center !important;
|
text-align: center !important;
|
||||||
font-weight: bold !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 {
|
.preface-content .hospital-name {
|
||||||
|
margin-top: 60px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
@ -737,7 +746,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.preface-paragraphs {
|
.preface-paragraphs {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 40px;
|
||||||
|
line-height: 2.5; /* 增加行间距 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.preface-paragraphs p {
|
||||||
|
margin-bottom: 40px; /* 段落之间的间距 */
|
||||||
|
line-height: 2.5; /* 段落内的行间距 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.preface-footer {
|
.preface-footer {
|
||||||
@ -745,6 +760,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.hospital-name {
|
.hospital-name {
|
||||||
|
margin-top: 60px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -839,7 +855,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="repott_concent" style="top: -350px;">
|
<div class="repott_concent" style="top: -350px;">
|
||||||
<div style="display: flex; align-items: flex-start; justify-content: center; margin-bottom: 20px;">
|
<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>
|
||||||
<div class="repott_concent_area">
|
<div class="repott_concent_area">
|
||||||
<div class="repott_concent_title">健康</div>
|
<div class="repott_concent_title">健康</div>
|
||||||
@ -880,6 +897,9 @@
|
|||||||
class="person_content">--</span>
|
class="person_content">--</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="text-align: center; margin-top: 80px;">
|
||||||
|
<span style="font-size: 18px;">兴和县卫生健康委员会</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 添加 first-page-number 类 -->
|
<!-- 添加 first-page-number 类 -->
|
||||||
<div class="page-number first-page-number">第1页</div>
|
<div class="page-number first-page-number">第1页</div>
|
||||||
@ -899,15 +919,15 @@
|
|||||||
<p class="preface-greeting">尊敬的<span class="underline"></span>先生/女士:</p>
|
<p class="preface-greeting">尊敬的<span class="underline"></span>先生/女士:</p>
|
||||||
|
|
||||||
<div class="preface-paragraphs">
|
<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>
|
||||||
|
|
||||||
<div class="preface-footer">
|
<div class="preface-footer">
|
||||||
|
@ -47,4 +47,9 @@ export const PacsDataApi = {
|
|||||||
exportPacsData: async (params) => {
|
exportPacsData: async (params) => {
|
||||||
return await request.download({ url: `/inspect/pacs-data/export-excel`, 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 })
|
||||||
|
}
|
||||||
}
|
}
|
@ -107,5 +107,9 @@ export const PatientApi = {
|
|||||||
// 保存汇总结果
|
// 保存汇总结果
|
||||||
updatemedicalSn: async (data: PatientVO) => {
|
updatemedicalSn: async (data: PatientVO) => {
|
||||||
return await request.put({ url: `/inspect/patient/updatesummary`, data })
|
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 })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
45
src/api/inspect/inspecttemplate/index.ts
Normal file
45
src/api/inspect/inspecttemplate/index.ts
Normal 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 })
|
||||||
|
},
|
||||||
|
}
|
172
src/views/Department-entry/Drawer-Template.vue
Normal file
172
src/views/Department-entry/Drawer-Template.vue
Normal 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()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义props和emits
|
||||||
|
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>
|
@ -255,7 +255,14 @@
|
|||||||
<!-- 修改体检小结部分 -->
|
<!-- 修改体检小结部分 -->
|
||||||
<div v-if="['ultrasound', 'ecg'].includes(currentTab)" class="findings-diagnosis-container">
|
<div v-if="['ultrasound', 'ecg'].includes(currentTab)" class="findings-diagnosis-container">
|
||||||
<div class="findings-section">
|
<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
|
<textarea
|
||||||
v-model="conclusionData[currentTab].finding"
|
v-model="conclusionData[currentTab].finding"
|
||||||
placeholder="请输入检查所见"
|
placeholder="请输入检查所见"
|
||||||
@ -265,7 +272,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="diagnosis-section">
|
<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
|
<textarea
|
||||||
v-model="conclusionData[currentTab].diagnosis"
|
v-model="conclusionData[currentTab].diagnosis"
|
||||||
placeholder="请输入检查结果"
|
placeholder="请输入检查结果"
|
||||||
@ -277,7 +291,14 @@
|
|||||||
|
|
||||||
<!-- 其他类型使用单栏小结,但不包括汇总标签 -->
|
<!-- 其他类型使用单栏小结,但不包括汇总标签 -->
|
||||||
<div v-else-if="currentTab !== 'summary'" class="summary-section">
|
<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
|
<textarea
|
||||||
v-model="currentSummary"
|
v-model="currentSummary"
|
||||||
placeholder="输入多个以分号隔开"
|
placeholder="输入多个以分号隔开"
|
||||||
@ -329,6 +350,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 添加模板抽屉组件 -->
|
||||||
|
<template-drawer
|
||||||
|
v-model="drawerVisible"
|
||||||
|
:template-type="currentTemplateType"
|
||||||
|
@select-template="insertTemplate"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -343,6 +370,7 @@ import All from './All.vue' // 导入All组件用于超声、心电图等
|
|||||||
import { PacsDataApi } from '@/api/inspect/inspectpacsdata' // 导入PacsDataApi
|
import { PacsDataApi } from '@/api/inspect/inspectpacsdata' // 导入PacsDataApi
|
||||||
import { getStrDictOptions } from '@/utils/dict'//导入字典
|
import { getStrDictOptions } from '@/utils/dict'//导入字典
|
||||||
import Summary from './summary.vue' // 导入Summary组件用于汇总页面
|
import Summary from './summary.vue' // 导入Summary组件用于汇总页面
|
||||||
|
import TemplateDrawer from './Drawer-Template.vue'
|
||||||
|
|
||||||
|
|
||||||
const dialogTitle = ref('体检报告')
|
const dialogTitle = ref('体检报告')
|
||||||
@ -578,9 +606,6 @@ const loadPatientData = async (patient) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 获取用户信息和部门ID
|
|
||||||
const userProfile = await getUserProfile()
|
|
||||||
user.value = userProfile
|
|
||||||
|
|
||||||
// 获取患者基本信息
|
// 获取患者基本信息
|
||||||
const patientData = await PatientApi.getPatient(patient.id)
|
const patientData = await PatientApi.getPatient(patient.id)
|
||||||
@ -653,6 +678,118 @@ const loadPatientData = async (patient) => {
|
|||||||
examItems.value = groupedItems
|
examItems.value = groupedItems
|
||||||
conclusionData.value = conclusions
|
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) {
|
} catch (error) {
|
||||||
console.error('加载患者数据失败:', error)
|
console.error('加载患者数据失败:', error)
|
||||||
ElMessage.error('加载患者数据失败')
|
ElMessage.error('加载患者数据失败')
|
||||||
@ -1170,6 +1307,8 @@ const handleSync = async () => {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
// 如果需要,添加中医体质辨识报告请求
|
||||||
|
await PatientApi.getZytzInfo(medicalSn, currentSelectedPatient.cardId)
|
||||||
|
|
||||||
// 如果没有需要同步的项目,直接返回
|
// 如果没有需要同步的项目,直接返回
|
||||||
if (syncPromises.length === 0) {
|
if (syncPromises.length === 0) {
|
||||||
@ -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>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@ -2929,4 +3137,44 @@ cursor: not-allowed;
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
display: block;
|
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>
|
</style>
|
@ -3,15 +3,7 @@
|
|||||||
<div class="summary-header">
|
<div class="summary-header">
|
||||||
<div class="title-with-button">
|
<div class="title-with-button">
|
||||||
<h3>体检汇总</h3>
|
<h3>体检汇总</h3>
|
||||||
<!-- <el-button
|
<el-button type="text" @click="openTemplateDrawer" style="margin-left: 15px;">诊断模板</el-button>
|
||||||
type="success"
|
|
||||||
circle
|
|
||||||
size="small"
|
|
||||||
@click="loadPatientItems"
|
|
||||||
class="refresh-button"
|
|
||||||
>
|
|
||||||
<el-icon><Refresh /></el-icon>
|
|
||||||
</el-button> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -26,6 +18,12 @@
|
|||||||
></textarea>
|
></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 添加诊断模板抽屉组件 -->
|
||||||
|
<template-drawer
|
||||||
|
v-model="drawerVisible"
|
||||||
|
@select-template="insertTemplate"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -35,6 +33,7 @@ import { PatientitemsApi } from '@/api/inspect/inspectpatientitems'
|
|||||||
import { PatientApi } from '@/api/inspect/inspectpatient'
|
import { PatientApi } from '@/api/inspect/inspectpatient'
|
||||||
import { ElLoading, ElMessage } from 'element-plus'
|
import { ElLoading, ElMessage } from 'element-plus'
|
||||||
import { Refresh } from '@element-plus/icons-vue'
|
import { Refresh } from '@element-plus/icons-vue'
|
||||||
|
import TemplateDrawer from '@/views/Department-entry/Drawer-Template.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
patient: {
|
patient: {
|
||||||
@ -75,7 +74,6 @@ const checkPatientStatus = () => {
|
|||||||
if (props.patient?.status) {
|
if (props.patient?.status) {
|
||||||
// 同时处理字符串和数字类型的状态值
|
// 同时处理字符串和数字类型的状态值
|
||||||
isReadOnly.value = String(props.patient.status) === '1'
|
isReadOnly.value = String(props.patient.status) === '1'
|
||||||
console.log('患者状态:', props.patient.status, '只读模式:', isReadOnly.value)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,7 +130,6 @@ const formatSummaryData = () => {
|
|||||||
|
|
||||||
// 从DOM中获取各个标签页的数据
|
// 从DOM中获取各个标签页的数据
|
||||||
const getDataFromDOM = () => {
|
const getDataFromDOM = () => {
|
||||||
console.log('尝试从DOM中获取数据...')
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const parentDoc = window.parent ? window.parent.document : document
|
const parentDoc = window.parent ? window.parent.document : document
|
||||||
@ -160,7 +157,6 @@ const getDataFromDOM = () => {
|
|||||||
for (const selector of selectorList) {
|
for (const selector of selectorList) {
|
||||||
const element = parentDoc.querySelector(selector)
|
const element = parentDoc.querySelector(selector)
|
||||||
if (element) {
|
if (element) {
|
||||||
console.log(`找到元素 ${selector}:`, element)
|
|
||||||
return element.value || ''
|
return element.value || ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -177,28 +173,15 @@ const getDataFromDOM = () => {
|
|||||||
const urineSummary = getElementValue(selectors.urine)
|
const urineSummary = getElementValue(selectors.urine)
|
||||||
const biochemicalSummary = getElementValue(selectors.biochemical)
|
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) {
|
if (!generalSummary) {
|
||||||
console.log('尝试从体检小结文本框获取数据...')
|
|
||||||
const generalTextarea =
|
const generalTextarea =
|
||||||
parentDoc.querySelector('#体检小结') ||
|
parentDoc.querySelector('#体检小结') ||
|
||||||
parentDoc.querySelector('.体检小结') ||
|
parentDoc.querySelector('.体检小结') ||
|
||||||
parentDoc.querySelector('[placeholder*="体检小结"]')
|
parentDoc.querySelector('[placeholder*="体检小结"]')
|
||||||
|
|
||||||
if (generalTextarea) {
|
if (generalTextarea) {
|
||||||
console.log('找到体检小结文本框:', generalTextarea)
|
|
||||||
const generalText = generalTextarea.value || ''
|
const generalText = generalTextarea.value || ''
|
||||||
console.log('体检小结内容:', generalText)
|
|
||||||
|
|
||||||
// 更新汇总数据
|
// 更新汇总数据
|
||||||
return {
|
return {
|
||||||
@ -242,17 +225,14 @@ const loadPatientItems = async () => {
|
|||||||
background: 'rgba(255, 255, 255, 0.7)'
|
background: 'rgba(255, 255, 255, 0.7)'
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log('当前患者信息:', props.patient)
|
|
||||||
|
|
||||||
// 检查患者状态
|
// 检查患者状态
|
||||||
checkPatientStatus()
|
checkPatientStatus()
|
||||||
|
|
||||||
// 优先使用props中的conclusionData
|
// 优先使用props中的conclusionData
|
||||||
if (props.conclusionData) {
|
if (props.conclusionData) {
|
||||||
console.log('从props获取conclusionData:', props.conclusionData)
|
|
||||||
summaryData.value = props.conclusionData
|
summaryData.value = props.conclusionData
|
||||||
} else if (window.parent?.conclusionData) {
|
} else if (window.parent?.conclusionData) {
|
||||||
console.log('父窗口conclusionData:', window.parent.conclusionData)
|
|
||||||
const parentData = window.parent.conclusionData
|
const parentData = window.parent.conclusionData
|
||||||
|
|
||||||
// 复制父组件的数据到本地
|
// 复制父组件的数据到本地
|
||||||
@ -271,20 +251,17 @@ const loadPatientItems = async () => {
|
|||||||
biochemical: { summary: parentData.biochemical?.summary || '' }
|
biochemical: { summary: parentData.biochemical?.summary || '' }
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('从父窗口获取的汇总数据:', summaryData.value)
|
|
||||||
} else {
|
} else {
|
||||||
console.warn('父窗口中没有找到conclusionData,尝试从全局变量获取')
|
console.warn('父窗口中没有找到conclusionData,尝试从全局变量获取')
|
||||||
|
|
||||||
// 尝试从全局变量获取
|
// 尝试从全局变量获取
|
||||||
if (window.conclusionData) {
|
if (window.conclusionData) {
|
||||||
console.log('从全局变量获取conclusionData:', window.conclusionData)
|
|
||||||
summaryData.value = window.conclusionData
|
summaryData.value = window.conclusionData
|
||||||
} else {
|
} else {
|
||||||
console.warn('全局变量中没有找到conclusionData,尝试从props获取')
|
console.warn('全局变量中没有找到conclusionData,尝试从props获取')
|
||||||
|
|
||||||
// 尝试从props中获取数据
|
// 尝试从props中获取数据
|
||||||
if (props.reportData && props.reportData.conclusionData) {
|
if (props.reportData && props.reportData.conclusionData) {
|
||||||
console.log('从props.reportData中获取数据:', props.reportData.conclusionData)
|
|
||||||
summaryData.value = props.reportData.conclusionData
|
summaryData.value = props.reportData.conclusionData
|
||||||
} else {
|
} else {
|
||||||
// 尝试直接从父组件的DOM中获取数据
|
// 尝试直接从父组件的DOM中获取数据
|
||||||
@ -301,7 +278,6 @@ const loadPatientItems = async () => {
|
|||||||
|
|
||||||
// 格式化汇总数据并设置为可编辑文本
|
// 格式化汇总数据并设置为可编辑文本
|
||||||
const formattedText = formatSummaryData()
|
const formattedText = formatSummaryData()
|
||||||
console.log('格式化后的文本:', formattedText)
|
|
||||||
editableSummary.value = formattedText
|
editableSummary.value = formattedText
|
||||||
loading.close()
|
loading.close()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -336,7 +312,6 @@ const saveSummary = async () => {
|
|||||||
summaryResult: editableSummary.value
|
summaryResult: editableSummary.value
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('保存汇总数据:', saveData)
|
|
||||||
|
|
||||||
// 调用API保存数据
|
// 调用API保存数据
|
||||||
const response = await PatientApi.updatemedicalSn(saveData)
|
const response = await PatientApi.updatemedicalSn(saveData)
|
||||||
@ -371,8 +346,6 @@ const queryPatientData = async () => {
|
|||||||
try {
|
try {
|
||||||
const response = await PatientApi.getByMedicalSn(props.patient.medicalSn)
|
const response = await PatientApi.getByMedicalSn(props.patient.medicalSn)
|
||||||
if (response && response.code === 200 && response.data) {
|
if (response && response.code === 200 && response.data) {
|
||||||
console.log('查询到的患者数据:', response.data)
|
|
||||||
|
|
||||||
// 更新患者信息
|
// 更新患者信息
|
||||||
if (response.data.summaryResult) {
|
if (response.data.summaryResult) {
|
||||||
editableSummary.value = response.data.summaryResult
|
editableSummary.value = response.data.summaryResult
|
||||||
@ -381,7 +354,6 @@ const queryPatientData = async () => {
|
|||||||
// 如果患者状态已更新,检查是否需要设置只读
|
// 如果患者状态已更新,检查是否需要设置只读
|
||||||
if (response.data.status) {
|
if (response.data.status) {
|
||||||
isReadOnly.value = response.data.status === 2
|
isReadOnly.value = response.data.status === 2
|
||||||
console.log('更新后的患者状态:', response.data.status, '只读模式:', isReadOnly.value)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -407,6 +379,29 @@ watch(() => props.patient, (newVal) => {
|
|||||||
}
|
}
|
||||||
}, { deep: true, immediate: true })
|
}, { 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 })
|
defineExpose({ saveSummary })
|
||||||
</script>
|
</script>
|
||||||
|
130
src/views/inspect/inspecttemplate/TemplateForm.vue
Normal file
130
src/views/inspect/inspecttemplate/TemplateForm.vue
Normal 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) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
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>
|
196
src/views/inspect/inspecttemplate/index.vue
Normal file
196
src/views/inspect/inspecttemplate/index.vue
Normal 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>
|
Loading…
Reference in New Issue
Block a user