- 从物料跟踪页面移除订单号列和表单字段 - 从导航菜单移除PDI管理,添加设备巡检 - 新增InspectionLocation和InspectionRecord后端模型和API - 新增设备巡检前端页面(左侧点位列表,右侧设备和历史记录)
29 lines
1.0 KiB
Python
29 lines
1.0 KiB
Python
from sqlalchemy import Column, Integer, String, Text, DateTime, ForeignKey, func
|
|
from app.database import Base
|
|
|
|
|
|
class InspectionLocation(Base):
|
|
__tablename__ = "inspection_locations"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
code = Column(String(30), unique=True, nullable=False, index=True)
|
|
name = Column(String(100), nullable=False)
|
|
description = Column(Text)
|
|
sort_order = Column(Integer, default=0)
|
|
created_at = Column(DateTime, server_default=func.now())
|
|
|
|
|
|
class InspectionRecord(Base):
|
|
__tablename__ = "inspection_records"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
location_id = Column(Integer, ForeignKey("inspection_locations.id"), nullable=False)
|
|
location_name = Column(String(100))
|
|
equipment_code = Column(String(30), index=True)
|
|
equipment_name = Column(String(100))
|
|
scan_code = Column(String(200))
|
|
inspector = Column(String(50), nullable=False)
|
|
result = Column(String(20), default="normal")
|
|
notes = Column(Text)
|
|
created_at = Column(DateTime, server_default=func.now())
|