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
29605800
authored
Feb 21, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
CRM:完善商机的新增、修改逻辑
parent
6baeadc8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
30 deletions
+53
-30
src/api/crm/business/status/index.ts
+26
-0
src/views/crm/business/BusinessForm.vue
+1
-0
src/views/crm/business/status/BusinessStatusForm.vue
+24
-8
src/views/crm/business/status/index.vue
+2
-22
No files found.
src/api/crm/business/status/index.ts
View file @
29605800
...
@@ -11,6 +11,27 @@ export interface BusinessStatusTypeVO {
...
@@ -11,6 +11,27 @@ export interface BusinessStatusTypeVO {
}
}
}
}
export
const
DEFAULT_STATUSES
=
[
{
endStatus
:
1
,
key
:
'结束'
,
name
:
'赢单'
,
percent
:
100
},
{
endStatus
:
2
,
key
:
'结束'
,
name
:
'输单'
,
percent
:
0
},
{
endStatus
:
3
,
key
:
'结束'
,
name
:
'无效'
,
percent
:
0
}
]
// 查询商机状态组列表
// 查询商机状态组列表
export
const
getBusinessStatusPage
=
async
(
params
:
any
)
=>
{
export
const
getBusinessStatusPage
=
async
(
params
:
any
)
=>
{
return
await
request
.
get
({
url
:
`/crm/business-status/page`
,
params
})
return
await
request
.
get
({
url
:
`/crm/business-status/page`
,
params
})
...
@@ -31,6 +52,11 @@ export const getBusinessStatus = async (id: number) => {
...
@@ -31,6 +52,11 @@ export const getBusinessStatus = async (id: number) => {
return
await
request
.
get
({
url
:
`/crm/business-status/get?id=`
+
id
})
return
await
request
.
get
({
url
:
`/crm/business-status/get?id=`
+
id
})
}
}
// 删除商机状态
export
const
deleteBusinessStatus
=
async
(
id
:
number
)
=>
{
return
await
request
.
delete
({
url
:
`/crm/business-status/delete?id=`
+
id
})
}
// 获得商机状态组列表
// 获得商机状态组列表
export
const
getBusinessStatusTypeSimpleList
=
async
()
=>
{
export
const
getBusinessStatusTypeSimpleList
=
async
()
=>
{
return
await
request
.
get
({
url
:
`/crm/business-status/type-simple-list`
})
return
await
request
.
get
({
url
:
`/crm/business-status/type-simple-list`
})
...
...
src/views/crm/business/BusinessForm.vue
View file @
29605800
...
@@ -50,6 +50,7 @@
...
@@ -50,6 +50,7 @@
placeholder=
"请选择商机状态组"
placeholder=
"请选择商机状态组"
clearable
clearable
class=
"w-1/1"
class=
"w-1/1"
:disabled=
"formType !== 'create'"
>
>
<el-option
<el-option
v-for=
"item in statusTypeList"
v-for=
"item in statusTypeList"
...
...
src/views/crm/business/status/BusinessStatusForm.vue
View file @
29605800
...
@@ -25,20 +25,27 @@
...
@@ -25,20 +25,27 @@
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"阶段设置"
prop=
"statuses"
>
<el-form-item
label=
"阶段设置"
prop=
"statuses"
>
<el-table
border
style=
"width: 100%"
:data=
"formData.statuses"
>
<el-table
border
style=
"width: 100%"
:data=
"formData.statuses.concat(BusinessStatusApi.DEFAULT_STATUSES)"
>
<el-table-column
align=
"center"
label=
"阶段"
width=
"70"
>
<el-table-column
align=
"center"
label=
"阶段"
width=
"70"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<el-text>
阶段
{{
scope
.
$index
+
1
}}
</el-text>
<el-text
v-if=
"!scope.row.defaultStatus"
>
阶段
{{
scope
.
$index
+
1
}}
</el-text>
<el-text
v-else
>
结束
</el-text>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"阶段名称"
width=
"160"
prop=
"name"
>
<el-table-column
align=
"center"
label=
"阶段名称"
width=
"160"
prop=
"name"
>
<
template
#
default=
"{ row }"
>
<
template
#
default=
"{ row }"
>
<el-input
v-model=
"row.name"
placeholder=
"请输入状态名称"
/>
<el-input
v-if=
"!row.endStatus"
v-model=
"row.name"
placeholder=
"请输入状态名称"
/>
<el-text
v-else
>
{{
row
.
name
}}
</el-text>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
width=
"140"
align=
"center"
label=
"赢单率"
prop=
"percent"
>
<el-table-column
width=
"140"
align=
"center"
label=
"赢单率
(%)
"
prop=
"percent"
>
<
template
#
default=
"{ row }"
>
<
template
#
default=
"{ row }"
>
<el-input-number
<el-input-number
v-if=
"!row.endStatus"
v-model=
"row.percent"
v-model=
"row.percent"
placeholder=
"请输入赢单率"
placeholder=
"请输入赢单率"
controls-position=
"right"
controls-position=
"right"
...
@@ -47,12 +54,21 @@
...
@@ -47,12 +54,21 @@
:precision=
"2"
:precision=
"2"
class=
"!w-1/1"
class=
"!w-1/1"
/>
/>
<el-text
v-else
>
{{
row
.
percent
}}
</el-text>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作"
width=
"110"
align=
"center"
>
<el-table-column
label=
"操作"
width=
"110"
align=
"center"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<el-button
link
type=
"primary"
@
click=
"addStatusArea(scope.$index)"
>
添加
</el-button>
<el-button
<el-button
v-if=
"!scope.row.endStatus"
link
type=
"primary"
@
click=
"addStatus(scope.$index)"
>
添加
</el-button>
<el-button
v-if=
"!scope.row.endStatus"
link
link
type=
"danger"
type=
"danger"
@
click=
"deleteStatusArea(scope.$index)"
@
click=
"deleteStatusArea(scope.$index)"
...
@@ -110,13 +126,13 @@ const open = async (type: string, id?: number) => {
...
@@ -110,13 +126,13 @@ const open = async (type: string, id?: number) => {
formData
.
value
=
await
BusinessStatusApi
.
getBusinessStatus
(
id
)
formData
.
value
=
await
BusinessStatusApi
.
getBusinessStatus
(
id
)
treeRef
.
value
.
setCheckedKeys
(
formData
.
value
.
deptIds
)
treeRef
.
value
.
setCheckedKeys
(
formData
.
value
.
deptIds
)
if
(
formData
.
value
.
statuses
.
length
==
0
)
{
if
(
formData
.
value
.
statuses
.
length
==
0
)
{
addStatus
Area
(
0
)
addStatus
(
)
}
}
}
finally
{
}
finally
{
formLoading
.
value
=
false
formLoading
.
value
=
false
}
}
}
else
{
}
else
{
addStatus
Area
(
0
)
addStatus
(
)
}
}
// 加载部门树
// 加载部门树
deptList
.
value
=
handleTree
(
await
DeptApi
.
getSimpleDeptList
())
deptList
.
value
=
handleTree
(
await
DeptApi
.
getSimpleDeptList
())
...
@@ -162,7 +178,7 @@ const resetForm = () => {
...
@@ -162,7 +178,7 @@ const resetForm = () => {
}
}
/** 添加状态 */
/** 添加状态 */
const
addStatus
Area
=
()
=>
{
const
addStatus
=
()
=>
{
const
data
=
formData
.
value
const
data
=
formData
.
value
data
.
statuses
.
push
({
data
.
statuses
.
push
({
name
:
''
,
name
:
''
,
...
...
src/views/crm/business/status/index.vue
View file @
29605800
...
@@ -80,6 +80,7 @@ import { dateFormatter } from '@/utils/formatTime'
...
@@ -80,6 +80,7 @@ import { dateFormatter } from '@/utils/formatTime'
import
download
from
'@/utils/download'
import
download
from
'@/utils/download'
import
*
as
BusinessStatusApi
from
'@/api/crm/business/status'
import
*
as
BusinessStatusApi
from
'@/api/crm/business/status'
import
BusinessStatusForm
from
'./BusinessStatusForm.vue'
import
BusinessStatusForm
from
'./BusinessStatusForm.vue'
import
{
deleteBusinessStatus
}
from
'@/api/crm/business/status'
defineOptions
({
name
:
'CrmBusinessStatus'
})
defineOptions
({
name
:
'CrmBusinessStatus'
})
...
@@ -126,40 +127,19 @@ const openForm = (type: string, id?: number) => {
...
@@ -126,40 +127,19 @@ const openForm = (type: string, id?: number) => {
formRef
.
value
.
open
(
type
,
id
)
formRef
.
value
.
open
(
type
,
id
)
}
}
/** 选择客户操作 */
const
formCustomerRef
=
ref
()
const
openCustomerForm
=
(
id
?:
number
)
=>
{
formCustomerRef
.
value
.
open
(
id
)
}
/** 删除按钮操作 */
/** 删除按钮操作 */
const
handleDelete
=
async
(
id
:
number
)
=>
{
const
handleDelete
=
async
(
id
:
number
)
=>
{
try
{
try
{
// 删除的二次确认
// 删除的二次确认
await
message
.
delConfirm
()
await
message
.
delConfirm
()
// 发起删除
// 发起删除
await
BusinessStatus
TypeApi
.
deleteBusinessStatusType
(
id
)
await
BusinessStatus
Api
.
deleteBusinessStatus
(
id
)
message
.
success
(
t
(
'common.delSuccess'
))
message
.
success
(
t
(
'common.delSuccess'
))
// 刷新列表
// 刷新列表
await
getList
()
await
getList
()
}
catch
{}
}
catch
{}
}
}
/** 导出按钮操作 */
const
handleExport
=
async
()
=>
{
try
{
// 导出的二次确认
await
message
.
exportConfirm
()
// 发起导出
exportLoading
.
value
=
true
const
data
=
await
BusinessStatusTypeApi
.
exportBusinessStatusType
(
queryParams
)
download
.
excel
(
data
,
'商机状态组.xls'
)
}
catch
{
}
finally
{
exportLoading
.
value
=
false
}
}
/** 初始化 **/
/** 初始化 **/
onMounted
(()
=>
{
onMounted
(()
=>
{
getList
()
getList
()
...
...
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