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 @@ + + + + + + + + +