From accbb1a9f6a485512d6873c5f6c7e9efae957f7c Mon Sep 17 00:00:00 2001
From: huang <1724659546@qq.com>
Date: Thu, 23 Oct 2025 11:51:19 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=8C=AA=E7=BE=A4=E7=AE=A1?=
=?UTF-8?q?=E7=90=86=E7=95=8C=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/swagger.json | 8 +
src/components/PigBatchForm.vue | 216 +++++++++++++++
src/components/PigBatchList.vue | 137 ++++++++++
src/components/PigPenInfoCard.vue | 7 +-
src/layouts/MainLayout.vue | 9 +-
src/main.js | 4 +-
src/views/pms/PigBatchManagementView.vue | 323 +++++++++++++++++++++++
7 files changed, 699 insertions(+), 5 deletions(-)
create mode 100644 src/components/PigBatchForm.vue
create mode 100644 src/components/PigBatchList.vue
create mode 100644 src/views/pms/PigBatchManagementView.vue
diff --git a/docs/swagger.json b/docs/swagger.json
index 15339a95..d0300e60 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -4901,6 +4901,14 @@
"description": "创建时间",
"type": "string"
},
+ "currentTotalPigsInPens": {
+ "description": "当前存栏总数",
+ "type": "integer"
+ },
+ "currentTotalQuantity": {
+ "description": "当前总数",
+ "type": "integer"
+ },
"end_date": {
"description": "批次结束日期",
"type": "string"
diff --git a/src/components/PigBatchForm.vue b/src/components/PigBatchForm.vue
new file mode 100644
index 00000000..3061445f
--- /dev/null
+++ b/src/components/PigBatchForm.vue
@@ -0,0 +1,216 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/PigBatchList.vue b/src/components/PigBatchList.vue
new file mode 100644
index 00000000..807f5800
--- /dev/null
+++ b/src/components/PigBatchList.vue
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
diff --git a/src/components/PigPenInfoCard.vue b/src/components/PigPenInfoCard.vue
index 677240d6..c768f5ca 100644
--- a/src/components/PigPenInfoCard.vue
+++ b/src/components/PigPenInfoCard.vue
@@ -4,7 +4,9 @@
猪栏: {{ pen.pen_number }}
状态: {{ pen.status || '未知' }}
容量: {{ pen.capacity }}
+ 存栏: {{ pen.current_pig_count || 0 }}
批次: {{ pen.batch_number || '未分配' }}
+ 猪舍: {{ pen.house_name || '未知' }}
编辑
@@ -67,7 +69,7 @@ export default {
flex-direction: column;
justify-content: space-between;
width: 200px; /* 适当加宽以容纳更多信息 */
- height: 240px;
+ height: 260px; /* 调整高度以适应更多信息 */
background-color: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
transition: box-shadow 0.3s;
@@ -80,7 +82,8 @@ export default {
.info-section {
display: flex;
flex-direction: column;
- gap: 12px; /* 增加信息项间距 */
+ gap: 10px; /* 调整信息项间距 */
+ margin-bottom: 10px;
}
.info-section .title {
diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue
index ac65d043..b7656cf6 100644
--- a/src/layouts/MainLayout.vue
+++ b/src/layouts/MainLayout.vue
@@ -48,6 +48,10 @@
栏舍管理
+
+
+ 猪群管理
+
@@ -179,14 +183,14 @@ import { ref, computed, onMounted, onUnmounted } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import {
House, Monitor, Calendar, ArrowDown, Menu, Fold, Expand, Setting, Tickets, DataAnalysis, Document, Food,
- FirstAidKit, Clock, Files, ShoppingCart, SoldOut, Warning, Switch, List, Shop, Coin, DataLine, Finished, User, ScaleToOriginal, OfficeBuilding
+ FirstAidKit, Clock, Files, ShoppingCart, SoldOut, Warning, Switch, List, Shop, Coin, DataLine, Finished, User, ScaleToOriginal, OfficeBuilding, Management
} from '@element-plus/icons-vue';
export default {
name: 'MainLayout',
components: {
House, Monitor, Calendar, ArrowDown, Menu, Fold, Expand, Setting, Tickets, DataAnalysis, Document, Food,
- FirstAidKit, Clock, Files, ShoppingCart, SoldOut, Warning, Switch, List, Shop, Coin, DataLine, Finished, User, ScaleToOriginal, OfficeBuilding
+ FirstAidKit, Clock, Files, ShoppingCart, SoldOut, Warning, Switch, List, Shop, Coin, DataLine, Finished, User, ScaleToOriginal, OfficeBuilding, Management
},
setup() {
const route = useRoute();
@@ -224,6 +228,7 @@ export default {
'/devices': '设备管理',
'/device-templates': '设备模板管理',
'/pms/farm-management': '栏舍管理',
+ '/pms/batch-management': '猪群管理',
'/plans': '计划管理',
'/monitor/device-command-logs': '设备命令日志',
'/monitor/feed-usage-records': '饲料使用记录',
diff --git a/src/main.js b/src/main.js
index b69151e1..ab626612 100644
--- a/src/main.js
+++ b/src/main.js
@@ -11,6 +11,7 @@ import PlanList from './views/plan/PlanList.vue';
import LoginForm from './views/home/LoginForm.vue';
import DeviceTemplateList from './views/device/DeviceTemplateList.vue';
import PigFarmManagementView from './views/pms/PigFarmManagementView.vue'; // 导入栏舍管理视图
+import PigBatchManagementView from './views/pms/PigBatchManagementView.vue'; // 导入猪群管理视图
// --- 统一导入所有监控视图 ---
import DeviceCommandLogView from './views/monitor/DeviceCommandLogView.vue';
@@ -42,7 +43,8 @@ const routes = [
{path: '/device-templates', component: DeviceTemplateList, meta: {requiresAuth: true}},
{path: '/plans', component: PlanList, meta: {requiresAuth: true}},
{path: '/login', component: LoginForm},
- {path: '/pms/farm-management', name: 'PigFarmManagement', component: PigFarmManagementView, meta: { requiresAuth: true }},
+ {path: '/pms/farm-management', name: 'PigFarmManagement', component: PigFarmManagementView, meta: { requiresAuth: true, title: '栏舍管理' }},
+ {path: '/pms/batch-management', name: 'PigBatchManagement', component: PigBatchManagementView, meta: { requiresAuth: true, title: '猪群管理' }},
// --- 统一注册所有监控路由 ---
{path: '/monitor/device-command-logs', component: DeviceCommandLogView, meta: {requiresAuth: true}},
diff --git a/src/views/pms/PigBatchManagementView.vue b/src/views/pms/PigBatchManagementView.vue
new file mode 100644
index 00000000..77836f10
--- /dev/null
+++ b/src/views/pms/PigBatchManagementView.vue
@@ -0,0 +1,323 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 重新加载
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+