diff --git a/src/api/pigBatch.js b/src/api/pigBatch.js
index 2919c89e..06ec3d95 100644
--- a/src/api/pigBatch.js
+++ b/src/api/pigBatch.js
@@ -197,10 +197,7 @@ import http from '../utils/http';
* @returns {Promise>}
*/
export const getPigBatches = (params) => {
- const newParams = {
- is_active: params.is_active,
- };
- return http.get('/api/v1/pig-batches', { params: newParams });
+ return http.get('/api/v1/pig-batches', params);
};
/**
@@ -209,7 +206,7 @@ export const getPigBatches = (params) => {
* @returns {Promise}
*/
export const createPigBatch = (batchData) => {
- return http.post('/api/v1/pig-batches', batchData);
+ return http.post('/api/v1/pig-batches', batchData);
};
/**
@@ -218,7 +215,7 @@ export const createPigBatch = (batchData) => {
* @returns {Promise}
*/
export const getPigBatchById = (id) => {
- return http.get(`/api/v1/pig-batches/${id}`);
+ return http.get(`/api/v1/pig-batches/${id}`);
};
/**
@@ -228,7 +225,7 @@ export const getPigBatchById = (id) => {
* @returns {Promise}
*/
export const updatePigBatch = (id, batchData) => {
- return http.put(`/api/v1/pig-batches/${id}`, batchData);
+ return http.put(`/api/v1/pig-batches/${id}`, batchData);
};
/**
@@ -237,7 +234,7 @@ export const updatePigBatch = (id, batchData) => {
* @returns {Promise}
*/
export const deletePigBatch = (id) => {
- return http.delete(`/api/v1/pig-batches/${id}`);
+ return http.delete(`/api/v1/pig-batches/${id}`);
};
// --- 猪批次业务操作 ---
@@ -249,7 +246,7 @@ export const deletePigBatch = (id) => {
* @returns {Promise}
*/
export const assignPensToBatch = (id, pensData) => {
- return http.post(`/api/v1/pig-batches/assign-pens/${id}`, pensData);
+ return http.post(`/api/v1/pig-batches/assign-pens/${id}`, pensData);
};
/**
@@ -259,7 +256,7 @@ export const assignPensToBatch = (id, pensData) => {
* @returns {Promise}
*/
export const removePenFromBatch = (penID, batchID) => {
- return http.delete(`/api/v1/pig-batches/remove-pen/${penID}/${batchID}`);
+ return http.delete(`/api/v1/pig-batches/remove-pen/${penID}/${batchID}`);
};
/**
@@ -269,7 +266,7 @@ export const removePenFromBatch = (penID, batchID) => {
* @returns {Promise}
*/
export const buyPigsForBatch = (id, buyData) => {
- return http.post(`/api/v1/pig-batches/buy-pigs/${id}`, buyData);
+ return http.post(`/api/v1/pig-batches/buy-pigs/${id}`, buyData);
};
/**
@@ -279,7 +276,7 @@ export const buyPigsForBatch = (id, buyData) => {
* @returns {Promise}
*/
export const sellPigsFromBatch = (id, sellData) => {
- return http.post(`/api/v1/pig-batches/sell-pigs/${id}`, sellData);
+ return http.post(`/api/v1/pig-batches/sell-pigs/${id}`, sellData);
};
/**
@@ -289,7 +286,7 @@ export const sellPigsFromBatch = (id, sellData) => {
* @returns {Promise}
*/
export const movePigsIntoPen = (id, moveData) => {
- return http.post(`/api/v1/pig-batches/move-pigs-into-pen/${id}`, moveData);
+ return http.post(`/api/v1/pig-batches/move-pigs-into-pen/${id}`, moveData);
};
/**
@@ -299,7 +296,7 @@ export const movePigsIntoPen = (id, moveData) => {
* @returns {Promise}
*/
export const transferPigsWithinBatch = (id, transferData) => {
- return http.post(`/api/v1/pig-batches/transfer-within-batch/${id}`, transferData);
+ return http.post(`/api/v1/pig-batches/transfer-within-batch/${id}`, transferData);
};
/**
@@ -309,7 +306,7 @@ export const transferPigsWithinBatch = (id, transferData) => {
* @returns {Promise}
*/
export const transferPigsAcrossBatches = (sourceBatchID, transferData) => {
- return http.post(`/api/v1/pig-batches/transfer-across-batches/${sourceBatchID}`, transferData);
+ return http.post(`/api/v1/pig-batches/transfer-across-batches/${sourceBatchID}`, transferData);
};
/**
@@ -319,7 +316,7 @@ export const transferPigsAcrossBatches = (sourceBatchID, transferData) => {
* @returns {Promise}
*/
export const reclassifyPenToNewBatch = (fromBatchID, reclassifyData) => {
- return http.post(`/api/v1/pig-batches/reclassify-pen/${fromBatchID}`, reclassifyData);
+ return http.post(`/api/v1/pig-batches/reclassify-pen/${fromBatchID}`, reclassifyData);
};
// --- 猪只数量变更记录 ---
@@ -331,7 +328,7 @@ export const reclassifyPenToNewBatch = (fromBatchID, reclassifyData) => {
* @returns {Promise}
*/
export const recordSickPigsInBatch = (id, sickData) => {
- return http.post(`/api/v1/pig-batches/record-sick-pigs/${id}`, sickData);
+ return http.post(`/api/v1/pig-batches/record-sick-pigs/${id}`, sickData);
};
/**
@@ -341,7 +338,7 @@ export const recordSickPigsInBatch = (id, sickData) => {
* @returns {Promise}
*/
export const recordSickPigRecoveryInBatch = (id, recoveryData) => {
- return http.post(`/api/v1/pig-batches/record-sick-pig-recovery/${id}`, recoveryData);
+ return http.post(`/api/v1/pig-batches/record-sick-pig-recovery/${id}`, recoveryData);
};
/**
@@ -351,7 +348,7 @@ export const recordSickPigRecoveryInBatch = (id, recoveryData) => {
* @returns {Promise}
*/
export const recordSickPigDeathInBatch = (id, deathData) => {
- return http.post(`/api/v1/pig-batches/record-sick-pig-death/${id}`, deathData);
+ return http.post(`/api/v1/pig-batches/record-sick-pig-death/${id}`, deathData);
};
/**
@@ -361,7 +358,7 @@ export const recordSickPigDeathInBatch = (id, deathData) => {
* @returns {Promise}
*/
export const recordSickPigCullInBatch = (id, cullData) => {
- return http.post(`/api/v1/pig-batches/record-sick-pig-cull/${id}`, cullData);
+ return http.post(`/api/v1/pig-batches/record-sick-pig-cull/${id}`, cullData);
};
/**
@@ -371,7 +368,7 @@ export const recordSickPigCullInBatch = (id, cullData) => {
* @returns {Promise}
*/
export const recordDeathInBatch = (id, deathData) => {
- return http.post(`/api/v1/pig-batches/record-death/${id}`, deathData);
+ return http.post(`/api/v1/pig-batches/record-death/${id}`, deathData);
};
/**
@@ -381,7 +378,7 @@ export const recordDeathInBatch = (id, deathData) => {
* @returns {Promise}
*/
export const recordCullInBatch = (id, cullData) => {
- return http.post(`/api/v1/pig-batches/record-cull/${id}`, cullData);
+ return http.post(`/api/v1/pig-batches/record-cull/${id}`, cullData);
};
// --- 新增的猪栏和猪舍API ---
@@ -391,7 +388,7 @@ export const recordCullInBatch = (id, cullData) => {
* @returns {Promise>}
*/
export const getAllPens = () => {
- return http.get('/api/v1/pens');
+ return http.get('/api/v1/pens');
};
/**
@@ -399,29 +396,29 @@ export const getAllPens = () => {
* @returns {Promise>}
*/
export const getAllPigHouses = () => {
- return http.get('/api/v1/pig-houses');
+ return http.get('/api/v1/pig-houses');
};
export const PigBatchApi = {
- getPigBatches,
- createPigBatch,
- getPigBatchById,
- updatePigBatch,
- deletePigBatch,
- assignPensToBatch,
- removePenFromBatch,
- buyPigsForBatch,
- sellPigsFromBatch,
- movePigsIntoPen,
- transferPigsWithinBatch,
- transferPigsAcrossBatches,
- reclassifyPenToNewBatch,
- recordSickPigsInBatch,
- recordSickPigRecoveryInBatch,
- recordSickPigDeathInBatch,
- recordSickPigCullInBatch,
- recordDeathInBatch,
- recordCullInBatch,
- getAllPens,
- getAllPigHouses,
+ getPigBatches,
+ createPigBatch,
+ getPigBatchById,
+ updatePigBatch,
+ deletePigBatch,
+ assignPensToBatch,
+ removePenFromBatch,
+ buyPigsForBatch,
+ sellPigsFromBatch,
+ movePigsIntoPen,
+ transferPigsWithinBatch,
+ transferPigsAcrossBatches,
+ reclassifyPenToNewBatch,
+ recordSickPigsInBatch,
+ recordSickPigRecoveryInBatch,
+ recordSickPigDeathInBatch,
+ recordSickPigCullInBatch,
+ recordDeathInBatch,
+ recordCullInBatch,
+ getAllPens,
+ getAllPigHouses,
};
diff --git a/src/components/PlanDetail.vue b/src/components/PlanDetail.vue
index 1aded98f..6904740f 100644
--- a/src/components/PlanDetail.vue
+++ b/src/components/PlanDetail.vue
@@ -1,15 +1,15 @@
-
+
重新加载
@@ -20,27 +20,35 @@
{{ plan.name }} - 内容
- 保存
- 取消
- 编辑内容
+ 保存
+
+ 取消
+
+
+ 编辑内容
+
增加子计划
+ v-if="plan.content_type === 'sub_plans' || !plan.content_type"
+ type="primary"
+ size="small"
+ @click="showAddSubPlanDialog"
+ :disabled="plan.plan_type === '系统任务'"
+ >增加子计划
+
增加子任务
+ v-if="plan.content_type === 'tasks' || !plan.content_type"
+ type="primary"
+ size="small"
+ @click="showTaskEditorDialog()"
+ :disabled="plan.plan_type === '系统任务'"
+ >增加子任务
+
@@ -51,10 +59,10 @@
任务列表
{{ task.name }} ({{ task.type === 'waiting' ? '延时任务' : '未知任务' }})
@@ -63,8 +71,12 @@
延时: {{ task.parameters.delay_duration }} 秒
- 编辑
- 删除
+ 编辑
+
+ 删除
+
@@ -76,13 +88,16 @@
子计划列表
-
+
@@ -102,22 +117,22 @@
@@ -130,32 +145,35 @@
-
+
-
+
-
+
currentTaskForm.parameters = val"
- prop-path="parameters.delay_duration"
- :is-editing="true"
- :disabled="plan.plan_type === '系统任务'"
+ :parameters="currentTaskForm.parameters"
+ @update:parameters="val => currentTaskForm.parameters = val"
+ prop-path="parameters.delay_duration"
+ :is-editing="true"
+ :disabled="plan.plan_type === '系统任务'"
/>
@@ -172,17 +190,17 @@