不活跃禁用按钮

This commit is contained in:
2025-10-23 14:13:24 +08:00
parent c176fadafe
commit 2fe6f0c576
2 changed files with 8 additions and 3 deletions

View File

@@ -24,7 +24,7 @@
</div>
</div>
<div class="batch-actions">
<el-button size="small" type="primary" @click.stop="showAddPenDialog(batch)">增加猪栏</el-button>
<el-button size="small" type="primary" @click.stop="showAddPenDialog(batch)" :disabled="!batch.is_active">增加猪栏</el-button>
<el-button size="small" @click.stop="emitEditBatch(batch)">编辑</el-button>
<el-button size="small" type="danger" @click.stop="emitDeleteBatch(batch)">删除</el-button>
</div>
@@ -35,6 +35,7 @@
v-for="pen in batch.pens"
:key="pen.id"
:pen="pen"
:isBatchActive="batch.is_active"
@modify-pig-count="emitModifyPigCountPen"
@remove="emitRemovePen"
/>