|
|
@ -83,6 +83,7 @@ |
|
|
|
<MainComponent |
|
|
|
v-for="(item, idx) in consumableStore.consumableData?.littBottleGroup" |
|
|
|
:key="idx" |
|
|
|
:order="idx + 1" |
|
|
|
class="ball-grid" |
|
|
|
:projectName="item.projName || ''" |
|
|
|
:currentCount="item.num" |
|
|
@ -93,6 +94,7 @@ |
|
|
|
gridHeight="240px" |
|
|
|
:activeColor="consumableStore.projIdColorMap[item.projId!]" |
|
|
|
:inUse="item.isInstall" |
|
|
|
@updateBottleNum="updateLittleBottomNum" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -243,6 +245,41 @@ const handleUnloadConsumable = async (index: number) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const updateLittleBottomNum = async ({ |
|
|
|
index, |
|
|
|
bottleNum, |
|
|
|
sync, |
|
|
|
}: { |
|
|
|
index: number |
|
|
|
bottleNum: number |
|
|
|
sync: boolean |
|
|
|
}) => { |
|
|
|
if (bottleNum < 0) { |
|
|
|
return |
|
|
|
} |
|
|
|
if (deviceStore.deviceState.workState !== 'WORKING') { |
|
|
|
consumableStore.setDisableUpdateConsumableData(true) |
|
|
|
consumableStore.updateLittleBottomNum(index, bottleNum) |
|
|
|
if (sync) { |
|
|
|
console.log(`🚀 ~ updatePlateNum ~ order ${index + 1}, num ${bottleNum}`) |
|
|
|
try { |
|
|
|
const res = await updateConsumables({ |
|
|
|
group: `CG${index + 1}`, |
|
|
|
num: bottleNum, |
|
|
|
}) |
|
|
|
if (!res.success) { |
|
|
|
errMsg$.next(res.data.info || '修改耗材数量失败') |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.error('修改耗材数量失败:', error) |
|
|
|
} |
|
|
|
consumableStore.setDisableUpdateConsumableData(false) |
|
|
|
} |
|
|
|
} else { |
|
|
|
errMsg$.next('设备正在工作,无法修改数值') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const updateReactionPlateNum = async ({ |
|
|
|
index, |
|
|
|
plateNum, |
|
|
@ -261,7 +298,10 @@ const updateReactionPlateNum = async ({ |
|
|
|
if (sync) { |
|
|
|
console.log(`🚀 ~ updatePlateNum ~ order ${index + 1}, num ${plateNum}`) |
|
|
|
try { |
|
|
|
const res = await updateConsumables({ group: `CG${index + 1}`, num: plateNum }) |
|
|
|
const res = await updateConsumables({ |
|
|
|
group: `CG${index + 1}`, |
|
|
|
num: plateNum, |
|
|
|
}) |
|
|
|
if (!res.success) { |
|
|
|
errMsg$.next(res.data.info || '修改耗材数量失败') |
|
|
|
} |
|
|
@ -293,7 +333,10 @@ const updateTipNum = async ({ |
|
|
|
if (sync) { |
|
|
|
console.log(`🚀 ~ updateTipNum ~ order ${index + 1}, num ${tipNum}`) |
|
|
|
try { |
|
|
|
const res = await updateTipsNum({ group: `TipG${index + 1}`, num: tipNum }) |
|
|
|
const res = await updateTipsNum({ |
|
|
|
group: `TipG${index + 1}`, |
|
|
|
num: tipNum, |
|
|
|
}) |
|
|
|
if (!res.success) { |
|
|
|
errMsg$.next(res.data.info || '修改耗材数量失败') |
|
|
|
} |
|
|
@ -301,7 +344,7 @@ const updateTipNum = async ({ |
|
|
|
console.error('修改耗材数量失败:', error) |
|
|
|
} |
|
|
|
consumableStore.setDisableUpdateConsumableData(false) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
errMsg$.next('设备正在工作,无法修改数值') |
|
|
|
} |
|
|
|