初始化项目 #1
@ -116,20 +116,21 @@
|
|||||||
{{ formatAreaRange(scope.row) }}
|
{{ formatAreaRange(scope.row) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="expectedSignDate" label="预计签约时间" width="110" />
|
<el-table-column prop="expectSignDate" label="预计签约时间" width="110" />
|
||||||
<el-table-column label="标签" min-width="150">
|
<el-table-column label="标签" min-width="150">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-for="tag in scope.row.tags" :key="tag.id" size="mini"
|
<el-tag v-for="tag in scope.row.tags" :key="tag.id" size="mini"
|
||||||
style="margin-right: 5px; margin-bottom: 5px;">
|
style="margin-right: 5px; margin-bottom: 5px;">
|
||||||
{{ tag.tagName }}
|
{{ tag.tagName }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
|
<span v-if="!scope.row.tags || scope.row.tags.length === 0">--</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" size="small" @click="handleFollow(scope.row)">跟进</el-button>
|
<el-button v-if="activeTab === 'my'" type="text" size="small" @click="handleFollow(scope.row)">跟进</el-button>
|
||||||
<el-button type="text" size="small" @click="handleViewDetail(scope.row)">详情</el-button>
|
<el-button type="text" size="small" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||||
<el-button v-if="activeTab === 'my' || activeTab === 'all'" type="text" size="small" class="delete-btn"
|
<el-button v-if="activeTab === 'my'" type="text" size="small" class="delete-btn"
|
||||||
@click="returnToPublic(scope.row)">退回公海</el-button>
|
@click="returnToPublic(scope.row)">退回公海</el-button>
|
||||||
<el-button v-if="activeTab === 'my'" type="text" size="small" @click="handleTag(scope.row)">打标签</el-button>
|
<el-button v-if="activeTab === 'my'" type="text" size="small" @click="handleTag(scope.row)">打标签</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -166,7 +167,7 @@
|
|||||||
{{ formatAreaRange(scope.row) }}
|
{{ formatAreaRange(scope.row) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="expectedSignDate" label="预计签约时间" width="110" />
|
<el-table-column prop="expectSignDate" label="预计签约时间" width="110" />
|
||||||
<el-table-column prop="remark" label="备注" min-width="150" show-overflow-tooltip />
|
<el-table-column prop="remark" label="备注" min-width="150" show-overflow-tooltip />
|
||||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -267,8 +268,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="预计签约时间" prop="expectedSignDate">
|
<el-form-item label="预计签约时间" prop="expectSignDate">
|
||||||
<el-date-picker v-model="addForm.expectedSignDate" type="date" placeholder="选择日期" style="width: 100%;"
|
<el-date-picker v-model="addForm.expectSignDate" type="date" placeholder="选择日期" style="width: 100%;"
|
||||||
value-format="yyyy-MM-dd"></el-date-picker>
|
value-format="yyyy-MM-dd"></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -362,8 +363,8 @@
|
|||||||
<el-form-item label="公司" prop="companyName">
|
<el-form-item label="公司" prop="companyName">
|
||||||
<el-input v-model="customerInfo.companyName" placeholder="请输入公司" />
|
<el-input v-model="customerInfo.companyName" placeholder="请输入公司" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="预计签约时间" prop="expectedSignDate">
|
<el-form-item label="预计签约时间" prop="expectSignDate">
|
||||||
<el-date-picker v-model="customerInfo.expectedSignDate" type="date" placeholder="选择日期"
|
<el-date-picker v-model="customerInfo.expectSignDate" type="date" placeholder="选择日期"
|
||||||
style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker>
|
style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="需求面积">
|
<el-form-item label="需求面积">
|
||||||
@ -465,7 +466,7 @@
|
|||||||
<el-descriptions-item label="客户手机号">{{ customerDetail.customerPhone || '--' }}</el-descriptions-item>
|
<el-descriptions-item label="客户手机号">{{ customerDetail.customerPhone || '--' }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="客户所属公司">{{ customerDetail.companyName || '--' }}</el-descriptions-item>
|
<el-descriptions-item label="客户所属公司">{{ customerDetail.companyName || '--' }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="行业">{{ customerDetail.industry || '--' }}</el-descriptions-item>
|
<el-descriptions-item label="行业">{{ customerDetail.industry || '--' }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="预计签约时间">{{ customerDetail.expectedSignDate || '--' }}</el-descriptions-item>
|
<el-descriptions-item label="预计签约时间">{{ customerDetail.expectSignDate || '--' }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="需求面积段">{{ formatAreaRange(customerDetail) || '--' }}</el-descriptions-item>
|
<el-descriptions-item label="需求面积段">{{ formatAreaRange(customerDetail) || '--' }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="客户预算">{{ customerDetail.budget ? `${customerDetail.budget}元` : '--'
|
<el-descriptions-item label="客户预算">{{ customerDetail.budget ? `${customerDetail.budget}元` : '--'
|
||||||
}}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
@ -672,7 +673,7 @@ export default {
|
|||||||
areaMin: undefined,
|
areaMin: undefined,
|
||||||
areaMax: undefined,
|
areaMax: undefined,
|
||||||
budget: undefined,
|
budget: undefined,
|
||||||
expectedSignDate: undefined,
|
expectSignDate: undefined,
|
||||||
followType: '2', // 默认加入公海
|
followType: '2', // 默认加入公海
|
||||||
followPersonnel: undefined
|
followPersonnel: undefined
|
||||||
},
|
},
|
||||||
@ -693,7 +694,7 @@ export default {
|
|||||||
customerName: undefined,
|
customerName: undefined,
|
||||||
customerPhone: undefined,
|
customerPhone: undefined,
|
||||||
companyName: undefined,
|
companyName: undefined,
|
||||||
expectedSignDate: undefined,
|
expectSignDate: undefined,
|
||||||
areaMin: undefined,
|
areaMin: undefined,
|
||||||
areaMax: undefined,
|
areaMax: undefined,
|
||||||
budget: undefined,
|
budget: undefined,
|
||||||
@ -800,6 +801,20 @@ export default {
|
|||||||
.then(response => {
|
.then(response => {
|
||||||
if (response.code === API_SUCCESS_CODE) {
|
if (response.code === API_SUCCESS_CODE) {
|
||||||
this.customerList = response.data.list || []
|
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
|
this.total = response.data.total || 0
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(response.msg || '获取意向客户列表失败')
|
this.$message.error(response.msg || '获取意向客户列表失败')
|
||||||
@ -813,6 +828,33 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 将标签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() {
|
getStatusOptions() {
|
||||||
// 使用API获取状态列表
|
// 使用API获取状态列表
|
||||||
@ -923,7 +965,7 @@ export default {
|
|||||||
areaMin: this.addForm.areaMin,
|
areaMin: this.addForm.areaMin,
|
||||||
areaMax: this.addForm.areaMax,
|
areaMax: this.addForm.areaMax,
|
||||||
budget: this.addForm.budget,
|
budget: this.addForm.budget,
|
||||||
expectedSignDate: this.addForm.expectedSignDate,
|
expectSignDate: this.addForm.expectSignDate,
|
||||||
assignmentType: this.addForm.followType == 1 ? '指定人员' : this.addForm.followType == 2 ? '加入公海' : '分配给创建人',
|
assignmentType: this.addForm.followType == 1 ? '指定人员' : this.addForm.followType == 2 ? '加入公海' : '分配给创建人',
|
||||||
}
|
}
|
||||||
if (this.addForm.followType === '3') {
|
if (this.addForm.followType === '3') {
|
||||||
@ -972,8 +1014,8 @@ export default {
|
|||||||
this.followForm = {
|
this.followForm = {
|
||||||
id: row.id,
|
id: row.id,
|
||||||
statusId: row.statusId,
|
statusId: row.statusId,
|
||||||
content: undefined,
|
followContent: row.content,
|
||||||
nextFollowTime: undefined,
|
nextFollowTime: row.nextFollowTime,
|
||||||
imageList: [],
|
imageList: [],
|
||||||
imageUrl: undefined,
|
imageUrl: undefined,
|
||||||
contractIds: []
|
contractIds: []
|
||||||
@ -983,13 +1025,14 @@ export default {
|
|||||||
getCustomerDetail(row.id).then(response => {
|
getCustomerDetail(row.id).then(response => {
|
||||||
if (response.code === API_SUCCESS_CODE) {
|
if (response.code === API_SUCCESS_CODE) {
|
||||||
const detail = response.data
|
const detail = response.data
|
||||||
|
this.followForm.followContent = detail.followHistory[0].followContent
|
||||||
this.customerInfo = {
|
this.customerInfo = {
|
||||||
id: detail.id,
|
id: detail.id,
|
||||||
projectId: detail.projectId,
|
projectId: detail.projectId,
|
||||||
customerName: detail.customerName,
|
customerName: detail.customerName,
|
||||||
customerPhone: detail.customerPhone,
|
customerPhone: detail.customerPhone,
|
||||||
companyName: detail.companyName,
|
companyName: detail.companyName,
|
||||||
expectedSignDate: detail.expectedSignDate,
|
expectSignDate: detail.expectSignDate,
|
||||||
areaMin: detail.areaMin,
|
areaMin: detail.areaMin,
|
||||||
areaMax: detail.areaMax,
|
areaMax: detail.areaMax,
|
||||||
budget: detail.budget,
|
budget: detail.budget,
|
||||||
@ -1016,29 +1059,64 @@ export default {
|
|||||||
// 如果跟进表单验证通过,再校验客户信息表单
|
// 如果跟进表单验证通过,再校验客户信息表单
|
||||||
this.$refs.customerInfoForm.validate(infoValid => {
|
this.$refs.customerInfoForm.validate(infoValid => {
|
||||||
if (infoValid) {
|
if (infoValid) {
|
||||||
|
// 获取当前登录用户信息
|
||||||
|
const userId = getUserId() || '201'
|
||||||
|
|
||||||
// 组装所有数据
|
// 组装所有数据
|
||||||
const submitData = {
|
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,
|
statusId: this.followForm.statusId,
|
||||||
followContent: this.followForm.followContent,
|
content: this.followForm.followContent,
|
||||||
nextFollowTime: this.followForm.nextFollowTime,
|
nextFollowTime: this.followForm.nextFollowTime,
|
||||||
followImage: this.followForm.imageUrl,
|
followImage: this.followForm.imageUrl,
|
||||||
contractNos: this.followForm.contractIds || [],
|
contractNos: this.followForm.contractIds || [],
|
||||||
// 标签信息
|
followUserId: parseInt(userId),
|
||||||
tagIds: this.customerInfo.tagIds,
|
followUserName: "张三", // 这里可以替换为实际的当前用户名
|
||||||
followUserId:201
|
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
|
// 调用更新API
|
||||||
|
Loading…
x
Reference in New Issue
Block a user