From c35627d60a9fee05ccf7319d8184efb6eae876c5 Mon Sep 17 00:00:00 2001 From: zlwu <704541015@qq.com> Date: Tue, 28 Jul 2026 09:31:51 +0800 Subject: [PATCH] feat(pl): show brand constraint on plan product rows Co-authored-by: Cursor --- backend/app/schemas/pl/plan.py | 3 +++ backend/app/services/pl_plan_service.py | 3 +++ web-admin/src/api/pl/index.ts | 3 +++ .../pl-plan-form-dialog/PlPlanFormProductTable.vue | 9 +++++++++ 4 files changed, 18 insertions(+) diff --git a/backend/app/schemas/pl/plan.py b/backend/app/schemas/pl/plan.py index 3fff589d0..d5cb835a6 100644 --- a/backend/app/schemas/pl/plan.py +++ b/backend/app/schemas/pl/plan.py @@ -17,6 +17,9 @@ class PlanProductBase(BaseModel): product_id: str = Field(..., alias="productId", description="产品ID") product_no: str = Field(..., max_length=50, alias="productNo", description="产品编号") product_name: str = Field(..., max_length=200, alias="productName", description="产品名称") + brand_mode: Optional[str] = Field(default=None, alias="brandMode", description="required/any") + brand_id: Optional[str] = Field(default=None, alias="brandId", description="指定品牌ID") + brand_name: Optional[str] = Field(default=None, alias="brandName", description="品牌名快照") model: Optional[str] = Field(default=None, max_length=100, description="规格型号") unit: str = Field(default="吨", max_length=20, description="单位") category_name: Optional[str] = Field(default=None, max_length=200, alias="categoryName", description="产品分类") diff --git a/backend/app/services/pl_plan_service.py b/backend/app/services/pl_plan_service.py index 223b252e1..bccc8171b 100644 --- a/backend/app/services/pl_plan_service.py +++ b/backend/app/services/pl_plan_service.py @@ -115,6 +115,9 @@ def build_plan_product( product_id=prod.product_id, product_no=prod.product_no, product_name=prod.product_name, + brand_mode=prod.brand_mode, + brand_id=prod.brand_id, + brand_name=prod.brand_name, model=prod.model, unit=prod.unit or "吨", category_name=prod.category_name, diff --git a/web-admin/src/api/pl/index.ts b/web-admin/src/api/pl/index.ts index a1b5f4295..428420549 100644 --- a/web-admin/src/api/pl/index.ts +++ b/web-admin/src/api/pl/index.ts @@ -382,6 +382,9 @@ export interface PlanProduct { productId: string productNo: string productName: string + brandMode?: string + brandId?: string + brandName?: string model?: string unit: string categoryName?: string diff --git a/web-admin/src/components/business/pl-plan-form-dialog/PlPlanFormProductTable.vue b/web-admin/src/components/business/pl-plan-form-dialog/PlPlanFormProductTable.vue index 0bee505b6..6e87e1a85 100644 --- a/web-admin/src/components/business/pl-plan-form-dialog/PlPlanFormProductTable.vue +++ b/web-admin/src/components/business/pl-plan-form-dialog/PlPlanFormProductTable.vue @@ -8,6 +8,15 @@ + + +