|
|
@ -93,10 +93,12 @@ import { |
|
|
|
useConsumablesStore, |
|
|
|
useTestTubeStore, |
|
|
|
useSettingTestTubeStore, |
|
|
|
|
|
|
|
} from '../../../store' |
|
|
|
import { ElDialog } from 'element-plus' |
|
|
|
import { BloodType, ReactionPlateGroup, TestTubeRack } from '@/websocket/socket' |
|
|
|
import { eMessage } from '../utils' |
|
|
|
import { reactionPlateGroupItem } from './type' |
|
|
|
|
|
|
|
const router = useRouter() |
|
|
|
|
|
|
@ -265,6 +267,37 @@ const updateTubeSettings = async (rackIdx: number, tubeIdx: number) => { |
|
|
|
eMessage.error('试管架已激活,不能修改') |
|
|
|
return |
|
|
|
} |
|
|
|
//检查耗材 |
|
|
|
if(consumablesStore.consumableData && consumablesStore.consumableData.reactionPlateGroup){ |
|
|
|
let reactionPlateGroup = consumablesStore.consumableData.reactionPlateGroup |
|
|
|
let list:reactionPlateGroupItem[] = [] |
|
|
|
reactionPlateGroup.forEach((item:any) => { |
|
|
|
if(item.projId && selectedProjIds.value.includes(item.projId) && item.num <=0){ |
|
|
|
list.push(item.projName) |
|
|
|
} |
|
|
|
}) |
|
|
|
if(list.length){ |
|
|
|
eMessage.error(`项目${list.join(',')}耗材不足,请添加耗材`) |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//超出现有数量 |
|
|
|
if(consumablesStore.projectsAvailable){ |
|
|
|
let list = consumablesStore.projectsAvailable.map((item:any) => { |
|
|
|
console.log('projIdCntMap===', projIdCntMap) |
|
|
|
let cn = projIdCntMap[item.projId || 1]; |
|
|
|
console.log('cn===', cn , item.num) |
|
|
|
if(cn > item.num){ |
|
|
|
return item; |
|
|
|
} |
|
|
|
}) |
|
|
|
if(list && list.length){ |
|
|
|
eMessage.error(`耗材已用尽,请添加耗材`) |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (tubeIdx < rack.tubeSettings.length) { |
|
|
|
const setting = rack.tubeSettings[tubeIdx] |
|
|
|
const updSetting = { |
|
|
|