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
4362251b
authored
Feb 20, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
CRM:优化客户的详情、更新成交状态
parent
ac9a77e6
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
62 additions
and
41 deletions
+62
-41
src/api/crm/customer/index.ts
+5
-0
src/views/crm/clue/ClueForm.vue
+5
-3
src/views/crm/clue/detail/ClueDetailsHeader.vue
+1
-1
src/views/crm/clue/detail/ClueDetailsInfo.vue
+1
-1
src/views/crm/customer/CustomerForm.vue
+5
-4
src/views/crm/customer/detail/CustomerDetailsHeader.vue
+5
-5
src/views/crm/customer/detail/CustomerDetailsInfo.vue
+20
-23
src/views/crm/customer/detail/index.vue
+20
-4
No files found.
src/api/crm/customer/index.ts
View file @
4362251b
...
@@ -50,6 +50,11 @@ export const updateCustomer = async (data: CustomerVO) => {
...
@@ -50,6 +50,11 @@ export const updateCustomer = async (data: CustomerVO) => {
return
await
request
.
put
({
url
:
`/crm/customer/update`
,
data
})
return
await
request
.
put
({
url
:
`/crm/customer/update`
,
data
})
}
}
// 更新客户的成交状态
export
const
updateCustomerDealStatus
=
async
(
id
:
number
,
dealStatus
:
boolean
)
=>
{
return
await
request
.
put
({
url
:
`/crm/customer/update-deal-status`
,
params
:
{
id
,
dealStatus
}
})
}
// 删除客户
// 删除客户
export
const
deleteCustomer
=
async
(
id
:
number
)
=>
{
export
const
deleteCustomer
=
async
(
id
:
number
)
=>
{
return
await
request
.
delete
({
url
:
`/crm/customer/delete?id=`
+
id
})
return
await
request
.
delete
({
url
:
`/crm/customer/delete?id=`
+
id
})
...
...
src/views/crm/clue/ClueForm.vue
View file @
4362251b
...
@@ -102,12 +102,14 @@
...
@@ -102,12 +102,14 @@
<el-row>
<el-row>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"地址"
prop=
"areaId"
>
<el-form-item
label=
"地址"
prop=
"areaId"
>
<el-
tree-select
<el-
cascader
v-model=
"formData.areaId"
v-model=
"formData.areaId"
:
data
=
"areaList"
:
options
=
"areaList"
:props=
"defaultProps"
:props=
"defaultProps"
:render-after-expand=
"true"
class=
"w-1/1"
class=
"w-1/1"
clearable
filterable
placeholder=
"请选择城市"
/>
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
...
...
src/views/crm/clue/detail/ClueDetailsHeader.vue
View file @
4362251b
...
@@ -35,7 +35,7 @@ import { DICT_TYPE } from '@/utils/dict'
...
@@ -35,7 +35,7 @@ import { DICT_TYPE } from '@/utils/dict'
import
*
as
ClueApi
from
'@/api/crm/clue'
import
*
as
ClueApi
from
'@/api/crm/clue'
import
{
formatDate
}
from
'@/utils/formatTime'
import
{
formatDate
}
from
'@/utils/formatTime'
defineOptions
({
name
:
'ClueDetailsHeader'
})
defineOptions
({
name
:
'C
rmC
lueDetailsHeader'
})
defineProps
<
{
defineProps
<
{
clue
:
ClueApi
.
ClueVO
// 线索信息
clue
:
ClueApi
.
ClueVO
// 线索信息
loading
:
boolean
// 加载中
loading
:
boolean
// 加载中
...
...
src/views/crm/clue/detail/ClueDetailsInfo.vue
View file @
4362251b
...
@@ -62,7 +62,7 @@ import * as ClueApi from '@/api/crm/clue'
...
@@ -62,7 +62,7 @@ import * as ClueApi from '@/api/crm/clue'
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
{
formatDate
}
from
'@/utils/formatTime'
import
{
formatDate
}
from
'@/utils/formatTime'
defineOptions
({
name
:
'ClueDetailsInfo'
})
defineOptions
({
name
:
'C
rmC
lueDetailsInfo'
})
const
{
clue
}
=
defineProps
<
{
const
{
clue
}
=
defineProps
<
{
clue
:
ClueApi
.
ClueVO
// 线索明细
clue
:
ClueApi
.
ClueVO
// 线索明细
}
>
()
}
>
()
...
...
src/views/crm/customer/CustomerForm.vue
View file @
4362251b
...
@@ -102,12 +102,14 @@
...
@@ -102,12 +102,14 @@
<el-row>
<el-row>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"地址"
prop=
"areaId"
>
<el-form-item
label=
"地址"
prop=
"areaId"
>
<el-
tree-select
<el-
cascader
v-model=
"formData.areaId"
v-model=
"formData.areaId"
:
data
=
"areaList"
:
options
=
"areaList"
:props=
"defaultProps"
:props=
"defaultProps"
:render-after-expand=
"true"
class=
"w-1/1"
class=
"w-1/1"
clearable
filterable
placeholder=
"请选择城市"
/>
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
...
@@ -117,7 +119,6 @@
...
@@ -117,7 +119,6 @@
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
<!-- TODO 芋艿:待整理 -->
<el-row>
<el-row>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"下次联系时间"
prop=
"contactNextTime"
>
<el-form-item
label=
"下次联系时间"
prop=
"contactNextTime"
>
...
...
src/views/crm/customer/detail/CustomerDetailsHeader.vue
View file @
4362251b
...
@@ -24,18 +24,18 @@
...
@@ -24,18 +24,18 @@
{{
customer
.
dealStatus
?
'已成交'
:
'未成交'
}}
{{
customer
.
dealStatus
?
'已成交'
:
'未成交'
}}
</el-descriptions-item>
</el-descriptions-item>
<el-descriptions-item
label=
"负责人"
>
{{
customer
.
ownerUserName
}}
</el-descriptions-item>
<el-descriptions-item
label=
"负责人"
>
{{
customer
.
ownerUserName
}}
</el-descriptions-item>
<!-- TODO wanwan 首要联系人? -->
<el-descriptions-item
label=
"创建时间"
>
<el-descriptions-item
label=
"首要联系人"
/>
{{
formatDate
(
customer
.
createTime
)
}}
<!-- TODO wanwan 首要联系人电话? -->
</el-descriptions-item>
<el-descriptions-item
label=
"首要联系人电话"
>
{{
customer
.
mobile
}}
</el-descriptions-item>
</el-descriptions>
</el-descriptions>
</ContentWrap>
</ContentWrap>
</
template
>
</
template
>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
*
as
CustomerApi
from
'@/api/crm/customer'
import
*
as
CustomerApi
from
'@/api/crm/customer'
import
{
formatDate
}
from
'@/utils/formatTime'
defineOptions
({
name
:
'CustomerDetailsHeader'
})
defineOptions
({
name
:
'C
rmC
ustomerDetailsHeader'
})
defineProps
<
{
defineProps
<
{
customer
:
CustomerApi
.
CustomerVO
// 客户信息
customer
:
CustomerApi
.
CustomerVO
// 客户信息
loading
:
boolean
// 加载中
loading
:
boolean
// 加载中
...
...
src/views/crm/customer/detail/CustomerDetailsInfo.vue
View file @
4362251b
...
@@ -9,36 +9,26 @@
...
@@ -9,36 +9,26 @@
<el-descriptions-item
label=
"客户名称"
>
<el-descriptions-item
label=
"客户名称"
>
{{ customer.name }}
{{ customer.name }}
</el-descriptions-item>
</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=
"客户来源"
>
<el-descriptions-item
label=
"客户来源"
>
<dict-tag
:type=
"DICT_TYPE.CRM_CUSTOMER_SOURCE"
:value=
"customer.source"
/>
<dict-tag
:type=
"DICT_TYPE.CRM_CUSTOMER_SOURCE"
:value=
"customer.source"
/>
</el-descriptions-item>
</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.mobile }}
</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.telephone }}
</el-descriptions-item>
<el-descriptions-item
label=
"邮箱"
>
{{ customer.email }}
</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=
"QQ"
>
{{ customer.qq }}
</el-descriptions-item>
<el-descriptions-item
label=
"QQ"
>
{{ customer.qq }}
</el-descriptions-item>
<el-descriptions-item
label=
"微信"
>
{{ customer.wechat }}
</el-descriptions-item>
<el-descriptions-item
label=
"微信"
>
{{ customer.wechat }}
</el-descriptions-item>
<el-descriptions-item
label=
"网址"
>
{{ customer.website }}
</el-descriptions-item>
<el-descriptions-item
label=
"客户行业"
>
<el-descriptions-item
label=
"所在地"
>
{{ customer.areaName }}
</el-descriptions-item>
<dict-tag
:type=
"DICT_TYPE.CRM_CUSTOMER_INDUSTRY"
:value=
"customer.industryId"
/>
<el-descriptions-item
label=
"详细地址"
>
{{ customer.detailAddress }}
</el-descriptions-item>
</el-descriptions-item>
<el-descriptions-item
label=
"下次联系时间"
>
<el-descriptions-item
label=
"客户级别"
>
{{
<dict-tag
:type=
"DICT_TYPE.CRM_CUSTOMER_LEVEL"
:value=
"customer.level"
/>
customer.contactNextTime ? formatDate(customer.contactNextTime, 'YYYY-MM-DD') : '空'
}}
</el-descriptions-item>
</el-descriptions-item>
<el-descriptions-item
label=
"
最后跟进
时间"
>
<el-descriptions-item
label=
"
下次联系
时间"
>
{{
customer.contactLastTime ? formatDate(customer.contactLastTime) : '空'
}}
{{
formatDate(customer.contactNextTime)
}}
</el-descriptions-item>
</el-descriptions-item>
</el-descriptions>
<el-descriptions
:column=
"1"
>
<el-descriptions-item
label=
"客户描述"
>
{{ customer.description }}
</el-descriptions-item>
<el-descriptions-item
label=
"备注"
>
{{ customer.remark }}
</el-descriptions-item>
<el-descriptions-item
label=
"备注"
>
{{ customer.remark }}
</el-descriptions-item>
</el-descriptions>
</el-descriptions>
</el-collapse-item>
</el-collapse-item>
...
@@ -46,14 +36,21 @@
...
@@ -46,14 +36,21 @@
<
template
#
title
>
<
template
#
title
>
<span
class=
"text-base font-bold"
>
系统信息
</span>
<span
class=
"text-base font-bold"
>
系统信息
</span>
</
template
>
</
template
>
<el-descriptions
:column=
"
2
"
>
<el-descriptions
:column=
"
4
"
>
<el-descriptions-item
label=
"负责人"
>
{{ customer.ownerUserName }}
</el-descriptions-item>
<el-descriptions-item
label=
"负责人"
>
{{ customer.ownerUserName }}
</el-descriptions-item>
<el-descriptions-item
label=
"最后跟进记录"
>
{{ customer.contactLastContent }}
</el-descriptions-item>
<el-descriptions-item
label=
"最后跟进时间"
>
{{ formatDate(customer.contactLastTime) }}
</el-descriptions-item>
<el-descriptions-item
label=
""
>
</el-descriptions-item>
<el-descriptions-item
label=
"创建人"
>
{{ customer.creatorName }}
</el-descriptions-item>
<el-descriptions-item
label=
"创建人"
>
{{ customer.creatorName }}
</el-descriptions-item>
<el-descriptions-item
label=
"创建时间"
>
<el-descriptions-item
label=
"创建时间"
>
{{
customer.createTime ? formatDate(customer.createTime) : '空'
}}
{{
formatDate(customer.createTime)
}}
</el-descriptions-item>
</el-descriptions-item>
<el-descriptions-item
label=
"更新时间"
>
<el-descriptions-item
label=
"更新时间"
>
{{
customer.updateTime ? formatDate(customer.updateTime) : '空'
}}
{{
formatDate(customer.updateTime)
}}
</el-descriptions-item>
</el-descriptions-item>
</el-descriptions>
</el-descriptions>
</el-collapse-item>
</el-collapse-item>
...
@@ -65,7 +62,7 @@ import * as CustomerApi from '@/api/crm/customer'
...
@@ -65,7 +62,7 @@ import * as CustomerApi from '@/api/crm/customer'
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
{
formatDate
}
from
'@/utils/formatTime'
import
{
formatDate
}
from
'@/utils/formatTime'
defineOptions
({
name
:
'CustomerDetailsInfo'
})
defineOptions
({
name
:
'C
rmC
ustomerDetailsInfo'
})
const
{
customer
}
=
defineProps
<
{
const
{
customer
}
=
defineProps
<
{
customer
:
CustomerApi
.
CustomerVO
// 客户明细
customer
:
CustomerApi
.
CustomerVO
// 客户明细
}
>
()
}
>
()
...
...
src/views/crm/customer/detail/index.vue
View file @
4362251b
...
@@ -11,7 +11,9 @@
...
@@ -11,7 +11,9 @@
<el-button
v-if=
"permissionListRef?.validateOwnerUser"
type=
"primary"
@
click=
"transfer"
>
<el-button
v-if=
"permissionListRef?.validateOwnerUser"
type=
"primary"
@
click=
"transfer"
>
转移
转移
</el-button>
</el-button>
<el-button
v-if=
"permissionListRef?.validateWrite"
>
更改成交状态
</el-button>
<el-button
v-if=
"permissionListRef?.validateWrite"
@
click=
"handleUpdateDealStatus"
>
更改成交状态
</el-button>
<el-button
<el-button
v-if=
"customer.lockStatus && permissionListRef?.validateOwnerUser"
v-if=
"customer.lockStatus && permissionListRef?.validateOwnerUser"
@
click=
"handleUnlock"
@
click=
"handleUnlock"
...
@@ -72,7 +74,7 @@
...
@@ -72,7 +74,7 @@
<!-- 表单弹窗:添加/修改 -->
<!-- 表单弹窗:添加/修改 -->
<CustomerForm
ref=
"formRef"
@
success=
"getCustomer"
/>
<CustomerForm
ref=
"formRef"
@
success=
"getCustomer"
/>
<CrmTransferForm
ref=
"
crmT
ransferFormRef"
@
success=
"close"
/>
<CrmTransferForm
ref=
"
t
ransferFormRef"
@
success=
"close"
/>
</
template
>
</
template
>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
useTagsViewStore
}
from
'@/store/modules/tagsView'
import
{
useTagsViewStore
}
from
'@/store/modules/tagsView'
...
@@ -120,10 +122,24 @@ const openForm = () => {
...
@@ -120,10 +122,24 @@ const openForm = () => {
formRef
.
value
?.
open
(
'update'
,
customerId
.
value
)
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
crmT
ransferFormRef
=
ref
<
InstanceType
<
typeof
CrmTransferForm
>>
()
// 客户转移表单 ref
const
t
ransferFormRef
=
ref
<
InstanceType
<
typeof
CrmTransferForm
>>
()
// 客户转移表单 ref
const
transfer
=
()
=>
{
const
transfer
=
()
=>
{
crmT
ransferFormRef
.
value
?.
open
(
'客户转移'
,
customerId
.
value
,
CustomerApi
.
transferCustomer
)
t
ransferFormRef
.
value
?.
open
(
'客户转移'
,
customerId
.
value
,
CustomerApi
.
transferCustomer
)
}
}
/** 锁定客户 */
/** 锁定客户 */
...
...
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