From 4cedd7a425a48222e45b663b18970a70f577b17f Mon Sep 17 00:00:00 2001
From: Euni4U <958079825@qq.com>
Date: Wed, 2 Apr 2025 17:02:48 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=93=E5=8D=B0=E5=AD=97?=
=?UTF-8?q?=E6=AE=B5=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/inspect/inspectpatient/index.ts | 5 ++
.../Medical-examination-vehicle.vue | 42 ++++++---
.../Inspection-checklist.vue | 90 +++++++++++--------
3 files changed, 89 insertions(+), 48 deletions(-)
diff --git a/src/api/inspect/inspectpatient/index.ts b/src/api/inspect/inspectpatient/index.ts
index a1452b4..7d0cd22 100644
--- a/src/api/inspect/inspectpatient/index.ts
+++ b/src/api/inspect/inspectpatient/index.ts
@@ -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 })
}
}
diff --git a/src/views/Department-entry/Medical-examination-vehicle.vue b/src/views/Department-entry/Medical-examination-vehicle.vue
index c433709..c651e79 100644
--- a/src/views/Department-entry/Medical-examination-vehicle.vue
+++ b/src/views/Department-entry/Medical-examination-vehicle.vue
@@ -32,7 +32,7 @@
待检查
已检查
- 全部
+ 已打印
@@ -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('获取患者列表失败')
+ }
}
// 添加检查是否已完成的响应式引用
diff --git a/src/views/Inspection-checklist/Inspection-checklist.vue b/src/views/Inspection-checklist/Inspection-checklist.vue
index 6073cff..488bc37 100644
--- a/src/views/Inspection-checklist/Inspection-checklist.vue
+++ b/src/views/Inspection-checklist/Inspection-checklist.vue
@@ -41,6 +41,12 @@ v-loading.fullscreen.lock="fullscreenLoading"
class="!w-200px"
/>
+
+
+
+
+
+
查询
@@ -78,7 +84,7 @@ v-loading.fullscreen.lock="fullscreenLoading"
-
+
(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 = {
- '0': '待检查',
- '1': '已检查',
- '2': '放弃',
- '3': '挂起,择日检',
- '4': '已汇总',
- '5': '终检审核',
- '6': '报告已取'
- }
- return statusMap[row.status] || '未知'
+ return row.isprint === 1 ? '已打印' : '未打印'
}
/** 处理导入按钮点击 */