diff --git a/inventory-backend/app/api/v1/warehouse.py b/inventory-backend/app/api/v1/warehouse.py index ad42d4f..fe48f52 100644 --- a/inventory-backend/app/api/v1/warehouse.py +++ b/inventory-backend/app/api/v1/warehouse.py @@ -176,7 +176,7 @@ def delete_location(location_id): return jsonify({'code': 404, 'msg': '库位不存在', 'data': None}) # 在删除前提取属性,避免 commit 后访问已删除对象 - location_code = location.location_code + deleted_loc_name = location.name # 递归删除所有子库位 def delete_recursive(loc): @@ -193,7 +193,7 @@ def delete_location(location_id): return jsonify({ 'code': 200, 'msg': '删除成功', - 'location_code': location_code + 'deleted_location': deleted_loc_name }) except Exception as e: db.session.rollback()