# 客户档案 — 客户交接功能
## 涉及页面
- **私海客户列表** — 操作列增加"客户交接"按钮
- 公海客户不显示此按钮
## API
| 方法 | 路径 | 说明 |
|------|------|------|
| POST | `/basic/customer/handover` | 客户交接 |
**请求体:**
```json
{
"id": 123,
"maintainer": "张三"
}
```
**响应:**
```json
{
"code": 200,
"msg": "操作成功"
}
```
## 前端修改点
### 1. 私海客户列表 — 操作列增加按钮
```html
客户交接
```
仅在 `row.type === 0`(私海客户)时显示。
### 2. 交接弹窗
```html
{{ handoverForm.oldMaintainer }}
取消
确定
```
### 3. data 数据
```js
data() {
return {
handoverDialogVisible: false,
handoverForm: {
id: null,
oldMaintainer: '',
maintainer: ''
},
userList: [], // 负责人列表,复用现有用户下拉数据源
}
}
```
### 4. 方法
```js
// 打开交接弹窗
handleHandover(row) {
this.handoverForm.id = row.id;
this.handoverForm.oldMaintainer = row.maintainer;
this.handoverForm.maintainer = '';
this.handoverDialogVisible = true;
},
// 提交交接
submitHandover() {
if (!this.handoverForm.maintainer) {
this.$message.warning('请选择新维护人');
return;
}
postRequest('/basic/customer/handover', {
id: this.handoverForm.id,
maintainer: this.handoverForm.maintainer
}).then(res => {
if (res.code === 200) {
this.$message.success('交接成功');
this.handoverDialogVisible = false;
this.getList(); // 刷新列表
}
});
}
```
## 注意事项
- 交接按钮仅在私海客户列表显示(`row.type === 0`)
- 新维护人下拉数据源可复用系统中已有的用户选择器接口(如 `/system/user/list`)
- 交接成功后列表自动刷新,维护人列更新为新值
- 后端会同步更新 `maintenanceTime`(维护时间)为当前时间