修改半成品与成品出入库相关联逻辑

This commit is contained in:
dxc
2026-02-05 13:17:39 +08:00
parent aa40d4a6da
commit 10e53cab23
5 changed files with 90 additions and 23 deletions

View File

@ -19,7 +19,7 @@ def search_base():
# ------------------------------------------------------------------
# 1. 获取列表 (修改:支持状态筛选)
# 1. 获取列表 (修改:接收 status 参数)
# ------------------------------------------------------------------
@inbound_product_bp.route('/list', methods=['GET'])
def get_list():
@ -27,8 +27,7 @@ def get_list():
page = request.args.get('page', 1, type=int)
limit = request.args.get('pageSize', 15, type=int)
keyword = request.args.get('keyword', '')
# 获取状态列表参数
# 接收状态参数
statuses_str = request.args.get('statuses', '')
statuses = statuses_str.split(',') if statuses_str else []
@ -78,5 +77,17 @@ def delete(id):
try:
ProductInboundService.delete_inbound(id)
return jsonify({"code": 200, "msg": "删除成功"})
except Exception as e:
return jsonify({"code": 500, "msg": str(e)}), 500
# ------------------------------------------------------------------
# 5. [新增] 获取出库历史
# ------------------------------------------------------------------
@inbound_product_bp.route('/<int:id>/history', methods=['GET'])
def get_history(id):
try:
data = ProductInboundService.get_outbound_history(id)
return jsonify({"code": 200, "msg": "success", "data": data})
except Exception as e:
return jsonify({"code": 500, "msg": str(e)}), 500