增加打印字段显示

This commit is contained in:
Euni4U 2025-04-02 17:02:48 +08:00
parent 450edfb217
commit 4cedd7a425
3 changed files with 89 additions and 48 deletions

View File

@ -29,6 +29,7 @@ export interface PatientVO {
xcgcode: string // 血常规编号
ncgcode: string // 尿常规编号
shqx: string // 生化编号
isprint: number // 是否打印
}
// 患者信息 API
@ -123,5 +124,9 @@ export const PatientApi = {
//获取公卫患者信息
getGwPatientInfo: async (idCard: string) => {
return await request.get({ url: `/inspect/patient/GetApiPatientInfo?idCard=` + idCard })
},
//更新打印状态
updatePrintStatus: async (medicalSn: string) => {
return await request.put({ url: `/inspect/patient/updatePrintStatus?medicalSn=` + medicalSn })
}
}

View File

@ -32,7 +32,7 @@
<el-radio-group v-model="statusFilter" @change="handleStatusFilterChange">
<el-radio label="0">待检查</el-radio>
<el-radio label="1">已检查</el-radio>
<el-radio label="">全部</el-radio>
<el-radio label="2">已打印</el-radio>
</el-radio-group>
</div>
@ -2007,9 +2007,15 @@ const statusFilter = ref('0') // 默认选择待检查
const filteredPatients = computed(() => {
let result = patients.value
//
//
if (statusFilter.value !== '') {
result = result.filter((patient) => String(patient.status) === statusFilter.value)
if (statusFilter.value === '2') {
// 使 isprint
result = result.filter((patient) => patient.isprint === 1)
} else {
// 使 status
result = result.filter((patient) => String(patient.status) === statusFilter.value)
}
}
return result
@ -2021,17 +2027,33 @@ const handleStatusFilterChange = async (value) => {
//
selectedPatient.value = null //
searchQuery.value = '' //
patients.value = []//
const params = {
status: value,
patients.value = [] //
try {
const params = {
pageNo: 1,
pageSize: 100
pageSize: pageSize.value,
isprint: null
}
const itemsRes = await PatientApi.getPatientPage(params) //
patients.value = itemsRes.list //
//
if (value === '2') {
// isprint 1
params.isprint = 1
} else {
// 使 status
params.status = value
}
const res = await PatientApi.getPatientPage(params)
patients.value = res.list
total.value = res.total
console.log( patients.value)
} catch (error) {
console.error('获取患者列表失败:', error)
ElMessage.error('获取患者列表失败')
}
}
//

View File

@ -41,6 +41,12 @@ v-loading.fullscreen.lock="fullscreenLoading"
class="!w-200px"
/>
</el-form-item>
<el-form-item label="状态" prop="isprint">
<el-select v-model="queryParams.isprint" placeholder="请选择状态" clearable class="!w-200px">
<el-option label="已打印" value="1" />
<el-option label="未打印" value="0" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery">
<Icon icon="ep:search" class="mr-5px" /> 查询
@ -78,7 +84,7 @@ v-loading.fullscreen.lock="fullscreenLoading"
<el-table-column label="身份证号" align="center" prop="cardId" />
<el-table-column label="联系电话" align="center" prop="phoneNum" />
<el-table-column label="住址" align="center" prop="domicileaddress" />
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormatter" />
<el-table-column label="状态" align="center" prop="isprint" :formatter="statusFormatter" />
<el-table-column label="操作" align="center" fixed="right" width="120px">
<template #default="scope">
<el-button
@ -177,7 +183,8 @@ const queryParams = reactive({
medicalDateTime: [],
cardId: undefined as string | undefined,
phoneNum: undefined as string | undefined,
domicileaddress: undefined as string | undefined
domicileaddress: undefined as string | undefined,
isprint: undefined as string | undefined
})
const queryFormRef = ref() //
const fileInputRef = ref<HTMLInputElement | null>(null) //
@ -214,10 +221,10 @@ const getList = async () => {
try {
const data = await PatientApi.getPatientPage({
...queryParams,
pName: queryParams.pname?.trim() || undefined
pName: queryParams.pname?.trim() || undefined,
isprint: queryParams.isprint || undefined // isprint
})
// 使
list.value = data.list
total.value = data.total
} catch (error) {
@ -229,10 +236,16 @@ const getList = async () => {
/** 搜索操作 */
const handleQuery = () => {
queryParams.pageNo = 1
queryParams.pageNo = 1 //
getList()
}
/** 重置操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields()
handleQuery()
}
/** 添加/修改操作 */
const formRef = ref()
/** 初始化 **/
@ -242,32 +255,42 @@ onMounted(() => {
/** 打印报告按钮操作 */
const handlePrint = async (row: PatientVO) => {
const data = await PatientApi.getPatientInfo(row.medicalSn)
//尿
if(!data.xcgcode && !data.ncgcode && !data.shqx){
await PatientApi.bindPatientProject(row.medicalSn)
await PatientApi.syncinspectApplyTj(row.medicalSn)
createPrint(row.medicalSn)
} else {
//
const confirmResult = await ElMessageBox.confirm(
'检验单已存在,是否重新创建?',
'提示',
{
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
}
).catch(() => 'cancel')
// ""
if (confirmResult === 'confirm') {
try {
const data = await PatientApi.getPatientInfo(row.medicalSn)
//尿
if(!data.xcgcode && !data.ncgcode && !data.shqx){
await PatientApi.bindPatientProject(row.medicalSn)
await PatientApi.syncinspectApplyTj(row.medicalSn)
await createPrint(row.medicalSn)
} else {
//
const confirmResult = await ElMessageBox.confirm(
'检验单已存在,是否重新创建?',
'提示',
{
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
}
).catch(() => 'cancel')
// ""
if (confirmResult === 'confirm') {
await PatientApi.syncinspectApplyTj(row.medicalSn)
}
// ""
await createPrint(row.medicalSn)
}
// ""
createPrint(row.medicalSn)
//
await PatientApi.updatePrintStatus(row.medicalSn, '1')
//
await getList()
message.success('打印成功')
} catch (error: any) {
console.error('打印失败:', error)
message.error(`打印失败: ${error.message || '未知错误'}`)
}
}
/** 打印导检单 */
const createPrint = async (medicalSn) => {
@ -306,16 +329,7 @@ const createPrint = async (medicalSn) => {
}
/** 状态格式化 */
const statusFormatter = (row: any) => {
const statusMap: Record<string, string> = {
'0': '待检查',
'1': '已检查',
'2': '放弃',
'3': '挂起,择日检',
'4': '已汇总',
'5': '终检审核',
'6': '报告已取'
}
return statusMap[row.status] || '未知'
return row.isprint === 1 ? '已打印' : '未打印'
}
/** 处理导入按钮点击 */