feat: 添加参考价格列 + 修复公司筛选跨域问题 + CLIP模型持久化

## 新增功能
- material_base 表新增 reference_price 列(NUMERIC(10,2))
- 基础信息 list.vue / buyOdoo.vue 页面增加「参考价格」列展示和编辑
- 新增 material_list:referencePrice 权限元素,支持按角色控制可见性

## Bug 修复
- 入库三页面(buy/product/semi)公司筛选:非超管用户 company=ALL 不再传给旧版后端
- 基础信息两页面(list/buyOdoo):buyOdoo 增加 v-if=isSuperAdmin 与 list.vue 行为统一
- company=ALL 默认值在各页面 getList/fetchData 中自动过滤,兼容旧版后端

## 运维优化
- docker-compose.prod.yml 增加 models_prod 卷挂载,CLIP模型持久化免重复上传
- deploy_code.sh 增加 models_prod 目录检查与模型文件存在性告警
This commit is contained in:
yueli
2026-07-13 17:30:52 +08:00
parent 4f5965db02
commit 760f78e016
10 changed files with 112 additions and 24 deletions

View File

@ -39,6 +39,9 @@ class MaterialBase(db.Model):
# 强制质检标记(采购入库时必须上传检测报告)
is_inspection_required = db.Column(db.Boolean, default=False, comment='是否强制要求质检')
# 参考价格
reference_price = db.Column(db.Numeric(10, 2), nullable=True, comment='参考价格')
# CLIP 视觉向量(用于以图搜图)
img_embedding = db.Column(Vector(512), nullable=True)
@ -96,6 +99,8 @@ class MaterialBase(db.Model):
'isEnabled': bool(self.is_enabled),
# 强制质检标记
'isInspectionRequired': bool(self.is_inspection_required),
# 参考价格
'referencePrice': float(self.reference_price) if self.reference_price is not None else None,
}