From 70e3a4f2b0a852f446161a76b3a6fd65d6e142de Mon Sep 17 00:00:00 2001 From: huang <1724659546@qq.com> Date: Thu, 23 Oct 2025 12:14:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8C=AA=E7=BE=A4=E7=AE=A1=E7=90=86=E8=AE=A9?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E9=80=89=E6=8B=A9=E7=8C=AA=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/pigBatch.js | 18 ++++++ src/components/PigBatchList.vue | 73 ++++++++++++++++++++++-- src/views/pms/PigBatchManagementView.vue | 13 ++++- 3 files changed, 98 insertions(+), 6 deletions(-) diff --git a/src/api/pigBatch.js b/src/api/pigBatch.js index 0c7a5dc4..92d9ca3c 100644 --- a/src/api/pigBatch.js +++ b/src/api/pigBatch.js @@ -191,3 +191,21 @@ export const recordDeathInBatch = (id, deathData) => { export const recordCullInBatch = (id, cullData) => { return http.post(`/api/v1/pig-batches/record-cull/${id}`, cullData); }; + +// --- 新增的猪栏和猪舍API --- + +/** + * 获取所有猪栏的列表 + * @returns {Promise<*>} + */ +export const getAllPens = () => { + return http.get('/api/v1/pens'); +}; + +/** + * 获取所有猪舍的列表 + * @returns {Promise<*>} + */ +export const getAllPigHouses = () => { + return http.get('/api/v1/pig-houses'); +}; diff --git a/src/components/PigBatchList.vue b/src/components/PigBatchList.vue index 807f5800..d68574a8 100644 --- a/src/components/PigBatchList.vue +++ b/src/components/PigBatchList.vue @@ -8,7 +8,7 @@ 初始数量: {{ batch.initial_count }}
- 增加猪栏 + 增加猪栏 编辑 删除
@@ -28,11 +28,30 @@ + + + + + + + + +