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( + `