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 865c4297
authored
Jul 17, 2023
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交年份切换的问题
1 parent
b4c9bfff
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
59 additions
and
67 deletions
src/components/BarLineOptions.js
src/components/DetailTitle.vue
src/components/SelectBox.vue
src/components/ViewDate.vue
src/views/home/solar/PurchaseProgress.vue
src/views/home/solar/PurchasePropertion.vue
src/views/home/solar/PurchaseRank.vue
src/views/home/solar/StorageContent.vue
src/views/solarDetail/index.vue
src/components/BarLineOptions.js
View file @
865c429
...
...
@@ -75,19 +75,10 @@ function getBarLineOptions(obj) {
color
:
function
(
params
)
{
const
colorList
=
[
[
'#22D8FF'
,
'#5C56FF'
],
[
'#2AD190'
,
'#00B7DF'
],
[
'#22D8FF'
,
'#5C56FF'
],
[
'#2AD190'
,
'#00B7DF'
],
[
'#22D8FF'
,
'#5C56FF'
],
[
'#2AD190'
,
'#00B7DF'
],
[
'#22D8FF'
,
'#5C56FF'
],
[
'#2AD190'
,
'#00B7DF'
],
[
'#22D8FF'
,
'#5C56FF'
],
[
'#2AD190'
,
'#00B7DF'
],
[
'#22D8FF'
,
'#5C56FF'
],
[
'#2AD190'
,
'#00B7DF'
]
]
var
colorItem
=
colorList
[
params
.
dataIndex
]
var
colorItem
=
[]
colorItem
=
params
.
dataIndex
%
2
===
0
?
colorList
[
0
]
:
colorList
[
1
]
return
new
echarts
.
graphic
.
LinearGradient
(
0
,
0
,
0
,
1
,
[{
// 代表渐变色从正上方开始
offset
:
0
,
// offset范围是0~1,用于表示位置,0是指0%处的颜色
...
...
@@ -117,19 +108,10 @@ function getBarLineOptions(obj) {
color
:
function
(
params
)
{
const
colorList
=
[
[
'#11627A'
,
'#282F7A'
],
[
'#145F4E'
,
'#035972'
],
[
'#11627A'
,
'#282F7A'
],
[
'#145F4E'
,
'#035972'
],
[
'#11627A'
,
'#282F7A'
],
[
'#145F4E'
,
'#035972'
],
[
'#11627A'
,
'#282F7A'
],
[
'#145F4E'
,
'#035972'
],
[
'#11627A'
,
'#282F7A'
],
[
'#145F4E'
,
'#035972'
],
[
'#11627A'
,
'#282F7A'
],
[
'#145F4E'
,
'#035972'
]
]
var
colorItem
=
colorList
[
params
.
dataIndex
]
var
colorItem
=
[]
colorItem
=
params
.
dataIndex
%
2
===
0
?
colorList
[
0
]
:
colorList
[
1
]
return
new
echarts
.
graphic
.
LinearGradient
(
0
,
0
,
0
,
1
,
[{
// 代表渐变色从正上方开始
offset
:
0
,
// offset范围是0~1,用于表示位置,0是指0%处的颜色
...
...
src/components/DetailTitle.vue
View file @
865c429
...
...
@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-07-1
4 18:15
:03
* @LastEditTime: 2023-07-1
7 11:47
:03
* @FilePath: \dj-data-view\src\components\ViewTitle.vue
* @Description: 页面头部组件
-->
...
...
@@ -16,7 +16,7 @@
<div
class=
"merchant-name"
>
{{
firstTab
[
dataListObj
.
labelName
]
}}
</div>
<img
class=
"arrow-down"
src=
"@/assets/images/title-arrow.png"
alt=
""
>
</div>
<SelectBox
:isShow=
"isShow"
:defaultValue=
"firstTab[dataListObj.valueName]"
@
clickOutside=
"clickOutside"
:dataList=
"
data
List"
:boxWidth=
"'23.33vw'"
isObject
@
selectVal=
"selectVal"
:labelName=
"dataListObj.labelName"
:valueName=
"dataListObj.valueName"
>
<SelectBox
:isShow=
"isShow"
:defaultValue=
"firstTab[dataListObj.valueName]"
@
clickOutside=
"clickOutside"
:dataList=
"
merchant
List"
:boxWidth=
"'23.33vw'"
isObject
@
selectVal=
"selectVal"
:labelName=
"dataListObj.labelName"
:valueName=
"dataListObj.valueName"
>
<div
slot=
"search"
class=
"search"
>
<input
type=
"text"
class=
"search-input"
v-model=
"search"
@
input=
"handleInput"
>
<img
class=
"icon-search"
src=
"@/assets/images/icon-search.png"
@
click=
"searchMerchant"
alt=
""
>
...
...
@@ -54,10 +54,16 @@ export default {
default
:
()
=>
{}
}
},
watch
:
{
'dataList'
(
val
)
{
console
.
log
(
val
)
this
.
merchantList
=
utils
.
deepClone
(
this
.
dataList
)
}
},
data
()
{
return
{
isShow
:
false
,
merchantList
:
utils
.
deepClone
(
this
.
dataList
)
,
merchantList
:
[]
,
firstTab
:
this
.
tabObject
,
// 存储第一个tab下的子菜单对象
now
:
new
Date
().
format
(
'yyyy-MM-dd hh:mm:ss'
),
currentMenu
:
'home'
,
// 标记当前是哪个tab菜单
...
...
@@ -68,6 +74,7 @@ export default {
},
mounted
()
{
this
.
timer
()
console
.
log
(
this
.
merchantList
)
},
methods
:
{
timer
()
{
...
...
@@ -85,30 +92,17 @@ export default {
this
.
openSelect
()
this
.
search
=
''
},
searchMerchant
()
{
// this.merchantList = [
// {
// merchantname: '广东省深圳市宝安区XXXXXXXXX广东省深圳市宝安区XXXXXXXXX',
// merchantid: '1'
// },
// {
// merchantname: '广东省XXXXXXXXX服务商1',
// merchantid: '2'
// },
// {
// merchantname: '广东省XXXXXXXXX服务商2',
// merchantid: '3'
// },
// {
// merchantname: '广东省XXXXXXXXX服务商3',
// merchantid: '4'
// }
// ]
this
.
merchantList
=
[]
async
searchMerchant
()
{
const
_searchData
=
await
this
.
api
.
solar
.
getMerchant
({})
const
_dataList
=
_searchData
.
data
.
dataList
_dataList
.
forEach
(
item
=>
{
item
.
merchantname
=
item
.
merchantName
})
this
.
merchantList
=
_dataList
},
handleInput
:
utils
.
throttle
(
function
(
e
)
{
this
.
searchMerchant
()
},
1000
/
60
),
},
2000
/
25
),
clickOutside
()
{
this
.
isShow
=
false
}
...
...
src/components/SelectBox.vue
View file @
865c429
...
...
@@ -72,6 +72,11 @@ export default {
empty
:
'暂无数据'
}
},
watch
:
{
'dataList'
(
val
)
{
console
.
log
(
val
)
}
},
mounted
()
{
const
{
valueName
,
isObject
,
dataList
,
defaultValue
}
=
this
console
.
log
(
defaultValue
)
...
...
src/components/ViewDate.vue
View file @
865c429
...
...
@@ -3,13 +3,13 @@
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-17 1
0:56:1
1
* @LastEditTime: 2023-07-17 1
5:19:2
1
-->
<
template
>
<div
class=
"view-date"
>
统计年份:
<div
class=
"year-plugin"
>
<div
class=
"year"
@
click
.
stop=
"switchYear"
>
{{
defaultYear
||
$store
.
state
.
app
.
solarYear
}}
{{
$store
.
state
.
app
.
solarYear
}}
<img
class=
"arrow-down"
src=
"@/assets/images/arrow-down.png"
alt=
""
>
</div>
<SelectBox
:isShow=
"isShow"
:defaultValue=
"defaultYear"
@
clickOutside=
"clickOutside"
:dataList=
"dataList"
:boxWidth=
"'8.61vw'"
@
selectVal=
"selectVal"
></SelectBox>
...
...
@@ -43,6 +43,8 @@ export default {
}
},
mounted
()
{
const
{
defaultYear
}
=
this
if
(
defaultYear
)
this
.
setSolarYear
(
defaultYear
)
// this.year = this.$store.state.app.solarYear
},
methods
:
{
...
...
src/views/home/solar/PurchaseProgress.vue
View file @
865c429
<!--
* @Description:
* @Author: huyue
* @Date: 2023-07-07 17:34:48
* @LastEditors: huyue
* @LastEditTime: 2023-07-17 14:29:07
-->
<
template
>
<div
class=
"purchase-progress-box"
>
<box-title
title=
"商城采购进度分析"
></box-title>
...
...
@@ -54,7 +61,7 @@ export default {
},
// 获取商品采购进度占比
getBugProgress
()
{
this
.
api
.
solar
.
getBugProgress
({
year
:
2023
}).
then
(
res
=>
{
this
.
api
.
solar
.
getBugProgress
({
year
:
this
.
$store
.
state
.
app
.
solarYear
}).
then
(
res
=>
{
console
.
log
(
res
,
'000'
)
if
(
!
res
.
code
===
'0'
)
{
this
.
openMessage
(
'获取采购进度占比失败'
)
...
...
src/views/home/solar/PurchasePropertion.vue
View file @
865c429
...
...
@@ -59,7 +59,7 @@ export default {
},
// 获取商品采购占比
getAllGoodsRatio
()
{
this
.
api
.
solar
.
getAllGoodsRatio
({
year
:
2023
}).
then
(
res
=>
{
this
.
api
.
solar
.
getAllGoodsRatio
({
year
:
this
.
$store
.
state
.
app
.
solarYear
}).
then
(
res
=>
{
console
.
log
(
res
,
'000'
)
if
(
!
res
.
code
===
'0'
)
{
this
.
openMessage
(
'获取商品采购占比失败'
)
...
...
src/views/home/solar/PurchaseRank.vue
View file @
865c429
...
...
@@ -77,7 +77,7 @@ export default {
},
// 获取各类商品采购额排名
getAllRanking
()
{
this
.
api
.
solar
.
getAllRanking
({
year
:
2023
}).
then
(
res
=>
{
this
.
api
.
solar
.
getAllRanking
({
year
:
this
.
$store
.
state
.
app
.
solarYear
}).
then
(
res
=>
{
console
.
log
(
res
,
'000'
)
if
(
!
res
.
code
===
'0'
)
{
this
.
openMessage
(
'获取商品采购额排名失败'
)
...
...
src/views/home/solar/StorageContent.vue
View file @
865c429
...
...
@@ -48,7 +48,7 @@ export default {
},
// 获取所有门店入库
getUsedWarehousing
()
{
this
.
api
.
solar
.
getUsedWarehousing
({
year
:
2023
}).
then
(
res
=>
{
this
.
api
.
solar
.
getUsedWarehousing
({
year
:
this
.
$store
.
state
.
app
.
solarYear
}).
then
(
res
=>
{
console
.
log
(
res
,
'000'
)
if
(
!
res
.
code
===
'0'
)
{
this
.
openMessage
(
'获取所有门店入库失败'
)
...
...
src/views/solarDetail/index.vue
View file @
865c429
...
...
@@ -185,6 +185,9 @@ export default {
businessTime
:
''
}
},
mounted
()
{
this
.
getYears
(
this
.
$route
.
query
.
merchantid
)
},
methods
:
{
async
init
()
{
this
.
tabObject
=
this
.
$route
.
query
...
...
@@ -194,14 +197,13 @@ export default {
const
_merchantList
=
await
this
.
getAllRanking
(
purchaseType
)
this
.
merchantList
=
_merchantList
console
.
log
(
this
.
merchantList
,
'this.merchantList'
)
this
.
getMerchantGoodsRatio
(
year
,
merchantid
)
this
.
getMerchantPurchase
(
year
,
merchantid
)
this
.
getMerchantPurchaseTrend
(
year
,
merchantid
)
this
.
getYears
(
merchantid
)
this
.
getMerchantGoodsRatio
(
merchantid
)
this
.
getMerchantPurchase
(
merchantid
)
this
.
getMerchantPurchaseTrend
(
merchantid
)
},
// 获取门店的商品采购占比(商城、自采)
getMerchantGoodsRatio
(
year
,
merchantid
)
{
this
.
api
.
solar
.
getMerchantGoodsRatio
({
year
:
y
ear
,
MerchantId
:
merchantid
}).
then
(
res
=>
{
getMerchantGoodsRatio
(
merchantid
)
{
this
.
api
.
solar
.
getMerchantGoodsRatio
({
year
:
this
.
$store
.
state
.
app
.
solarY
ear
,
MerchantId
:
merchantid
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
!
res
.
code
===
'0'
)
{
this
.
openMessage
(
'获取门店商品采购占比失败'
)
...
...
@@ -212,8 +214,8 @@ export default {
})
},
// 获取每个门店的 总采购额(总计、本月) 、商城采购额(总计、本月) 、自采采购额(总计、本月)
getMerchantPurchase
(
year
,
merchantid
)
{
this
.
api
.
solar
.
getMerchantPurchase
({
year
:
y
ear
,
MerchantId
:
merchantid
}).
then
(
res
=>
{
getMerchantPurchase
(
merchantid
)
{
this
.
api
.
solar
.
getMerchantPurchase
({
year
:
this
.
$store
.
state
.
app
.
solarY
ear
,
MerchantId
:
merchantid
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
!
res
.
code
===
'0'
)
{
this
.
openMessage
(
'获取门店商品采购占比失败'
)
...
...
@@ -228,30 +230,30 @@ export default {
})
},
// 获取每个门店的商城采购额(占比)、自采采购额(占比) 趋势
getMerchantPurchaseTrend
(
year
,
merchantid
)
{
this
.
dataList
=
[]
this
.
api
.
solar
.
getMerchantPurchaseTrend
({
year
:
year
,
MerchantId
:
merchantid
}).
then
(
res
=>
{
getMerchantPurchaseTrend
(
merchantid
)
{
this
.
api
.
solar
.
getMerchantPurchaseTrend
({
year
:
this
.
$store
.
state
.
app
.
solarYear
,
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
(
{
_dataList
.
forEach
(
(
item
,
index
)
=>
{
this
.
dataList
[
index
]
=
{
month
:
item
.
statDate
,
data1
:
item
.
shopamount
,
data2
:
item
.
selfamount
,
data3
:
item
.
shopratio
}
)
}
})
console
.
log
(
this
.
dataList
,
'p-0-0-0-'
)
this
.
$refs
.
purchaseTrend
.
drawBarLine
()
})
},
getAllRanking
(
purchaseType
)
{
return
new
Promise
(
resolve
=>
{
let
_merchantList
this
.
api
.
solar
.
getAllRanking
({
year
:
2023
}).
then
(
res
=>
{
this
.
api
.
solar
.
getAllRanking
({
year
:
this
.
$store
.
state
.
app
.
solarYear
}).
then
(
res
=>
{
console
.
log
(
res
,
'000'
)
if
(
!
res
.
code
===
'0'
)
{
this
.
openMessage
(
'获取商品采购额排名失败'
)
...
...
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