提交代码

This commit is contained in:
zengqiyang 2025-04-17 12:20:29 +08:00
parent 5d978c4ac8
commit 3ac7dbff00

View File

@ -116,20 +116,21 @@
{{ formatAreaRange(scope.row) }}
</template>
</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">
<template slot-scope="scope">
<el-tag v-for="tag in scope.row.tags" :key="tag.id" size="mini"
style="margin-right: 5px; margin-bottom: 5px;">
{{ tag.tagName }}
</el-tag>
<span v-if="!scope.row.tags || scope.row.tags.length === 0">--</span>
</template>
</el-table-column>
<el-table-column label="操作" width="150" align="center" fixed="right">
<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 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>
<el-button v-if="activeTab === 'my'" type="text" size="small" @click="handleTag(scope.row)">打标签</el-button>
</template>
@ -166,7 +167,7 @@
{{ formatAreaRange(scope.row) }}
</template>
</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 label="操作" width="150" align="center" fixed="right">
<template slot-scope="scope">
@ -267,8 +268,8 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="预计签约时间" prop="expectedSignDate">
<el-date-picker v-model="addForm.expectedSignDate" type="date" placeholder="选择日期" style="width: 100%;"
<el-form-item label="预计签约时间" prop="expectSignDate">
<el-date-picker v-model="addForm.expectSignDate" type="date" placeholder="选择日期" style="width: 100%;"
value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
</el-col>
@ -362,8 +363,8 @@
<el-form-item label="公司" prop="companyName">
<el-input v-model="customerInfo.companyName" placeholder="请输入公司" />
</el-form-item>
<el-form-item label="预计签约时间" prop="expectedSignDate">
<el-date-picker v-model="customerInfo.expectedSignDate" type="date" placeholder="选择日期"
<el-form-item label="预计签约时间" prop="expectSignDate">
<el-date-picker v-model="customerInfo.expectSignDate" type="date" placeholder="选择日期"
style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
<el-form-item label="需求面积">
@ -465,7 +466,7 @@
<el-descriptions-item label="客户手机号">{{ customerDetail.customerPhone || '--' }}</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.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="客户预算">{{ customerDetail.budget ? `${customerDetail.budget}` : '--'
}}</el-descriptions-item>
@ -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