|
|
@ -241,6 +241,7 @@ const projIdsOfTube = (tube) => { |
|
|
|
// 处理试管架激活状态变化 |
|
|
|
const handleActivateChange = async (index: number) => { |
|
|
|
const rack = testTubeStore.tubeRacks[index] |
|
|
|
console.log('---', rack) |
|
|
|
if(rack.tubeSettings.every((tube) => projIdsOfTube(tube).length === 0)) { |
|
|
|
eMessage.error('请为试管配置检测项目') |
|
|
|
return |
|
|
@ -275,30 +276,37 @@ const updateTubeSettings = async (rackIdx: number, tubeIdx: number) => { |
|
|
|
eMessage.error('试管架已激活,不能修改') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
console.log('rack.tubeSettings---', rack.tubeSettings) |
|
|
|
|
|
|
|
//检查耗材 |
|
|
|
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.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; |
|
|
|
// let list = [] |
|
|
|
// consumablesStore.projectsAvailable.map((item:any) => { |
|
|
|
// console.log('projIdCntMap===', projIdCntMap.value) |
|
|
|
// let cn = projIdCntMap.value[item.projId || 1]; |
|
|
|
// if(cn){ |
|
|
|
// console.log('cn===', cn , item.num) |
|
|
|
// if(cn > item.num){ |
|
|
|
// list.push(item) |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
// }) |
|
|
|
// if(list && list.length){ |
|
|
|
// eMessage.error(`耗材已用尽,请添加耗材`) |
|
|
|