From 8705e536f5a5cabb0c390a9605f48739522de5a2 Mon Sep 17 00:00:00 2001 From: Euni4U <958079825@qq.com> Date: Wed, 23 Apr 2025 10:59:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=A1=E5=BD=A2=E7=A0=81=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/inspect/inspectpatient/index.ts | 7 + .../Inspection-checklist.vue | 55 ++++ src/views/sta/index.vue | 306 +++++++++++------- 3 files changed, 245 insertions(+), 123 deletions(-) diff --git a/src/api/inspect/inspectpatient/index.ts b/src/api/inspect/inspectpatient/index.ts index 4c98ed4..201aa3a 100644 --- a/src/api/inspect/inspectpatient/index.ts +++ b/src/api/inspect/inspectpatient/index.ts @@ -31,6 +31,7 @@ export interface PatientVO { shqx: string // 生化编号 isprint: number // 是否打印 printtime: Date // 打印时间 + barcodetime: Date // 条形码时间 chiefinspectorid: string // 总检医生ID chiefinspector: string // 总检医生 } @@ -165,5 +166,11 @@ export const PatientApi = { //更新患者补充信息 updatePatientSupplement: async (medicalSn: string,idCard: string) => { return await request.get({ url: `/inspect/patient/updatePatientSupplement?medicalSn=` + medicalSn + `&idCard=` + idCard}) + }, + //更新条形码打印时间 + updateBarcodeTime: async (medicalSn: string, barcodetime: Date) => { + return await request.put({ + url: `/inspect/patient/updateBarcodeTime?medicalSn=${medicalSn}&barcodetime=${barcodetime.toISOString()}` + }) } } diff --git a/src/views/Inspection-checklist/Inspection-checklist.vue b/src/views/Inspection-checklist/Inspection-checklist.vue index 7f6ad60..b94b72a 100644 --- a/src/views/Inspection-checklist/Inspection-checklist.vue +++ b/src/views/Inspection-checklist/Inspection-checklist.vue @@ -347,8 +347,56 @@ const createPrint = async (medicalSn) => { /** 打印条形码 */ const handlePrintBarcode = async (row: PatientVO) => { try { + // 获取最新的患者信息 + const patientInfo = await PatientApi.getPatientInfo(row.medicalSn) + console.log('患者信息:', patientInfo) + + // 检查是否存在条形码打印时间 + if(patientInfo.barcodetime){ + // 格式化上次打印时间,显示中文年月日格式 + const date = new Date(patientInfo.barcodetime) + const year = date.getFullYear() + const month = String(date.getMonth() + 1).padStart(2, '0') + const day = String(date.getDate()).padStart(2, '0') + const lastPrintTime = `${year}年${month}月${day}日` + + // 格式化报告打印时间 + let reportPrintTime = '' + if (patientInfo.medicalDateTime && patientInfo.status == 1) { + const reportDate = new Date(patientInfo.medicalDateTime) + const reportYear = reportDate.getFullYear() + const reportMonth = String(reportDate.getMonth() + 1).padStart(2, '0') + const reportDay = String(reportDate.getDate()).padStart(2, '0') + reportPrintTime = `${reportYear}年${reportMonth}月${reportDay}日` + } + + try { + // 显示只有确定按钮的提示框 + await ElMessageBox.alert( + `