-
猪栏: {{ pen.pen_number }}
-
状态: {{ pen.status || '未知' }}
-
容量: {{ pen.capacity }}
-
存栏: {{ pen.current_pig_count || 0 }}
-
批次: {{ pen.batch_number || '未分配' }}
+
+ 猪栏: {{ pen.pen_number }} {{ pen.status || '未知' }}
+
猪舍: {{ pen.house_name || '未知' }}
+
容量: {{ pen.capacity }}
+
批次: {{ pen.batch_number || '未分配' }}
+
存栏: {{ pen.current_pig_count || 0 }}
编辑
@@ -68,8 +69,9 @@ export default {
display: flex;
flex-direction: column;
justify-content: space-between;
- width: 200px; /* 适当加宽以容纳更多信息 */
- height: 260px; /* 调整高度以适应更多信息 */
+ width: 220px; /* 适当加宽以容纳更多信息 */
+ height: auto; /* 让高度自适应内容 */
+ min-height: 240px; /* 设置最小高度 */
background-color: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
transition: box-shadow 0.3s;
@@ -80,16 +82,22 @@ export default {
}
.info-section {
- display: flex;
- flex-direction: column;
- gap: 10px; /* 调整信息项间距 */
+ display: grid; /* 使用grid布局创建两列 */
+ grid-template-columns: 1fr 1fr; /* 两列等宽 */
+ gap: 8px 10px; /* 行间距 8px, 列间距 10px */
margin-bottom: 10px;
+ flex-grow: 1; /* 允许信息部分填充可用空间 */
}
.info-section .title {
font-weight: bold;
font-size: 1.1em;
color: #303133;
+ grid-column: 1 / -1; /* 标题横跨两列 */
+ margin-bottom: 5px; /* 标题下方增加一点间距 */
+ display: flex; /* Add flexbox for alignment */
+ align-items: center; /* Vertically align items */
+ gap: 8px; /* Space between title text and tag */
}
.info-section .info-item {
@@ -97,6 +105,11 @@ export default {
color: #606266;
}
+.info-item.border-left {
+ border-left: 1px solid #eee; /* 添加左边框作为分隔线 */
+ padding-left: 10px; /* 增加左内边距,使内容不紧贴边框 */
+}
+
.actions-section {
display: flex;
flex-direction: column;
diff --git a/src/views/pms/PigBatchManagementView.vue b/src/views/pms/PigBatchManagementView.vue
index e47cbed7..f63d8831 100644
--- a/src/views/pms/PigBatchManagementView.vue
+++ b/src/views/pms/PigBatchManagementView.vue
@@ -39,8 +39,8 @@
@edit-batch="handleEditBatch"
@delete-batch="handleDeleteBatch"
@add-pen="handleAddPen"
- @edit-pen="handleEditPen"
- @delete-pen="handleDeletePen"
+ @modify-pig-count-pen="handleModifyPigCountPen"
+ @remove-pen="handleRemovePen"
@assign-pen-to-batch="handleAssignPenToBatch"
/>
@@ -201,17 +201,12 @@ export default {
}
},
// --- 猪栏操作 (在猪群管理中) ---
- handleAddPen(batch) {
- this.currentPen = { pig_batch_id: batch.id }; // 预设猪栏所属批次
- this.isEditPen = false;
- this.penDialogVisible = true;
- },
- handleEditPen(pen) {
+ handleModifyPigCountPen(pen) {
this.currentPen = { ...pen };
this.isEditPen = true;
this.penDialogVisible = true;
},
- async handleDeletePen(pen) {
+ async handleRemovePen(pen) {
try {
await this.$confirm(`确认删除猪栏 "${pen.pen_number}" 吗?`, '提示', {
confirmButtonText: '确定',