diff --git a/backend/app/database.py b/backend/app/database.py index f5adbbf..166f905 100644 --- a/backend/app/database.py +++ b/backend/app/database.py @@ -70,6 +70,7 @@ async def _run_migrations(conn): "ALTER TABLE production_plans ADD COLUMN IF NOT EXISTS run_data JSONB", "ALTER TABLE production_records ADD COLUMN IF NOT EXISTS process_data JSONB", "ALTER TABLE qc_defect ADD COLUMN IF NOT EXISTS inherit_source VARCHAR(30)", + "ALTER TABLE qc_defect ALTER COLUMN image_url TYPE TEXT", # 状态列改为 VARCHAR 以适配新值 "ALTER TABLE production_plans ALTER COLUMN status TYPE VARCHAR(20) USING status::text", # production_records 新字段 diff --git a/backend/app/models/quality.py b/backend/app/models/quality.py index fbd1b93..9a0f97d 100644 --- a/backend/app/models/quality.py +++ b/backend/app/models/quality.py @@ -58,7 +58,7 @@ class QcDefect(Base): side_drive = Column(Boolean, default=False, comment="驱动侧") is_main = Column(Boolean, default=False, comment="主缺陷") inherit_source = Column(String(30), nullable=True, comment="继承来源卷号") - image_url = Column(String(255), nullable=True, comment="缺陷图片URL") + image_url = Column(Text, nullable=True, comment="缺陷图片(URL或base64)") # 兼容旧字段 production_line = Column(String(50), nullable=True) diff --git a/frontend/src/views/Quality.vue b/frontend/src/views/Quality.vue index ba2fd82..bdbee22 100644 --- a/frontend/src/views/Quality.vue +++ b/frontend/src/views/Quality.vue @@ -131,32 +131,15 @@
入场卷号{{ selectedCoil.coil_no || '—' }}
-
当前卷号{{ selectedCoil.coil_no || '—' }}
-
厂家原料号{{ selectedCoil.order_no || '—' }}
-
逻辑库位酸连轧原料库
-
实际库区
-
班组{{ selectedCoil.shift || '—' }}
-
材料类型原料
-
物料名热轧卷板
-
规格{{ specStr }}
-
材质{{ selectedCoil.steel_grade || '—' }}
-
厂家
-
镀层质量
-
表面处理
-
质量状态
-
切边要求
-
原料材质{{ selectedCoil.steel_grade || '—' }}
-
包装要求
-
实测厚度[mm]{{ selectedCoil.target_thickness || '—' }}
-
实测宽度[mm]{{ selectedCoil.target_width || '—' }}
-
长度[m]
+
订单号{{ selectedCoil.order_no || '—' }}
+
钢种{{ selectedCoil.steel_grade || '—' }}
+
规格[mm]{{ specStr }}
+
目标厚度[mm]{{ fmtNum(selectedCoil.target_thickness, 2) }}
+
目标宽度[mm]{{ fmtNum(selectedCoil.target_width, 0) }}
+
内径[mm]{{ fmtNum(selectedCoil.inner_diameter, 0) }}
毛重[t]{{ weightT(selectedCoil.gross_weight) }}
净重[t]{{ weightT(selectedCoil.net_weight) }}
-
生产开始
-
生产结束
-
调制度
-
镀层种类
-
钢卷表面处理
+
状态{{ coilStatusLabel(selectedCoil.status) }}
备注{{ selectedCoil.remark || '—' }}
@@ -222,7 +205,16 @@ {{ d.inherit_source || '—' }} - + +
+ + +
+ + 清空 删除 @@ -240,6 +232,11 @@ + +
+ +
+