diff --git a/pc/src/views/merchant/intent-customer/index.vue b/pc/src/views/merchant/intent-customer/index.vue
index b7900b6..1a91a81 100644
--- a/pc/src/views/merchant/intent-customer/index.vue
+++ b/pc/src/views/merchant/intent-customer/index.vue
@@ -116,20 +116,21 @@
{{ formatAreaRange(scope.row) }}
-
+
{{ tag.tagName }}
+ --
- 跟进
+ 跟进
详情
- 退回公海
打标签
@@ -166,7 +167,7 @@
{{ formatAreaRange(scope.row) }}
-
+
@@ -267,8 +268,8 @@
-
-
+
@@ -362,8 +363,8 @@
-
-
+
@@ -465,7 +466,7 @@
{{ customerDetail.customerPhone || '--' }}
{{ customerDetail.companyName || '--' }}
{{ customerDetail.industry || '--' }}
- {{ customerDetail.expectedSignDate || '--' }}
+ {{ customerDetail.expectSignDate || '--' }}
{{ formatAreaRange(customerDetail) || '--' }}
{{ customerDetail.budget ? `${customerDetail.budget}元` : '--'
}}
@@ -672,7 +673,7 @@ export default {
areaMin: undefined,
areaMax: undefined,
budget: undefined,
- expectedSignDate: undefined,
+ expectSignDate: undefined,
followType: '2', // 默认加入公海
followPersonnel: undefined
},
@@ -693,7 +694,7 @@ export default {
customerName: undefined,
customerPhone: undefined,
companyName: undefined,
- expectedSignDate: undefined,
+ expectSignDate: undefined,
areaMin: undefined,
areaMax: undefined,
budget: undefined,
@@ -800,6 +801,20 @@ export default {
.then(response => {
if (response.code === API_SUCCESS_CODE) {
this.customerList = response.data.list || []
+
+ // 处理标签数据,确保标签字段是数组并包含标签对象
+ this.customerList.forEach(customer => {
+ // 如果标签数据是id数组,转换为对象数组
+ if (Array.isArray(customer.tagIds) && customer.tagIds.length > 0) {
+ customer.tags = this.convertTagIdsToTags(customer.tagIds)
+ }
+
+ // 如果没有标签数据,初始化为空数组
+ if (!customer.tags) {
+ customer.tags = []
+ }
+ })
+
this.total = response.data.total || 0
} else {
this.$message.error(response.msg || '获取意向客户列表失败')
@@ -812,6 +827,33 @@ export default {
this.loading = false
})
},
+
+ // 将标签ID数组转换为标签对象数组
+ convertTagIdsToTags(tagIds) {
+ const result = []
+ if (!tagIds || !Array.isArray(tagIds)) return result
+
+ // 遍历所有标签分组
+ if (this.tagGroups && this.tagGroups.length > 0) {
+ tagIds.forEach(tagId => {
+ // 在所有标签分组中查找匹配的标签
+ for (const group of this.tagGroups) {
+ if (group.tags && Array.isArray(group.tags)) {
+ const foundTag = group.tags.find(tag => tag.id === tagId)
+ if (foundTag) {
+ result.push({
+ id: foundTag.id,
+ tagName: foundTag.tagName
+ })
+ break
+ }
+ }
+ }
+ })
+ }
+
+ return result
+ },
// 获取客户状态选项
getStatusOptions() {
@@ -923,7 +965,7 @@ export default {
areaMin: this.addForm.areaMin,
areaMax: this.addForm.areaMax,
budget: this.addForm.budget,
- expectedSignDate: this.addForm.expectedSignDate,
+ expectSignDate: this.addForm.expectSignDate,
assignmentType: this.addForm.followType == 1 ? '指定人员' : this.addForm.followType == 2 ? '加入公海' : '分配给创建人',
}
if (this.addForm.followType === '3') {
@@ -972,8 +1014,8 @@ export default {
this.followForm = {
id: row.id,
statusId: row.statusId,
- content: undefined,
- nextFollowTime: undefined,
+ followContent: row.content,
+ nextFollowTime: row.nextFollowTime,
imageList: [],
imageUrl: undefined,
contractIds: []
@@ -983,13 +1025,14 @@ export default {
getCustomerDetail(row.id).then(response => {
if (response.code === API_SUCCESS_CODE) {
const detail = response.data
+ this.followForm.followContent = detail.followHistory[0].followContent
this.customerInfo = {
id: detail.id,
projectId: detail.projectId,
customerName: detail.customerName,
customerPhone: detail.customerPhone,
companyName: detail.companyName,
- expectedSignDate: detail.expectedSignDate,
+ expectSignDate: detail.expectSignDate,
areaMin: detail.areaMin,
areaMax: detail.areaMax,
budget: detail.budget,
@@ -1016,29 +1059,64 @@ export default {
// 如果跟进表单验证通过,再校验客户信息表单
this.$refs.customerInfoForm.validate(infoValid => {
if (infoValid) {
+ // 获取当前登录用户信息
+ const userId = getUserId() || '201'
+
// 组装所有数据
const submitData = {
- // 客户基本信息
- customerId: this.customerInfo.id,
- projectId: this.customerInfo.projectId,
- customerName: this.customerInfo.customerName,
- customerPhone: this.customerInfo.customerPhone,
- companyName: this.customerInfo.companyName,
- expectedSignDate: this.customerInfo.expectedSignDate,
- areaMin: this.customerInfo.areaMin,
- areaMax: this.customerInfo.areaMax,
- budget: this.customerInfo.budget,
- successRate: this.customerInfo.successRate,
- remark: this.customerInfo.remark,
// 跟进信息
+ customerId: this.customerInfo.id,
statusId: this.followForm.statusId,
- followContent: this.followForm.followContent,
+ content: this.followForm.followContent,
nextFollowTime: this.followForm.nextFollowTime,
followImage: this.followForm.imageUrl,
contractNos: this.followForm.contractIds || [],
- // 标签信息
- tagIds: this.customerInfo.tagIds,
- followUserId:201
+ followUserId: parseInt(userId),
+ followUserName: "张三", // 这里可以替换为实际的当前用户名
+ followUserPhone: "13800138001", // 这里可以替换为实际的当前用户电话
+ // 客户信息作为单独对象,包含完整字段
+ customerInfo: {
+ // 基本信息
+ id: this.customerInfo.id,
+ customerType: this.currentCustomer.customerType || "",
+ projectId: this.customerInfo.projectId || "",
+ buildingId: this.currentCustomer.buildingId || 0,
+ customerName: this.customerInfo.customerName || "",
+ customerPhone: this.customerInfo.customerPhone || "",
+ companyName: this.customerInfo.companyName || "",
+ industry: this.currentCustomer.industry || "",
+ areaMin: this.customerInfo.areaMin || 0,
+ areaMax: this.customerInfo.areaMax || 0,
+ budget: this.customerInfo.budget || 0,
+ expectSignDate: this.customerInfo.expectSignDate || "",
+ successRate: this.customerInfo.successRate || 0,
+ remark: this.customerInfo.remark || "",
+ tagIds: this.customerInfo.tagIds,
+
+ // 分配信息
+ teamId: this.currentCustomer.teamId || 0,
+ personnelId: this.currentCustomer.personnelId || 0,
+ assignmentType: this.currentCustomer.assignmentType || "",
+ statusId: this.followForm.statusId || 0,
+
+ // 线索信息
+ leadId: this.currentCustomer.leadId || 0,
+ leadConvertTime: this.currentCustomer.leadConvertTime || "",
+
+ // 跟进信息
+ lastFollowTime: this.currentCustomer.lastFollowTime || "",
+ nextFollowTime: this.followForm.nextFollowTime || "",
+
+ // 系统信息
+ createUserId: this.currentCustomer.createUserId || "",
+ createUserName: this.currentCustomer.createUserName || "",
+ createUserPhone: this.currentCustomer.createUserPhone || "",
+ createTime: this.currentCustomer.createTime || "",
+ delFlag: this.currentCustomer.delFlag || "0",
+ lastModUserId: userId,
+ lastModTime: new Date().toISOString().split('.')[0].replace('T', ' '),
+ tenantId: this.currentCustomer.tenantId || ""
+ }
}
// 调用更新API