From d0aa46f87d2c83b07d541178a2025fd91c15b266 Mon Sep 17 00:00:00 2001 From: Euni4U <958079825@qq.com> Date: Fri, 28 Feb 2025 10:30:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=84=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E6=B5=8B=E8=AF=95BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/inspect/inspectpatient/index.ts | 1 + .../Department-entry/Department-entryUI.vue | 10 +- src/views/inspect/physicalEnroll/index.vue | 183 +++++++----------- .../project-management/base/createUI.vue | 2 +- .../exam-package/drawer.vue | 12 +- .../exam-package/exam-packageUI.vue | 14 +- 6 files changed, 95 insertions(+), 127 deletions(-) diff --git a/src/api/inspect/inspectpatient/index.ts b/src/api/inspect/inspectpatient/index.ts index 3eda41a..d383042 100644 --- a/src/api/inspect/inspectpatient/index.ts +++ b/src/api/inspect/inspectpatient/index.ts @@ -24,6 +24,7 @@ export interface PatientVO { auditor: string // 审核人 auditorTime: Date // 审核时间 chargetime: Date // 收费时间 + headimage: string // 个人信息图片 } // 患者信息 API diff --git a/src/views/Department-entry/Department-entryUI.vue b/src/views/Department-entry/Department-entryUI.vue index 4016295..cd7fe06 100644 --- a/src/views/Department-entry/Department-entryUI.vue +++ b/src/views/Department-entry/Department-entryUI.vue @@ -883,15 +883,19 @@ const formattedMedicalDateTime = computed(() => { }).replace(/\//g, '-') }) +// 修改年龄计算属性 const age = computed(() => { - if (!reportData.value.birthday || !Array.isArray(reportData.value.birthday)) return '' + if (!reportData.value.birthday) return '' + + // 处理 YYYY-MM-DD 格式的生日 + const birthDate = new Date(reportData.value.birthday) + if (isNaN(birthDate.getTime())) return '' // 日期无效时返回空字符串 - const [year, month, day] = reportData.value.birthday - const birthDate = new Date(year, month - 1, day) // 注意月份要减1,因为JS中月份从0开始 const today = new Date() let age = today.getFullYear() - birthDate.getFullYear() const monthDiff = today.getMonth() - birthDate.getMonth() + // 如果还没到生日月份,或者是生日月但还没到具体日期,年龄减1 if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthDate.getDate())) { age-- } diff --git a/src/views/inspect/physicalEnroll/index.vue b/src/views/inspect/physicalEnroll/index.vue index b8c4177..21e6c85 100644 --- a/src/views/inspect/physicalEnroll/index.vue +++ b/src/views/inspect/physicalEnroll/index.vue @@ -161,28 +161,30 @@
- + 人像采集