Skip to content

Commit d629138

Browse files
YunaiVgitee-org
authored andcommitted
!341 crm联系人商机功能
Merge pull request !341 from zyna/dev
2 parents f8c4700 + ba49b28 commit d629138

File tree

8 files changed

+403
-112
lines changed

8 files changed

+403
-112
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { getBusiness } from './../business/index';
2+
import request from '@/config/axios'
3+
4+
export interface ContactBusinessLinkVO {
5+
id: number
6+
contactId: number
7+
businessId: number
8+
}
9+
10+
// 查询联系人商机关联分页
11+
export const getContactBusinessLinkPage = async (params) => {
12+
return await request.get({ url: `/crm/contact-business-link/page`, params })
13+
}
14+
15+
// 查询联系人商机关联详情
16+
export const getContactBusinessLink = async (id: number) => {
17+
return await request.get({ url: `/crm/contact-business-link/get?id=` + id })
18+
}
19+
20+
// 新增联系人商机关联
21+
export const createContactBusinessLink = async (data: ContactBusinessLinkVO) => {
22+
return await request.post({ url: `/crm/contact-business-link/create`, data })
23+
}
24+
25+
// 修改联系人商机关联
26+
export const updateContactBusinessLink = async (data: ContactBusinessLinkVO) => {
27+
return await request.put({ url: `/crm/contact-business-link/update`, data })
28+
}
29+
30+
// 删除联系人商机关联
31+
export const deleteContactBusinessLink = async (data: ContactBusinessLinkVO) => {
32+
return await request.delete({ url: `/crm/contact-business-link/delete-batch` , data })
33+
}
34+
35+
// 导出联系人商机关联 Excel
36+
export const exportContactBusinessLink = async (params) => {
37+
return await request.download({ url: `/crm/contact-business-link/export-excel`, params })
38+
}
39+
40+
//批量新增联系人商机关联
41+
export const createContactBusinessLinkBatch = async (data: ContactBusinessLinkVO[]) => {
42+
return await request.post({ url: `/crm/contact-business-link/create-batch`, data })
43+
}
44+
// 查询联系人关联商机列表
45+
export const getBusinessByContactPage = async (params) => {
46+
return await request.get({ url: `/crm/contact-business-link/page-by-contact` , params })
47+
}

src/views/crm/contact/detail/ContactBasicInfo.vue

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<!--
2+
* @Author: zyna
3+
* @Date: 2023-12-02 13:08:57
4+
* @LastEditTime: 2023-12-03 13:47:16
5+
* @FilePath: \yudao-ui-admin-vue3\src\views\crm\contact\detail\ContactDetailsHeader.vue
6+
* @Description:
7+
-->
8+
<template>
9+
<div v-loading="loading">
10+
<div class="flex items-start justify-between">
11+
<div>
12+
<el-col>
13+
<el-row>
14+
<span class="text-xl font-bold">{{ contact.name }}</span>
15+
</el-row>
16+
</el-col>
17+
</div>
18+
<div>
19+
<!-- 右上:按钮 -->
20+
<el-button @click="openForm('update', contact.id)" v-hasPermi="['crm:contact:update']">
21+
编辑
22+
</el-button>
23+
</div>
24+
</div>
25+
</div>
26+
<ContentWrap class="mt-10px">
27+
<el-descriptions :column="5" direction="vertical">
28+
<el-descriptions-item label="客户">
29+
{{ contact.customerName }}
30+
</el-descriptions-item>
31+
<el-descriptions-item label="职务">
32+
{{ contact.post }}
33+
</el-descriptions-item>
34+
<el-descriptions-item label="手机">
35+
{{ contact.mobile }}
36+
</el-descriptions-item>
37+
<el-descriptions-item label="创建时间">
38+
{{ contact.createTime ? formatDate(contact.createTime) : '空' }}
39+
</el-descriptions-item>
40+
</el-descriptions>
41+
</ContentWrap>
42+
<!-- 表单弹窗:添加/修改 -->
43+
<ContactForm ref="formRef" @success="emit('refresh')" />
44+
</template>
45+
<script setup lang="ts">
46+
import * as ContactApi from '@/api/crm/contact'
47+
import ContactForm from '@/views/crm/contact/ContactForm.vue'
48+
import { formatDate } from '@/utils/formatTime'
49+
50+
//操作修改
51+
const formRef = ref()
52+
const openForm = (type: string, id?: number) => {
53+
formRef.value.open(type, id)
54+
}
55+
const { contact } = defineProps<{ contact: ContactApi.ContactVO }>()
56+
const emit = defineEmits(['refresh']) // 定义 success 事件,用于操作成功后的回调
57+
</script>

src/views/crm/contact/detail/index.vue

