Files
ops2/.workbuddy/memory/2026-04-29.md
T
2026-04-29 21:54:02 +08:00

90 lines
3.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 2026-04-29 工作记录
## 完成的任务
### 1. Web 前端优化
- **WorkOrderList.vue** - 工单列表页
- 增宽工单标题列:w-64 → w-80
- 增宽描述列:w-32 → w-48
- 状态气泡添加 `whitespace-nowrap` 防止换行
- **WarehouseOverview.vue** - 仓库概览页
- 操作列按钮添加 `whitespace-nowrap`
- 删除创建日期列
- **WarehouseContainerDetail.vue** - 容器详情页
- 操作列按钮添加 `whitespace-nowrap`
- 删除创建日期列
### 2. 部署脚本
- 创建 `install.sh`(根目录)
- 执行 git pull
- 构建前端:cd frontend/ops_vue_js && npm run build
- 安装后端:cd backend/my_work && sudo bash install.sh
### 3. 移动端开发
- **add-workorder.vue** - 新建工单页
- 添加客户搜索功能(参考 Web 前端实现)
- 修改关联物品为多选模式
- 添加 `selectedItems``linkedItemIds` 数组
- 修改 `submitForm()` 提交 `item_ids` 数组
- **edit-workorder.vue** - 编辑工单页
- 添加关联物品多选功能
- 添加关联客户多选功能
- 加载时已关联的物品和客户
- 修改 `fetchOrder()` 加载 `res.data.items``res.data.customers`
- 修改 `submitForm()` 提交 `item_ids``customer_ids`
### 4. API 文件创建
- **customer.js** (uni-app api)
- 创建客户 API 模块
- 支持 list、get、add、update、delete 操作
## 技术要点
- 使用防抖搜索(setTimeout 300ms
- 多选标签式 UI(参考关联客户实现)
- Vue 3 Composition API (ref, reactive, onMounted)
- uni-app 开发规范
### 5. 样式修改
- **show-workorder.vue** - 工单详情页
- 修改关联客户标签颜色:绿色 → 蓝色
- 背景色: #f6ffed#e6f7ff
- 边框色: #b7eb8f#91d5ff
- 文字色: #52c41a#1890ff
- 与关联物品样式保持一致
### 6. 物品页面添加关联客户
- **add-item.vue** - 新增物品页
- 添加客户搜索功能(防抖 300ms)
- 添加 `selectedCustomers` 数组存储已选客户
- 添加 `customerSearchQuery``customerSearchResults` 等搜索数据
- 修改 `submitForm()` 提交 `customer_ids` 数组
- 添加客户标签样式(蓝色主题)
- **item-edit.vue** - 编辑物品页
- 添加客户搜索功能(防抖 300ms)
- 修改 `fetchDetail()` 加载已关联客户 `res.data.customers`(非 `linkedCustomers`
- 修改 `submitForm()` 提交 `customer_ids` 数组
- 添加客户标签样式(蓝色主题)
- **item-detail.vue** - 物品详情页
- 添加加载 `res.data.customers`
- 添加显示关联客户 UI
- 添加关联客户样式
### 7. 修复关联客户显示问题
- **问题1**: item-edit.vue 没回填关联客户
- 原因:使用了错误的字段名 `linkedCustomers`
- 修复:改为 `res.data.customers`
- **问题2**: item-detail.vue 没显示关联客户
- 原因:`fetchDetail()` 没有加载 `customers` 字段
- 修复:添加 `linkedCustomers.value = res.data.customers || []`
- 添加模板代码显示关联客户
- **后端修复**: apiWarehouse.go
- `CustomerInfo` 结构体添加 `PrimaryPhone` 字段
- 返回客户信息时包含 `primary_phone`