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
34a796de
authored
Jan 31, 2024
by
安浩浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改:商业智能-排行榜,合同金额排行和回款金额排行时间条件和接口修改
parent
a5f8c3d7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
20 deletions
+52
-20
src/api/crm/bi/ranking.ts
+5
-3
src/views/crm/bi/ranking/components/RankingContractStatistics.vue
+12
-2
src/views/crm/bi/ranking/components/RankingReceivablesStatistics.vue
+13
-3
src/views/crm/bi/ranking/index.vue
+22
-12
No files found.
src/api/crm/bi/ranking.ts
View file @
34a796de
...
...
@@ -12,7 +12,9 @@ export interface BiReceivablesRanKingRespVO {
}
export
interface
BiRankReqVO
{
deptId
:
number
type
:
string
orderDate
:
Date
[]
startTime
:
Date
endTime
:
Date
}
// 排行 API
...
...
@@ -20,14 +22,14 @@ export const RankingStatisticsApi = {
// 获得合同排行榜
contractAmountRanking
:
(
params
:
any
)
=>
{
return
request
.
get
({
url
:
'/
bi/
ranking/contract-ranking'
,
url
:
'/
crm/bi-
ranking/contract-ranking'
,
params
})
},
// 获得回款排行榜
receivablesAmountRanking
:
(
params
:
any
)
=>
{
return
request
.
get
({
url
:
'/
bi/
ranking/receivables-ranking'
,
url
:
'/
crm/bi-
ranking/receivables-ranking'
,
params
})
}
...
...
src/views/crm/bi/ranking/components/RankingContractStatistics.vue
View file @
34a796de
...
...
@@ -18,14 +18,21 @@
<
script
setup
lang=
"ts"
>
import
{
RankingStatisticsApi
,
BiContractRanKingRespVO
,
BiRankReqVO
}
from
'@/api/crm/bi/ranking'
import
{
EChartsOption
}
from
'echarts'
import
{
beginOfDay
,
endOfDay
,
formatDate
}
from
'@/utils/formatTime'
/** 合同金额排行 */
defineOptions
({
name
:
'RankingContractStatistics'
})
const
params
=
reactive
({
deptId
:
undefined
,
startTime
:
undefined
,
endTime
:
undefined
})
const
trendLoading
=
ref
(
true
)
// 状态加载中
const
loading
=
ref
(
false
)
// 列表的加载中
const
list
=
ref
<
BiContractRanKingRespVO
[]
>
([])
// 列表的数据
const
p
arams
=
defineProps
<
{
queryParams
:
BiRankReqVO
}
>
()
// 搜索参数
const
queryP
arams
=
defineProps
<
{
queryParams
:
BiRankReqVO
}
>
()
// 搜索参数
/** 柱状图配置 横向 */
const
barChartOptions
=
reactive
<
EChartsOption
>
({
...
...
@@ -98,7 +105,10 @@ const barChartOptions = reactive<EChartsOption>({
const
getRankingContractStatistics
=
async
()
=>
{
trendLoading
.
value
=
true
loading
.
value
=
true
const
rankingList
=
await
RankingStatisticsApi
.
contractAmountRanking
(
params
.
queryParams
)
params
.
deptId
=
queryParams
.
queryParams
.
deptId
params
.
startTime
=
formatDate
(
beginOfDay
(
new
Date
(
queryParams
.
queryParams
.
orderDate
[
0
])))
params
.
endTime
=
formatDate
(
endOfDay
(
new
Date
(
queryParams
.
queryParams
.
orderDate
[
1
])))
const
rankingList
=
await
RankingStatisticsApi
.
contractAmountRanking
(
params
)
let
source
=
rankingList
.
map
((
item
:
BiContractRanKingRespVO
)
=>
{
return
{
name
:
item
.
nickname
,
...
...
src/views/crm/bi/ranking/components/RankingReceivablesStatistics.vue
View file @
34a796de
...
...
@@ -16,16 +16,23 @@
</el-card>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
RankingStatisticsApi
,
BiReceivablesRanKingRespVO
}
from
'@/api/crm/bi/ranking'
import
{
RankingStatisticsApi
,
BiReceivablesRanKingRespVO
,
BiRankReqVO
}
from
'@/api/crm/bi/ranking'
import
{
EChartsOption
}
from
'echarts'
import
{
beginOfDay
,
endOfDay
,
formatDate
}
from
'@/utils/formatTime'
/** 回款金额排行 */
defineOptions
({
name
:
'RankingReceivablesStatistics'
})
const
params
=
reactive
({
deptId
:
undefined
,
startTime
:
undefined
,
endTime
:
undefined
})
const
trendLoading
=
ref
(
true
)
// 状态加载中
const
loading
=
ref
(
false
)
// 列表的加载中
const
list
=
ref
<
BiReceivablesRanKingRespVO
[]
>
([])
// 列表的数据
const
params
=
defineProps
<
{
queryParams
:
any
}
>
()
// 搜索参数
const
queryParams
=
defineProps
<
{
queryParams
:
BiRankReqVO
}
>
()
// 搜索参数
/** 柱状图配置 横向 */
const
barChartOptions
=
reactive
<
EChartsOption
>
({
...
...
@@ -98,7 +105,10 @@ const barChartOptions = reactive<EChartsOption>({
const
getRankingReceivablesStatistics
=
async
()
=>
{
trendLoading
.
value
=
true
loading
.
value
=
true
const
rankingList
=
await
RankingStatisticsApi
.
receivablesAmountRanking
(
params
.
queryParams
)
params
.
deptId
=
queryParams
.
queryParams
.
deptId
params
.
startTime
=
formatDate
(
beginOfDay
(
new
Date
(
queryParams
.
queryParams
.
orderDate
[
0
])))
params
.
endTime
=
formatDate
(
endOfDay
(
new
Date
(
queryParams
.
queryParams
.
orderDate
[
1
])))
const
rankingList
=
await
RankingStatisticsApi
.
receivablesAmountRanking
(
params
)
let
source
=
rankingList
.
map
((
item
:
BiReceivablesRanKingRespVO
)
=>
{
return
{
name
:
item
.
nickname
,
...
...
src/views/crm/bi/ranking/index.vue
View file @
34a796de
...
...
@@ -8,15 +8,17 @@
:inline=
"true"
label-width=
"68px"
>
<el-form-item
label=
"类型"
prop=
"type"
>
<el-select
v-model=
"queryParams.type"
placeholder=
"请选择类型"
clearable
class=
"!w-240px"
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.BI_ANALYZE_TYPE)"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
<el-form-item
label=
"时间"
prop=
"orderDate"
>
<el-date-picker
v-model=
"queryParams.orderDate"
:shortcuts=
"defaultShortcuts"
class=
"!w-240px"
end-placeholder=
"结束日期"
start-placeholder=
"开始日期"
type=
"daterange"
value-format=
"YYYY-MM-DD HH:mm:ss"
:default-time=
"[new Date('1 00:00:00'), new Date('1 23:59:59')]"
/>
</el-form-item>
<el-form-item
label=
"归属部门"
prop=
"deptId"
>
<el-tree-select
...
...
@@ -54,15 +56,23 @@
import
RankingContractStatistics
from
'./components/RankingContractStatistics.vue'
import
{
defaultProps
,
handleTree
}
from
'@/utils/tree'
import
*
as
DeptApi
from
'@/api/system/dept'
import
{
DICT_TYPE
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
beginOfDay
,
defaultShortcuts
,
endOfDay
,
formatDate
}
from
'@/utils/formatTime'
import
RankingReceivablesStatistics
from
'@/views/crm/bi/ranking/components/RankingReceivablesStatistics.vue'
/** 排行榜 */
defineOptions
({
name
:
'RankingStatistics'
})
const
queryParams
=
reactive
({
type
:
9
,
// 将 type 的初始值设置为 9 本年
deptId
:
null
deptId
:
undefined
,
//默认显示最近一周的数据
orderDate
:
[
formatDate
(
beginOfDay
(
new
Date
(
new
Date
().
getTime
()
-
3600
*
1000
*
24
*
7
))),
formatDate
(
endOfDay
(
new
Date
(
new
Date
().
getTime
()
-
3600
*
1000
*
24
)))
],
startTime
:
undefined
,
endTime
:
undefined
})
const
queryFormRef
=
ref
()
// 搜索的表单
const
deptList
=
ref
<
Tree
[]
>
([])
// 树形结构
const
activeTab
=
ref
(
'contractAmountRanking'
)
...
...
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