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 e8dcb9bd
authored
Jul 14, 2023
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交
1 parent
8cf204ae
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
37 deletions
src/utils/data.js
src/views/home/solar/MerchantTrends.vue
src/views/home/solar/PurchaseTrends.vue
src/views/solarDetail/index.vue
src/utils/data.js
View file @
e8dcb9b
/*
* @Description: 基础数据
* @Author: huyue
* @Date: 2023-07-04 11:46:53
* @LastEditors: huyue
* @LastEditTime: 2023-07-14 14:39:49
*/
const
DefaultData
=
{
const
DefaultData
=
{
yearList
:
[
'2023'
,
'2022'
,
'2021'
,
'2020'
],
yearList
:
[
'2023'
,
'2022'
],
businessList
:
[
businessList
:
[
{
{
label
:
'业务数据 | 1.0太阳膜采购'
,
label
:
'业务数据 | 1.0太阳膜采购'
,
...
...
src/views/home/solar/MerchantTrends.vue
View file @
e8dcb9b
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Author: huyue
* @Date: 2023-07-06 16:19:15
* @Date: 2023-07-06 16:19:15
* @LastEditors: huyue
* @LastEditors: huyue
* @LastEditTime: 2023-07-14 1
0:29:38
* @LastEditTime: 2023-07-14 1
4:28:17
-->
-->
<
template
>
<
template
>
<div
class=
"merchant-box"
>
<div
class=
"merchant-box"
>
...
@@ -45,22 +45,9 @@ export default {
...
@@ -45,22 +45,9 @@ export default {
methods
:
{
methods
:
{
init
()
{
init
()
{
this
.
getTrendData
()
this
.
getTrendData
()
// const p = new Promise((resolve) => {
// for (let i = 0; i < 12; i++) {
// this.dataList.push({
// month: i + 1 + '月',
// data1: +(Math.random() * 20).toFixed(2),
// data2: +(Math.random() * 40).toFixed(2)
// })
// }
// console.log(this.dataList)
// resolve()
// })
// p.then(() => {
// this.$refs.merchantTrendsRef.drawBar()
// })
},
},
async
getTrendData
()
{
async
getTrendData
()
{
this
.
dataList
=
[]
const
_data
=
await
this
.
api
.
solar
.
getAllOpenBuyTrend
({
year
:
this
.
$store
.
state
.
app
.
solarYear
})
const
_data
=
await
this
.
api
.
solar
.
getAllOpenBuyTrend
({
year
:
this
.
$store
.
state
.
app
.
solarYear
})
const
_dataList
=
_data
.
data
.
dataList
const
_dataList
=
_data
.
data
.
dataList
_dataList
.
forEach
(
item
=>
{
_dataList
.
forEach
(
item
=>
{
...
...
src/views/home/solar/PurchaseTrends.vue
View file @
e8dcb9b
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Author: huyue
* @Date: 2023-07-06 16:19:15
* @Date: 2023-07-06 16:19:15
* @LastEditors: huyue
* @LastEditors: huyue
* @LastEditTime: 2023-07-14 1
0:29:34
* @LastEditTime: 2023-07-14 1
4:27:08
-->
-->
<
template
>
<
template
>
<div
class=
"purchase-box"
>
<div
class=
"purchase-box"
>
...
@@ -57,22 +57,9 @@ export default {
...
@@ -57,22 +57,9 @@ export default {
methods
:
{
methods
:
{
init
()
{
init
()
{
this
.
getDataList
()
this
.
getDataList
()
// const p = new Promise((resolve) => {
// for (let i = 0; i < 12; i++) {
// this.dataList.push({
// month: i + 1 + '月',
// data1: +(Math.random() * 2000).toFixed(2),
// data2: +(Math.random() * 5000).toFixed(2),
// data3: +(Math.random() * 50).toFixed(2)
// })
// }
// resolve()
// })
// p.then(() => {
// this.$refs.purchaseRef.drawBarLine()
// })
},
},
async
getDataList
()
{
async
getDataList
()
{
this
.
dataList
=
[]
const
_data
=
await
this
.
api
.
solar
.
getAllPurchaseTrend
({
year
:
this
.
$store
.
state
.
app
.
solarYear
})
const
_data
=
await
this
.
api
.
solar
.
getAllPurchaseTrend
({
year
:
this
.
$store
.
state
.
app
.
solarYear
})
const
_dataList
=
_data
.
data
.
dataList
const
_dataList
=
_data
.
data
.
dataList
_dataList
.
forEach
(
item
=>
{
_dataList
.
forEach
(
item
=>
{
...
...
src/views/solarDetail/index.vue
View file @
e8dcb9b
...
@@ -83,21 +83,30 @@ export default {
...
@@ -83,21 +83,30 @@ export default {
solarDetailList
:
[
solarDetailList
:
[
{
{
name
:
'总采购额'
,
name
:
'总采购额'
,
valueName
:
'amounttotal'
,
value
:
'2,280,708'
,
value
:
'2,280,708'
,
bottomLabel
:
'本月采购额'
,
bottomLabel
:
'本月采购额'
,
bottomValue
:
'2,280,708'
bottemName
:
'amounttotalThismonth'
,
bottomValue
:
'2,280,708'
,
bottomType
:
'money'
},
},
{
{
name
:
'商城采购额'
,
name
:
'商城采购额'
,
valueName
:
'amountshop'
,
value
:
'2,280,708'
,
value
:
'2,280,708'
,
bottomLabel
:
'本月采购额'
,
bottomLabel
:
'本月采购额'
,
bottomValue
:
'2,280,708'
bottemName
:
'amountshopThismonth'
,
bottomValue
:
'2,280,708'
,
bottomType
:
'money'
},
},
{
{
name
:
'自采采购额'
,
name
:
'自采采购额'
,
valueName
:
'amountself'
,
value
:
'2,280,708'
,
value
:
'2,280,708'
,
bottomLabel
:
'本月采购额'
,
bottomLabel
:
'本月采购额'
,
bottomValue
:
'2,280,708'
bottemName
:
'amountselfThismonth'
,
bottomValue
:
'2,280,708'
,
bottomType
:
'money'
}
}
],
],
// 商城采购饼图结构
// 商城采购饼图结构
...
@@ -186,11 +195,16 @@ export default {
...
@@ -186,11 +195,16 @@ export default {
this
.
openMessage
(
'获取门店商品采购占比失败'
)
this
.
openMessage
(
'获取门店商品采购占比失败'
)
return
return
}
}
const
_dataList
=
res
.
data
.
dataList
[
0
]
this
.
solarDetailList
.
forEach
(
item
=>
{
item
.
value
=
_dataList
[
item
.
valueName
]
item
.
bottomValue
=
_dataList
[
item
.
bottemName
]
})
})
})
},
},
// 获取每个门店的商城采购额(占比)、自采采购额(占比) 趋势
// 获取每个门店的商城采购额(占比)、自采采购额(占比) 趋势
getMerchantPurchaseTrend
(
merchantid
)
{
getMerchantPurchaseTrend
(
merchantid
)
{
this
.
api
.
solar
.
getMerchantPurchaseTrend
({
year
:
2023
,
MerchantId
:
merchantid
}).
then
(
res
=>
{
this
.
api
.
solar
.
getMerchantPurchaseTrend
({
year
:
this
.
$store
.
state
.
app
.
solarYear
,
MerchantId
:
merchantid
}).
then
(
res
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
if
(
!
res
.
code
===
'0'
)
{
if
(
!
res
.
code
===
'0'
)
{
this
.
openMessage
(
'获取门店商品采购占比失败'
)
this
.
openMessage
(
'获取门店商品采购占比失败'
)
...
@@ -201,10 +215,10 @@ export default {
...
@@ -201,10 +215,10 @@ export default {
this
.
dataList
.
push
({
this
.
dataList
.
push
({
month
:
item
.
statDate
,
month
:
item
.
statDate
,
data1
:
item
.
shopamount
,
data1
:
item
.
shopamount
,
data2
:
item
.
selfamount
data2
:
item
.
selfamount
,
data3
:
item
.
shopratio
})
})
})
})
console
.
log
(
this
.
dataList
)
this
.
$refs
.
purchaseTrend
.
drawBarLine
()
this
.
$refs
.
purchaseTrend
.
drawBarLine
()
})
})
},
},
...
...
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