Lines changed: 15 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,32 @@
11
<template>
2-
<!-- TODO 芋艿:要不要把 3 到 62 合并成一个组件 -->
3-
<div v-loading="loading">
4-
<div class="flex items-start justify-between">
5-
<div>
6-
<!-- 左上:客户基本信息 -->
7-
<ContactBasicInfo :contact="contact" />
8-
</div>
9-
<div>
10-
<!-- 右上:按钮 -->
11-
<el-button @click="openForm('update', contact.id)" v-hasPermi="['crm:contact:update']">
12-
编辑
13-
</el-button>
14-
</div>
15-
</div>
16-
<el-row class="mt-10px">
17-
<el-button>
18-
<Icon icon="ph:calendar-fill" class="mr-5px" />
19-
创建任务
20-
</el-button>
21-
<el-button>
22-
<Icon icon="carbon:email" class="mr-5px" />
23-
发送邮件
24-
</el-button>
25-
<el-button>
26-
<Icon icon="system-uicons:contacts" class="mr-5px" />
27-
创建联系人
28-
</el-button>
29-
<el-button>
30-
<Icon icon="ep:opportunity" class="mr-5px" />
31-
创建商机
32-
</el-button>
33-
<el-button>
34-
<Icon icon="clarity:contract-line" class="mr-5px" />
35-
创建合同
36-
</el-button>
37-
<el-button>
38-
<Icon icon="icon-park:income-one" class="mr-5px" />
39-
创建回款
40-
</el-button>
41-
<el-button>
42-
<Icon icon="fluent:people-team-add-20-filled" class="mr-5px" />
43-
添加团队成员
44-
</el-button>
45-
</el-row>
46-
</div>
47-
<ContentWrap class="mt-10px">
48-
<el-descriptions :column="5" direction="vertical">
49-
<el-descriptions-item label="客户">
50-
{{ contact.customerName }}
51-
</el-descriptions-item>
52-
<el-descriptions-item label="职务">
53-
{{ contact.post }}
54-
</el-descriptions-item>
55-
<el-descriptions-item label="手机">
56-
{{ contact.mobile }}
57-
</el-descriptions-item>
58-
<el-descriptions-item label="创建时间">
59-
{{ contact.createTime ? formatDate(contact.createTime) : '空' }}
60-
</el-descriptions-item>
61-
</el-descriptions>
62-
</ContentWrap>
63-
<!-- TODO wanwan:这个 tab 拉满哈,可以更好看; -->
64-
<el-col :span="18">
2+
<ContactDetailsHeader :contact="contact" :loading="loading" @refresh="getContactData(id)" />
3+
<el-col>
654
<el-tabs>
66-
<el-tab-pane label="基本信息">
67-
<!-- TODO wanwan:这个 ml-2 是不是可以优化下,不要整个左移,而是里面的内容有个几 px 的偏移,不顶在框里 -->
68-
<ContactDetails class="ml-2" :contact="contact" />
5+
<el-tab-pane label="详细资料">
6+
<ContactDetailsInfo :contact="contact" />
697
</el-tab-pane>
70-
<el-tab-pane label="跟进记录" lazy> 跟进记录</el-tab-pane>
71-
<el-tab-pane label="商机" lazy> 商机</el-tab-pane>
72-
<el-tab-pane label="附件" lazy> 附件</el-tab-pane>
73-
<!-- TODO wanwan 以下标签上的数量需要接口统计返回 -->
74-
<el-tab-pane label="操作记录" lazy>
75-
<template #label> 操作记录<el-badge :value="12" class="item" type="primary" /> </template>
76-
操作记录
8+
<el-tab-pane label="操作日志" lazy>TODO 待开发</el-tab-pane>
9+
<el-tab-pane label="团队成员" lazy>
10+
<PermissionList :biz-id="contact.id!" :biz-type="BizTypeEnum.CRM_CONTACT" />
11+
</el-tab-pane>
12+
<el-tab-pane label="商机" lazy>
13+
<BusinessList :biz-id="contact.id!" :biz-type="BizTypeEnum.CRM_CONTACT"/>
7714
</el-tab-pane>
7815
</el-tabs>
7916
</el-col>
80-
81-
<!-- 表单弹窗:添加/修改 -->
82-
<ContactForm ref="formRef" @success="getContactData(id)" />
8317
</template>
8418

8519
<script setup lang="ts">
8620
import { ElMessage } from 'element-plus'
8721
import { useTagsViewStore } from '@/store/modules/tagsView'
8822
import * as ContactApi from '@/api/crm/contact'
89-
import ContactBasicInfo from '@/views/crm/contact/detail/ContactBasicInfo.vue'
90-
import ContactDetails from '@/views/crm/contact/detail/ContactDetails.vue'
91-
import ContactForm from '@/views/crm/contact/ContactForm.vue'
92-
import { formatDate } from '@/utils/formatTime'
93-
// TODO 芋艿:后面在 review 么?
23+
import ContactDetailsHeader from '@/views/crm/contact/detail/ContactDetailsHeader.vue'
24+
import ContactDetailsInfo from '@/views/crm/contact/detail/ContactDetailsInfo.vue'
25+
import BusinessList from '@/views/crm/contactBusinessLink/components/BusinessListByContact.vue' // 商机列表
26+
import PermissionList from '@/views/crm/permission/components/PermissionList.vue' // 团队成员列表(权限)
27+
import { BizTypeEnum } from '@/api/crm/permission'
9428
9529
defineOptions({ name: 'CrmContactDetail' })
96-
9730
const { delView } = useTagsViewStore() // 视图操作
9831
const route = useRoute()
9932
const { currentRoute } = useRouter() // 路由
@@ -114,12 +47,6 @@ const getContactData = async (id: number) => {
11447
loading.value = false
11548
}
11649
}
117-
118-
const formRef = ref()
119-
const openForm = (type: string, id?: number) => {
120-
formRef.value.open(type, id)
121-
}
122-
12350
/**
12451
* 初始化
12552
*/

0 commit comments

Comments
 (0)