This commit is contained in:
Euni4U 2025-03-15 14:43:57 +08:00
commit ac31b6753d
2 changed files with 56 additions and 29 deletions

View File

@ -77,24 +77,27 @@ export const PatientApi = {
}, },
//获取检验报告 //获取检验报告
getReportTj: async (medicalSn: string,type:string) => { getReportTj: async (medicalSn: string, type: string) => {
return await request.get({ url: `/inspect/patient/getReportTj?medicalSn=` + medicalSn + `&type=` + type }) return await request.get({ url: `/inspect/patient/getReportTj?medicalSn=` + medicalSn + `&type=` + type })
}, },
//获取超声报告 //获取超声报告
getUSTj: async (medicalSn: string) => { getUSTj: async (medicalSn: string) => {
return await request.get({ url: `/inspect/patient/getUSTj?medicalSn=` + medicalSn}) return await request.get({ url: `/inspect/patient/getUSTj?medicalSn=` + medicalSn })
}, },
//获取心电报告 //获取心电报告
GetApiEcgInfo: async (medicalSn: string) => { GetApiEcgInfo: async (medicalSn: string) => {
return await request.get({ url: `/inspect/patient/getecgTj?medicalSn=` + medicalSn}) return await request.get({ url: `/inspect/patient/getecgTj?medicalSn=` + medicalSn })
}, },
//获取一般检查项目结果 //获取一般检查项目结果
GetApiYbjcInfo: async (medicalSn: string,cardId:string) => { GetApiYbjcInfo: async (medicalSn: string, cardId: string) => {
return await request.put({ url: `/inspect/patient/GetApiYbjcInfo?medicalSn=` + medicalSn + `&cardId=` + cardId}) return await request.put({ url: `/inspect/patient/GetApiYbjcInfo?medicalSn=` + medicalSn + `&cardId=` + cardId })
}, },
//新增患者信息和体检项目 //新增患者信息和体检项目
insertPatinetInfo: async (data: PatientVO) => { insertPatinetInfo: async (data: PatientVO) => {
return await request.post({ url: `/inspect/patient/insertPatinetInfo`, data }) return await request.post({ url: `/inspect/patient/insertPatinetInfo`, data })
}, },
createPatientInspectDataReport: async (medicalSn: any) => {
return await request.get({ url: `/inspect/patient/createPatientInspectDataReport?medicalSn=` + medicalSn, timeout: 110 * 1000 })
}
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<ContentWrap style="height: 70px; display: flex; align-items: center;"> <ContentWrap style="height: 70px; display: flex; align-items: center">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <el-form
class="-mb-15px" class="-mb-15px"
@ -33,10 +33,7 @@
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
value-format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
:default-time="[ :default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
new Date(2000, 1, 1, 0, 0, 0),
new Date(2000, 1, 1, 23, 59, 59)
]"
clearable clearable
class="!w-320px" class="!w-320px"
/> />
@ -56,7 +53,7 @@
:data="list" :data="list"
:stripe="true" :stripe="true"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
:header-cell-style="{ background: 'rgb(235, 241, 250)', height: '56px',color:'#333333' }" :header-cell-style="{ background: 'rgb(235, 241, 250)', height: '56px', color: '#333333' }"
:row-style="{ height: '56px' }" :row-style="{ height: '56px' }"
> >
<el-table-column label="体检编号" align="center" prop="medicalSn" /> <el-table-column label="体检编号" align="center" prop="medicalSn" />
@ -71,13 +68,7 @@
/> />
<el-table-column label="操作" align="center" fixed="right" width="120px"> <el-table-column label="操作" align="center" fixed="right" width="120px">
<template #default="scope"> <template #default="scope">
<el-button <el-button link type="primary" @click="handlePrint(scope.row)"> 打印报告 </el-button>
link
type="primary"
@click="handlePrint(scope.row)"
>
打印报告
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -90,19 +81,45 @@
/> />
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 打印报告 -->
<DepartmentForm ref="formRef" @success="getList" /> <Dialog
v-model="printDialogVisible"
width="84%"
top="16px"
:close-on-click-modal="false"
:close-on-press-escape="false"
@close="
() => {
printDialogLoading = false
printFileSrc = ''
}
"
>
<template #title>
<div>
<span>打印报告</span>
</div>
</template>
<div v-loading="printDialogLoading" style="height: 84vh; margin: -6px -14px -24px -14px">
<iframe
v-if="printDialogVisible && printFileSrc && printFileSrc.trim()"
:src="printFileSrc.trim() + '#view=Fit&navpanes=1'"
frameborder="0"
style="width: 100%; height: 100%; border: none"
>
</iframe>
</div>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { PatientApi, type PatientVO } from '@/api/inspect/inspectpatient' import { PatientApi, type PatientVO } from '@/api/inspect/inspectpatient'
defineOptions({ name: 'Department' }) defineOptions({ name: 'ReportPrint' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const loading = ref(true) // const loading = ref(true) //
const allList = ref<PatientVO[]>([]) //
const list = ref<PatientVO[]>([]) // const list = ref<PatientVO[]>([]) //
const total = ref(0) // const total = ref(0) //
const queryParams = reactive({ const queryParams = reactive({
@ -139,8 +156,6 @@ const handleQuery = () => {
queryParams.pageNo = 1 queryParams.pageNo = 1
getList() getList()
} }
/** 添加/修改操作 */
const formRef = ref()
/** 初始化 **/ /** 初始化 **/
onMounted(() => { onMounted(() => {
@ -148,14 +163,23 @@ onMounted(() => {
}) })
/** 打印报告按钮操作 */ /** 打印报告按钮操作 */
const handlePrint = async (row: PatientVO) => { const printDialogVisible = ref(false)
const printDialogLoading = ref(false)
const printFileSrc = ref('')
const handlePrint = async (row) => {
try { try {
const blob = await PatientApi.exportPatient({ medicalSn: row.medicalSn }) printDialogVisible.value = true
const url = window.URL.createObjectURL(blob) printDialogLoading.value = true
window.open(url) const result = await PatientApi.createPatientInspectDataReport(row.medicalSn)
window.URL.revokeObjectURL(url) if (result && result.code == '200') {
printFileSrc.value = result.msg
} else {
throw '错误发生'
}
} catch (error) { } catch (error) {
message.error('打印报告失败') message.error('打印报告失败')
} finally {
if (printDialogLoading.value) printDialogLoading.value = false
} }
} }