fix: 入库 search-base 物料选择加公司隔离,恢复半成品批号按本公司历史自动递增
This commit is contained in:
@ -59,6 +59,11 @@ class BuyInboundService:
|
|||||||
)
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
# ★ 行级公司隔离:只能搜索/选择本公司的物料(超管/跨域不受限)
|
||||||
|
from app.utils.decorators import get_current_company_filter
|
||||||
|
company_limit = get_current_company_filter()
|
||||||
|
if company_limit is not None:
|
||||||
|
query = query.filter(MaterialBase.company_name == company_limit)
|
||||||
query = query.order_by(MaterialBase.id.desc())
|
query = query.order_by(MaterialBase.id.desc())
|
||||||
pagination = query.paginate(page=page, per_page=limit, error_out=False)
|
pagination = query.paginate(page=page, per_page=limit, error_out=False)
|
||||||
|
|
||||||
|
|||||||
@ -43,6 +43,11 @@ class ProductInboundService:
|
|||||||
MaterialBase.company_name.ilike(kw)
|
MaterialBase.company_name.ilike(kw)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
# ★ 行级公司隔离:只能搜索/选择本公司的物料(超管/跨域不受限)
|
||||||
|
from app.utils.decorators import get_current_company_filter
|
||||||
|
company_limit = get_current_company_filter()
|
||||||
|
if company_limit is not None:
|
||||||
|
query = query.filter(MaterialBase.company_name == company_limit)
|
||||||
query = query.order_by(MaterialBase.id.desc())
|
query = query.order_by(MaterialBase.id.desc())
|
||||||
pagination = query.paginate(page=page, per_page=limit, error_out=False)
|
pagination = query.paginate(page=page, per_page=limit, error_out=False)
|
||||||
results = []
|
results = []
|
||||||
|
|||||||
@ -53,6 +53,11 @@ class SemiInboundService:
|
|||||||
MaterialBase.company_name.ilike(kw)
|
MaterialBase.company_name.ilike(kw)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
# ★ 行级公司隔离:只能搜索/选择本公司的物料(超管/跨域不受限)
|
||||||
|
from app.utils.decorators import get_current_company_filter
|
||||||
|
company_limit = get_current_company_filter()
|
||||||
|
if company_limit is not None:
|
||||||
|
query = query.filter(MaterialBase.company_name == company_limit)
|
||||||
query = query.order_by(MaterialBase.id.desc())
|
query = query.order_by(MaterialBase.id.desc())
|
||||||
pagination = query.paginate(page=page, per_page=limit, error_out=False)
|
pagination = query.paginate(page=page, per_page=limit, error_out=False)
|
||||||
results = []
|
results = []
|
||||||
|
|||||||
@ -55,6 +55,11 @@ class ServiceService:
|
|||||||
MaterialBase.spec_model.ilike(f'%{keyword}%'),
|
MaterialBase.spec_model.ilike(f'%{keyword}%'),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
# ★ 行级公司隔离:只能搜索/选择本公司的物料(超管/跨域不受限)
|
||||||
|
from app.utils.decorators import get_current_company_filter
|
||||||
|
company_limit = get_current_company_filter()
|
||||||
|
if company_limit is not None:
|
||||||
|
query = query.filter(MaterialBase.company_name == company_limit)
|
||||||
query = query.order_by(MaterialBase.id.desc()).limit(20)
|
query = query.order_by(MaterialBase.id.desc()).limit(20)
|
||||||
|
|
||||||
results = []
|
results = []
|
||||||
|
|||||||
Reference in New Issue
Block a user