|
|
a8a3c82331
|
fix(stock): 补行级防穿仓与入库改量下限,杜绝可用数变负
available_quantity 一旦为负,预占/释放/盘点的全部算术都会失真。此前有两处
缺口,本次一并堵上,使 available_quantity >= 0 成为不变量。
1) 执行阶段逐行扣减无下限校验(inventory_reservation.restore_then_deduct)
物料级校验只保证「Σ实扫 ≤ Σ可用」这一总量关系,拦不住「总量守恒但单行
穿仓」:同物料下 A 批可用 2、B 批可用 8,工人把 5 件全压在 A 批上,总量
5 ≤ 10 通过,A 批却被扣成 -3。借库走 deduct_stock=False,连实物数校验都
跳过,是裸扣。
已实测复现:借库与出库路径均可把单行扣成 -3。
校验放在 release_reserved() 之后,故不会误拒合法的换批次(物理覆盖):
释放后每行 available 已含本单预占,扫自己预占过的批次时 raw >= 0 保证
必然放行;改扫其它批次时,该批次实时可用量就是它自己的上限。
2) 下调入库数量可把可用数压成负(buy/product/semi 三处 update_inbound)
按 diff 同步增减 stock/available,但无任何下限检查。该批次若已有部分被
预占/出库/借出,向下调整即产生负可用数。现在下调前校验可用数是否够扣。
正常数据下 stock >= available 恒成立,故守住 available 同时守住 stock。
配套:三个 update_* 端点此前只捕获 Exception → 500,没有 ValueError 分支
(同文件的 delete_* 早就有)。补上 400 分支,使业务校验失败不再被记成
服务端故障。
验证(事务内执行并回滚,未落库):跨批次穿仓被拦、合法换批次放行、全额执行
本单预占批次放行、下调击穿被拦(API 返回 400,三个端点一致)、上调不受影响、
真实借库单 52 行全额执行正常、全库无负可用数。
|
2026-09-11 10:34:15 +08:00 |
|
|
|
2b0e335790
|
fix(inbound/buy): 批号自增改为按物料精准取最近一条
- 新增 get_latest_batch_record_by_base_id:SQL 直接 filter(base_id)+order by in_date/id desc first(),O(1) 不分页
- 新增 GET /inbound/buy/latest-record
- 修复原“拉全表前1000条再前端过滤”导致的历史被截断→批号退回000001/重复入库被拦(如 CCAB0029)
|
2026-09-08 18:16:04 +08:00 |
|
|
|
e5c49c5177
|
fix: 入库 search-base 物料选择加公司隔离,恢复半成品批号按本公司历史自动递增
|
2026-09-04 09:42:49 +08:00 |
|
|
|
c68ffdca0f
|
fix: 入库成品/半成品/采购编辑其它字段时不再误清空图片——仅显式携带图片字段才更新
|
2026-09-03 14:14:24 +08:00 |
|
|
|
a11b7972c3
|
feat: 打通采购申请与入库的按单入库链路
后端变更:
- PurchaseRequest 新增 base_id 硬关联 MaterialBase,StockBuy 新增 request_id 关联采购单
- handle_inbound 支持 request_id 入参,入库后自动反写采购单状态为已完成
- 新增 get_approved_requests 接口,返回已审批未入库采购单列表(含物料信息+历史数据回退匹配)
- create_purchase_request 新增 name+spec_model 自动匹配 MaterialBase
- 新增 SQL 和 Alembic 数据库迁移脚本
前端变更:
- 入库表单新增"从采购单导入"弹窗,支持搜索/选中已审批采购单并一键填充物料和商务信息
- 单价/总价交叉推算,缺项自动补全
- 选中行蓝色高亮+点击整行选中,行级交互优化
|
2026-07-14 15:25:00 +08:00 |
|
|
|
a2f9a3e754
|
V3.54
|
2026-07-13 17:33:16 +08:00 |
|
|
|
4f5965db02
|
feat: JWT多租户数据权限隔离 & 主管系统管理权限 & 含税单价补齐
## 多租户公司数据隔离
- 新增 get_current_company_filter() 工具函数 (decorators.py)
SUPER_ADMIN: 可传company_name参数过滤或传ALL看全量
其他角色: 强制隔离到JWT中的company_name
- 重构 base_service.py / buy_service.py: 用集中式函数替换内联公司过滤
- SysRolePermission 表新增 company_name 字段,支持同角色不同公司权限
- get_user_permissions() 新增 company_name 参数,查公司定制+全局模板权限
- permission.py API 新增 @permission_required 拦截 + 公司过滤
- 19个API/service文件传递 company_name 到权限查询
## 主管系统管理权限
- delete_user() 允许SUPERVISOR删除同公司用户 (原仅SUPER_ADMIN)
- get_all_users() 新增 company_name 参数过滤
- 用户列表/权限分配 API 应用 get_current_company_filter()
- 前端 UserCreate.vue: 超管可见公司下拉框,主管隐藏部门字段
## 前端多租户适配
- material/list.vue / buy.vue: 公司下拉框仅超管可见,默认ALL
- UserCreate.vue: 新增搜索栏公司筛选,部门字段按角色显隐
- auth.ts: getUserList() 支持 params 参数
## Bug修复: 含税单价字段补齐
- buy.vue: 表格列/高级筛选/排序/权限映射新增 post_tax_unit_price
- buy_service.py: allowed_fields/sort_field_map 新增 post_tax_unit_price
|
2026-07-13 15:12:22 +08:00 |
|
|
|
afe0f25415
|
物料类别隔离校验:buy 改黑名单 + semi/product 改精确路径匹配,消除子串包含Bug
|
2026-06-05 13:01:39 +08:00 |
|
|
|
ff5418afa3
|
入库模块:物料搜索点击无感修复 + 类别校验白名单准入制
前端(buy/semi/product/service.vue,4 文件):
修复物料搜索"点击已聚焦 input 时内容被清空"交互 bug。
el-select 在 filterable+remote 模式下点击已聚焦的 input 时,el-select 内部
会 emit query='' 触发 remote-method,绕过 handleMaterialDropdownVisible
入口保护,直接清空 searchKeyword 和 materialOptions,导致用户被迫重写。
新增两层防御实现"编辑无感":
1) handleMaterialDropdownVisible 入口拦截:已选过物料(form.base_id 有值)
时下拉打开直接 return,不请求默认列表
2) handleSearchMaterial 内部拦截:拦截 el-select 内部 emit 的空 query,
仅在 form.base_id 有值 + safeQuery 为空 + 列表非空时 return
后端(buy/semi/product_service.py,3 文件):
入库类别校验从黑名单改为白名单准入制,彻底杜绝"成品进半成品库"
等非法组合(d94b52b 黑名单方案"成品不能进采购库"已挡不住这种组合)。
- buy_service.py: 黑名单(禁半成品/成品进采购)→ 白名单(必须含"原材料")
- semi_service.py: 统一错误信息格式为"只有【半成品】才允许半成品入库!"
- product_service.py: 统一错误信息格式为"只有【成品】才允许成品入库!"
- 三处空 category 统一显示为"未分类"
配合前端已修复的 catch 块(e.response.data.msg 精准提取),后端新错误
信息可原样弹窗给用户。
|
2026-06-04 17:57:17 +08:00 |
|
|
|
d94b52bf73
|
入库模块:物料类别隔离硬性校验(写拦截,读放宽)
|
2026-06-04 17:19:43 +08:00 |
|
|
|
fffee9d964
|
入库管理三页面类别搜索中间节点支持子级匹配(buy/semi/product 类别过滤改为 ilike 前缀,与基础信息页一致)
|
2026-06-04 11:31:44 +08:00 |
|
|
|
fb5b8d873b
|
版本变更V3.35将图像的处理统一更换到新表当中
|
2026-05-26 11:28:26 +08:00 |
|
|
|
682139bab8
|
版本变更V3.34将图像的处理统一更换到新表当中
|
2026-05-26 08:57:41 +08:00 |
|
|
|
567c3175f6
|
fix: 审计日志跳过向量字段,修复 numpy 数组比较异常;补全三大入库单更新向量提取,统一删除确认弹窗
|
2026-05-25 11:11:10 +08:00 |
|
|
|
1da4b454cd
|
feat: 新增物料/入库单实时 CLIP 向量提取(新建+更新),修复 I/O 延迟和路径解析静默失败
|
2026-05-25 10:04:32 +08:00 |
|
|
|
8291a89898
|
feat(backend): apply global cross-company data isolation logic across all inbound, outbound, and stock services
|
2026-04-17 09:57:00 +08:00 |
|
|
|
bd93a3d70b
|
feat: implement clean global cross-organization permission node and backend service isolation logic
|
2026-04-17 08:59:55 +08:00 |
|
|
|
477da7c434
|
fix-security-correct-field-permission-mapping-and-403-denial
|
2026-04-14 15:37:39 +08:00 |
|
|
|
0e8ddd0851
|
feat(security): implement strict row-level data isolation based on user company
|
2026-04-14 08:38:50 +08:00 |
|
|
|
4df471add2
|
fix(inbound): correct date attributes for StockProduct and StockSemi in history location query
|
2026-04-08 17:45:29 +08:00 |
|
|
|
4a4baa2f8f
|
fix: sort warehouse tree by name, fix tree batch delete cascade, and implement safe history location autofill
|
2026-04-08 17:32:00 +08:00 |
|
|
|
5ea2be58ae
|
fix(filter): globally apply not_contains operator parsing to all stock and inbound queries
|
2026-04-07 17:32:27 +08:00 |
|
|
|
f9edb5f1f7
|
fix(api): fix AttributeError on inbound deletion by accessing base.name instead of material_name
|
2026-03-25 11:02:32 +08:00 |
|
|
|
ac7774e0e3
|
fix(api): gracefully handle integrity error on inbound record deletion
|
2026-03-25 10:48:43 +08:00 |
|
|
|
032479fe38
|
fix: capture and persist target object names for delete, outbound, and borrow operations in audit logs
|
2026-03-20 15:47:13 +08:00 |
|
|
|
11f5a1f51e
|
fix: patch validation bypass for mandatory inspection
|
2026-03-17 13:26:17 +08:00 |
|
|
|
c1c494893f
|
feat: implement dynamic inspection requirement logic based on material master data
|
2026-03-17 11:56:04 +08:00 |
|
|
|
b1cc280a71
|
feat: 重构全局搜索框为复合条件选择,支持按名称、俗名、规格进行精准查杂
|
2026-03-11 13:37:52 +08:00 |
|
|
|
5d813c24bc
|
feat: 采购/半成品/成品列表拆分SKU独立搜索框
|
2026-03-09 17:29:24 +08:00 |
|
|
|
893be24071
|
feat: add column sorting and advanced filtering for purchase inbound
Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
|
2026-03-02 15:39:32 +08:00 |
|
|
|
a1df62238e
|
fix: correct post-tax unit price calculation in buy inbound service
Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
|
2026-02-27 16:28:22 +08:00 |
|
|
|
657c916703
|
feat: add post-tax unit price, company filter, and frontend price linkage
Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
|
2026-02-27 15:58:55 +08:00 |
|
|
|
3c1c822f88
|
feat: add pre/post-tax price linkage, hide barcode, and tablet adapt
Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
|
2026-02-27 15:44:10 +08:00 |
|
|
|
42171ed612
|
对于采购件的税率添加以及所属公司添加
|
2026-02-24 15:43:14 +08:00 |
|
|
|
5f3ceef3fd
|
修改采购件对于两个搜索框的bug修复
|
2026-02-11 13:39:02 +08:00 |
|
|
|
5532c87684
|
基础信息展示以及搜索逻辑进行修复
|
2026-02-11 13:12:05 +08:00 |
|
|
|
d0a237625c
|
feat: improve fuzzy search for buy inbound material
Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
|
2026-02-11 11:28:15 +08:00 |
|
|
|
b1e2836e4b
|
feat: expand search fields and remove result limits in buy inbound service
|
2026-02-11 11:28:02 +08:00 |
|
|
|
ec16ef8d20
|
对于采购件的内容进行修改,使其填写更加便利加上库位自动加载上一次的逻辑
|
2026-02-11 08:38:12 +08:00 |
|
|
|
d594ed7ef1
|
采购人根据历史上传记录来
|
2026-02-10 17:41:53 +08:00 |
|
|
|
8ee2a9a45b
|
采购人走用户的表
|
2026-02-10 17:20:06 +08:00 |
|
|
|
94ff7cecdc
|
feat: add backend autocomplete for suppliers and users in inbound
Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
|
2026-02-10 13:51:19 +08:00 |
|
|
|
17a61b489c
|
fix: prevent inbound of disabled materials
|
2026-02-10 13:50:26 +08:00 |
|
|
|
e876505a1b
|
修复出库时候找不到名称等问题
|
2026-02-10 11:13:07 +08:00 |
|
|
|
04ee938cd1
|
借库逻辑实现
|
2026-02-06 17:11:47 +08:00 |
|
|
|
e027ebd4a9
|
盘库操作初设计
|
2026-02-06 10:16:37 +08:00 |
|
|
|
4f90e02dcf
|
修改时间时区问题
|
2026-02-05 14:36:36 +08:00 |
|
|
|
0bc47d306d
|
增加入库记录页面,同时修正三组入库的时间问题
|
2026-02-05 14:30:11 +08:00 |
|
|
|
1e5627dc0a
|
修改采购件入库逻辑
|
2026-02-05 11:37:06 +08:00 |
|
|
|
273f20f5c3
|
采购件入库与出库相关联
|
2026-02-05 11:08:29 +08:00 |
|