| 方法 | 路径 | 说明 |
|---|---|---|
| POST | /basic/customer/handover |
客户交接 |
请求体:json { "id": 123, "maintainer": "张三" }
响应:json { "code": 200, "msg": "操作成功" }
<el-button type="text" @click="handleHandover(row)">客户交接</el-button>
仅在 row.type === 0(私海客户)时显示。
<el-dialog title="客户交接" :visible.sync="handoverDialogVisible" width="400px">
<el-form :model="handoverForm" label-width="100px">
<el-form-item label="当前维护人">
<span>{{ handoverForm.oldMaintainer }}</span>
</el-form-item>
<el-form-item label="新维护人" prop="maintainer">
<el-select v-model="handoverForm.maintainer" placeholder="请选择新维护人" filterable>
<el-option
v-for="user in userList"
:key="user.userId"
:label="user.userName"
:value="user.userName"
/>
</el-select>
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="handoverDialogVisible = false">取消</el-button>
<el-button type="primary" @click="submitHandover">确定</el-button>
</div>
</el-dialog>
data() {
return {
handoverDialogVisible: false,
handoverForm: {
id: null,
oldMaintainer: '',
maintainer: ''
},
userList: [], // 负责人列表,复用现有用户下拉数据源
}
}
// 打开交接弹窗
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(维护时间)为当前时间