提交
This commit is contained in:
1 parent
012a2ad68e
commit
5fe53c5481
4775 files changed
+2190111
-40277
No files matched your search
@@ -77,6 +77,7 @@ from app.crud.crm.customer import (
|
||||
get_customer,
|
||||
get_park_area_list,
|
||||
into_pool,
|
||||
list_customer_options,
|
||||
list_customers,
|
||||
list_pool_customers,
|
||||
soft_delete_customer,
|
||||
@@ -207,6 +208,7 @@ from app.schemas.crm.customer import (
|
||||
CustomerCreateBody,
|
||||
CustomerDeleteBody,
|
||||
CustomerListBody,
|
||||
CustomerOptionsBody,
|
||||
CustomerUpdateBody,
|
||||
)
|
||||
from app.schemas.crm.contact import (
|
||||
@@ -412,6 +414,29 @@ def customer_detail(
|
||||
return error_response(500, str(e))
|
||||
|
||||
|
||||
@router.post("/customer/options")
|
||||
def customer_options(
|
||||
body: CustomerOptionsBody,
|
||||
_user: dict = Depends(require_admin_or_super_admin),
|
||||
db: Session = Depends(get_db),
|
||||
):
|
||||
"""客户下拉选项(租户内只读,不做 owner 数据权限)"""
|
||||
try:
|
||||
tenant_no = get_tenant_no(db, _user)
|
||||
keyword = (body.keyword or body.customer_name or "").strip() or None
|
||||
options = list_customer_options(
|
||||
db,
|
||||
tenant_no,
|
||||
keyword=keyword,
|
||||
limit=body.limit,
|
||||
)
|
||||
return success_response(options)
|
||||
except ValueError as e:
|
||||
return error_response(400, str(e))
|
||||
except Exception as e:
|
||||
return error_response(500, str(e))
|
||||
|
||||
|
||||
@router.post("/customer/add")
|
||||
@oper_log(title="CRM客户管理", business_type=1, summary="新增客户【{customerName}】")
|
||||
def customer_create(
|
||||
@@ -741,6 +766,7 @@ def product_options(
|
||||
keyword=body.keyword,
|
||||
category_id=body.category_id,
|
||||
user_info=user_info,
|
||||
limit=body.limit,
|
||||
)
|
||||
return success_response(options)
|
||||
except ValueError as e:
|
||||
|
||||
Reference in new issue
Block a user