30 lines
1.3 KiB
Markdown
30 lines
1.3 KiB
Markdown
# 2026-04-29 工作日志
|
|
|
|
## 仓库物品列表添加列
|
|
|
|
在仓库容器详情页的物品列表中,在"数量"列后面添加了"工单数量"和"关联客户"两列。
|
|
|
|
### 修改内容
|
|
|
|
**后端** (`backend/my_work/routers/apiWarehouse.go`):
|
|
- 修改 `/list_item` API,批量查询物品的工单绑定数量和客户关联信息
|
|
- 新增返回字段:`WorkOrderCount` (int) 和 `Customers` (数组)
|
|
|
|
**前端** (`frontend/ops_vue_js/src/views/warehouse/WarehouseContainerDetail.vue`):
|
|
- 导入 `IconTool`, `IconUser` 图标和 `RouterLink` 组件
|
|
- 表格表头添加两列:工单数量、关联客户
|
|
- 表格数据行显示:
|
|
- 工单数量:橙色徽章显示,带工具图标
|
|
- 关联客户:蓝色标签显示客户姓名,可点击跳转,最多显示3个
|
|
- 更新 colspan 从 8 改为 10
|
|
|
|
**i18n 翻译**:
|
|
- `en.json`: 添加 `work_order.work_order_count` 和 `customer.related_customers`
|
|
- `zh-CN.json`: 添加对应中文翻译
|
|
- **修复**: 修正了重复添加 `customer` 对象的问题,将 `related_customers` 合并到已有的 `customer` 对象中
|
|
|
|
### 技术细节
|
|
- 工单数量通过 `TabWarehouseItemWorkOrderBind` 表统计
|
|
- 客户信息通过 `TabWarehouseItemCustomerBind` 和 `TabCustomer` 表关联查询
|
|
- 采用批量查询优化性能,避免N+1查询问题
|