From d5f91b9b12d0fdbf9ae1653c872500791e01d721 Mon Sep 17 00:00:00 2001
From: huang <1724659546@qq.com>
Date: Thu, 23 Oct 2025 18:41:08 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B7=A8=E7=BE=A4=E8=B0=83=E6=A0=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/PigBatchList.vue | 9 +-
.../TransferPigsAcrossBatchesModal.vue | 204 ++++++++++++++++++
src/views/pms/PigBatchManagementView.vue | 28 +++
3 files changed, 240 insertions(+), 1 deletion(-)
create mode 100644 src/components/TransferPigsAcrossBatchesModal.vue
diff --git a/src/components/PigBatchList.vue b/src/components/PigBatchList.vue
index 8563e430..60162f46 100644
--- a/src/components/PigBatchList.vue
+++ b/src/components/PigBatchList.vue
@@ -51,6 +51,10 @@
@click="emitTransferPigs(batch)"
:disabled="!batch.is_active || !batch.pens || batch.pens.length < 2"
>群内调栏
+ 跨群调栏
@@ -122,7 +126,7 @@ export default {
required: true
}
},
- emits: ['edit-batch', 'delete-batch', 'add-pen', 'remove-pen', 'assign-pen-to-batch', 'reload-data', 'transfer-pigs'],
+ emits: ['edit-batch', 'delete-batch', 'add-pen', 'remove-pen', 'assign-pen-to-batch', 'reload-data', 'transfer-pigs', 'transfer-pigs-across-batches'],
data() {
return {
addPenDialogVisible: false,
@@ -206,6 +210,9 @@ export default {
emitTransferPigs(batch) {
this.$emit('transfer-pigs', batch);
},
+ emitTransferPigsAcrossBatches(batch) {
+ this.$emit('transfer-pigs-across-batches', batch);
+ },
// 猪栏操作
emitRemovePen(pen) {
this.$emit('remove-pen', pen);
diff --git a/src/components/TransferPigsAcrossBatchesModal.vue b/src/components/TransferPigsAcrossBatchesModal.vue
new file mode 100644
index 00000000..938878a0
--- /dev/null
+++ b/src/components/TransferPigsAcrossBatchesModal.vue
@@ -0,0 +1,204 @@
+
+
+
+
+ {{ batch.batch_number }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/pms/PigBatchManagementView.vue b/src/views/pms/PigBatchManagementView.vue
index 574c190c..3caf9a18 100644
--- a/src/views/pms/PigBatchManagementView.vue
+++ b/src/views/pms/PigBatchManagementView.vue
@@ -43,6 +43,7 @@
@remove-pen="handleRemovePen"
@assign-pen-to-batch="handleAssignPenToBatch"
@transfer-pigs="handleTransferPigs"
+ @transfer-pigs-across-batches="handleTransferPigsAcrossBatches"
@reload-data="loadData"
/>
@@ -75,6 +76,13 @@
:batch="currentBatchForTransfer"
@success="handleTransferSuccess"
/>
+
+
+
@@ -86,6 +94,7 @@ import PigBatchList from '@/components/PigBatchList.vue';
import PigBatchForm from '@/components/PigBatchForm.vue';
import PenForm from '@/components/PenForm.vue';
import TransferPigsModal from '@/components/TransferPigsModal.vue';
+import TransferPigsAcrossBatchesModal from '@/components/TransferPigsAcrossBatchesModal.vue';
import { Refresh } from '@element-plus/icons-vue';
export default {
@@ -95,6 +104,7 @@ export default {
PigBatchForm,
PenForm,
TransferPigsModal,
+ TransferPigsAcrossBatchesModal,
Refresh
},
data() {
@@ -113,6 +123,9 @@ export default {
// 调栏模态框状态
transferDialogVisible: false,
currentBatchForTransfer: {},
+ // 跨群调栏模态框状态
+ transferAcrossBatchesDialogVisible: false,
+ currentBatchForTransferAcrossBatches: {},
// 辅助映射
houseMap: new Map(), // 用于猪栏显示猪舍名称
};
@@ -222,6 +235,11 @@ export default {
}
},
// --- 猪栏操作 (在猪群管理中) ---
+ handleAddPen(house) {
+ this.currentPen = { ...house }; // 修正:这里应该是传入house对象,而不是pen对象
+ this.isEditPen = false;
+ this.penDialogVisible = true;
+ },
handleModifyPigCountPen(pen) {
this.currentPen = { ...pen };
this.isEditPen = true;
@@ -287,6 +305,16 @@ export default {
handleTransferSuccess() {
this.transferDialogVisible = false;
this.loadData(); // 重新加载数据以反映变化
+ },
+ handleTransferPigsAcrossBatches(batch) {
+ console.log('handleTransferPigsAcrossBatches called with batch:', batch);
+ this.currentBatchForTransferAcrossBatches = batch;
+ this.transferAcrossBatchesDialogVisible = true;
+ console.log('transferAcrossBatchesDialogVisible set to:', this.transferAcrossBatchesDialogVisible);
+ },
+ handleTransferAcrossBatchesSuccess() {
+ this.transferAcrossBatchesDialogVisible = false;
+ this.loadData(); // 重新加载数据以反映变化
}
}
}