支持移除猪栏
This commit is contained in:
@@ -7,7 +7,9 @@
|
|||||||
<span>批次编号: {{ batch.batch_number }}</span>
|
<span>批次编号: {{ batch.batch_number }}</span>
|
||||||
<span>状态: {{ batch.status }}</span>
|
<span>状态: {{ batch.status }}</span>
|
||||||
<span>初始数量: {{ batch.initial_count }}</span>
|
<span>初始数量: {{ batch.initial_count }}</span>
|
||||||
<span v-if="batch.currentTotalQuantity !== undefined && batch.currentTotalQuantity !== null">当前总数: {{ batch.currentTotalQuantity }}</span>
|
<span v-if="batch.currentTotalQuantity !== undefined && batch.currentTotalQuantity !== null">当前总数: {{
|
||||||
|
batch.currentTotalQuantity
|
||||||
|
}}</span>
|
||||||
<span v-if="batch.origin_type">批次来源: {{ batch.origin_type }}</span>
|
<span v-if="batch.origin_type">批次来源: {{ batch.origin_type }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="batch-info-line">
|
<div class="batch-info-line">
|
||||||
@@ -27,7 +29,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="batch-actions">
|
<div class="batch-actions">
|
||||||
<el-button size="small" type="primary" @click.stop="showAddPenDialog(batch)" :disabled="!batch.is_active">增加猪栏</el-button>
|
<el-button size="small" type="primary" @click.stop="showAddPenDialog(batch)" :disabled="!batch.is_active">
|
||||||
|
增加猪栏
|
||||||
|
</el-button>
|
||||||
<el-button size="small" @click.stop="emitEditBatch(batch)">编辑</el-button>
|
<el-button size="small" @click.stop="emitEditBatch(batch)">编辑</el-button>
|
||||||
<el-button size="small" type="danger" @click.stop="emitDeleteBatch(batch)">删除</el-button>
|
<el-button size="small" type="danger" @click.stop="emitDeleteBatch(batch)">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -252,20 +256,6 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.batch-info-line .red-text {
|
.batch-info-line .red-text {
|
||||||
color: red !important; // src/api/pigBatch.js 中错误的部分
|
color: red !important;
|
||||||
|
|
||||||
/**
|
|
||||||
* 从猪批次移除空栏
|
|
||||||
* @param {number} batchID - 猪批次ID
|
|
||||||
* @param {number} penID - 待移除的猪栏ID
|
|
||||||
* @returns {Promise<*>}
|
|
||||||
*/
|
|
||||||
export const removePenFromBatch = (batchID, penID) = > {
|
|
||||||
// BUG: URL中的参数顺序 ${penID}/${batchID} 与函数签名 (batchID, penID) 不一致
|
|
||||||
|
|
||||||
return http.
|
|
||||||
|
|
||||||
delete(` /api/ v1 /pig-batches/ remove-pen / ${penID} / ${batchID} `);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user