From 4e0dd344199181088e5693784ba1caaf352ff83c Mon Sep 17 00:00:00 2001 From: guoapeng Date: Wed, 16 Jul 2025 17:34:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=B7=BB=E5=8A=A0=E8=AF=95=E7=AE=A1?= =?UTF-8?q?=E5=92=8C=E6=80=A5=E8=AF=8Abug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Index/Regular/Emergency.vue | 43 +++++++++++++++++++++++++++-------- src/pages/Index/Regular/TestTube.vue | 9 +++++--- 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/src/pages/Index/Regular/Emergency.vue b/src/pages/Index/Regular/Emergency.vue index ff238cd..35e19c0 100644 --- a/src/pages/Index/Regular/Emergency.vue +++ b/src/pages/Index/Regular/Emergency.vue @@ -61,16 +61,13 @@
样本类型
+
-
- {{ item.name }} -
+ + + {{ type.name }} + +

@@ -108,7 +105,7 @@ import { } from '@/store' import type { AddEmergencyInfo } from '@/types/Index' import type { BloodType, ReactionPlateGroup } from '@/websocket/socket' -import { eMessage } from '../utils' +import { eMessage, findCommonElements } from '../utils' defineOptions({ name: 'EmergencyForm', @@ -119,6 +116,8 @@ const keyboardType = ref<'text' | 'number'>('text') const softKeyboardRef = ref() const currentFocusType = ref('') + + const openKeyboard = (type: 'sampleBarcode' | 'userid') => { inputValue.value = type === 'sampleBarcode' ? emergencyPosition.value.sampleBarcode : emergencyPosition.value.userid keyboardVisible.value = true @@ -147,6 +146,8 @@ const emergencyStore = useEmergencyStore() const deviceStore = useDeviceStore() const settingTubeStore = useSettingTestTubeStore() + + const isProjectActivated = (item: ReactionPlateGroup) => { return emergencyPosition.value.projIds.includes(item.projId!) } @@ -202,6 +203,8 @@ const confirmHandle = async () => { } } +const sampleListSomeProjId = ref([]) + const selectProject = (item: ReactionPlateGroup) => { const projectIndex = emergencyPosition.value.projIds.findIndex( (proj) => proj === item.projId, @@ -211,14 +214,31 @@ const selectProject = (item: ReactionPlateGroup) => { } else { emergencyPosition.value.projIds.push(item.projId!) } + let sampleList:string[][] = []; // 保存选择项目的样本类型 + emergencyPosition.value.projIds.forEach(projId => { + const supportBloodTypes = settingTubeStore.supportedProjects?.find( + (p) => p.projId === projId, + )?.supportBloodTypes + sampleList.push(supportBloodTypes) + + }) + sampleListSomeProjId.value = findCommonElements(sampleList) + console.log(sampleListSomeProjId.value) + emergencyPosition.value.bloodType = undefined } const selectBloodType = (item: { key: BloodType }) => { emergencyPosition.value.bloodType = item.key } +watch(() =>consumableStore.projectsAvailable, () => { + console.log(consumableStore.projectsAvailable) +} ) + // 处理回显数据 onMounted(() => { + + console.log(settingTubeStore.bloodTypes) if (!emergencyStore.emergencyInfo) { return } @@ -253,6 +273,9 @@ onUnmounted(() => {