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:
@ -259,6 +259,7 @@ class MaterialBaseService:
|
||||
'type': 'material_type',
|
||||
'spec': 'spec_model',
|
||||
'unit': 'unit',
|
||||
'referencePrice': 'reference_price',
|
||||
'inventoryCount': 'total_inv',
|
||||
'availableCount': 'total_avail'
|
||||
}
|
||||
@ -273,6 +274,7 @@ class MaterialBaseService:
|
||||
'type': 'material_list:type',
|
||||
'spec': 'material_list:spec',
|
||||
'unit': 'material_list:unit',
|
||||
'referencePrice': 'material_list:referencePrice',
|
||||
'inventoryCount': 'material_list:inventoryCount',
|
||||
'availableCount': 'material_list:availableCount'
|
||||
}
|
||||
@ -390,6 +392,7 @@ class MaterialBaseService:
|
||||
'type': MaterialBase.material_type,
|
||||
'spec': MaterialBase.spec_model,
|
||||
'unit': MaterialBase.unit,
|
||||
'referencePrice': MaterialBase.reference_price,
|
||||
'inventoryCount': inner_sub.c.total_inv,
|
||||
'availableCount': inner_sub.c.total_avail
|
||||
}
|
||||
@ -556,6 +559,7 @@ class MaterialBaseService:
|
||||
product_image=json.dumps(data.get('generalImage', [])),
|
||||
product_image_remark=data.get('productImageRemark', ''),
|
||||
manual_link_remark=data.get('manualLinkRemark', ''),
|
||||
reference_price=data.get('referencePrice'),
|
||||
is_enabled=is_enabled_val
|
||||
)
|
||||
db.session.add(new_material)
|
||||
@ -625,6 +629,9 @@ class MaterialBaseService:
|
||||
)
|
||||
|
||||
# 【核心修改】:兼容前端传来的布尔值
|
||||
if 'referencePrice' in data:
|
||||
material.reference_price = data['referencePrice']
|
||||
|
||||
if 'isEnabled' in data:
|
||||
raw_enabled = data['isEnabled']
|
||||
material.is_enabled = str(raw_enabled).lower() in ['1', 'true', 'yes', 't']
|
||||
|
||||
Reference in New Issue
Block a user