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

@ -138,3 +138,27 @@ def delete_service(service_id):
except Exception as e:
current_app.logger.error(f'删除服务权益失败: {str(e)}')
return jsonify({'code': 500, 'msg': '内部服务器错误'}), 500
# ------------------------------------------------------------------
# 供应商建议
# ------------------------------------------------------------------
@inbound_bp.route('/service/suggestions/providers', methods=['GET'])
@jwt_required()
def get_provider_suggestions():
base_id = request.args.get('base_id', type=int)
if not base_id:
return jsonify({'code': 400, 'msg': 'base_id required'}), 400
data = ServiceService.get_history_providers(base_id)
return jsonify({'code': 200, 'msg': 'success', 'data': data})
# ------------------------------------------------------------------
# 系统用户建议
# ------------------------------------------------------------------
@inbound_bp.route('/service/suggestions/users', methods=['GET'])
@jwt_required()
def get_user_suggestions():
keyword = request.args.get('keyword', '')
data = ServiceService.search_system_users(keyword)
return jsonify({'code': 200, 'msg': 'success', 'data': data})