Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a1fd3afc
authored
Dec 17, 2023
by
zyna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crm联系人商机修改
parent
df1c565c
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
71 additions
and
102 deletions
+71
-102
src/api/crm/business/index.ts
+12
-0
src/api/crm/contact/index.ts
+16
-1
src/api/crm/contactbusinesslink/index.ts
+0
-47
src/views/crm/business/BusinessForm.vue
+2
-1
src/views/crm/business/components/BusinessForContactLink.vue
+17
-22
src/views/crm/business/components/BusinessList.vue
+4
-0
src/views/crm/business/components/BusinessListByContact.vue
+17
-18
src/views/crm/contact/detail/ContactDetailsHeader.vue
+1
-11
src/views/crm/contact/detail/index.vue
+2
-2
No files found.
src/api/crm/business/index.ts
View file @
a1fd3afc
/*
* @Author: zyna
* @Date: 2023-12-02 13:08:56
* @LastEditTime: 2023-12-17 16:28:20
* @FilePath: \yudao-ui-admin-vue3\src\api\crm\business\index.ts
* @Description:
*/
import
request
from
'@/config/axios'
import
request
from
'@/config/axios'
export
interface
BusinessVO
{
export
interface
BusinessVO
{
...
@@ -55,3 +62,8 @@ export const deleteBusiness = async (id: number) => {
...
@@ -55,3 +62,8 @@ export const deleteBusiness = async (id: number) => {
export
const
exportBusiness
=
async
(
params
)
=>
{
export
const
exportBusiness
=
async
(
params
)
=>
{
return
await
request
.
download
({
url
:
`/crm/business/export-excel`
,
params
})
return
await
request
.
download
({
url
:
`/crm/business/export-excel`
,
params
})
}
}
//联系人关联商机列表
export
const
getBusinessPageByContact
=
async
(
params
)
=>
{
return
await
request
.
get
({
url
:
`/crm/business/page-by-contact`
,
params
})
}
src/api/crm/contact/index.ts
View file @
a1fd3afc
...
@@ -25,7 +25,11 @@ export interface ContactVO {
...
@@ -25,7 +25,11 @@ export interface ContactVO {
areaName
:
string
areaName
:
string
ownerUserName
:
string
ownerUserName
:
string
}
}
export
interface
ContactBusinessLinkVO
{
id
:
number
contactId
:
number
businessId
:
number
}
// 查询 CRM 联系人列表
// 查询 CRM 联系人列表
export
const
getContactPage
=
async
(
params
)
=>
{
export
const
getContactPage
=
async
(
params
)
=>
{
return
await
request
.
get
({
url
:
`/crm/contact/page`
,
params
})
return
await
request
.
get
({
url
:
`/crm/contact/page`
,
params
})
...
@@ -65,3 +69,13 @@ export const exportContact = async (params) => {
...
@@ -65,3 +69,13 @@ export const exportContact = async (params) => {
export
const
getSimpleContactList
=
async
()
=>
{
export
const
getSimpleContactList
=
async
()
=>
{
return
await
request
.
get
({
url
:
`/crm/contact/simple-all-list`
})
return
await
request
.
get
({
url
:
`/crm/contact/simple-all-list`
})
}
}
//批量新增联系人商机关联
export
const
createContactBusinessLinkBatch
=
async
(
data
:
ContactBusinessLinkVO
[])
=>
{
return
await
request
.
post
({
url
:
`/crm/contact/create-batch-business`
,
data
})
}
//解除联系人商机关联
export
const
deleteContactBusinessLink
=
async
(
data
:
ContactBusinessLinkVO
)
=>
{
return
await
request
.
delete
({
url
:
`/crm/contact/delete-batch-business`
,
data
})
}
\ No newline at end of file
src/api/crm/contactbusinesslink/index.ts
deleted
100644 → 0
View file @
df1c565c
import
request
from
'@/config/axios'
export
interface
ContactBusinessLinkVO
{
id
:
number
contactId
:
number
businessId
:
number
}
// 查询联系人商机关联分页
export
const
getContactBusinessLinkPage
=
async
(
params
)
=>
{
return
await
request
.
get
({
url
:
`/crm/contact-business-link/page`
,
params
})
}
// 查询联系人商机关联详情
export
const
getContactBusinessLink
=
async
(
id
:
number
)
=>
{
return
await
request
.
get
({
url
:
`/crm/contact-business-link/get?id=`
+
id
})
}
// 新增联系人商机关联
export
const
createContactBusinessLink
=
async
(
data
:
ContactBusinessLinkVO
)
=>
{
return
await
request
.
post
({
url
:
`/crm/contact-business-link/create`
,
data
})
}
// 修改联系人商机关联
export
const
updateContactBusinessLink
=
async
(
data
:
ContactBusinessLinkVO
)
=>
{
return
await
request
.
put
({
url
:
`/crm/contact-business-link/update`
,
data
})
}
// 删除联系人商机关联
export
const
deleteContactBusinessLink
=
async
(
data
:
ContactBusinessLinkVO
)
=>
{
return
await
request
.
delete
({
url
:
`/crm/contact-business-link/delete-batch`
,
data
})
}
// 导出联系人商机关联 Excel
export
const
exportContactBusinessLink
=
async
(
params
)
=>
{
return
await
request
.
download
({
url
:
`/crm/contact-business-link/export-excel`
,
params
})
}
//批量新增联系人商机关联
export
const
createContactBusinessLinkBatch
=
async
(
data
:
ContactBusinessLinkVO
[])
=>
{
return
await
request
.
post
({
url
:
`/crm/contact-business-link/create-batch`
,
data
})
}
// 查询联系人关联商机列表
export
const
getBusinessByContactPage
=
async
(
params
)
=>
{
return
await
request
.
get
({
url
:
`/crm/contact-business-link/page-by-contact`
,
params
})
}
// TODO @zyna:根据后端,调整下请求
src/views/crm/business/BusinessForm.vue
View file @
a1fd3afc
...
@@ -242,7 +242,8 @@ const queryParams = reactive({
...
@@ -242,7 +242,8 @@ const queryParams = reactive({
mobile
:
null
,
mobile
:
null
,
industryId
:
null
,
industryId
:
null
,
level
:
null
,
level
:
null
,
source
:
null
source
:
null
,
pool
:
false
})
})
// 选择客户
// 选择客户
const
showCustomer
=
ref
(
false
)
const
showCustomer
=
ref
(
false
)
...
...
src/views/crm/
contactBusinessLink/components/BusinessLinkContactList
.vue
→
src/views/crm/
business/components/BusinessForContactLink
.vue
View file @
a1fd3afc
...
@@ -29,7 +29,6 @@
...
@@ -29,7 +29,6 @@
</ContentWrap>
</ContentWrap>
<!-- 列表 -->
<!-- 列表 -->
<!-- TODO @zyna:字段按照他们对齐下 -->
<ContentWrap
class=
"mt-10px"
>
<ContentWrap
class=
"mt-10px"
>
<el-table
<el-table
v-loading=
"loading"
v-loading=
"loading"
...
@@ -75,12 +74,14 @@
...
@@ -75,12 +74,14 @@
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
*
as
BusinessApi
from
'@/api/crm/business'
import
*
as
BusinessApi
from
'@/api/crm/business'
import
BusinessForm
from
'../
../business/
BusinessForm.vue'
import
BusinessForm
from
'../BusinessForm.vue'
import
{
fenToYuanFormat
}
from
'@/utils/formatter'
import
{
fenToYuanFormat
}
from
'@/utils/formatter'
// TODO @zyna:下面这个拼接,要注意大小写哈
import
*
as
ContactApi
from
'@/api/crm/contact'
import
*
as
ContactbusinesslinkApi
from
'@/api/crm/contactbusinesslink'
const
message
=
useMessage
()
// 消息弹窗
const
message
=
useMessage
()
// 消息弹窗
const
props
=
defineProps
<
{
customerId
:
number
}
>
()
defineOptions
({
name
:
'CrmBusinessLinkContactList'
})
defineOptions
({
name
:
'CrmBusinessLinkContactList'
})
const
dialogVisible
=
ref
(
false
)
// 弹窗的是否展示
const
dialogVisible
=
ref
(
false
)
// 弹窗的是否展示
...
@@ -93,8 +94,8 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
...
@@ -93,8 +94,8 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
const
queryParams
=
reactive
({
const
queryParams
=
reactive
({
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
10
,
pageSize
:
10
,
// TODO @zyna:是不是要根据 customerId 筛选?
name
:
undefined
,
name
:
undefine
d
customerId
:
props
.
customerI
d
})
})
const
contactIdProp
=
ref
(
0
)
// 联系人编号
const
contactIdProp
=
ref
(
0
)
// 联系人编号
...
@@ -102,8 +103,7 @@ const contactIdProp = ref(0) // 联系人编号
...
@@ -102,8 +103,7 @@ const contactIdProp = ref(0) // 联系人编号
const
open
=
async
(
contactId
:
number
)
=>
{
const
open
=
async
(
contactId
:
number
)
=>
{
dialogVisible
.
value
=
true
dialogVisible
.
value
=
true
contactIdProp
.
value
=
contactId
contactIdProp
.
value
=
contactId
// TODO @zyna:下面要 await 下;一般 idea 如果有黄色警告,最好都看看哈
await
getList
()
getList
()
}
}
defineExpose
({
open
})
// 提供 open 方法,用于打开弹窗
defineExpose
({
open
})
// 提供 open 方法,用于打开弹窗
...
@@ -111,7 +111,8 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
...
@@ -111,7 +111,8 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
const
getList
=
async
()
=>
{
const
getList
=
async
()
=>
{
loading
.
value
=
true
loading
.
value
=
true
try
{
try
{
const
data
=
await
BusinessApi
.
getBusinessPage
(
queryParams
)
console
.
log
(
queryParams
)
const
data
=
await
BusinessApi
.
getBusinessPageByCustomer
(
queryParams
)
list
.
value
=
data
.
list
list
.
value
=
data
.
list
total
.
value
=
data
.
total
total
.
value
=
data
.
total
}
finally
{
}
finally
{
...
@@ -141,25 +142,19 @@ const openForm = () => {
...
@@ -141,25 +142,19 @@ const openForm = () => {
const
emit
=
defineEmits
([
'success'
])
// 定义 success 事件,用于操作成功后的回调
const
emit
=
defineEmits
([
'success'
])
// 定义 success 事件,用于操作成功后的回调
const
businessRef
=
ref
()
const
businessRef
=
ref
()
const
submitForm
=
async
()
=>
{
const
submitForm
=
async
()
=>
{
// TODO @zyna:可以 if return,这样括号层级简单一点
if
(
businessRef
.
value
.
getSelectionRows
().
length
===
0
)
{
if
(
businessRef
.
value
.
getSelectionRows
().
length
===
0
)
{
message
.
success
(
'未选择商机'
)
return
message
.
success
(
'未选择商机'
)
}
else
{
}
// TODO @zyna:这里 postData 应该不用 ref,搞个 数组就好了?
const
postData
=
[]
const
postData
=
ref
<
ContactbusinesslinkApi
.
ContactBusinessLinkVO
[]
>
([])
businessRef
.
value
.
getSelectionRows
().
forEach
((
element
)
=>
{
businessRef
.
value
.
getSelectionRows
().
forEach
((
element
)
=>
{
// TODO @zyna:可以直接 push,不用声明 data
postData
.
push
({
let
data
=
{
id
:
undefined
,
businessId
:
element
.
id
,
businessId
:
element
.
id
,
contactId
:
contactIdProp
.
value
contactId
:
contactIdProp
.
value
}
postData
.
value
.
push
(
data
)
})
})
await
ContactbusinesslinkApi
.
createContactBusinessLinkBatch
(
postData
.
value
)
})
await
ContactApi
.
createContactBusinessLinkBatch
(
postData
)
dialogVisible
.
value
=
false
dialogVisible
.
value
=
false
emit
(
'success'
)
emit
(
'success'
)
}
}
}
/** 打开联系人详情 */
/** 打开联系人详情 */
...
...
src/views/crm/business/components/BusinessList.vue
View file @
a1fd3afc
...
@@ -39,6 +39,7 @@ import * as BusinessApi from '@/api/crm/business'
...
@@ -39,6 +39,7 @@ import * as BusinessApi from '@/api/crm/business'
import
BusinessForm
from
'./../BusinessForm.vue'
import
BusinessForm
from
'./../BusinessForm.vue'
import
{
BizTypeEnum
}
from
'@/api/crm/permission'
import
{
BizTypeEnum
}
from
'@/api/crm/permission'
import
{
fenToYuanFormat
}
from
'@/utils/formatter'
import
{
fenToYuanFormat
}
from
'@/utils/formatter'
import
*
as
ContactApi
from
'@/api/crm/contact'
defineOptions
({
name
:
'CrmBusinessList'
})
defineOptions
({
name
:
'CrmBusinessList'
})
const
props
=
defineProps
<
{
const
props
=
defineProps
<
{
...
@@ -67,12 +68,15 @@ const getList = async () => {
...
@@ -67,12 +68,15 @@ const getList = async () => {
case
BizTypeEnum
.
CRM_CUSTOMER
:
case
BizTypeEnum
.
CRM_CUSTOMER
:
queryParams
.
customerId
=
props
.
bizId
queryParams
.
customerId
=
props
.
bizId
data
=
await
BusinessApi
.
getBusinessPageByCustomer
(
queryParams
)
data
=
await
BusinessApi
.
getBusinessPageByCustomer
(
queryParams
)
console
.
log
(
data
)
break
break
default
:
default
:
return
return
}
}
list
.
value
=
data
.
list
list
.
value
=
data
.
list
total
.
value
=
data
.
total
total
.
value
=
data
.
total
console
.
log
(
list
.
value
)
}
finally
{
}
finally
{
loading
.
value
=
false
loading
.
value
=
false
}
}
...
...
src/views/crm/
contactBusinessLink
/components/BusinessListByContact.vue
→
src/views/crm/
business
/components/BusinessListByContact.vue
View file @
a1fd3afc
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
<Icon
class=
"mr-5px"
icon=
"ep:opportunity"
/>
<Icon
class=
"mr-5px"
icon=
"ep:opportunity"
/>
创建商机
创建商机
</el-button>
</el-button>
<el-button
@
click=
"openBusinessLink"
>
关联
</el-button>
<el-button
@
click=
"openBusinessLink"
>
<Icon
class=
"mr-5px"
icon=
"ep:remove"
/>
关联
</el-button>
<el-button
@
click=
"deleteBusinessLink"
>
解除关联
</el-button>
<el-button
@
click=
"deleteBusinessLink"
>
<Icon
class=
"mr-5px"
icon=
"ep:circle-plus"
/>
解除关联
</el-button>
</el-row>
</el-row>
<!-- 列表 -->
<!-- 列表 -->
...
@@ -41,22 +41,25 @@
...
@@ -41,22 +41,25 @@
</ContentWrap>
</ContentWrap>
<!-- 表单弹窗:添加 -->
<!-- 表单弹窗:添加 -->
<BusinessForm
ref=
"formRef"
@
success=
"getList"
/>
<BusinessForm
ref=
"formRef"
@
success=
"getList"
/>
<!---->
<!--
关联商机选择弹框
-->
<BusinessLink
ref=
"businessLinkRef"
@
success=
"getList"
/>
<BusinessLink
ref=
"businessLinkRef"
@
success=
"getList"
:customer-id=
"props.customerId"
/>
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
*
as
ContactBusinessLinkApi
from
'@/api/crm/contactbusinesslink
'
import
*
as
BusinessApi
from
'@/api/crm/business
'
import
BusinessForm
from
'../
../business/
BusinessForm.vue'
import
BusinessForm
from
'../BusinessForm.vue'
import
{
BizTypeEnum
}
from
'@/api/crm/permission'
import
{
BizTypeEnum
}
from
'@/api/crm/permission'
import
{
fenToYuanFormat
}
from
'@/utils/formatter'
import
{
fenToYuanFormat
}
from
'@/utils/formatter'
import
BusinessLink
from
'./BusinessLinkContactList.vue'
import
BusinessLink
from
'./BusinessForContactLink.vue'
import
*
as
ContactApi
from
'@/api/crm/contact'
import
{
el
}
from
'element-plus/es/locale'
const
message
=
useMessage
()
// 消息弹窗
const
message
=
useMessage
()
// 消息弹窗
// TODO @zyna:这个组件,可以服用 BusinessList,然后根据传入的编号类型,做一些判断?
defineOptions
({
name
:
'CrmBusinessContactList'
})
defineOptions
({
name
:
'CrmBusinessContactList'
})
const
props
=
defineProps
<
{
const
props
=
defineProps
<
{
bizType
:
number
// 业务类型
bizType
:
number
// 业务类型
bizId
:
number
// 业务编号
bizId
:
number
// 业务编号
customerId
:
number
}
>
()
}
>
()
const
loading
=
ref
(
true
)
// 列表的加载中
const
loading
=
ref
(
true
)
// 列表的加载中
...
@@ -72,6 +75,7 @@ const queryParams = reactive({
...
@@ -72,6 +75,7 @@ const queryParams = reactive({
const
getList
=
async
()
=>
{
const
getList
=
async
()
=>
{
loading
.
value
=
true
loading
.
value
=
true
try
{
try
{
console
.
log
(
props
.
customerId
)
// 置空参数
// 置空参数
queryParams
.
contactId
=
undefined
queryParams
.
contactId
=
undefined
// 执行查询
// 执行查询
...
@@ -79,7 +83,7 @@ const getList = async () => {
...
@@ -79,7 +83,7 @@ const getList = async () => {
switch
(
props
.
bizType
)
{
switch
(
props
.
bizType
)
{
case
BizTypeEnum
.
CRM_CONTACT
:
case
BizTypeEnum
.
CRM_CONTACT
:
queryParams
.
contactId
=
props
.
bizId
queryParams
.
contactId
=
props
.
bizId
data
=
await
ContactBusinessLinkApi
.
getBusinessByContactPage
(
queryParams
)
data
=
await
BusinessApi
.
getBusinessPageByContact
(
queryParams
)
break
break
default
:
default
:
return
return
...
@@ -113,16 +117,11 @@ const deleteBusinessLink = async () => {
...
@@ -113,16 +117,11 @@ const deleteBusinessLink = async () => {
if
(
businessRef
.
value
.
getSelectionRows
().
length
===
0
)
{
if
(
businessRef
.
value
.
getSelectionRows
().
length
===
0
)
{
message
.
success
(
'未选择商机'
)
message
.
success
(
'未选择商机'
)
}
else
{
}
else
{
const
postData
=
ref
<
ContactBusinessLinkApi
.
ContactBusinessLinkVO
[]
>
([])
const
postData
=
[]
businessRef
.
value
.
getSelectionRows
().
forEach
((
element
)
=>
{
businessRef
.
value
.
getSelectionRows
().
forEach
((
element
)
=>
{
let
data
=
{
postData
.
push
(
element
.
businessContactId
)
id
:
undefined
,
businessId
:
element
.
id
,
contactId
:
props
.
bizId
}
postData
.
value
.
push
(
data
)
})
})
await
Contact
BusinessLinkApi
.
deleteContactBusinessLink
(
postData
.
value
)
await
Contact
Api
.
deleteContactBusinessLink
(
postData
)
handleQuery
()
handleQuery
()
}
}
}
}
...
...
src/views/crm/contact/detail/ContactDetailsHeader.vue
View file @
a1fd3afc
<!--
* @Author: zyna
* @Date: 2023-12-02 13:08:57
* @LastEditTime: 2023-12-03 13:47:16
* @FilePath: \yudao-ui-admin-vue3\src\views\crm\contact\detail\ContactDetailsHeader.vue
* @Description:
-->
<!-- TODO @zyna:上面这个不加哈 -->
<
template
>
<
template
>
<!-- TODO @zyna:loading 缺了 -->
<div>
<div
v-loading=
"loading"
>
<div
class=
"flex items-start justify-between"
>
<div
class=
"flex items-start justify-between"
>
<div>
<div>
<el-col>
<el-col>
...
@@ -48,7 +39,6 @@
...
@@ -48,7 +39,6 @@
import
*
as
ContactApi
from
'@/api/crm/contact'
import
*
as
ContactApi
from
'@/api/crm/contact'
import
ContactForm
from
'@/views/crm/contact/ContactForm.vue'
import
ContactForm
from
'@/views/crm/contact/ContactForm.vue'
import
{
formatDate
}
from
'@/utils/formatTime'
import
{
formatDate
}
from
'@/utils/formatTime'
//操作修改
//操作修改
const
formRef
=
ref
()
const
formRef
=
ref
()
const
openForm
=
(
type
:
string
,
id
?:
number
)
=>
{
const
openForm
=
(
type
:
string
,
id
?:
number
)
=>
{
...
...
src/views/crm/contact/detail/index.vue
View file @
a1fd3afc
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<PermissionList
:biz-id=
"contact.id!"
:biz-type=
"BizTypeEnum.CRM_CONTACT"
/>
<PermissionList
:biz-id=
"contact.id!"
:biz-type=
"BizTypeEnum.CRM_CONTACT"
/>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"商机"
lazy
>
<el-tab-pane
label=
"商机"
lazy
>
<BusinessList
:biz-id=
"contact.id!"
:biz-type=
"BizTypeEnum.CRM_CONTACT"
/>
<BusinessList
:biz-id=
"contact.id!"
:biz-type=
"BizTypeEnum.CRM_CONTACT"
:customer-id=
"contact.customerId"
/>
</el-tab-pane>
</el-tab-pane>
</el-tabs>
</el-tabs>
</el-col>
</el-col>
...
@@ -21,7 +21,7 @@ import { useTagsViewStore } from '@/store/modules/tagsView'
...
@@ -21,7 +21,7 @@ import { useTagsViewStore } from '@/store/modules/tagsView'
import
*
as
ContactApi
from
'@/api/crm/contact'
import
*
as
ContactApi
from
'@/api/crm/contact'
import
ContactDetailsHeader
from
'@/views/crm/contact/detail/ContactDetailsHeader.vue'
import
ContactDetailsHeader
from
'@/views/crm/contact/detail/ContactDetailsHeader.vue'
import
ContactDetailsInfo
from
'@/views/crm/contact/detail/ContactDetailsInfo.vue'
import
ContactDetailsInfo
from
'@/views/crm/contact/detail/ContactDetailsInfo.vue'
import
BusinessList
from
'@/views/crm/
contactBusinessLink
/components/BusinessListByContact.vue'
// 商机列表
import
BusinessList
from
'@/views/crm/
business
/components/BusinessListByContact.vue'
// 商机列表
import
PermissionList
from
'@/views/crm/permission/components/PermissionList.vue'
// 团队成员列表(权限)
import
PermissionList
from
'@/views/crm/permission/components/PermissionList.vue'
// 团队成员列表(权限)
import
{
BizTypeEnum
}
from
'@/api/crm/permission'
import
{
BizTypeEnum
}
from
'@/api/crm/permission'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment