增加打印字段显示
This commit is contained in:
parent
450edfb217
commit
4cedd7a425
@ -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 })
|
||||
}
|
||||
}
|
||||
|
@ -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('获取患者列表失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 添加检查是否已完成的响应式引用
|
||||
|
@ -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 ? '已打印' : '未打印'
|
||||
}
|
||||
|
||||
/** 处理导入按钮点击 */
|
||||
|
Loading…
Reference in New Issue
Block a user