From 8be9df145c74529eb62764371e31938d4a5700e5 Mon Sep 17 00:00:00 2001 From: "1747191978@qq.com" <1942943850@qq.com> Date: Wed, 19 Mar 2025 09:39:02 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=9B=E6=9F=A5=E6=B7=BB=E5=8A=A0=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E5=88=86=E9=99=A9=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/patientFile/index.vue | 8 +- acupuncture-前台/src/views/screening/h5.vue | 151 +++++++++++++++++- 2 files changed, 153 insertions(+), 6 deletions(-) diff --git a/acupuncture-前台/src/views/patientFile/index.vue b/acupuncture-前台/src/views/patientFile/index.vue index 62855c53..12e7a0bc 100644 --- a/acupuncture-前台/src/views/patientFile/index.vue +++ b/acupuncture-前台/src/views/patientFile/index.vue @@ -548,6 +548,11 @@ export default { ], // 现病史 medicalHistory: [ + "高脂血症", + "肝脏疾病(脂肪肝、乙型肝炎、肝硬化等)", + "胰岛素抵抗", + "高尿酸", + "多囊卵巢综合症", "高血压", "脑血管病", "恶性肿瘤", @@ -559,13 +564,10 @@ export default { "遗传性、先天性疾病", "糖尿病", "慢性肺系疾病", - "高脂血症", - "肝脏疾病(脂肪肝、乙型肝炎、肝硬化等)", "过敏性疾病", "关节炎", "痛风", "肾炎、肾病", - "高脂血症", ], idCardType: [ { diff --git a/acupuncture-前台/src/views/screening/h5.vue b/acupuncture-前台/src/views/screening/h5.vue index ee854d8a..6280b3ee 100644 --- a/acupuncture-前台/src/views/screening/h5.vue +++ b/acupuncture-前台/src/views/screening/h5.vue @@ -100,9 +100,67 @@ - + + +
-
体重自评
+
疾病风险选择
+ + + + + + +
@@ -187,7 +245,29 @@ export default { stepNum: 1, // 步骤数 uploadFileUrl: process.env.VUE_APP_BASE_URL + "/baidu/ocr/idcardInfo", // 上传的图片服务器地址 fileList: [], - + // 现病史 + medicalHistory: [ + "高脂血症", + "肝脏疾病(脂肪肝、乙型肝炎、肝硬化等)", + "胰岛素抵抗", + "高尿酸", + "多囊卵巢综合症", + "高血压", + "脑血管病", + "恶性肿瘤", + "冠心病", + "精神疾病", + "胃和十二指肠溃疡", + "肥胖症", + "骨质疏松症", + "遗传性、先天性疾病", + "糖尿病", + "慢性肺系疾病", + "过敏性疾病", + "关节炎", + "痛风", + "肾炎、肾病", + ], BMITips: [ { label: "体重过轻", @@ -346,6 +426,12 @@ export default { "SCWJ-BMI": "", "SCWJ-JL": "", "SCWJ-ZLFS": [], + "SCWJ-SCSJ": "", + "SCWJ-RSSJ": "", + "SCWJ-SXSJ": "", + "SCWJ-SMXL": "", + "SCWJ-XBS": [], + "SCWJ-XBS-QT": "", // "SCWJ-NAME": "测试患者2", // "SCWJ-SEX": "男", // "SCWJ-BIRTH": "1945-01-01", @@ -420,6 +506,27 @@ export default { trigger: "blur", }, ], + "SCWJ-SCSJ": [ + { + required: true, + message: "上床睡觉不能为空", + trigger: "change", + }, + ], + "SCWJ-RSSJ": [ + { + required: true, + message: "入睡时间不能为空", + trigger: "change", + }, + ], + "SCWJ-SXSJ": [ + { + required: true, + message: "睡醒时间不能为空", + trigger: "change", + }, + ], }, loading: false, }; @@ -431,6 +538,40 @@ export default { this.getQueryHospitalNoToken(); // 组织id获取组织名称 }, methods: { + // 计算睡眠效率 + // 上床睡觉时间、入睡时间、睡醒时间、起床时间,自动计算睡眠效率(睡眠时间/在床上时间) + // 睡眠时间 = 入睡时间 - 起床时间 + // 在床上时间 = 上床睡觉时间 - 入睡时间 + // 睡眠效率 = 睡眠时间 / 在床上时间 + + calculateSleepTime() { + // 获取时间值 + const bedTime = this.form["SCWJ-SCSJ"]; // 上床睡觉时间 + const sleepTime = this.form["SCWJ-RSSJ"]; // 入睡时间 + const wakeTime = this.form["SCWJ-SXSJ"]; // 睡醒时间 + + // 如果缺少任一时间,直接返回 + if (!bedTime || !sleepTime || !wakeTime) return; + + // 将时间字符串转换为分钟数 + const toMinutes = (timeStr) => { + const [hour, minute] = timeStr.split(":"); + return parseInt(hour) * 60 + parseInt(minute); + }; + + // 计算在床上时间(入睡时间 - 上床睡觉时间) + const inBedMinutes = toMinutes(sleepTime) - toMinutes(bedTime); + + // 计算睡眠时间(睡醒时间 - 入睡时间) + const sleepMinutes = toMinutes(wakeTime) - toMinutes(sleepTime); + + // 计算睡眠效率(睡眠时间 / 在床上时间) + const sleepEfficiency = (sleepMinutes / inBedMinutes) * 100; + + // 更新睡眠效率字段,保留两位小数 + this.form["SCWJ-SMXL"] = sleepEfficiency.toFixed(2) + "%"; + }, + // 通过出生日期计算年龄 calculateAge() { const birthDate = new Date(this.form["SCWJ-BIRTH"]); @@ -633,6 +774,10 @@ export default {