zy 2025-05-14 22:10:12 +08:00
commit 0ea5bb7d9b
4 changed files with 262 additions and 20 deletions

View File

@ -512,6 +512,17 @@ const remainingRouter: AppRouteRecordRaw[] = [
},
component: () => import('@/views/crm/clue/detail/index.vue')
},
{
path: 'customer/HighSeasDetail/:id',
name: 'CrmCustomerHighSeasDetail',
meta: {
title: '客户公海详情',
noCache: false,
hidden: true,
activeMenu: '/crm/customer/pool'
},
component: () => import('@/views/crm/customer/detail/highSeasIndex.vue')
},
{
path: 'customer/detail/:id',
name: 'CrmCustomerDetail',

View File

@ -9,33 +9,32 @@
<el-descriptions-item label="客户名称">
{{ customer.name }}
</el-descriptions-item>
<el-descriptions-item label="信用统一代码">{{ customer.creditNo }}</el-descriptions-item>
<el-descriptions-item label="客户来源">
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_SOURCE" :value="customer.source" />
</el-descriptions-item>
<el-descriptions-item label="合作类型">{{ getName(getIntDictOptions(DICT_TYPE.CRM_COOPERATION_TYPE),customer.cooperationType) }}</el-descriptions-item>
<el-descriptions-item label="合作地区">{{ getName(getIntDictOptions(DICT_TYPE.CRM_COOPERATION_AREA),customer.cooperationArea) }}</el-descriptions-item>
<el-descriptions-item label="客户级别">
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_LEVEL" :value="customer.level" />
</el-descriptions-item>
<el-descriptions-item label="商务拓展人">{{ customer.developerName }}</el-descriptions-item>
<el-descriptions-item label="线索拓展人">{{ customer.clueDeveloperName }}</el-descriptions-item>
<el-descriptions-item label="协助人">{{ customer.assistName }}</el-descriptions-item>
<el-descriptions-item label="合作类型">{{ getName(getIntDictOptions(DICT_TYPE.CRM_COOPERATION_TYPE),customer.cooperationType) }}</el-descriptions-item>
<el-descriptions-item label="合作地区">{{ getName(getIntDictOptions(DICT_TYPE.CRM_COOPERATION_AREA),customer.cooperationArea) }}</el-descriptions-item>
<el-descriptions-item label="所属行业">{{ getName(getIntDictOptions(DICT_TYPE.CRM_CUSTOMER_INDUSTRY),customer.industryId) }}</el-descriptions-item>
<el-descriptions-item label="售后维护人">{{ customer.maintainerName }}</el-descriptions-item>
<el-descriptions-item label="商务签约人">{{ customer.contractorName }}</el-descriptions-item>
<el-descriptions-item label="信用统一代码">{{ customer.creditNo }}</el-descriptions-item>
<el-descriptions-item label="手机号">{{ customer.mobile }}</el-descriptions-item>
<el-descriptions-item label="电话">{{ customer.telephone }}</el-descriptions-item>
<el-descriptions-item label="邮箱">{{ customer.email }}</el-descriptions-item>
<el-descriptions-item label="地址">
{{ customer.areaName }} {{ customer.detailAddress }}
</el-descriptions-item>
<el-descriptions-item label="客户行业">
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_INDUSTRY" :value="customer.industryId" />
</el-descriptions-item>
<el-descriptions-item label="客户详情">{{ customer.customerDetails }}</el-descriptions-item>
<el-descriptions-item label=" 线索拓展人">{{ customer.developerName }}</el-descriptions-item>
<!-- <el-descriptions-item label="线索拓展人">{{ customer.clueDeveloperName }}</el-descriptions-item>-->
<el-descriptions-item label="协助人">{{ customer.assistName }}</el-descriptions-item>
=<el-descriptions-item label="售后维护人">{{ customer.maintainerName }}</el-descriptions-item>
<el-descriptions-item label="商务签约人">{{ customer.contractorName }}</el-descriptions-item>
<!-- <el-descriptions-item label="手机号">{{ customer.mobile }}</el-descriptions-item>
<el-descriptions-item label="电话">{{ customer.telephone }}</el-descriptions-item>
<el-descriptions-item label="邮箱">{{ customer.email }}</el-descriptions-item>-->
<el-descriptions-item label="地址">
{{ customer.areaName }} {{ customer.detailAddress }}
</el-descriptions-item>
<!-- <el-descriptions-item label="客户详情">{{ customer.customerDetails }}</el-descriptions-item>-->
<el-descriptions-item label="下次联系时间">
{{ formatDate(customer.contactNextTime) }}
</el-descriptions-item>

View File

@ -0,0 +1,234 @@
<template>
<CustomerDetailsHeader :customer="customer" :loading="loading">
<el-button
v-if="permissionListRef?.validateWrite"
v-hasPermi="['crm:customer:update']"
type="primary"
@click="openForm"
>
编辑
</el-button>
<!-- <el-button v-if="permissionListRef?.validateOwnerUser" type="primary" @click="transfer">
转移
</el-button> -->
<el-button v-if="permissionListRef?.validateWrite" @click="handleUpdateDealStatus">
更改成交状态
</el-button>
<el-button
v-if="customer.lockStatus && permissionListRef?.validateOwnerUser"
@click="handleUnlock"
>
解锁
</el-button>
<el-button
v-if="!customer.lockStatus && permissionListRef?.validateOwnerUser"
@click="handleLock"
>
锁定
</el-button>
<el-button v-if="!customer.ownerUserId" type="primary" @click="handleReceive"> </el-button>
<el-button v-if="!customer.ownerUserId" type="primary" @click="handleDistributeForm">
分配
</el-button>
<el-button
v-if="customer.ownerUserId && permissionListRef?.validateOwnerUser"
@click="handlePutPool"
>
放入公海
</el-button>
</CustomerDetailsHeader>
<el-col>
<el-tabs>
<el-tab-pane label="跟进记录">
<FollowUpList :biz-id="customerId" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
</el-tab-pane>
<el-tab-pane label="基本信息">
<CustomerDetailsInfo :customer="customer" />
</el-tab-pane>
<el-tab-pane label="工商信息">
<CompanyDetailsInfo :customer="customer" />
</el-tab-pane>
<el-tab-pane label="联系人" lazy>
<ContactList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
</el-tab-pane>
<el-tab-pane label="团队成员">
<PermissionList
ref="permissionListRef"
:biz-id="customer.id!"
:biz-type="BizTypeEnum.CRM_CUSTOMER"
:show-action="!permissionListRef?.isPool || false"
@quit-team="close"
/>
</el-tab-pane>
<el-tab-pane label="商机" lazy>
<BusinessList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
</el-tab-pane>
<el-tab-pane label="方案报价" lazy>
<QuotationList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
</el-tab-pane>
<!-- <el-tab-pane label="合同" lazy>
<ContractList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
</el-tab-pane>
<el-tab-pane label="回访" lazy>
<ReturnVisitrecord :biz-id="customerId" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
</el-tab-pane>-->
<!-- <el-tab-pane label="回款" lazy>
<ReceivablePlanList :customer-id="customer.id!" @create-receivable="createReceivable" />
<ReceivableList ref="receivableListRef" :customer-id="customer.id!" />
</el-tab-pane> -->
<el-tab-pane label="操作日志">
<OperateLogV2 :log-list="logList" />
</el-tab-pane>
</el-tabs>
</el-col>
<!-- 表单弹窗添加/修改 -->
<CustomerForm ref="formRef" @success="getCustomer" />
<CustomerDistributeForm ref="distributeForm" @success="getCustomer" />
<CrmTransferForm ref="transferFormRef" :biz-type="BizTypeEnum.CRM_CUSTOMER" @success="close" />
</template>
<script lang="ts" setup>
import { useTagsViewStore } from '@/store/modules/tagsView'
import * as CustomerApi from '@/api/crm/customer'
import CustomerForm from '@/views/crm/customer/CustomerForm.vue'
import CompanyDetailsInfo from './companyDetailsInfo.vue' //
import CustomerDetailsInfo from './CustomerDetailsInfo.vue' // -
import CustomerDetailsHeader from './CustomerDetailsHeader.vue' // -
import ReturnVisitrecord from './returnvisitrecord/index.vue' // 访
import ContactList from '@/views/crm/contact/components/ContactList.vue' //
import ContractList from '@/views/crm/contract/components/ContractList.vue' //
import BusinessList from '@/views/crm/business/components/BusinessList.vue' //
import QuotationList from '@/views/crm/contract/components/QuotationList.vue' //
import ReceivableList from '@/views/crm/receivable/components/ReceivableList.vue' //
import ReceivablePlanList from '@/views/crm/receivable/plan/components/ReceivablePlanList.vue' //
import PermissionList from '@/views/crm/permission/components/PermissionList.vue' //
import CrmTransferForm from '@/views/crm/permission/components/TransferForm.vue'
import FollowUpList from '@/views/crm/followup/index.vue'
import { BizTypeEnum } from '@/api/crm/permission'
import type { OperateLogVO } from '@/api/system/operatelog'
import { getOperateLogPage } from '@/api/crm/operateLog'
import CustomerDistributeForm from '@/views/crm/customer/pool/CustomerDistributeForm.vue'
defineOptions({ name: 'CrmCustomerDetail' })
const customerId = ref(0) //
const loading = ref(true) //
const message = useMessage() //
const { delView } = useTagsViewStore() //
const { push, currentRoute } = useRouter() //
const permissionListRef = ref<InstanceType<typeof PermissionList>>() // Ref
/** 获取详情 */
const customer = ref<CustomerApi.CustomerVO>({} as CustomerApi.CustomerVO) //
const getCustomer = async () => {
loading.value = true
try {
customer.value = await CustomerApi.getCustomer(customerId.value)
await getOperateLog()
} finally {
loading.value = false
}
}
/** 编辑客户 */
const formRef = ref<InstanceType<typeof CustomerForm>>() // Ref
const openForm = () => {
formRef.value?.open('update', customerId.value)
}
/** 更新成交状态操作 */
const handleUpdateDealStatus = async () => {
const dealStatus = !customer.value.dealStatus
try {
//
await message.confirm(`确定更新成交状态为【${dealStatus ? '已成交' : '未成交'}】吗?`)
//
await CustomerApi.updateCustomerDealStatus(customerId.value, dealStatus)
message.success(`更新成交状态成功`)
//
await getCustomer()
} catch {}
}
/** 客户转移 */
const transferFormRef = ref<InstanceType<typeof CrmTransferForm>>() // ref
const transfer = () => {
transferFormRef.value?.open(customerId.value)
}
/** 锁定客户 */
const handleLock = async () => {
await message.confirm(`确定锁定客户【${customer.value.name}】 吗?`)
await CustomerApi.lockCustomer(unref(customerId.value), true)
message.success(`锁定客户【${customer.value.name}】成功`)
await getCustomer()
}
/** 解锁客户 */
const handleUnlock = async () => {
await message.confirm(`确定解锁客户【${customer.value.name}】 吗?`)
await CustomerApi.lockCustomer(unref(customerId.value), false)
message.success(`解锁客户【${customer.value.name}】成功`)
await getCustomer()
}
/** 领取客户 */
const handleReceive = async () => {
await message.confirm(`确定领取客户【${customer.value.name}】 吗?`)
await CustomerApi.receiveCustomer([unref(customerId.value)])
message.success(`领取客户【${customer.value.name}】成功`)
await getCustomer()
}
/** 分配客户 */
const distributeForm = ref<InstanceType<typeof CustomerDistributeForm>>() // Ref
const handleDistributeForm = async () => {
distributeForm.value?.open(customerId.value)
}
/** 客户放入公海 */
const handlePutPool = async () => {
await message.confirm(`确定将客户【${customer.value.name}】放入公海吗?`)
await CustomerApi.putCustomerPool(unref(customerId.value))
message.success(`客户【${customer.value.name}】放入公海成功`)
//
close()
}
/** 获取操作日志 */
const logList = ref<OperateLogVO[]>([]) //
const getOperateLog = async () => {
if (!customerId.value) {
return
}
const data = await getOperateLogPage({
bizType: BizTypeEnum.CRM_CUSTOMER,
bizId: customerId.value
})
logList.value = data.list
}
/** 从回款计划创建回款 */
const receivableListRef = ref<InstanceType<typeof ReceivableList>>() // Ref
const createReceivable = (planData: any) => {
receivableListRef.value?.createReceivable(planData)
}
const close = () => {
delView(unref(currentRoute))
push({ name: 'CrmCustomer' })
}
/** 初始化 */
const { params } = useRoute()
onMounted(() => {
if (!params.id) {
message.warning('参数错误,客户不能为空!')
close()
return
}
customerId.value = params.id as unknown as number
getCustomer()
})
</script>

View File

@ -1,6 +1,4 @@
<template>
<doc-alert title="【客户】客户管理、公海客户" url="https://doc.iocoder.cn/crm/customer/" />
<doc-alert title="【通用】数据权限" url="https://doc.iocoder.cn/crm/permission/" />
<ContentWrap>
<!-- 搜索工作栏 -->
@ -271,7 +269,7 @@ const resetQuery = () => {
/** 打开客户详情 */
const { currentRoute, push } = useRouter()
const openDetail = (id: number) => {
push({ name: 'CrmCustomerDetail', params: { id } })
push({ name: 'CrmCustomerHighSeasDetail', params: { id } })
}
/** 领取客户 */