Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
glsk-data-view-pd
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 77eadeb0
authored
Jul 17, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
详情页分组件
1 parent
2d2fcc2e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
330 additions
and
242 deletions
src/views/home/solar/MerchantTrends.vue
src/views/home/solar/PurchaseTrends.vue
src/views/solarDetail/MerchantsPropotion.vue
src/views/solarDetail/MerchantsPurchaseTrends.vue
src/views/solarDetail/index.vue
src/views/home/solar/MerchantTrends.vue
View file @
77eadeb
...
...
@@ -8,15 +8,22 @@
<
template
>
<div
class=
"merchant-box"
>
<box-title
title=
"商户开通及使用趋势"
></box-title>
<div
class=
"legend"
>
<div
class=
"legend-item"
>
<span
class=
"open"
></span>
开通商户
</div>
<div
class=
"legend-item"
>
<span
class=
"procure"
></span>
采购商户
<div
v-if=
"!isEmpty"
>
<div
class=
"legend"
>
<div
class=
"legend-item"
>
<span
class=
"open"
></span>
开通商户
</div>
<div
class=
"legend-item"
>
<span
class=
"procure"
></span>
采购商户
</div>
</div>
<BarChart
ref=
"merchantTrendsRef"
height=
"28.67vh"
domId=
"merchantTrends"
:dataList
.
sync=
"dataList"
:tooltipFormatterObj=
"tooltipFormatterObj"
></BarChart>
</div>
<div
v-else
class=
"empty"
>
<Empty></Empty>
</div>
<BarChart
ref=
"merchantTrendsRef"
height=
"28.67vh"
domId=
"merchantTrends"
:dataList
.
sync=
"dataList"
:tooltipFormatterObj=
"tooltipFormatterObj"
></BarChart>
</div>
</
template
>
...
...
@@ -37,7 +44,8 @@ export default {
attrName
:
'data2'
}
],
dataList
:
[]
dataList
:
[],
isEmpty
:
false
}
},
mounted
()
{
...
...
@@ -50,6 +58,7 @@ export default {
this
.
dataList
=
[]
const
_data
=
await
this
.
api
.
solar
.
getAllOpenBuyTrend
({
year
:
this
.
$store
.
state
.
app
.
solarYear
})
const
_dataList
=
_data
.
data
.
dataList
if
(
!
_dataList
.
length
)
this
.
isEmpty
=
true
_dataList
.
forEach
(
item
=>
{
this
.
dataList
.
push
({
month
:
item
.
statDate
,
...
...
@@ -62,7 +71,7 @@ export default {
}
}
</
script
>
<
style
scoped
lang=
'scss'
>
<
style
scoped
lang=
"scss"
>
.merchant-box
{
position
:
relative
;
//
margin
:
1.78vh
0
;
...
...
@@ -90,12 +99,17 @@ export default {
margin-right
:
0.28vw
;
}
.open
{
background-image
:
linear-gradient
(
180deg
,
#22
D8FF
0%
,
#223FA
9
100%
);
background-image
:
linear-gradient
(
180deg
,
#22
d8ff
0%
,
#223fa
9
100%
);
}
.procure
{
background-image
:
linear-gradient
(
180deg
,
#38
FBB0
1%
,
#00A89E
100%
);
background-image
:
linear-gradient
(
180deg
,
#38
fbb0
1%
,
#00a89e
100%
);
}
}
}
.empty
{
height
:
28.67vh
;
display
:
flex
;
align-items
:
center
;
}
}
</
style
>
src/views/home/solar/PurchaseTrends.vue
View file @
77eadeb
...
...
@@ -8,22 +8,28 @@
<
template
>
<div
class=
"purchase-box"
>
<box-title
title=
"近一年采购额趋势"
></box-title>
<BarLineChart
ref=
"purchaseRef"
height=
"30.23vh"
domId=
"purchase"
:dataList
.
sync=
"dataList"
:tooltipFormatterObj=
"tooltipFormatterObj"
></BarLineChart>
<div
class=
"legend"
>
<div
class=
"legend-item shop"
>
<span
class=
"legend-even"
>
双
</span>
<span
class=
"legend-odd"
>
单
</span>
<span>
商城
</span>
</div>
<div
class=
"legend-item self"
>
<span
class=
"legend-even"
>
双
</span>
<span
class=
"legend-odd"
>
单
</span>
自采
</div>
<div
class=
"legend-item"
>
<img
class=
"icon-line"
src=
"@/assets/images/icon-line.png"
alt=
""
>
商城采购占比
<div
v-if=
"!isEmpty"
>
<BarLineChart
ref=
"purchaseRef"
height=
"30.23vh"
domId=
"purchase"
:dataList
.
sync=
"dataList"
:tooltipFormatterObj=
"tooltipFormatterObj"
></BarLineChart>
<div
class=
"legend"
>
<div
class=
"legend-item shop"
>
<span
class=
"legend-even"
>
双
</span>
<span
class=
"legend-odd"
>
单
</span>
<span>
商城
</span>
</div>
<div
class=
"legend-item self"
>
<span
class=
"legend-even"
>
双
</span>
<span
class=
"legend-odd"
>
单
</span>
自采
</div>
<div
class=
"legend-item"
>
<img
class=
"icon-line"
src=
"@/assets/images/icon-line.png"
alt=
""
/>
商城采购占比
</div>
</div>
</div>
<div
v-else
class=
"empty"
>
<Empty></Empty>
</div>
</div>
</
template
>
...
...
@@ -49,7 +55,8 @@ export default {
addSymbol
:
'%'
}
],
dataList
:
[]
dataList
:
[],
isEmpty
:
false
}
},
mounted
()
{
...
...
@@ -62,6 +69,7 @@ export default {
this
.
dataList
=
[]
const
_data
=
await
this
.
api
.
solar
.
getAllPurchaseTrend
({
year
:
this
.
$store
.
state
.
app
.
solarYear
})
const
_dataList
=
_data
.
data
.
dataList
if
(
!
_dataList
.
length
)
this
.
isEmpty
=
true
_dataList
.
forEach
(
item
=>
{
this
.
dataList
.
push
({
month
:
item
.
statDate
,
...
...
@@ -75,7 +83,7 @@ export default {
}
}
</
script
>
<
style
scoped
lang=
'scss'
>
<
style
scoped
lang=
"scss"
>
.purchase-box
{
position
:
relative
;
margin
:
1.78vh
0
;
...
...
@@ -114,21 +122,26 @@ export default {
}
}
}
.empty
{
height
:
30.23vh
;
display
:
flex
;
align-items
:
center
;
}
}
.shop
{
.legend-even
{
background-image
:
linear-gradient
(
180deg
,
#2
AD190
1%
,
#00B7DF
100%
);
background-image
:
linear-gradient
(
180deg
,
#2
ad190
1%
,
#00b7df
100%
);
}
.legend-odd
{
background-image
:
linear-gradient
(
180deg
,
#22
D8FF
0%
,
#5C56FF
100%
);
background-image
:
linear-gradient
(
180deg
,
#22
d8ff
0%
,
#5c56ff
100%
);
}
}
.self
{
.legend-even
{
background-image
:
linear-gradient
(
180deg
,
#145
F4E
1%
,
#035972
100%
);
background-image
:
linear-gradient
(
180deg
,
#145
f4e
1%
,
#035972
100%
);
}
.legend-odd
{
background-image
:
linear-gradient
(
180deg
,
#11627
A
0%
,
#282F7A
100%
);
background-image
:
linear-gradient
(
180deg
,
#11627
a
0%
,
#282f7a
100%
);
}
}
</
style
>
src/views/solarDetail/MerchantsPropotion.vue
0 → 100644
View file @
77eadeb
<
template
>
<div
class=
"propotion-box flex"
>
<div
class=
"propotion-box-left"
>
<box-title
title=
"商城采购商品占比"
></box-title>
<RightViewContent
v-if=
"shopmallData.length"
class=
"content-box"
:chart=
"shopmallChart"
:listData=
"shopmallData"
:legentList=
"shopmallLegend"
:legendColors=
"shopmallChart.colors"
></RightViewContent>
<div
v-else
class=
"empty"
>
<Empty></Empty>
</div>
</div>
<div
class=
"propotion-box-right"
>
<box-title
title=
"自采商品占比"
></box-title>
<RightViewContent
v-if=
"selfPickData.length"
class=
"content-box"
:chart=
"selfPickChart"
:listData=
"selfPickData"
:legentList=
"selfPickLegend"
:legendColors=
"selfPickChart.colors"
></RightViewContent>
<div
v-else
class=
"empty"
>
<Empty></Empty>
</div>
</div>
</div>
</
template
>
<
script
>
import
RightViewContent
from
'../home/solar/RightViewContent.vue'
export
default
{
name
:
'MerchantsPropotion'
,
components
:
{
RightViewContent
},
props
:
{
shopmallData
:
{
type
:
Array
,
default
:
()
=>
[]
},
selfPickData
:
{
type
:
Array
,
default
:
()
=>
[]
}
},
data
()
{
return
{
// 商城采购饼图结构
shopmallChart
:
{
id
:
'shopmall'
,
keys
:
[
'goodsname'
,
'purchaseamount'
],
height
:
'16vh'
,
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
]
},
shopmallLegend
:
[
{
name
:
'goodsname'
},
{
name
:
'rate'
,
type
:
'decimal'
},
{
name
:
'purchaseamount'
,
hasIcon
:
'¥'
,
type
:
'number'
},
{
name
:
'averprice'
,
hasIcon
:
'均价¥'
,
type
:
'number'
}
],
// 自采饼图结构
selfPickChart
:
{
id
:
'selfPick'
,
keys
:
[
'goodsname'
,
'purchaseamount'
],
height
:
'16vh'
,
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
]
},
selfPickLegend
:
[
{
name
:
'goodsname'
},
{
name
:
'rate'
,
type
:
'decimal'
},
{
name
:
'purchaseamount'
,
hasIcon
:
'¥'
,
type
:
'number'
},
{
name
:
'averprice'
,
hasIcon
:
'均价¥'
,
type
:
'number'
}
]
}
},
mounted
()
{},
methods
:
{}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.propotion-box
{
justify-content
:
space-between
;
margin-top
:
1.78vh
;
&-left,
&-right
{
width
:
47.78vw
;
height
:
25.33vh
;
box-shadow
:
inset
0
0
20px
0
#3d57ff69
;
}
.content-box
{
padding
:
1.78vh
6.18vw
4.44vh
0
;
}
.empty
{
height
:
22vh
;
display
:
flex
;
align-items
:
center
;
}
}
</
style
>
src/views/solarDetail/MerchantsPurchaseTrends.vue
0 → 100644
View file @
77eadeb
<
template
>
<div
class=
"tendency-box"
>
<box-title
title=
"近一年采购额趋势"
></box-title>
<div
v-if=
"!isEmpty"
>
<div
class=
"legend"
>
<div
class=
"legend-item shop"
>
<span
class=
"legend-even"
>
双
</span>
<span
class=
"legend-odd"
>
单
</span>
<span>
商城
</span>
</div>
<div
class=
"legend-item self"
>
<span
class=
"legend-even"
>
双
</span>
<span
class=
"legend-odd"
>
单
</span>
自采
</div>
<div
class=
"legend-item"
>
<img
class=
"icon-line"
src=
"@/assets/images/icon-line.png"
alt=
""
/>
商城采购占比
</div>
</div>
<BarLineChart
ref=
"purchaseTrend"
height=
"36.45vh"
domId=
"purchaseTrend"
:dataList
.
sync=
"dataList"
:tooltipFormatterObj=
"tooltipFormatterObj"
></BarLineChart>
</div>
<div
v-else
class=
"empty"
>
<Empty></Empty>
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
'MerchantsPurchaseTrends'
,
props
:
{
dataList
:
{
type
:
Array
,
default
:
()
=>
[]
},
isEmpty
:
{
type
:
Boolean
,
default
:
false
}
},
data
()
{
return
{
tooltipFormatterObj
:
[
{
label
:
'商城'
,
attrName
:
'data1'
},
{
label
:
'自采'
,
attrName
:
'data2'
},
{
label
:
'占比'
,
attrName
:
'data3'
,
addSymbol
:
'%'
}
]
}
},
mounted
()
{},
methods
:
{}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.tendency-box
{
position
:
relative
;
width
:
96.67vw
;
height
:
39.78vh
;
box-shadow
:
inset
0
0
20px
0
#3d57ff69
;
margin-top
:
1.78vh
;
.legend
{
display
:
flex
;
position
:
absolute
;
right
:
1.39vw
;
top
:
2.22vh
;
&-item
{
display
:
flex
;
align-items
:
center
;
color
:
#fff
;
margin-right
:
1.67vw
;
&:last-child
{
margin-right
:
0
;
}
img
{
width
:
1.32vw
;
height
:
1vh
;
margin-right
:
0.28vw
;
}
.icon-line
{
width
:
0.98vw
;
height
:
0.56vh
;
}
.legend-even
,
.legend-odd
{
display
:
inline-block
;
width
:
0.83vw
;
height
:
1.33vh
;
margin-right
:
0.28vw
;
font-size
:
8px
;
text-align
:
center
;
}
}
}
.shop
{
.legend-even
{
background-image
:
linear-gradient
(
180deg
,
#2ad190
1%
,
#00b7df
100%
);
}
.legend-odd
{
background-image
:
linear-gradient
(
180deg
,
#22d8ff
0%
,
#5c56ff
100%
);
}
}
.self
{
.legend-even
{
background-image
:
linear-gradient
(
180deg
,
#145f4e
1%
,
#035972
100%
);
}
.legend-odd
{
background-image
:
linear-gradient
(
180deg
,
#11627a
0%
,
#282f7a
100%
);
}
}
}
.empty
{
height
:
36.45vh
;
display
:
flex
;
align-items
:
center
;
}
</
style
>
src/views/solarDetail/index.vue
View file @
77eadeb
...
...
@@ -9,57 +9,9 @@
<view-date
:businessTime=
"businessTime"
></view-date>
<StatisticsBox
class=
"statistic-box"
:list=
"solarDetailList"
></StatisticsBox>
<!-- 采购趋势 -->
<div
class=
"tendency-box"
>
<box-title
title=
"近一年采购额趋势"
></box-title>
<div
class=
"legend"
>
<div
class=
"legend-item shop"
>
<span
class=
"legend-even"
>
双
</span>
<span
class=
"legend-odd"
>
单
</span>
<span>
商城
</span>
</div>
<div
class=
"legend-item self"
>
<span
class=
"legend-even"
>
双
</span>
<span
class=
"legend-odd"
>
单
</span>
自采
</div>
<div
class=
"legend-item"
>
<img
class=
"icon-line"
src=
"@/assets/images/icon-line.png"
alt=
""
/>
商城采购占比
</div>
</div>
<BarLineChart
ref=
"purchaseTrend"
height=
"36.45vh"
domId=
"purchaseTrend"
:dataList
.
sync=
"dataList"
:tooltipFormatterObj=
"tooltipFormatterObj"
></BarLineChart>
</div>
<MerchantsPurchaseTrends
:dataList=
"dataList"
:isEmpty=
"isEmpty"
></MerchantsPurchaseTrends>
<!-- 商品占比 -->
<div
class=
"propotion-box flex"
>
<div
class=
"propotion-box-left"
>
<box-title
title=
"商城采购商品占比"
></box-title>
<RightViewContent
v-if=
"shopmallData.length"
class=
"content-box"
:chart=
"shopmallChart"
:listData=
"shopmallData"
:legentList=
"shopmallLegend"
:legendColors=
"shopmallChart.colors"
></RightViewContent>
<div
v-else
class=
"empty"
>
<Empty></Empty>
</div>
</div>
<div
class=
"propotion-box-right"
>
<box-title
title=
"自采商品占比"
></box-title>
<RightViewContent
v-if=
"selfPickData.length"
class=
"content-box"
:chart=
"selfPickChart"
:listData=
"selfPickData"
:legentList=
"selfPickLegend"
:legendColors=
"selfPickChart.colors"
></RightViewContent>
<div
v-else
class=
"empty"
>
<Empty></Empty>
</div>
</div>
</div>
<MerchantsPropotion
:shopmallData=
"shopmallData"
:selfPickData=
"selfPickData"
></MerchantsPropotion>
</div>
</
template
>
</view-container>
...
...
@@ -68,37 +20,25 @@
<
script
>
import
{
changeMixin
}
from
'@/mixins'
import
RightViewContent
from
'../home/solar/RightViewContent.vue'
import
MerchantsPurchaseTrends
from
'./MerchantsPurchaseTrends.vue'
import
MerchantsPropotion
from
'./MerchantsPropotion.vue'
export
default
{
name
:
'SolarDetail'
,
mixins
:
[
changeMixin
],
components
:
{
RightViewContent
MerchantsPropotion
,
MerchantsPurchaseTrends
},
data
()
{
return
{
tooltipFormatterObj
:
[
{
label
:
'商城'
,
attrName
:
'data1'
},
{
label
:
'自采'
,
attrName
:
'data2'
},
{
label
:
'占比'
,
attrName
:
'data3'
,
addSymbol
:
'%'
}
],
isEmpty
:
false
,
dataList
:
[],
merchantList
:
[],
merchantListObj
:
{
labelName
:
'merchantname'
,
valueName
:
'merchantid'
},
tabObject
:
{},
dataList
:
[],
solarDetailList
:
[
{
name
:
'总采购额'
,
...
...
@@ -128,58 +68,10 @@ export default {
bottomType
:
'money'
}
],
// 商城采购饼图结构
shopmallChart
:
{
id
:
'shopmall'
,
keys
:
[
'goodsname'
,
'purchaseamount'
],
height
:
'16vh'
,
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
]
},
// 商城采购数据
shopmallData
:
[],
shopmallLegend
:
[
{
name
:
'goodsname'
},
{
name
:
'rate'
,
type
:
'decimal'
},
{
name
:
'purchaseamount'
,
hasIcon
:
'¥'
},
{
name
:
'averprice'
,
hasIcon
:
'均价¥'
}
],
// 自采饼图结构
selfPickChart
:
{
id
:
'selfPick'
,
keys
:
[
'goodsname'
,
'purchaseamount'
],
height
:
'16vh'
,
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
]
},
// 自采采购数据
selfPickData
:
[],
selfPickLegend
:
[
{
name
:
'goodsname'
},
{
name
:
'rate'
,
type
:
'decimal'
},
{
name
:
'purchaseamount'
,
hasIcon
:
'¥'
},
{
name
:
'averprice'
,
hasIcon
:
'均价¥'
}
],
businessTime
:
''
}
},
...
...
@@ -225,27 +117,6 @@ export default {
})
})
},
// 获取每个门店的商城采购额(占比)、自采采购额(占比) 趋势
getMerchantPurchaseTrend
(
year
,
merchantid
)
{
this
.
dataList
=
[]
this
.
api
.
solar
.
getMerchantPurchaseTrend
({
year
:
year
,
MerchantId
:
merchantid
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
!
res
.
code
===
'0'
)
{
this
.
openMessage
(
'获取门店商品采购占比失败'
)
return
}
const
_dataList
=
res
.
data
.
dataList
_dataList
.
forEach
(
item
=>
{
this
.
dataList
.
push
({
month
:
item
.
statDate
,
data1
:
item
.
shopamount
,
data2
:
item
.
selfamount
,
data3
:
item
.
shopratio
})
})
this
.
$refs
.
purchaseTrend
.
drawBarLine
()
})
},
getAllRanking
(
purchaseType
)
{
return
new
Promise
(
resolve
=>
{
let
_merchantList
...
...
@@ -275,79 +146,6 @@ export default {
.statistic-box
{
margin-top
:
1.78vh
;
}
.tendency-box
{
position
:
relative
;
width
:
96.67vw
;
height
:
39.78vh
;
box-shadow
:
inset
0
0
20px
0
#3d57ff69
;
margin-top
:
1.78vh
;
}
.propotion-box
{
justify-content
:
space-between
;
margin-top
:
1.78vh
;
&-left,
&-right
{
width
:
47.78vw
;
height
:
25.33vh
;
box-shadow
:
inset
0
0
20px
0
#3d57ff69
;
}
.content-box
{
padding
:
1.78vh
6.18vw
4.44vh
0
;
}
.empty
{
height
:
22vh
;
display
:
flex
;
align-items
:
center
;
}
}
}
.legend
{
display
:
flex
;
position
:
absolute
;
right
:
1.39vw
;
top
:
2.22vh
;
&-item
{
display
:
flex
;
align-items
:
center
;
color
:
#fff
;
margin-right
:
1.67vw
;
&:last-child
{
margin-right
:
0
;
}
img
{
width
:
1.32vw
;
height
:
1vh
;
margin-right
:
0.28vw
;
}
.icon-line
{
width
:
0.98vw
;
height
:
0.56vh
;
}
.legend-even
,
.legend-odd
{
display
:
inline-block
;
width
:
0.83vw
;
height
:
1.33vh
;
margin-right
:
0.28vw
;
font-size
:
8px
;
text-align
:
center
;
}
}
}
.shop
{
.legend-even
{
background-image
:
linear-gradient
(
180deg
,
#2ad190
1%
,
#00b7df
100%
);
}
.legend-odd
{
background-image
:
linear-gradient
(
180deg
,
#22d8ff
0%
,
#5c56ff
100%
);
}
}
.self
{
.legend-even
{
background-image
:
linear-gradient
(
180deg
,
#145f4e
1%
,
#035972
100%
);
}
.legend-odd
{
background-image
:
linear-gradient
(
180deg
,
#11627a
0%
,
#282f7a
100%
);
}
}
</
style
>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment