From 163399fdac73ea64b321626a7d07a74af1ce24f5 Mon Sep 17 00:00:00 2001 From: zhangjiming Date: Mon, 13 Jan 2025 16:43:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E6=96=AD=E8=AF=95=E7=AE=A1=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E8=83=BD=E6=BF=80=E6=B4=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Index/Regular/TestTube.vue | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/pages/Index/Regular/TestTube.vue b/src/pages/Index/Regular/TestTube.vue index 603bc16..1d9df8d 100644 --- a/src/pages/Index/Regular/TestTube.vue +++ b/src/pages/Index/Regular/TestTube.vue @@ -150,8 +150,8 @@ const clickBloodTypeItem = (type) => { } const projectsAvailable = computed(() => { - const group = R.groupBy((p) => p.projName, consumables.plates) - const pNames = R.keys(group) + const group = R.groupBy((p) => p.projName, consumables.consumableData.reactionPlateGroup) + const pNames = R.keys(group).filter(n => n !== 'null') const projArr = pNames.map((n) => R.reduce( @@ -220,7 +220,6 @@ const getTubeData = async () => { const res = await getTestTube() if (res.success) { - tubeRacks.value = mockData(res.data) console.log(tubeRacks.value) } else { @@ -251,6 +250,10 @@ const handleChangeUser = async (index) => { }) } +const existValidProject = (tubeRack) => { + return tubeRack.tubeSettings.some(s => (s.projId || []).length > 0 && !!s.bloodType) +} + //删除试管架 const deleteTubeRack = async (idx) => { const rack = tubeRacks.value[idx] @@ -303,6 +306,10 @@ const handleActivateChange = async (index) => { return } let destState = rack.state === 'INACTIVE' ? 'ACTIVE' : 'INACTIVE' + if (destState === 'ACTIVE' && !existValidProject(rack)) { + ElMessage.error('请为试管配置检测项目') + return + } const res = await updateTubeActivationStatus({ uuid: rack.uuid, active: destState === 'ACTIVE',