From 1073379b096b93bc429cc22c395994303c96550a Mon Sep 17 00:00:00 2001 From: wangyu <823267011@qq.com> Date: Mon, 29 Jun 2026 16:20:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(quality):=20=E5=B7=A6=E4=BE=A7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=8A=A0=E9=AB=98=20+=20=E5=A4=8D=E9=80=89/=E5=8D=95?= =?UTF-8?q?=E9=80=89=E4=B8=BB=E9=A2=98=E6=A0=B7=E5=BC=8F=20+=20=E7=BC=BA?= =?UTF-8?q?=E9=99=B7=E5=9B=BE=E7=89=87=E6=94=B9=E9=99=84=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E9=A2=84=E8=A7=88=20+=20=E9=92=A2=E5=8D=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=8C=89L2=E7=B2=BE=E7=AE=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 钢卷列表高度撑满;选中态/悬浮改主题红 - 复选框/单选框 accent-color 主题红、统一尺寸 - 缺陷图片改为附件上传(客户端压缩为base64)+ 缩略图 + 点击大图预览,去掉URL输入 - qc_defect.image_url 改 TEXT 以存图片 - 钢卷信息只保留 L2 实际有的字段(卷号/订单号/钢种/规格/厚宽/内径/毛净重/状态/备注) Co-Authored-By: Claude Opus 4.8 --- backend/app/database.py | 1 + backend/app/models/quality.py | 2 +- frontend/src/views/Quality.vue | 100 +++++++++++++++++++++++---------- 3 files changed, 72 insertions(+), 31 deletions(-) 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 @@ + +
+ +
+