diff --git a/src/pages/Index/Regular/Consumables.vue b/src/pages/Index/Regular/Consumables.vue
index e7b2801..b4a8442 100644
--- a/src/pages/Index/Regular/Consumables.vue
+++ b/src/pages/Index/Regular/Consumables.vue
@@ -83,6 +83,7 @@
@@ -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('设备正在工作,无法修改数值')
}
diff --git a/src/pages/Index/components/Consumables/MainComponent.vue b/src/pages/Index/components/Consumables/MainComponent.vue
index 5021592..b4313dd 100644
--- a/src/pages/Index/components/Consumables/MainComponent.vue
+++ b/src/pages/Index/components/Consumables/MainComponent.vue
@@ -1,11 +1,26 @@
-
+
-
+
@@ -15,6 +30,9 @@ import InfoBar from './InfoBar.vue' // 引入项目信息组件
// Props 定义
const props = defineProps({
+ order: {
+ type: Number,
+ },
projectName: {
type: String,
// required: true,
@@ -53,9 +71,18 @@ const props = defineProps({
},
inUse: {
type: Boolean,
- default: true
+ default: true,
},
})
+const emit = defineEmits(['updateBottleNum'])
+
+const handleUpdateBottleNum = (
+ remainingCount,
+ order,
+ sync,
+) => {
+ emit('updateBottleNum', { index: order - 1, bottleNum: remainingCount, sync })
+}