feat: add backend autocomplete for suppliers and users in inbound

Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
This commit is contained in:
dxc
2026-02-10 13:51:19 +08:00
parent 17a61b489c
commit 94ff7cecdc
8 changed files with 209 additions and 7 deletions

View File

@ -110,4 +110,26 @@ def get_history(id):
})
except Exception as e:
traceback.print_exc()
return jsonify({"code": 500, "msg": str(e)}), 500
return jsonify({"code": 500, "msg": str(e)}), 500
# ------------------------------------------------------------------
# 6. 供应商建议
# ------------------------------------------------------------------
@inbound_buy_bp.route('/suggestions/suppliers', methods=['GET'])
def get_supplier_suggestions():
base_id = request.args.get('base_id', type=int)
if not base_id:
return jsonify({"code": 400, "msg": "base_id required"}), 400
data = BuyInboundService.get_history_suppliers(base_id)
return jsonify({"code": 200, "msg": "success", "data": data})
# ------------------------------------------------------------------
# 7. 系统用户建议
# ------------------------------------------------------------------
@inbound_buy_bp.route('/suggestions/users', methods=['GET'])
def get_user_suggestions():
keyword = request.args.get('keyword', '')
data = BuyInboundService.search_system_users(keyword)
return jsonify({"code": 200, "msg": "success", "data": data})