From 0b4f9fc1768f0696c5046e139fb7b0c6b786a936 Mon Sep 17 00:00:00 2001
From: zhangchen <1652267879@qq.com>
Date: 星期五, 18 七月 2025 17:49:29 +0800
Subject: [PATCH] ID1825-副屏切换逻辑修改

---
 src/store/type/bedsideAuxiliaryScreen.type.ts |   68 ++++++++++++++++++++++++++--------
 1 files changed, 52 insertions(+), 16 deletions(-)

diff --git a/src/store/type/bedsideAuxiliaryScreen.type.ts b/src/store/type/bedsideAuxiliaryScreen.type.ts
index 134d531..8757549 100644
--- a/src/store/type/bedsideAuxiliaryScreen.type.ts
+++ b/src/store/type/bedsideAuxiliaryScreen.type.ts
@@ -1,3 +1,5 @@
+import { tryConvertToInt } from "@/utils/utils";
+import cache from '@/utils/cache';
 export interface IotInfo {
   属性历史列表: any[];
   床号: string;
@@ -139,7 +141,7 @@
   使用耗材字典: ConsumablesCollection | null; // 当透析状态为治疗中时该字段为null
   倒计时: "";
   推送类型: PushType;
-  透析状态: "";
+  透析状态: DialysisStatus | null;
 }
 
 export interface BedsideAuxiliaryScreen {
@@ -178,12 +180,18 @@
   | EPageType.SPHYGMOMANOMETER;
 
 export enum EMedStatus {
-  NOT_CHECKED_IN = 0, // 未签到
-  SIGNED_IN = 1, // 已签到
-  DURING_DIALYSIS = 2, // 透析中
-  END = 2.5, // 已结束
-  CHECKED = 3, // 已检查
-  ARCHIVED = 4, // 已归档
+  /** 未签到 */
+  NOT_CHECKED_IN = 0,
+  /** 已签到 */
+  SIGNED_IN = 1,
+  /** 透析中 */
+  DURING_DIALYSIS = 2,
+  /** 已结束 */
+  END = 2.5,
+  /** 已检查 */
+  CHECKED = 3,
+  /** 已归档 */
+  ARCHIVED = 4,
 }
 
 export type MedStatus =
@@ -211,7 +219,7 @@
     unit: string;
     firstAndAddition: string;
     total: string;
-  };
+  }[];
   carePackage: any[];
   punctureNeedle: PunctureNeedle[];
   vascularAccess: VascularAccess[];
@@ -235,12 +243,7 @@
     dialyzerList: [], // 透析器列表
     pipingList: [], // 一次性使用管路列表
     dialysateList: [], // 透析液列表
-    anticoagulant: {
-      name: "", // 抗凝剂名称
-      unit: "", // 抗凝剂单位
-      firstAndAddition: "", // 维持/追加剂量
-      total: "", // 总量
-    }, // 抗凝剂信息
+    anticoagulant: [], // 抗凝剂列表
     carePackage: [], // 一次性使用透析护理包列表
     punctureNeedle: [], // 穿刺针列表
     vascularAccess: [], // 血管通路列表
@@ -248,6 +251,7 @@
 };
 
 export const defaultDeviceData = (): BedsideAuxiliaryScreen => {
+  const pageType = cache.get('devcieCode') ? EPageType.LOADING : EPatForm.OUTPATIENT_SERVICE;
   return {
     devicdeNo: "", // 设备号
     recordCode: "", // 透析单code
@@ -258,7 +262,8 @@
     gender: "", // 性别
     patForm: EPatForm.OUTPATIENT_SERVICE, // 患者来源
     patFormNumber: "", // 住院门诊号
-    pageType: EPageType.NOT_INIT, // 当前要展示的页面
+    // @ts-ignore
+    pageType, // 当前要展示的页面
     treatmentStatus: EMedStatus.NOT_CHECKED_IN, // 透析状态
     consumablesCollection: defaultconsumablesCollection(), // 未排班时需要的数据
     notSignedIn: defalutNotSignedIn(), // 未签到时需要的数据
@@ -279,9 +284,40 @@
     // 判断是否存在透析状态,如果不存在就是没有排班
     if (seeMsg.透析状态 === null || !seeMsg.透析状态) {
       result.pageType = EPageType.UNPLANNED_SCHEDULE;
-      result.consumablesCollection = seeMsg?.使用耗材字典 || defaultconsumablesCollection()
+      result.consumablesCollection =
+        seeMsg?.使用耗材字典 || defaultconsumablesCollection();
     } else {
 
+      const treatmentStatus = tryConvertToInt(seeMsg.透析状态?.透析状态) as  MedStatus;
+
+      // 这里就是有排班的
+      result.treatmentStatus = treatmentStatus;
+      result.recordCode = seeMsg.透析状态?.透析单编号;
+      result.patientCode = seeMsg.透析状态?.患者编号;
+      result.patientName = seeMsg.透析状态?.患者姓名;
+      result.patientPhone = seeMsg.透析状态?.患者头像;
+      result.age = seeMsg.透析状态?.年龄 + '';
+      result.gender = seeMsg.透析状态?.性别 + '';
+      result.patForm = seeMsg.透析状态?.患者来源;
+      result.patFormNumber = seeMsg.透析状态?.患者门诊住院号;
+
+      switch(treatmentStatus) {
+        case EMedStatus.NOT_CHECKED_IN:
+          result.pageType = EPageType.NOT_SIGNED_IN;
+          const notSignedIn = {
+            dialysisMode: seeMsg.透析状态?.透析方案,
+            dialyzerList: seeMsg.透析状态?.透析器列表,
+            pipingList: seeMsg.透析状态?.管路列表,
+            dialysateList: seeMsg.透析状态?.透析液列表,
+            carePackage: seeMsg.透析状态?.护理包列表,
+            punctureNeedle: seeMsg.透析状态?.穿刺针列表,
+            vascularAccess: seeMsg.透析状态?.血管通路列表,
+            anticoagulant: [],
+          }
+          result.notSignedIn = notSignedIn;
+          break
+      }
+
     }
   }
   return result;

--
Gitblit v1.8.0