feat(pl): show brand constraint on plan product rows

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-07-28 09:31:51 +08:00
1 parent cd33befa07
commit c35627d60a
4 files changed
+18

No files matched your search

+3
View File
@@ -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="产品分类")
+3
View File
@@ -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,
+3
View File
@@ -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
@@ -8,6 +8,15 @@
<PlProductNameHazardCell :product="row" />
</template>
</el-table-column>
<el-table-column label="品牌约定" min-width="110" align="center">
<template #default="{ row }">
<el-tag v-if="row.brandMode === 'required'" size="small" type="warning">
{{ row.brandName || '指定品牌' }}
</el-tag>
<el-tag v-else-if="row.brandMode === 'any'" size="small" type="info">不限</el-tag>
<span v-else>—</span>
</template>
</el-table-column>
<el-table-column label="型号/规格" min-width="120" show-overflow-tooltip>
<template #default="{ row }">
{{ row.model || row.productModel || '—' }}