This commit is contained in:
2025-10-23 18:18:07 +08:00
parent 62801326cb
commit 6d452394aa
2 changed files with 7 additions and 3 deletions

View File

@@ -10,7 +10,7 @@
<div class="info-item border-left">存栏: {{ pen.current_pig_count || 0 }}</div>
</div>
<div class="actions-section">
<el-button size="small" @click="emitAllocatePigs" :disabled="!isBatchActive">分配猪只</el-button>
<el-button size="small" @click="emitAllocatePigs" :disabled="!isBatchActive || batchUnassignedPigCount <= 0">分配猪只</el-button>
<el-button size="small" type="danger" @click="emitRemove" :disabled="!isBatchActive || pen.current_pig_count > 0">移除</el-button>
</div>
</div>
@@ -29,6 +29,10 @@ export default {
isBatchActive: {
type: Boolean,
default: true // 默认活跃,以防万一没有传递
},
batchUnassignedPigCount: {
type: Number,
default: 0
}
},
emits: ['remove', 'allocate-pigs'],