修bug
This commit is contained in:
@@ -52,6 +52,7 @@
|
|||||||
:key="pen.id"
|
:key="pen.id"
|
||||||
:pen="pen"
|
:pen="pen"
|
||||||
:isBatchActive="batch.is_active"
|
:isBatchActive="batch.is_active"
|
||||||
|
:batchUnassignedPigCount="batch.unassigned_pig_count"
|
||||||
@allocate-pigs="showAllocatePigsDialog($event, batch)"
|
@allocate-pigs="showAllocatePigsDialog($event, batch)"
|
||||||
@remove="emitRemovePen"
|
@remove="emitRemovePen"
|
||||||
/>
|
/>
|
||||||
@@ -82,8 +83,7 @@
|
|||||||
|
|
||||||
<!-- 分配猪只对话框 -->
|
<!-- 分配猪只对话框 -->
|
||||||
<AllocatePigsDialog
|
<AllocatePigsDialog
|
||||||
v-if="allocatePigsDialogVisible"
|
v-model:visible="allocatePigsDialogVisible"
|
||||||
:visible.sync="allocatePigsDialogVisible"
|
|
||||||
:unassigned-pig-count="currentBatch ? currentBatch.unassigned_pig_count : 0"
|
:unassigned-pig-count="currentBatch ? currentBatch.unassigned_pig_count : 0"
|
||||||
:pen-id="selectedPenForAllocation ? selectedPenForAllocation.id : 0"
|
:pen-id="selectedPenForAllocation ? selectedPenForAllocation.id : 0"
|
||||||
@confirm="handleAllocatePigs"
|
@confirm="handleAllocatePigs"
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<div class="info-item border-left">存栏: {{ pen.current_pig_count || 0 }}</div>
|
<div class="info-item border-left">存栏: {{ pen.current_pig_count || 0 }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="actions-section">
|
<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>
|
<el-button size="small" type="danger" @click="emitRemove" :disabled="!isBatchActive || pen.current_pig_count > 0">移除</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -29,6 +29,10 @@ export default {
|
|||||||
isBatchActive: {
|
isBatchActive: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true // 默认活跃,以防万一没有传递
|
default: true // 默认活跃,以防万一没有传递
|
||||||
|
},
|
||||||
|
batchUnassignedPigCount: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
emits: ['remove', 'allocate-pigs'],
|
emits: ['remove', 'allocate-pigs'],
|
||||||
|
|||||||
Reference in New Issue
Block a user