2023-11-04 03:21:01 +08:00
|
|
|
<template>
|
2023-11-30 13:42:49 +08:00
|
|
|
<CustomerDetailsHeader :customer="customer" :loading="loading" @refresh="getCustomer(id)" />
|
2023-11-06 22:00:40 +08:00
|
|
|
<el-col>
|
2023-11-04 03:21:01 +08:00
|
|
|
<el-tabs>
|
|
|
|
<el-tab-pane label="详细资料">
|
2023-11-30 13:42:49 +08:00
|
|
|
<CustomerDetailsInfo :customer="customer" />
|
2023-11-04 03:21:01 +08:00
|
|
|
</el-tab-pane>
|
2023-11-29 21:42:10 +08:00
|
|
|
<el-tab-pane label="操作日志" lazy>TODO 待开发</el-tab-pane>
|
2023-11-04 03:21:01 +08:00
|
|
|
<el-tab-pane label="联系人" lazy>
|
2023-11-29 21:42:10 +08:00
|
|
|
<ContactList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
|
2023-11-04 03:21:01 +08:00
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane label="团队成员" lazy>
|
2023-11-30 13:42:49 +08:00
|
|
|
<PermissionList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
|
2023-11-04 03:21:01 +08:00
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane label="商机" lazy> 商机</el-tab-pane>
|
2023-11-29 21:42:10 +08:00
|
|
|
<el-tab-pane label="合同" lazy>TODO 待开发</el-tab-pane>
|
|
|
|
<el-tab-pane label="回款" lazy>TODO 待开发</el-tab-pane>
|
|
|
|
<el-tab-pane label="回访" lazy>TODO 待开发</el-tab-pane>
|
|
|
|
<el-tab-pane label="发票" lazy>TODO 待开发</el-tab-pane>
|
2023-11-04 03:21:01 +08:00
|
|
|
</el-tabs>
|
|
|
|
</el-col>
|
|
|
|
</template>
|
2023-11-22 15:45:10 +08:00
|
|
|
<script lang="ts" setup>
|
2023-11-04 03:21:01 +08:00
|
|
|
import { useTagsViewStore } from '@/store/modules/tagsView'
|
|
|
|
import * as CustomerApi from '@/api/crm/customer'
|
2023-11-30 13:42:49 +08:00
|
|
|
import CustomerDetailsInfo from './CustomerDetailsInfo.vue' // 客户明细 - 详细信息
|
|
|
|
import CustomerDetailsHeader from './CustomerDetailsHeader.vue' // 客户明细 - 头部
|
|
|
|
import ContactList from '@/views/crm/contact/components/ContactList.vue' // 联系人列表
|
|
|
|
import PermissionList from '@/views/crm/permission/components/PermissionList.vue' // 权限列表
|
2023-11-29 21:42:10 +08:00
|
|
|
import { BizTypeEnum } from '@/api/crm/permission'
|
2023-11-04 03:21:01 +08:00
|
|
|
|
2023-11-30 13:42:49 +08:00
|
|
|
defineOptions({ name: 'CrmCustomerDetail' })
|
2023-11-04 03:21:01 +08:00
|
|
|
|
|
|
|
const route = useRoute()
|
2023-11-30 13:42:49 +08:00
|
|
|
const id = Number(route.params.id) // 客户编号
|
2023-11-04 03:21:01 +08:00
|
|
|
const loading = ref(true) // 加载中
|
|
|
|
|
2023-11-30 13:42:49 +08:00
|
|
|
/** 获取详情 */
|
2023-11-18 22:11:42 +08:00
|
|
|
const customer = ref<CustomerApi.CustomerVO>({} as CustomerApi.CustomerVO) // 客户详情
|
2023-11-30 13:42:49 +08:00
|
|
|
const getCustomer = async (id: number) => {
|
2023-11-04 03:21:01 +08:00
|
|
|
loading.value = true
|
|
|
|
try {
|
|
|
|
customer.value = await CustomerApi.getCustomer(id)
|
|
|
|
} finally {
|
|
|
|
loading.value = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-30 13:42:49 +08:00
|
|
|
/** 初始化 */
|
|
|
|
const { delView } = useTagsViewStore() // 视图操作
|
|
|
|
const { currentRoute } = useRouter() // 路由
|
2023-11-04 03:21:01 +08:00
|
|
|
onMounted(() => {
|
|
|
|
if (!id) {
|
|
|
|
ElMessage.warning('参数错误,客户不能为空!')
|
|
|
|
delView(unref(currentRoute))
|
|
|
|
return
|
|
|
|
}
|
2023-11-30 13:42:49 +08:00
|
|
|
getCustomer(id)
|
2023-11-04 03:21:01 +08:00
|
|
|
})
|
|
|
|
</script>
|